diff --git a/src/Altinn.Dan.Plugin.Banking/Clients/Bank.cs b/src/Altinn.Dan.Plugin.Banking/Clients/Bank.cs deleted file mode 100644 index 693e04d..0000000 --- a/src/Altinn.Dan.Plugin.Banking/Clients/Bank.cs +++ /dev/null @@ -1,31 +0,0 @@ - -/* -using System.Net.Http; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using Jose; - -namespace Altinn.Dan.Plugin.Banking.Clients; -public partial class Bank -{ - public X509Certificate2 DecryptionCertificate { get; set; } - - /// - /// The bank sends a encrypted payload, use the ProcessResponse-mechanism to decrypt before further processing - /// - /// Http client - /// Response from bank - // ReSharper disable once UnusedParameterInPartialMethod - partial void ProcessResponse(HttpClient client, HttpResponseMessage response) - { - if (!response.IsSuccessStatusCode) return; - - var jwt = response.Content.ReadAsStringAsync().Result; - var decryptedContent = - JWT.Decode(jwt, - DecryptionCertificate - .GetRSAPrivateKey()); //, JweAlgorithm.RSA_OAEP_256, JweEncryption.A128CBC_HS256); - - response.Content = new StringContent(decryptedContent, Encoding.UTF8); - } -} */ diff --git a/src/Altinn.Dan.Plugin.Banking/Clients/BankClient.cs b/src/Altinn.Dan.Plugin.Banking/Clients/BankClient.cs deleted file mode 100644 index dc8f3a1..0000000 --- a/src/Altinn.Dan.Plugin.Banking/Clients/BankClient.cs +++ /dev/null @@ -1,2569 +0,0 @@ -//---------------------- -// -// Generated using the NSwag toolchain v13.13.2.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org) -// -//---------------------- - - -/* -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" - -namespace Altinn.Dan.Plugin.Banking.Clients -{ - using Altinn.Dan.Plugin.Banking.Exceptions; - using System; - using System = global::System; - - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.13.2.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v11.0.0.0))")] - public partial class Bank - { - private string _baseUrl = "https://hostname.no/v1"; - private System.Net.Http.HttpClient _httpClient; - private System.Lazy _settings; - - public Bank(System.Net.Http.HttpClient httpClient) - { - _httpClient = httpClient; - _settings = new System.Lazy(CreateSerializerSettings); - } - - private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings() - { - var settings = new Newtonsoft.Json.JsonSerializerSettings(); - UpdateJsonSerializerSettings(settings); - return settings; - } - - public string BaseUrl - { - get { return _baseUrl; } - set { _baseUrl = value; } - } - - protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } } - - partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings); - - - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); - partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); - /// List of accounts for a specified party and period. Account number can be provided in place of the party identifier for lookup requests directly on the account. Must provide a blank list if no hits. - /// Unique reference number / case number that follows the case throughout the different requests. - /// Correlation ID, unique identifier for the technical request - /// The Legal basis used by data consumers in order to fetch data. Should be validated by the data provider. - /// Parts identifier, personal identification number, D-number or organization number - /// The account number. Not in use per now. - /// Reference ID based on AdditionalReferenceIDType. Should be validated according to the legal-mandate. - /// What type of reference to expect in AdditionalReferenceID - /// From date, current date if not stated - /// To date, current date if not stated - /// Valid response - /// A server side error occurred. - public System.Threading.Tasks.Task ListAccountsAsync(System.Guid accountInfoRequestID, System.Guid correlationID, string legal_Mandate, string partyID, string accountID, string additionalReferenceID, AdditionalReferenceIDType? additionalReferenceIDType, System.DateTimeOffset? fromDate, System.DateTimeOffset? toDate) - { - return ListAccountsAsync(accountInfoRequestID, correlationID, legal_Mandate, partyID, accountID, additionalReferenceID, additionalReferenceIDType, fromDate, toDate, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// List of accounts for a specified party and period. Account number can be provided in place of the party identifier for lookup requests directly on the account. Must provide a blank list if no hits. - /// Unique reference number / case number that follows the case throughout the different requests. - /// Correlation ID, unique identifier for the technical request - /// The Legal basis used by data consumers in order to fetch data. Should be validated by the data provider. - /// Parts identifier, personal identification number, D-number or organization number - /// The account number. Not in use per now. - /// Reference ID based on AdditionalReferenceIDType. Should be validated according to the legal-mandate. - /// What type of reference to expect in AdditionalReferenceID - /// From date, current date if not stated - /// To date, current date if not stated - /// Valid response - /// A server side error occurred. - public async System.Threading.Tasks.Task ListAccountsAsync(System.Guid accountInfoRequestID, System.Guid correlationID, string legal_Mandate, string partyID, string accountID, string additionalReferenceID, AdditionalReferenceIDType? additionalReferenceIDType, System.DateTimeOffset? fromDate, System.DateTimeOffset? toDate, System.Threading.CancellationToken cancellationToken) - { - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/accounts?"); - if (fromDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fromDate") + "=").Append(System.Uri.EscapeDataString(fromDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (toDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("toDate") + "=").Append(System.Uri.EscapeDataString(toDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - if (accountInfoRequestID == null) - throw new System.ArgumentNullException("accountInfoRequestID"); - request_.Headers.TryAddWithoutValidation("AccountInfoRequestID", - ConvertToString(accountInfoRequestID, System.Globalization.CultureInfo.InvariantCulture)); - if (correlationID == null) - throw new System.ArgumentNullException("correlationID"); - request_.Headers.TryAddWithoutValidation("CorrelationID", - ConvertToString(correlationID, System.Globalization.CultureInfo.InvariantCulture)); - if (legal_Mandate == null) - throw new System.ArgumentNullException("legal_Mandate"); - request_.Headers.TryAddWithoutValidation("Legal-Mandate", - ConvertToString(legal_Mandate, System.Globalization.CultureInfo.InvariantCulture)); - if (partyID != null) - request_.Headers.TryAddWithoutValidation("PartyID", ConvertToString(partyID, System.Globalization.CultureInfo.InvariantCulture)); - if (accountID != null) - request_.Headers.TryAddWithoutValidation("AccountID", ConvertToString(accountID, System.Globalization.CultureInfo.InvariantCulture)); - if (additionalReferenceID != null) - request_.Headers.TryAddWithoutValidation("AdditionalReferenceID", - ConvertToString(additionalReferenceID, System.Globalization.CultureInfo.InvariantCulture)); - if (additionalReferenceIDType != null) - request_.Headers.TryAddWithoutValidation("AdditionalReferenceIDType", - ConvertToString(additionalReferenceIDType, System.Globalization.CultureInfo.InvariantCulture)); - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken) - .ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - - return objectResponse_.Object; - } - else if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - - throw new ApiException( - "ACC-001 and best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", - status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else if (status_ == 401) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - - throw new ApiException( - "ACC-010 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", - status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - - throw new ApiException( - "ACC-011 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", - status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else if (status_ == 405) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - - throw new ApiException( - "ACC-012 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", - status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else if (status_ == 429) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - - throw new ApiException( - "ACC-022 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", - status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - - throw new ApiException( - "ACC-100 or ACC-500 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification for the different ACC codes.", - status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - - throw new ApiException("Best possible description of the error from Data Provider.", status_, objectResponse_.Text, headers_, - objectResponse_.Object, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - catch (Exception ex) - { - Console.WriteLine(ex.Message); - return new Accounts(); - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// Account details, including balances, for an account - /// Unique reference to the account. Shall match the account number. - /// Unique reference number / case number that follows the case throughout the different requests. - /// Correlation ID, unique identifier for the technical request - /// The Legal basis used by data consumers in order to fetch data. Should be validated by the data provider. - /// Reference ID based on AdditionalReferenceIDType. Should be validated according to the legal-mandate. - /// What type of reference to expect in AdditionalReferenceID - /// From date, current date if not stated - /// To date, current date if not stated - /// Valid response - /// A server side error occurred. - public System.Threading.Tasks.Task ShowAccountByIdAsync(string accountReference, System.Guid accountInfoRequestID, System.Guid correlationID, string legal_Mandate, string additionalReferenceID, AdditionalReferenceIDType2? additionalReferenceIDType, System.DateTimeOffset? fromDate, System.DateTimeOffset? toDate) - { - return ShowAccountByIdAsync(accountReference, accountInfoRequestID, correlationID, legal_Mandate, additionalReferenceID, additionalReferenceIDType, fromDate, toDate, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Account details, including balances, for an account - /// Unique reference to the account. Shall match the account number. - /// Unique reference number / case number that follows the case throughout the different requests. - /// Correlation ID, unique identifier for the technical request - /// The Legal basis used by data consumers in order to fetch data. Should be validated by the data provider. - /// Reference ID based on AdditionalReferenceIDType. Should be validated according to the legal-mandate. - /// What type of reference to expect in AdditionalReferenceID - /// From date, current date if not stated - /// To date, current date if not stated - /// Valid response - /// A server side error occurred. - public async System.Threading.Tasks.Task ShowAccountByIdAsync(string accountReference, System.Guid accountInfoRequestID, System.Guid correlationID, string legal_Mandate, string additionalReferenceID, AdditionalReferenceIDType2? additionalReferenceIDType, System.DateTimeOffset? fromDate, System.DateTimeOffset? toDate, System.Threading.CancellationToken cancellationToken) - { - if (accountReference == null) - throw new System.ArgumentNullException("accountReference"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/accounts/{accountReference}?"); - urlBuilder_.Replace("{accountReference}", System.Uri.EscapeDataString(ConvertToString(accountReference, System.Globalization.CultureInfo.InvariantCulture))); - if (fromDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fromDate") + "=").Append(System.Uri.EscapeDataString(fromDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (toDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("toDate") + "=").Append(System.Uri.EscapeDataString(toDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - if (accountInfoRequestID == null) - throw new System.ArgumentNullException("accountInfoRequestID"); - request_.Headers.TryAddWithoutValidation("AccountInfoRequestID", ConvertToString(accountInfoRequestID, System.Globalization.CultureInfo.InvariantCulture)); - if (correlationID == null) - throw new System.ArgumentNullException("correlationID"); - request_.Headers.TryAddWithoutValidation("CorrelationID", ConvertToString(correlationID, System.Globalization.CultureInfo.InvariantCulture)); - if (legal_Mandate == null) - throw new System.ArgumentNullException("legal_Mandate"); - request_.Headers.TryAddWithoutValidation("Legal-Mandate", ConvertToString(legal_Mandate, System.Globalization.CultureInfo.InvariantCulture)); - if (additionalReferenceID != null) - request_.Headers.TryAddWithoutValidation("AdditionalReferenceID", ConvertToString(additionalReferenceID, System.Globalization.CultureInfo.InvariantCulture)); - if (additionalReferenceIDType != null) - request_.Headers.TryAddWithoutValidation("AdditionalReferenceIDType", ConvertToString(additionalReferenceIDType, System.Globalization.CultureInfo.InvariantCulture)); - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-001 and best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-010 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-011 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-002 or ACC-003 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification for the different ACC codes.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 405) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-012 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 429) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-022 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-100 or ACC-500 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification for the different ACC codes.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("Best possible description of the error from Data Provider", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// Transactions for specified account and period. Empty list if no hits. Must support pagination on large result sets (min 1000) - see separate description in the link element. - /// Unique reference to the account. Shall match the account number. - /// Unique reference number / case number that follows the case throughout the different requests. - /// Correlation ID, unique identifier for the technical request - /// The Legal basis used by data consumers in order to fetch data. Should be validated by the data provider. - /// Reference ID based on AdditionalReferenceIDType. Should be validated according to the legal-mandate. - /// What type of reference to expect in AdditionalReferenceID - /// From date, current date if not stated - /// To date, current date if not stated - /// A list of transactions - /// A server side error occurred. - public System.Threading.Tasks.Task ListTransactionsAsync(string accountReference, System.Guid accountInfoRequestID, System.Guid correlationID, string legal_Mandate, string additionalReferenceID, AdditionalReferenceIDType3? additionalReferenceIDType, System.DateTimeOffset? fromDate, System.DateTimeOffset? toDate) - { - return ListTransactionsAsync(accountReference, accountInfoRequestID, correlationID, legal_Mandate, additionalReferenceID, additionalReferenceIDType, fromDate, toDate, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Transactions for specified account and period. Empty list if no hits. Must support pagination on large result sets (min 1000) - see separate description in the link element. - /// Unique reference to the account. Shall match the account number. - /// Unique reference number / case number that follows the case throughout the different requests. - /// Correlation ID, unique identifier for the technical request - /// The Legal basis used by data consumers in order to fetch data. Should be validated by the data provider. - /// Reference ID based on AdditionalReferenceIDType. Should be validated according to the legal-mandate. - /// What type of reference to expect in AdditionalReferenceID - /// From date, current date if not stated - /// To date, current date if not stated - /// A list of transactions - /// A server side error occurred. - public async System.Threading.Tasks.Task ListTransactionsAsync(string accountReference, System.Guid accountInfoRequestID, System.Guid correlationID, string legal_Mandate, string additionalReferenceID, AdditionalReferenceIDType3? additionalReferenceIDType, System.DateTimeOffset? fromDate, System.DateTimeOffset? toDate, System.Threading.CancellationToken cancellationToken) - { - if (accountReference == null) - throw new System.ArgumentNullException("accountReference"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/accounts/{accountReference}/transactions?"); - urlBuilder_.Replace("{accountReference}", System.Uri.EscapeDataString(ConvertToString(accountReference, System.Globalization.CultureInfo.InvariantCulture))); - if (fromDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fromDate") + "=").Append(System.Uri.EscapeDataString(fromDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (toDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("toDate") + "=").Append(System.Uri.EscapeDataString(toDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - if (accountInfoRequestID == null) - throw new System.ArgumentNullException("accountInfoRequestID"); - request_.Headers.TryAddWithoutValidation("AccountInfoRequestID", ConvertToString(accountInfoRequestID, System.Globalization.CultureInfo.InvariantCulture)); - if (correlationID == null) - throw new System.ArgumentNullException("correlationID"); - request_.Headers.TryAddWithoutValidation("CorrelationID", ConvertToString(correlationID, System.Globalization.CultureInfo.InvariantCulture)); - if (legal_Mandate == null) - throw new System.ArgumentNullException("legal_Mandate"); - request_.Headers.TryAddWithoutValidation("Legal-Mandate", ConvertToString(legal_Mandate, System.Globalization.CultureInfo.InvariantCulture)); - if (additionalReferenceID != null) - request_.Headers.TryAddWithoutValidation("AdditionalReferenceID", ConvertToString(additionalReferenceID, System.Globalization.CultureInfo.InvariantCulture)); - if (additionalReferenceIDType != null) - request_.Headers.TryAddWithoutValidation("AdditionalReferenceIDType", ConvertToString(additionalReferenceIDType, System.Globalization.CultureInfo.InvariantCulture)); - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-001 and best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-010 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-011 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-002 or ACC-003 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification for the different ACC codes.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 405) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-012 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 429) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-022 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-100 or ACC-500 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification for the different ACC codes.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("Best possible description of the error from Data Provider", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// List of cards associated with the specified account. Empty list if no hits. - /// Unique reference to the account. Shall not match the account number. - /// Unique reference number / case number that follows the case throughout the different requests. - /// Correlation ID, unique identifier for the technical request - /// The Legal basis used by data consumers in order to fetch data. Should be validated by the data provider. - /// Reference ID based on AdditionalReferenceIDType. Should be validated according to the legal-mandate. - /// What type of reference to expect in AdditionalReferenceID - /// From date, current date if not stated - /// To date, current date if not stated - /// Valid response - /// A server side error occurred. - public System.Threading.Tasks.Task ListCardsAsync(string accountReference, System.Guid accountInfoRequestID, System.Guid correlationID, string legal_Mandate, string additionalReferenceID, AdditionalReferenceIDType4? additionalReferenceIDType, System.DateTimeOffset? fromDate, System.DateTimeOffset? toDate) - { - return ListCardsAsync(accountReference, accountInfoRequestID, correlationID, legal_Mandate, additionalReferenceID, additionalReferenceIDType, fromDate, toDate, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// List of cards associated with the specified account. Empty list if no hits. - /// Unique reference to the account. Shall not match the account number. - /// Unique reference number / case number that follows the case throughout the different requests. - /// Correlation ID, unique identifier for the technical request - /// The Legal basis used by data consumers in order to fetch data. Should be validated by the data provider. - /// Reference ID based on AdditionalReferenceIDType. Should be validated according to the legal-mandate. - /// What type of reference to expect in AdditionalReferenceID - /// From date, current date if not stated - /// To date, current date if not stated - /// Valid response - /// A server side error occurred. - public async System.Threading.Tasks.Task ListCardsAsync(string accountReference, System.Guid accountInfoRequestID, System.Guid correlationID, string legal_Mandate, string additionalReferenceID, AdditionalReferenceIDType4? additionalReferenceIDType, System.DateTimeOffset? fromDate, System.DateTimeOffset? toDate, System.Threading.CancellationToken cancellationToken) - { - if (accountReference == null) - throw new System.ArgumentNullException("accountReference"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/accounts/{accountReference}/cards?"); - urlBuilder_.Replace("{accountReference}", System.Uri.EscapeDataString(ConvertToString(accountReference, System.Globalization.CultureInfo.InvariantCulture))); - if (fromDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fromDate") + "=").Append(System.Uri.EscapeDataString(fromDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (toDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("toDate") + "=").Append(System.Uri.EscapeDataString(toDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - if (accountInfoRequestID == null) - throw new System.ArgumentNullException("accountInfoRequestID"); - request_.Headers.TryAddWithoutValidation("AccountInfoRequestID", ConvertToString(accountInfoRequestID, System.Globalization.CultureInfo.InvariantCulture)); - if (correlationID == null) - throw new System.ArgumentNullException("correlationID"); - request_.Headers.TryAddWithoutValidation("CorrelationID", ConvertToString(correlationID, System.Globalization.CultureInfo.InvariantCulture)); - if (legal_Mandate == null) - throw new System.ArgumentNullException("legal_Mandate"); - request_.Headers.TryAddWithoutValidation("Legal-Mandate", ConvertToString(legal_Mandate, System.Globalization.CultureInfo.InvariantCulture)); - if (additionalReferenceID != null) - request_.Headers.TryAddWithoutValidation("AdditionalReferenceID", ConvertToString(additionalReferenceID, System.Globalization.CultureInfo.InvariantCulture)); - if (additionalReferenceIDType != null) - request_.Headers.TryAddWithoutValidation("AdditionalReferenceIDType", ConvertToString(additionalReferenceIDType, System.Globalization.CultureInfo.InvariantCulture)); - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-001 and best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-010 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-011 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-002 or ACC-003 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification for the different ACC codes.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 405) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-012 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 429) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-022 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-100 or ACC-500 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification for the different ACC codes.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("Best possible description of the error from Data Provider", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - /// Role holders for the specified account. Empty list if no hits. - /// Unique reference to the account. Shall not match the account number. - /// Unique reference number / case number that follows the case throughout the different requests. - /// Correlation ID, unique identifier for the technical request - /// The Legal basis used by data consumers in order to fetch data. Should be validated by the data provider. - /// Reference ID based on AdditionalReferenceIDType. Should be validated according to the legal-mandate. - /// What type of reference to expect in AdditionalReferenceID - /// From date, current date if not stated - /// To date, current date if not stated - /// Valid response - /// A server side error occurred. - public System.Threading.Tasks.Task ListRolesAsync(string accountReference, System.Guid accountInfoRequestID, System.Guid correlationID, string legal_Mandate, string additionalReferenceID, AdditionalReferenceIDType5? additionalReferenceIDType, System.DateTimeOffset? fromDate, System.DateTimeOffset? toDate) - { - return ListRolesAsync(accountReference, accountInfoRequestID, correlationID, legal_Mandate, additionalReferenceID, additionalReferenceIDType, fromDate, toDate, System.Threading.CancellationToken.None); - } - - /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. - /// Role holders for the specified account. Empty list if no hits. - /// Unique reference to the account. Shall not match the account number. - /// Unique reference number / case number that follows the case throughout the different requests. - /// Correlation ID, unique identifier for the technical request - /// The Legal basis used by data consumers in order to fetch data. Should be validated by the data provider. - /// Reference ID based on AdditionalReferenceIDType. Should be validated according to the legal-mandate. - /// What type of reference to expect in AdditionalReferenceID - /// From date, current date if not stated - /// To date, current date if not stated - /// Valid response - /// A server side error occurred. - public async System.Threading.Tasks.Task ListRolesAsync(string accountReference, System.Guid accountInfoRequestID, System.Guid correlationID, string legal_Mandate, string additionalReferenceID, AdditionalReferenceIDType5? additionalReferenceIDType, System.DateTimeOffset? fromDate, System.DateTimeOffset? toDate, System.Threading.CancellationToken cancellationToken) - { - if (accountReference == null) - throw new System.ArgumentNullException("accountReference"); - - var urlBuilder_ = new System.Text.StringBuilder(); - urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/accounts/{accountReference}/roles?"); - urlBuilder_.Replace("{accountReference}", System.Uri.EscapeDataString(ConvertToString(accountReference, System.Globalization.CultureInfo.InvariantCulture))); - if (fromDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("fromDate") + "=").Append(System.Uri.EscapeDataString(fromDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - if (toDate != null) - { - urlBuilder_.Append(System.Uri.EscapeDataString("toDate") + "=").Append(System.Uri.EscapeDataString(toDate.Value.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture))).Append("&"); - } - urlBuilder_.Length--; - - var client_ = _httpClient; - var disposeClient_ = false; - try - { - using (var request_ = new System.Net.Http.HttpRequestMessage()) - { - if (accountInfoRequestID == null) - throw new System.ArgumentNullException("accountInfoRequestID"); - request_.Headers.TryAddWithoutValidation("AccountInfoRequestID", ConvertToString(accountInfoRequestID, System.Globalization.CultureInfo.InvariantCulture)); - if (correlationID == null) - throw new System.ArgumentNullException("correlationID"); - request_.Headers.TryAddWithoutValidation("CorrelationID", ConvertToString(correlationID, System.Globalization.CultureInfo.InvariantCulture)); - if (legal_Mandate == null) - throw new System.ArgumentNullException("legal_Mandate"); - request_.Headers.TryAddWithoutValidation("Legal-Mandate", ConvertToString(legal_Mandate, System.Globalization.CultureInfo.InvariantCulture)); - if (additionalReferenceID != null) - request_.Headers.TryAddWithoutValidation("AdditionalReferenceID", ConvertToString(additionalReferenceID, System.Globalization.CultureInfo.InvariantCulture)); - if (additionalReferenceIDType != null) - request_.Headers.TryAddWithoutValidation("AdditionalReferenceIDType", ConvertToString(additionalReferenceIDType, System.Globalization.CultureInfo.InvariantCulture)); - request_.Method = new System.Net.Http.HttpMethod("GET"); - request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); - - PrepareRequest(client_, request_, urlBuilder_); - - var url_ = urlBuilder_.ToString(); - request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); - - PrepareRequest(client_, request_, url_); - - var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); - var disposeResponse_ = true; - try - { - var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); - if (response_.Content != null && response_.Content.Headers != null) - { - foreach (var item_ in response_.Content.Headers) - headers_[item_.Key] = item_.Value; - } - - ProcessResponse(client_, response_); - - var status_ = (int)response_.StatusCode; - if (status_ == 200) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - return objectResponse_.Object; - } - else - if (status_ == 400) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-001 and best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 401) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-010 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 403) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-011 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 404) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-002 or ACC-003 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification for the different ACC codes.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 405) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-012 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 429) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-022 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - if (status_ == 500) - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("ACC-100 or ACC-500 and the best possible description of the error from Data Provider. See information regarding specific error situations on github under API-spesification for the different ACC codes.", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - else - { - var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); - if (objectResponse_.Object == null) - { - throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); - } - throw new ApiException("Best possible description of the error from Data Provider", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); - } - } - finally - { - if (disposeResponse_) - response_.Dispose(); - } - } - } - finally - { - if (disposeClient_) - client_.Dispose(); - } - } - - protected struct ObjectResponseResult - { - public ObjectResponseResult(T responseObject, string responseText) - { - this.Object = responseObject; - this.Text = responseText; - } - - public T Object { get; } - - public string Text { get; } - } - - public bool ReadResponseAsString { get; set; } - - protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) - { - if (response == null || response.Content == null) - { - return new ObjectResponseResult(default(T), string.Empty); - } - - if (ReadResponseAsString || true) - { - var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject(responseText, JsonSerializerSettings); - return new ObjectResponseResult(typedBody, responseText); - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; - throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception); - } - } - else - { - try - { - using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) - using (var streamReader = new System.IO.StreamReader(responseStream)) - using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader)) - { - var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings); - var typedBody = serializer.Deserialize(jsonTextReader); - return new ObjectResponseResult(typedBody, string.Empty); - } - } - catch (Newtonsoft.Json.JsonException exception) - { - var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; - throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception); - } - } - } - - private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo) - { - if (value == null) - { - return ""; - } - - if (value is System.Enum) - { - var name = System.Enum.GetName(value.GetType(), value); - if (name != null) - { - var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); - if (field != null) - { - var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) - as System.Runtime.Serialization.EnumMemberAttribute; - if (attribute != null) - { - return attribute.Value != null ? attribute.Value : name; - } - } - - var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); - return converted == null ? string.Empty : converted; - } - } - else if (value is bool) - { - return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); - } - else if (value is byte[]) - { - return System.Convert.ToBase64String((byte[]) value); - } - else if (value.GetType().IsArray) - { - var array = System.Linq.Enumerable.OfType((System.Array) value); - return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); - } - - var result = System.Convert.ToString(value, cultureInfo); - return result == null ? "" : result; - } - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Account - { - [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public AccountStatus Status { get; set; } - - [Newtonsoft.Json.JsonProperty("servicer", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public FinancialInstitution Servicer { get; set; } - - [Newtonsoft.Json.JsonProperty("links", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection Links { get; set; } - - [Newtonsoft.Json.JsonProperty("accountIdentifier", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string AccountIdentifier { get; set; } - - [Newtonsoft.Json.JsonProperty("accountReference", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string AccountReference { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public AccountType Type { get; set; } - - [Newtonsoft.Json.JsonProperty("currency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{3,3}")] - public string Currency { get; set; } - - [Newtonsoft.Json.JsonProperty("primaryOwner", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public AccountRole PrimaryOwner { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(70, MinimumLength = 1)] - public string Name { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class AccountDetail - { - [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public AccountStatus Status { get; set; } - - [Newtonsoft.Json.JsonProperty("servicer", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public FinancialInstitution Servicer { get; set; } - - [Newtonsoft.Json.JsonProperty("accountIdentifier", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string AccountIdentifier { get; set; } - - [Newtonsoft.Json.JsonProperty("accountReference", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string AccountReference { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public AccountType Type { get; set; } - - [Newtonsoft.Json.JsonProperty("currency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{3,3}")] - public string Currency { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(70, MinimumLength = 1)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("balances", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection Balances { get; set; } - - [Newtonsoft.Json.JsonProperty("primaryOwner", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public AccountRole PrimaryOwner { get; set; } - - [Newtonsoft.Json.JsonProperty("startDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))] - public System.DateTimeOffset StartDate { get; set; } - - [Newtonsoft.Json.JsonProperty("endDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))] - public System.DateTimeOffset EndDate { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class AccountDetails - { - [Newtonsoft.Json.JsonProperty("responseStatus", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public ResponseStatus ResponseStatus { get; set; } - - [Newtonsoft.Json.JsonProperty("account", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public AccountDetail Account { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum AccountPermissionType - { - [System.Runtime.Serialization.EnumMember(Value = @"rightToUseAlone")] - RightToUseAlone = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"rightToUseWithOther")] - RightToUseWithOther = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"rightToSeeOnly")] - RightToSeeOnly = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class AccountRole - { - [Newtonsoft.Json.JsonProperty("permission", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public AccountPermissionType Permission { get; set; } - - [Newtonsoft.Json.JsonProperty("identifier", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Identifier Identifier { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(140, MinimumLength = 1)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("startDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))] - public System.DateTimeOffset StartDate { get; set; } - - [Newtonsoft.Json.JsonProperty("endDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))] - public System.DateTimeOffset EndDate { get; set; } - - [Newtonsoft.Json.JsonProperty("postalAddress", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public PostalAddress PostalAddress { get; set; } - - [Newtonsoft.Json.JsonProperty("electronicAddresses", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection ElectronicAddresses { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Accounts - { - [Newtonsoft.Json.JsonProperty("responseStatus", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public ResponseStatus ResponseStatus { get; set; } - - [Newtonsoft.Json.JsonProperty("accounts", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection Accounts1 { get; set; } - - [Newtonsoft.Json.JsonProperty("links", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection Links { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum AccountStatus - { - [System.Runtime.Serialization.EnumMember(Value = @"enabled")] - Enabled = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"disabled")] - Disabled = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"deleted")] - Deleted = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum AccountType - { - [System.Runtime.Serialization.EnumMember(Value = @"loanAccount")] - LoanAccount = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"salaryAccount")] - SalaryAccount = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"currencyAccount")] - CurrencyAccount = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"savingsAccount")] - SavingsAccount = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"clientAccount")] - ClientAccount = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"taxDeductionAccount")] - TaxDeductionAccount = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"businessAccount")] - BusinessAccount = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"creditCardAccount")] - CreditCardAccount = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"prepaidCardAccount")] - PrepaidCardAccount = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"otherAccount")] - OtherAccount = 9, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum AddressType - { - [System.Runtime.Serialization.EnumMember(Value = @"residential")] - Residential = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"business")] - Business = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"mailTo")] - MailTo = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"deliveryTo")] - DeliveryTo = 3, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Balance - { - [Newtonsoft.Json.JsonProperty("creditLineIncluded", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool CreditLineIncluded { get; set; } - - [Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.Range(0D, double.MaxValue)] - public decimal Amount { get; set; } - - [Newtonsoft.Json.JsonProperty("creditDebitIndicator", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public CreditOrDebit CreditDebitIndicator { get; set; } - - [Newtonsoft.Json.JsonProperty("registered", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore)] - public System.DateTimeOffset Registered { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public BalanceType Type { get; set; } - - [Newtonsoft.Json.JsonProperty("creditLineAmount", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.Range(0D, double.MaxValue)] - public decimal CreditLineAmount { get; set; } - - [Newtonsoft.Json.JsonProperty("creditLineCurrency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{3,3}")] - public string CreditLineCurrency { get; set; } - - [Newtonsoft.Json.JsonProperty("currency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{3,3}")] - public string Currency { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum BalanceType - { - [System.Runtime.Serialization.EnumMember(Value = @"availableBalance")] - AvailableBalance = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"bookedBalance")] - BookedBalance = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class BankTransactionCode - { - [Newtonsoft.Json.JsonProperty("domain", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public DomainType Domain { get; set; } - - [Newtonsoft.Json.JsonProperty("family", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public FamilyType Family { get; set; } - - [Newtonsoft.Json.JsonProperty("subFamily", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public SubFamilyType SubFamily { get; set; } - - [Newtonsoft.Json.JsonProperty("freeText", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(500, MinimumLength = 1)] - public string FreeText { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Cards - { - [Newtonsoft.Json.JsonProperty("responseStatus", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public ResponseStatus ResponseStatus { get; set; } - - [Newtonsoft.Json.JsonProperty("paymentCards", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection PaymentCards { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum CardType - { - [System.Runtime.Serialization.EnumMember(Value = @"creditCard")] - CreditCard = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"debitCard")] - DebitCard = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CounterParty - { - [Newtonsoft.Json.JsonProperty("accountIdentifier", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string AccountIdentifier { get; set; } - - [Newtonsoft.Json.JsonProperty("identifier", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Identifier Identifier { get; set; } - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(140, MinimumLength = 1)] - public string Name { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public CounterPartyType Type { get; set; } - - [Newtonsoft.Json.JsonProperty("postalAddress", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public PostalAddress PostalAddress { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum CounterPartyType - { - [System.Runtime.Serialization.EnumMember(Value = @"debtor")] - Debtor = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"creditor")] - Creditor = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"ultimateDebtor")] - UltimateDebtor = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"ultimateCreditor")] - UltimateCreditor = 3, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum CreditOrDebit - { - [System.Runtime.Serialization.EnumMember(Value = @"credit")] - Credit = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"debit")] - Debit = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class CurrencyExchange - { - [Newtonsoft.Json.JsonProperty("originalAmount", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.Range(0D, double.MaxValue)] - public decimal OriginalAmount { get; set; } - - [Newtonsoft.Json.JsonProperty("sourceCurrency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{3,3}")] - public string SourceCurrency { get; set; } - - [Newtonsoft.Json.JsonProperty("targetCurrency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{3,3}")] - public string TargetCurrency { get; set; } - - [Newtonsoft.Json.JsonProperty("unitCurrency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{3,3}")] - public string UnitCurrency { get; set; } - - [Newtonsoft.Json.JsonProperty("exchangeRate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.Range(0D, double.MaxValue)] - public decimal ExchangeRate { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum DomainType - { - [System.Runtime.Serialization.EnumMember(Value = @"accountManagement")] - AccountManagement = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"cashManagement")] - CashManagement = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"foreignExchange")] - ForeignExchange = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"payments")] - Payments = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"securities")] - Securities = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"tradeServices")] - TradeServices = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"extended")] - Extended = 6, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class ElectronicAddress - { - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public ElectronicAddressType Type { get; set; } - - [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - [System.ComponentModel.DataAnnotations.StringLength(2048, MinimumLength = 1)] - public string Value { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum ElectronicAddressType - { - [System.Runtime.Serialization.EnumMember(Value = @"phoneNumber")] - PhoneNumber = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"emailAddress")] - EmailAddress = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum FamilyType - { - [System.Runtime.Serialization.EnumMember(Value = @"additionalMiscellaneousCreditOperations")] - AdditionalMiscellaneousCreditOperations = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"additionalMiscellaneousDebitOperations")] - AdditionalMiscellaneousDebitOperations = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"miscellaneousCreditOperations")] - MiscellaneousCreditOperations = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"miscellaneousDebitOperations")] - MiscellaneousDebitOperations = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"openingAndClosing")] - OpeningAndClosing = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"accountBalancing")] - AccountBalancing = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"cashPooling")] - CashPooling = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"notAvailable")] - NotAvailable = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"customerCardTransactions")] - CustomerCardTransactions = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"counterTransactions")] - CounterTransactions = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"drafts")] - Drafts = 10, - - [System.Runtime.Serialization.EnumMember(Value = @"issuedCashConcentrationTransactions")] - IssuedCashConcentrationTransactions = 11, - - [System.Runtime.Serialization.EnumMember(Value = @"issuedCreditTransfers")] - IssuedCreditTransfers = 12, - - [System.Runtime.Serialization.EnumMember(Value = @"issuedCheques")] - IssuedCheques = 13, - - [System.Runtime.Serialization.EnumMember(Value = @"issuedDirectDebits")] - IssuedDirectDebits = 14, - - [System.Runtime.Serialization.EnumMember(Value = @"lockboxTransactions")] - LockboxTransactions = 15, - - [System.Runtime.Serialization.EnumMember(Value = @"merchantCardTransactions")] - MerchantCardTransactions = 16, - - [System.Runtime.Serialization.EnumMember(Value = @"other")] - Other = 17, - - [System.Runtime.Serialization.EnumMember(Value = @"receivedCashConcentrationTransactions")] - ReceivedCashConcentrationTransactions = 18, - - [System.Runtime.Serialization.EnumMember(Value = @"receivedCreditTransfers")] - ReceivedCreditTransfers = 19, - - [System.Runtime.Serialization.EnumMember(Value = @"receivedCheques")] - ReceivedCheques = 20, - - [System.Runtime.Serialization.EnumMember(Value = @"receivedDirectDebits")] - ReceivedDirectDebits = 21, - - [System.Runtime.Serialization.EnumMember(Value = @"corporateAction")] - CorporateAction = 22, - - [System.Runtime.Serialization.EnumMember(Value = @"documentaryCollection")] - DocumentaryCollection = 23, - - [System.Runtime.Serialization.EnumMember(Value = @"standByLetterOfCredit")] - StandByLetterOfCredit = 24, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class FinancialInstitution - { - [Newtonsoft.Json.JsonProperty("identifier", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - public Identifier Identifier { get; set; } = new Identifier(); - - [Newtonsoft.Json.JsonProperty("name", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(140, MinimumLength = 1)] - public string Name { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Identifier - { - [Newtonsoft.Json.JsonProperty("countryOfResidence", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{2,2}")] - public string CountryOfResidence { get; set; } - - [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Value { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public IdentifierType Type { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum IdentifierType - { - [System.Runtime.Serialization.EnumMember(Value = @"countryIdentificationCode")] - CountryIdentificationCode = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"nationalIdentityNumber")] - NationalIdentityNumber = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Link - { - [Newtonsoft.Json.JsonProperty("rel", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - [System.ComponentModel.DataAnnotations.StringLength(50, MinimumLength = 1)] - public string Rel { get; set; } - - [Newtonsoft.Json.JsonProperty("href", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required] - [System.ComponentModel.DataAnnotations.StringLength(500, MinimumLength = 1)] - public string Href { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class PaymentCard - { - [Newtonsoft.Json.JsonProperty("cardIdentifier", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string CardIdentifier { get; set; } - - [Newtonsoft.Json.JsonProperty("holderName", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(140, MinimumLength = 1)] - public string HolderName { get; set; } - - [Newtonsoft.Json.JsonProperty("startDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"^[0-9]+-([0][1-9]|1[0-2])$")] - public string StartDate { get; set; } - - [Newtonsoft.Json.JsonProperty("expiryDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"^[0-9]+-([0][1-9]|1[0-2])$")] - public string ExpiryDate { get; set; } - - [Newtonsoft.Json.JsonProperty("cardIssuerName", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(140, MinimumLength = 1)] - public string CardIssuerName { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public CardType Type { get; set; } - - [Newtonsoft.Json.JsonProperty("cardIssuerIdentifier", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public Identifier CardIssuerIdentifier { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class PostalAddress - { - [Newtonsoft.Json.JsonProperty("postCode", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(16, MinimumLength = 1)] - public string PostCode { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public AddressType Type { get; set; } - - [Newtonsoft.Json.JsonProperty("streetName", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(70, MinimumLength = 1)] - public string StreetName { get; set; } - - [Newtonsoft.Json.JsonProperty("buildingNumber", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(16, MinimumLength = 1)] - public string BuildingNumber { get; set; } - - [Newtonsoft.Json.JsonProperty("townName", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(35, MinimumLength = 1)] - public string TownName { get; set; } - - [Newtonsoft.Json.JsonProperty("country", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{2,2}")] - public string Country { get; set; } - - [Newtonsoft.Json.JsonProperty("addressLines", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection AddressLines { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum ResponseStatus - { - [System.Runtime.Serialization.EnumMember(Value = @"partial")] - Partial = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"complete")] - Complete = 1, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Roles - { - [Newtonsoft.Json.JsonProperty("responseStatus", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public ResponseStatus ResponseStatus { get; set; } - - [Newtonsoft.Json.JsonProperty("roles", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection Roles1 { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum SubFamilyType - { - [System.Runtime.Serialization.EnumMember(Value = @"valueDate")] - ValueDate = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"chargesGeneric")] - ChargesGeneric = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"commissions")] - Commissions = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"interestsGeneric")] - InterestsGeneric = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"other")] - Other = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"accountClosing")] - AccountClosing = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"notAvailable")] - NotAvailable = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"sweeping")] - Sweeping = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"topping")] - Topping = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"zeroBalancing")] - ZeroBalancing = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"cashWithdrawal")] - CashWithdrawal = 10, - - [System.Runtime.Serialization.EnumMember(Value = @"debitCardPayment")] - DebitCardPayment = 11, - - [System.Runtime.Serialization.EnumMember(Value = @"crossBorderCashWithdrawal")] - CrossBorderCashWithdrawal = 12, - - [System.Runtime.Serialization.EnumMember(Value = @"cashDeposit")] - CashDeposit = 13, - - [System.Runtime.Serialization.EnumMember(Value = @"debitAdjustmentGeneric")] - DebitAdjustmentGeneric = 14, - - [System.Runtime.Serialization.EnumMember(Value = @"travellersChequesDeposit")] - TravellersChequesDeposit = 15, - - [System.Runtime.Serialization.EnumMember(Value = @"settlementAtMaturity")] - SettlementAtMaturity = 16, - - [System.Runtime.Serialization.EnumMember(Value = @"intraCompanyTransfer")] - IntraCompanyTransfer = 17, - - [System.Runtime.Serialization.EnumMember(Value = @"corporateOwnAccountTransfer")] - CorporateOwnAccountTransfer = 18, - - [System.Runtime.Serialization.EnumMember(Value = @"crossBorderIntraCompanyTransfer")] - CrossBorderIntraCompanyTransfer = 19, - - [System.Runtime.Serialization.EnumMember(Value = @"achDebit")] - AchDebit = 20, - - [System.Runtime.Serialization.EnumMember(Value = @"achReturn")] - AchReturn = 21, - - [System.Runtime.Serialization.EnumMember(Value = @"achTransactionAtxn")] - AchTransactionAtxn = 22, - - [System.Runtime.Serialization.EnumMember(Value = @"automaticTransfer")] - AutomaticTransfer = 23, - - [System.Runtime.Serialization.EnumMember(Value = @"bankCheque")] - BankCheque = 24, - - [System.Runtime.Serialization.EnumMember(Value = @"booked")] - Booked = 25, - - [System.Runtime.Serialization.EnumMember(Value = @"domesticCreditTransfer")] - DomesticCreditTransfer = 26, - - [System.Runtime.Serialization.EnumMember(Value = @"dividend")] - Dividend = 27, - - [System.Runtime.Serialization.EnumMember(Value = @"sepaCreditTransfer")] - SepaCreditTransfer = 28, - - [System.Runtime.Serialization.EnumMember(Value = @"financialInstitutionCreditTransfer")] - FinancialInstitutionCreditTransfer = 29, - - [System.Runtime.Serialization.EnumMember(Value = @"principalPayment")] - PrincipalPayment = 30, - - [System.Runtime.Serialization.EnumMember(Value = @"priorityCreditTransfer")] - PriorityCreditTransfer = 31, - - [System.Runtime.Serialization.EnumMember(Value = @"reversalDueToPaymentReturn")] - ReversalDueToPaymentReturn = 32, - - [System.Runtime.Serialization.EnumMember(Value = @"achTransactionSala")] - AchTransactionSala = 33, - - [System.Runtime.Serialization.EnumMember(Value = @"sameDayValueCreditTransfer")] - SameDayValueCreditTransfer = 34, - - [System.Runtime.Serialization.EnumMember(Value = @"standingOrder")] - StandingOrder = 35, - - [System.Runtime.Serialization.EnumMember(Value = @"taxes")] - Taxes = 36, - - [System.Runtime.Serialization.EnumMember(Value = @"creditTransferWithAgreedCommercialInformation")] - CreditTransferWithAgreedCommercialInformation = 37, - - [System.Runtime.Serialization.EnumMember(Value = @"crossBorderCreditTransfer")] - CrossBorderCreditTransfer = 38, - - [System.Runtime.Serialization.EnumMember(Value = @"cashLetter")] - CashLetter = 39, - - [System.Runtime.Serialization.EnumMember(Value = @"cheques")] - Cheques = 40, - - [System.Runtime.Serialization.EnumMember(Value = @"chequesReversal")] - ChequesReversal = 41, - - [System.Runtime.Serialization.EnumMember(Value = @"openCheque")] - OpenCheque = 42, - - [System.Runtime.Serialization.EnumMember(Value = @"unpaidCheque")] - UnpaidCheque = 43, - - [System.Runtime.Serialization.EnumMember(Value = @"crossBorderCheque")] - CrossBorderCheque = 44, - - [System.Runtime.Serialization.EnumMember(Value = @"sepaCoreDirectDebit")] - SepaCoreDirectDebit = 45, - - [System.Runtime.Serialization.EnumMember(Value = @"directDebitPayment")] - DirectDebitPayment = 46, - - [System.Runtime.Serialization.EnumMember(Value = @"reversalDueToPayment")] - ReversalDueToPayment = 47, - - [System.Runtime.Serialization.EnumMember(Value = @"reversalDueToPaymentCancellationRequest")] - ReversalDueToPaymentCancellationRequest = 48, - - [System.Runtime.Serialization.EnumMember(Value = @"reversalDueToReturnUnpaidDirectDebit")] - ReversalDueToReturnUnpaidDirectDebit = 49, - - [System.Runtime.Serialization.EnumMember(Value = @"debit")] - Debit = 50, - - [System.Runtime.Serialization.EnumMember(Value = @"deposit")] - Deposit = 51, - - [System.Runtime.Serialization.EnumMember(Value = @"adjustments")] - Adjustments = 52, - - [System.Runtime.Serialization.EnumMember(Value = @"fees")] - Fees = 53, - - [System.Runtime.Serialization.EnumMember(Value = @"creditCardPayment")] - CreditCardPayment = 54, - - [System.Runtime.Serialization.EnumMember(Value = @"pointOfSalePosPayment")] - PointOfSalePosPayment = 55, - - [System.Runtime.Serialization.EnumMember(Value = @"creditAdjustment")] - CreditAdjustment = 56, - - [System.Runtime.Serialization.EnumMember(Value = @"settlementAfterCollection")] - SettlementAfterCollection = 57, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Transaction - { - [Newtonsoft.Json.JsonProperty("transactionIdentifier", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string TransactionIdentifier { get; set; } - - [Newtonsoft.Json.JsonProperty("references", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection References { get; set; } - - [Newtonsoft.Json.JsonProperty("creditDebitIndicator", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public CreditOrDebit CreditDebitIndicator { get; set; } - - [Newtonsoft.Json.JsonProperty("reversalIndicator", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public bool ReversalIndicator { get; set; } - - [Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public TransactionStatus Status { get; set; } - - [Newtonsoft.Json.JsonProperty("transactionCode", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public BankTransactionCode TransactionCode { get; set; } - - [Newtonsoft.Json.JsonProperty("bookingDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore)] - public System.DateTimeOffset BookingDate { get; set; } - - [Newtonsoft.Json.JsonProperty("valueDate", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore)] - public System.DateTimeOffset ValueDate { get; set; } - - [Newtonsoft.Json.JsonProperty("counterParties", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection CounterParties { get; set; } - - [Newtonsoft.Json.JsonProperty("additionalInfo", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(500, MinimumLength = 1)] - public string AdditionalInfo { get; set; } - - [Newtonsoft.Json.JsonProperty("currencyExchange", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public CurrencyExchange CurrencyExchange { get; set; } - - [Newtonsoft.Json.JsonProperty("merchant", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.StringLength(140, MinimumLength = 1)] - public string Merchant { get; set; } - - [Newtonsoft.Json.JsonProperty("paymentCard", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public PaymentCard PaymentCard { get; set; } - - [Newtonsoft.Json.JsonProperty("registered", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, DefaultValueHandling = Newtonsoft.Json.DefaultValueHandling.Ignore)] - public System.DateTimeOffset Registered { get; set; } - - [Newtonsoft.Json.JsonProperty("amount", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.Range(0D, double.MaxValue)] - public decimal Amount { get; set; } - - [Newtonsoft.Json.JsonProperty("currency", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [System.ComponentModel.DataAnnotations.RegularExpression(@"[A-Z]{3,3}")] - public string Currency { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class TransactionReference - { - [Newtonsoft.Json.JsonProperty("value", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Value { get; set; } - - [Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Always)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public TransactionReferenceType Type { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum TransactionReferenceType - { - [System.Runtime.Serialization.EnumMember(Value = @"accountServicerReference")] - AccountServicerReference = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"archiveReference")] - ArchiveReference = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"chequeNumber")] - ChequeNumber = 2, - - [System.Runtime.Serialization.EnumMember(Value = @"endToEndIdentification")] - EndToEndIdentification = 3, - - [System.Runtime.Serialization.EnumMember(Value = @"instructionIdentification")] - InstructionIdentification = 4, - - [System.Runtime.Serialization.EnumMember(Value = @"invoiceNumber")] - InvoiceNumber = 5, - - [System.Runtime.Serialization.EnumMember(Value = @"mandateIdentification")] - MandateIdentification = 6, - - [System.Runtime.Serialization.EnumMember(Value = @"messageIdentification")] - MessageIdentification = 7, - - [System.Runtime.Serialization.EnumMember(Value = @"otherReference")] - OtherReference = 8, - - [System.Runtime.Serialization.EnumMember(Value = @"paymentInformationIdentification")] - PaymentInformationIdentification = 9, - - [System.Runtime.Serialization.EnumMember(Value = @"remittanceReference")] - RemittanceReference = 10, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum TransactionStatus - { - [System.Runtime.Serialization.EnumMember(Value = @"booked")] - Booked = 0, - - [System.Runtime.Serialization.EnumMember(Value = @"pending")] - Pending = 1, - - [System.Runtime.Serialization.EnumMember(Value = @"info")] - Info = 2, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Transactions - { - [Newtonsoft.Json.JsonProperty("responseStatus", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public ResponseStatus ResponseStatus { get; set; } - - [Newtonsoft.Json.JsonProperty("transactions", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection Transactions1 { get; set; } - - [Newtonsoft.Json.JsonProperty("links", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public System.Collections.Generic.ICollection Links { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - /// Error structure for error message 400 - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Error400 - { - /// error code, for automatic handling - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Code { get; set; } - - /// Best possible description of the error from Data Provider. - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Message { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - /// Error structure for error message 401 - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Error401 - { - /// error code, for automatic handling - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Code { get; set; } - - /// Best possible description of the error from Data Provider. - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Message { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - /// Error structure for error message 403 - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Error403 - { - /// error code, for automatic handling - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Code { get; set; } - - /// Best possible description of the error from Data Provider - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Message { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - /// Error structure for error message 404 - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Error404 - { - /// error code, for automatic handling - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Code { get; set; } - - /// Best possible description of the error from Data Provider - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Message { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - /// Error structure for error message 405 - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Error405 - { - /// error code, for automatic handling - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Code { get; set; } - - /// Best possible description of the error from Data Provider - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Message { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - /// Error structure for error message 429 - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Error429 - { - /// error code, for automatic handling - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Code { get; set; } - - /// Best possible description of the error from Data Provider - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Message { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - /// Error structure for error message 500 - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Error500 - { - /// error code, for automatic handling - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Code { get; set; } - - /// Best possible description of the error from Data Provider - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Message { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - /// Error structure for all error messages - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public partial class Error - { - /// error code, for automatic handling - [Newtonsoft.Json.JsonProperty("code", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Code { get; set; } - - /// Best possible description of the error from Data Provider - [Newtonsoft.Json.JsonProperty("message", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] - public string Message { get; set; } - - private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); - - [Newtonsoft.Json.JsonExtensionData] - public System.Collections.Generic.IDictionary AdditionalProperties - { - get { return _additionalProperties; } - set { _additionalProperties = value; } - } - - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum AdditionalReferenceIDType - { - [System.Runtime.Serialization.EnumMember(Value = @"pol")] - Pol = 0, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum AdditionalReferenceIDType2 - { - [System.Runtime.Serialization.EnumMember(Value = @"pol")] - Pol = 0, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum AdditionalReferenceIDType3 - { - [System.Runtime.Serialization.EnumMember(Value = @"pol")] - Pol = 0, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum AdditionalReferenceIDType4 - { - [System.Runtime.Serialization.EnumMember(Value = @"pol")] - Pol = 0, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.5.2.0 (Newtonsoft.Json v11.0.0.0)")] - public enum AdditionalReferenceIDType5 - { - [System.Runtime.Serialization.EnumMember(Value = @"pol")] - Pol = 0, - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.13.2.0 (NJsonSchema v10.5.2.0 (Newtonsoft.Json v11.0.0.0))")] - internal class DateFormatConverter : Newtonsoft.Json.Converters.IsoDateTimeConverter - { - public DateFormatConverter() - { - DateTimeFormat = "yyyy-MM-dd"; - } - } - -} - -#pragma warning restore 1591 -#pragma warning restore 1573 -#pragma warning restore 472 -#pragma warning restore 114 -#pragma warning restore 108 -#pragma warning restore 3016 -*/ diff --git a/src/Altinn.Dan.Plugin.Banking/Clients/V2/BankClient_v2.cs b/src/Altinn.Dan.Plugin.Banking/Clients/V2/BankClient_v2.cs index 053fdf0..dc2aa3f 100644 --- a/src/Altinn.Dan.Plugin.Banking/Clients/V2/BankClient_v2.cs +++ b/src/Altinn.Dan.Plugin.Banking/Clients/V2/BankClient_v2.cs @@ -22,6 +22,7 @@ namespace Altinn.Dan.Plugin.Banking.Clients.V2 { using System = global::System; + using System.Threading.Tasks; [System.CodeDom.Compiler.GeneratedCode("NSwag", "14.0.3.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")] public partial class Bank_v2 @@ -66,7 +67,7 @@ public string BaseUrl partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); - partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); + public partial Task ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); /// /// List of accounts for a specified party and period. Account number can be provided in place of the party identifier for lookup requests directly on the account. Must provide a blank list if no hits. @@ -179,7 +180,7 @@ public virtual async System.Threading.Tasks.Task ListAccountsAsync(Sys headers_[item_.Key] = item_.Value; } - ProcessResponse(client_, response_); + await ProcessResponse(client_, response_); var status_ = (int)response_.StatusCode; if (status_ == 200) diff --git a/src/Altinn.Dan.Plugin.Banking/Clients/V2/Bankv2.cs b/src/Altinn.Dan.Plugin.Banking/Clients/V2/Bankv2.cs index 1006540..34997df 100644 --- a/src/Altinn.Dan.Plugin.Banking/Clients/V2/Bankv2.cs +++ b/src/Altinn.Dan.Plugin.Banking/Clients/V2/Bankv2.cs @@ -5,6 +5,7 @@ using System.Net.Sockets; using System.Security.Cryptography.X509Certificates; using System.Text; +using System.Threading.Tasks; using Altinn.Dan.Plugin.Banking.Config; using Jose; using Microsoft.Extensions.Options; @@ -20,7 +21,7 @@ public partial class Bank_v2 /// Http client /// Response from bank // ReSharper disable once UnusedParameterInPartialMethod - partial void ProcessResponse(HttpClient client, HttpResponseMessage response) + public async partial Task ProcessResponse(HttpClient client, HttpResponseMessage response) { if (!response.IsSuccessStatusCode) return; @@ -32,7 +33,7 @@ partial void ProcessResponse(HttpClient client, HttpResponseMessage response) isAppJose = headervalues.Any(x => x == "application/jose"); } - var jwt = response.Content.ReadAsStringAsync().Result; + var jwt = await response.Content.ReadAsStringAsync(); var decryptedContent = JWT.Decode(jwt, diff --git a/src/Altinn.Dan.Plugin.Banking/Services/BankService.cs b/src/Altinn.Dan.Plugin.Banking/Services/BankService.cs index a5e102f..a0f23d1 100644 --- a/src/Altinn.Dan.Plugin.Banking/Services/BankService.cs +++ b/src/Altinn.Dan.Plugin.Banking/Services/BankService.cs @@ -178,7 +178,7 @@ private async Task GetAccountDetailsV2(Bank_v2.Bank_v2 bankClient,Bank await transactionsTask; _logger.LogInformation("Retrieved transactions: bank {0} account {1} dob {2} transaction count {3} accountinforequestid {4} correlationid {5}", - account.Servicer.Name, account.AccountIdentifier, account.PrimaryOwner?.Identifier?.Value?.Substring(0, 6), transactionsTask.Result.Transactions1.Count, accountInfoRequestId, correlationIdTransactions); + account.Servicer.Name, account.AccountIdentifier, account.PrimaryOwner?.Identifier?.Value?.Substring(0, 6), transactionsTask.Result.Transactions1?.Count, accountInfoRequestId, correlationIdTransactions); return MapToInternalV2(account.Type, details.Account, transactionsTask.Result.Transactions1, availableCredit - availableDebit, bookedCredit - bookedDebit);