From 3fa6c03844ddad1eb18d2e29d10c94a1ad096909 Mon Sep 17 00:00:00 2001 From: Shamsidinkhon Mukhibillaev Date: Tue, 14 Sep 2021 15:22:47 +0200 Subject: [PATCH] Regenerated code based on the latest tag --- .../Endpoint/AttachmentConversationContent.cs | 32 +- .../Endpoint/AttachmentMonetaryAccount.cs | 42 +- .../AttachmentMonetaryAccountContent.cs | 34 +- .../Generated/Endpoint/AttachmentPublic.cs | 56 +-- .../Endpoint/AttachmentPublicContent.cs | 31 +- .../Model/Generated/Endpoint/AttachmentTab.cs | 64 ++- .../Endpoint/AttachmentTabContent.cs | 34 +- .../Generated/Endpoint/AttachmentUser.cs | 48 +- .../Endpoint/AttachmentUserContent.cs | 28 +- BunqSdk/Model/Generated/Endpoint/Avatar.cs | 60 +-- .../BankSwitchServiceNetherlandsIncoming.cs | 50 +- ...SwitchServiceNetherlandsIncomingPayment.cs | 44 +- .../Endpoint/BillingContractSubscription.cs | 74 +-- .../Endpoint/BunqMeFundraiserProfile.cs | 58 ++- .../Endpoint/BunqMeFundraiserProfileUser.cs | 97 ++-- .../Endpoint/BunqMeFundraiserResult.cs | 54 +-- BunqSdk/Model/Generated/Endpoint/BunqMeTab.cs | 171 ++++--- .../Generated/Endpoint/BunqMeTabEntry.cs | 43 +- .../Endpoint/BunqMeTabResultInquiry.cs | 18 +- .../Endpoint/BunqMeTabResultResponse.cs | 36 +- BunqSdk/Model/Generated/Endpoint/Card.cs | 203 ++++---- BunqSdk/Model/Generated/Endpoint/CardBatch.cs | 50 +- .../Generated/Endpoint/CardBatchReplace.cs | 86 ++++ .../Model/Generated/Endpoint/CardCredit.cs | 180 +++---- BunqSdk/Model/Generated/Endpoint/CardDebit.cs | 168 ++++--- .../Generated/Endpoint/CardGeneratedCvc2.cs | 120 +++-- BunqSdk/Model/Generated/Endpoint/CardName.cs | 34 +- .../Model/Generated/Endpoint/CardReplace.cs | 68 +-- .../Model/Generated/Endpoint/CashRegister.cs | 150 +++--- .../Generated/Endpoint/CashRegisterQrCode.cs | 122 +++-- .../Endpoint/CashRegisterQrCodeContent.cs | 37 +- .../Generated/Endpoint/CertificatePinned.cs | 89 ++-- .../Model/Generated/Endpoint/ChatMessage.cs | 9 +- BunqSdk/Model/Generated/Endpoint/Company.cs | 126 +++-- .../Generated/Endpoint/ConfirmationOfFunds.cs | 54 +-- BunqSdk/Model/Generated/Endpoint/Customer.cs | 34 +- .../Model/Generated/Endpoint/CustomerLimit.cs | 68 +-- BunqSdk/Model/Generated/Endpoint/Device.cs | 46 +- .../Model/Generated/Endpoint/DeviceServer.cs | 94 ++-- .../Model/Generated/Endpoint/DraftPayment.cs | 158 +++---- .../Endpoint/DraftShareInviteBank.cs | 128 +++-- .../DraftShareInviteBankQrCodeContent.cs | 32 +- BunqSdk/Model/Generated/Endpoint/Event.cs | 95 ++-- .../Endpoint/ExportAnnualOverview.cs | 98 ++-- .../Endpoint/ExportAnnualOverviewContent.cs | 32 +- BunqSdk/Model/Generated/Endpoint/ExportRib.cs | 96 ++-- .../Generated/Endpoint/ExportRibContent.cs | 34 +- .../Generated/Endpoint/ExportStatement.cs | 140 +++--- .../Endpoint/ExportStatementContent.cs | 34 +- .../Endpoint/ExportStatementPayment.cs | 72 ++- .../Endpoint/ExportStatementPaymentContent.cs | 34 +- .../Generated/Endpoint/FeatureAnnouncement.cs | 56 ++- .../Endpoint/IdealMerchantTransaction.cs | 128 +++-- BunqSdk/Model/Generated/Endpoint/Insight.cs | 48 +- .../Model/Generated/Endpoint/InsightBudget.cs | 55 +++ .../Model/Generated/Endpoint/InsightEvent.cs | 64 +-- .../Endpoint/InsightPreferenceDate.cs | 71 +++ .../Endpoint/InstallationServerPublicKey.cs | 34 +- BunqSdk/Model/Generated/Endpoint/Invoice.cs | 126 +++-- .../Model/Generated/Endpoint/InvoiceByUser.cs | 108 ++--- .../Endpoint/InvoiceExportPdfContent.cs | 28 +- .../Generated/Endpoint/MasterCardAction.cs | 221 +++++---- .../MasterCardActionGreenAggregation.cs | 40 +- .../Generated/Endpoint/MasterCardPayment.cs | 55 +++ .../Generated/Endpoint/MonetaryAccount.cs | 74 ++- .../Generated/Endpoint/MonetaryAccountBank.cs | 220 +++++---- .../Endpoint/MonetaryAccountJoint.cs | 214 ++++----- .../Endpoint/MonetaryAccountLight.cs | 109 ++--- .../Endpoint/MonetaryAccountProfile.cs | 22 +- .../Endpoint/MonetaryAccountSavings.cs | 222 +++++---- ...SwitchServiceNetherlandsIncomingPayment.cs | 164 +++---- .../NoteAttachmentBunqMeFundraiserResult.cs | 159 +++---- .../Endpoint/NoteAttachmentDraftPayment.cs | 150 +++--- .../NoteAttachmentIdealMerchantTransaction.cs | 161 +++---- .../NoteAttachmentMasterCardAction.cs | 158 +++---- .../Endpoint/NoteAttachmentPayment.cs | 140 +++--- .../Endpoint/NoteAttachmentPaymentBatch.cs | 150 +++--- .../Endpoint/NoteAttachmentRequestInquiry.cs | 158 +++---- .../NoteAttachmentRequestInquiryBatch.cs | 159 +++---- .../Endpoint/NoteAttachmentRequestResponse.cs | 158 +++---- .../NoteAttachmentScheduleInstance.cs | 160 +++---- .../Endpoint/NoteAttachmentSchedulePayment.cs | 158 +++---- .../NoteAttachmentSchedulePaymentBatch.cs | 159 +++---- ...NoteAttachmentSofortMerchantTransaction.cs | 161 +++---- .../Endpoint/NoteAttachmentWhitelistResult.cs | 160 +++---- ...SwitchServiceNetherlandsIncomingPayment.cs | 153 +++--- .../NoteTextBunqMeFundraiserResult.cs | 151 +++--- .../Endpoint/NoteTextDraftPayment.cs | 132 +++--- .../NoteTextIdealMerchantTransaction.cs | 151 +++--- .../Endpoint/NoteTextMasterCardAction.cs | 140 +++--- .../Generated/Endpoint/NoteTextPayment.cs | 132 +++--- .../Endpoint/NoteTextPaymentBatch.cs | 132 +++--- .../Endpoint/NoteTextRequestInquiry.cs | 133 +++--- .../Endpoint/NoteTextRequestInquiryBatch.cs | 151 +++--- .../Endpoint/NoteTextRequestResponse.cs | 133 +++--- .../Endpoint/NoteTextScheduleInstance.cs | 152 +++--- .../Endpoint/NoteTextSchedulePayment.cs | 133 +++--- .../Endpoint/NoteTextSchedulePaymentBatch.cs | 151 +++--- .../NoteTextSofortMerchantTransaction.cs | 151 +++--- .../Endpoint/NoteTextWhitelistResult.cs | 151 +++--- .../Endpoint/NotificationFilterPushUser.cs | 58 ++- .../NotificationFilterUrlMonetaryAccount.cs | 62 ++- .../Endpoint/NotificationFilterUrlUser.cs | 58 ++- .../Generated/Endpoint/OauthCallbackUrl.cs | 108 ++--- .../Model/Generated/Endpoint/OauthClient.cs | 116 ++--- BunqSdk/Model/Generated/Endpoint/Payment.cs | 194 ++++---- .../Generated/Endpoint/PaymentAutoAllocate.cs | 149 +++--- .../Endpoint/PaymentAutoAllocateDefinition.cs | 71 ++- .../Endpoint/PaymentAutoAllocateInstance.cs | 90 ++-- .../Endpoint/PaymentAutoAllocateUser.cs | 40 +- .../Model/Generated/Endpoint/PaymentBatch.cs | 98 ++-- .../PaymentServiceProviderCredential.cs | 98 ++-- .../PaymentServiceProviderDraftPayment.cs | 130 +++-- .../Model/Generated/Endpoint/PermittedIp.cs | 106 ++--- .../Endpoint/PlacePhotoLookupContent.cs | 54 +++ BunqSdk/Model/Generated/Endpoint/Registry.cs | 334 ------------- .../Model/Generated/Endpoint/RegistryEntry.cs | 344 -------------- .../Generated/Endpoint/RegistryMembership.cs | 86 +++- .../Generated/Endpoint/RegistrySetting.cs | 97 ---- .../Generated/Endpoint/RegistrySettlement.cs | 98 ++-- .../Endpoint/RegistrySettlementPending.cs | 66 --- .../Model/Generated/Endpoint/RelationUser.cs | 34 +- .../Generated/Endpoint/RequestInquiry.cs | 237 +++++----- .../Generated/Endpoint/RequestInquiryBatch.cs | 121 +++-- .../Generated/Endpoint/RequestResponse.cs | 193 ++++---- BunqSdk/Model/Generated/Endpoint/Reward.cs | 73 +-- .../Generated/Endpoint/RewardRecipient.cs | 76 +-- .../Model/Generated/Endpoint/RewardSender.cs | 76 +-- .../Generated/Endpoint/SandboxUserCompany.cs | 38 +- .../Generated/Endpoint/SandboxUserPerson.cs | 38 +- BunqSdk/Model/Generated/Endpoint/Schedule.cs | 74 ++- .../Generated/Endpoint/ScheduleInstance.cs | 102 ++-- .../Generated/Endpoint/SchedulePayment.cs | 129 +++-- .../Endpoint/SchedulePaymentBatch.cs | 97 ++-- .../Model/Generated/Endpoint/ScheduleUser.cs | 31 +- BunqSdk/Model/Generated/Endpoint/Session.cs | 25 +- .../Endpoint/ShareInviteBankInquiryBatch.cs | 20 +- .../ShareInviteMonetaryAccountAmountUsed.cs | 37 +- .../ShareInviteMonetaryAccountInquiry.cs | 185 ++++---- .../ShareInviteMonetaryAccountResponse.cs | 131 +++--- .../Endpoint/SofortMerchantTransaction.cs | 90 ++-- BunqSdk/Model/Generated/Endpoint/Tab.cs | 64 ++- .../Generated/Endpoint/TabAttachmentTab.cs | 48 +- .../Endpoint/TabAttachmentTabContent.cs | 31 +- BunqSdk/Model/Generated/Endpoint/TabItem.cs | 39 +- .../Model/Generated/Endpoint/TabItemShop.cs | 180 +++---- .../Generated/Endpoint/TabItemShopBatch.cs | 51 +- .../Generated/Endpoint/TabQrCodeContent.cs | 37 +- .../Generated/Endpoint/TabResultInquiry.cs | 64 ++- .../Generated/Endpoint/TabResultResponse.cs | 60 ++- .../Generated/Endpoint/TabUsageMultiple.cs | 236 ++++------ .../Generated/Endpoint/TabUsageSingle.cs | 244 +++++----- .../Generated/Endpoint/TokenQrRequestIdeal.cs | 126 ++--- .../Endpoint/TokenQrRequestSofort.cs | 44 +- .../Endpoint/TransferwiseAccountQuote.cs | 119 +++-- .../TransferwiseAccountRequirement.cs | 87 ++-- .../Endpoint/TransferwiseCurrency.cs | 44 +- .../Generated/Endpoint/TransferwiseQuote.cs | 106 ++--- .../Endpoint/TransferwiseQuoteTemporary.cs | 99 ++-- .../Endpoint/TransferwiseTransfer.cs | 128 +++-- .../TransferwiseTransferRequirement.cs | 65 ++- .../Generated/Endpoint/TransferwiseUser.cs | 78 ++- .../Model/Generated/Endpoint/TreeProgress.cs | 44 +- BunqSdk/Model/Generated/Endpoint/User.cs | 83 ++-- .../Model/Generated/Endpoint/UserApiKey.cs | 30 +- .../Model/Generated/Endpoint/UserCompany.cs | 227 +++++---- .../Generated/Endpoint/UserCompanyName.cs | 34 +- .../Endpoint/UserCredentialPasswordIp.cs | 73 ++- .../Model/Generated/Endpoint/UserLegalName.cs | 34 +- BunqSdk/Model/Generated/Endpoint/UserLight.cs | 445 ------------------ .../Endpoint/UserPaymentServiceProvider.cs | 88 ++-- .../Model/Generated/Endpoint/UserPerson.cs | 243 +++++----- BunqSdk/Model/Generated/Endpoint/Whitelist.cs | 9 +- .../Generated/Endpoint/WhitelistResult.cs | 43 +- .../Model/Generated/Endpoint/WhitelistSdd.cs | 161 +++---- .../WhitelistSddMonetaryAccountPaying.cs | 182 +++++++ .../Generated/Endpoint/WhitelistSddOneOff.cs | 247 ++++++++++ .../Endpoint/WhitelistSddRecurring.cs | 257 ++++++++++ BunqSdk/Model/Generated/Object/Address.cs | 49 +- .../Model/Generated/Object/AllocationItem.cs | 84 ---- BunqSdk/Model/Generated/Object/Amount.cs | 21 +- BunqSdk/Model/Generated/Object/Attachment.cs | 18 +- .../AttachmentMonetaryAccountPayment.cs | 21 +- .../Generated/Object/AttachmentPublic.cs | 22 +- .../Model/Generated/Object/AttachmentTab.cs | 22 +- BunqSdk/Model/Generated/Object/Avatar.cs | 37 +- .../Generated/Object/BudgetRestriction.cs | 18 +- BunqSdk/Model/Generated/Object/BunqId.cs | 15 +- .../Object/BunqMeMerchantAvailable.cs | 18 +- .../Model/Generated/Object/CardBatchEntry.cs | 26 +- .../Generated/Object/CardBatchReplaceEntry.cs | 56 +++ .../Generated/Object/CardCountryPermission.cs | 25 +- .../Generated/Object/CardPinAssignment.cs | 23 +- .../Object/CardPrimaryAccountNumber.cs | 37 +- BunqSdk/Model/Generated/Object/Certificate.cs | 15 +- BunqSdk/Model/Generated/Object/CoOwner.cs | 22 +- .../Object/DraftPaymentAnchorObject.cs | 28 +- .../Generated/Object/DraftPaymentEntry.cs | 46 +- .../Generated/Object/DraftPaymentResponse.cs | 18 +- .../Generated/Object/DraftShareInviteEntry.cs | 25 +- BunqSdk/Model/Generated/Object/Error.cs | 18 +- BunqSdk/Model/Generated/Object/EventObject.cs | 184 ++++---- BunqSdk/Model/Generated/Object/Geolocation.cs | 26 +- BunqSdk/Model/Generated/Object/Image.cs | 26 +- BunqSdk/Model/Generated/Object/InvoiceItem.cs | 46 +- .../Generated/Object/InvoiceItemGroup.cs | 39 +- BunqSdk/Model/Generated/Object/Issuer.cs | 21 +- BunqSdk/Model/Generated/Object/LabelCard.cs | 34 +- .../Generated/Object/LabelMonetaryAccount.cs | 58 +-- BunqSdk/Model/Generated/Object/LabelUser.cs | 33 +- .../Object/MonetaryAccountProfileDrain.cs | 32 +- .../Object/MonetaryAccountProfileFill.cs | 37 +- .../Object/MonetaryAccountSetting.cs | 37 +- .../Object/NotificationAnchorObject.cs | 148 +++--- .../Generated/Object/NotificationFilter.cs | 25 +- .../Object/NotificationFilterPush.cs | 15 +- .../Generated/Object/NotificationFilterUrl.cs | 33 +- .../Model/Generated/Object/NotificationUrl.cs | 26 +- .../Generated/Object/OauthCallbackUrl.cs | 26 +- .../Object/PaymentBatchAnchoredPayment.cs | 14 +- .../Model/Generated/Object/PermittedDevice.cs | 18 +- BunqSdk/Model/Generated/Object/Pointer.cs | 31 +- .../Object/RegistryEntryAttachment.cs | 53 --- .../Object/RegistryEntryReference.cs | 37 -- .../Object/RegistrySettlementItem.cs | 30 +- .../Object/RequestInquiryReference.cs | 18 +- ...equestReferenceSplitTheBillAnchorObject.cs | 76 +-- .../Generated/Object/ScheduleAnchorObject.cs | 28 +- .../Object/ScheduleInstanceAnchorObject.cs | 28 +- .../Generated/Object/SchedulePaymentEntry.cs | 40 +- BunqSdk/Model/Generated/Object/ShareDetail.cs | 22 +- .../Object/ShareDetailDraftPayment.cs | 32 +- .../Generated/Object/ShareDetailPayment.cs | 37 +- .../Generated/Object/ShareDetailReadOnly.cs | 25 +- .../Generated/Object/TabTextWaitingScreen.cs | 21 +- .../Model/Generated/Object/TabVisibility.cs | 25 +- BunqSdk/Model/Generated/Object/TaxResident.cs | 25 +- .../Object/TransferwiseRequirementField.cs | 25 +- .../TransferwiseRequirementFieldGroup.cs | 58 +-- ...iseRequirementFieldGroupValidationAsync.cs | 18 +- ...uirementFieldGroupValidationAsyncParams.cs | 22 +- ...rwiseRequirementFieldGroupValuesAllowed.cs | 18 +- BunqSdk/Model/Generated/Object/Ubo.cs | 22 +- .../Object/UserApiKeyAnchoredUser.cs | 34 +- .../WhitelistResultViewAnchoredObject.cs | 22 +- 245 files changed, 9799 insertions(+), 11065 deletions(-) create mode 100644 BunqSdk/Model/Generated/Endpoint/CardBatchReplace.cs create mode 100644 BunqSdk/Model/Generated/Endpoint/InsightBudget.cs create mode 100644 BunqSdk/Model/Generated/Endpoint/InsightPreferenceDate.cs create mode 100644 BunqSdk/Model/Generated/Endpoint/MasterCardPayment.cs create mode 100644 BunqSdk/Model/Generated/Endpoint/PlacePhotoLookupContent.cs delete mode 100644 BunqSdk/Model/Generated/Endpoint/Registry.cs delete mode 100644 BunqSdk/Model/Generated/Endpoint/RegistryEntry.cs delete mode 100644 BunqSdk/Model/Generated/Endpoint/RegistrySetting.cs delete mode 100644 BunqSdk/Model/Generated/Endpoint/RegistrySettlementPending.cs delete mode 100644 BunqSdk/Model/Generated/Endpoint/UserLight.cs create mode 100644 BunqSdk/Model/Generated/Endpoint/WhitelistSddMonetaryAccountPaying.cs create mode 100644 BunqSdk/Model/Generated/Endpoint/WhitelistSddOneOff.cs create mode 100644 BunqSdk/Model/Generated/Endpoint/WhitelistSddRecurring.cs delete mode 100644 BunqSdk/Model/Generated/Object/AllocationItem.cs create mode 100644 BunqSdk/Model/Generated/Object/CardBatchReplaceEntry.cs delete mode 100644 BunqSdk/Model/Generated/Object/RegistryEntryAttachment.cs delete mode 100644 BunqSdk/Model/Generated/Object/RegistryEntryReference.cs diff --git a/BunqSdk/Model/Generated/Endpoint/AttachmentConversationContent.cs b/BunqSdk/Model/Generated/Endpoint/AttachmentConversationContent.cs index c3db2d12..a071452c 100644 --- a/BunqSdk/Model/Generated/Endpoint/AttachmentConversationContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/AttachmentConversationContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,41 +19,38 @@ public class AttachmentConversationContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/chat-conversation/{1}/attachment/{2}/content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "AttachmentConversationContent"; - + /// /// Get the raw content of a specific attachment. /// - public static BunqResponse List(int chatConversationId, int attachmentId, - IDictionary customHeaders = null) + public static BunqResponse List(int chatConversationId, int attachmentId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), chatConversationId, attachmentId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), chatConversationId, attachmentId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static AttachmentConversationContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/AttachmentMonetaryAccount.cs b/BunqSdk/Model/Generated/Endpoint/AttachmentMonetaryAccount.cs index 2f024b06..dccef70c 100644 --- a/BunqSdk/Model/Generated/Endpoint/AttachmentMonetaryAccount.cs +++ b/BunqSdk/Model/Generated/Endpoint/AttachmentMonetaryAccount.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,42 +20,38 @@ public class AttachmentMonetaryAccount : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/attachment"; - - + + /// /// The attachment. /// [JsonProperty(PropertyName = "attachment")] public Attachment Attachment { get; set; } - + /// /// The ID of the attachment created. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - - + + /// /// Create a new monetary account attachment. Create a POST request with a payload that contains the binary /// representation of the file, without any JSON wrapping. Make sure you define the MIME type (i.e. image/jpeg) /// in the Content-Type header. You are required to provide a description of the attachment using the /// X-Bunq-Attachment-Description header. /// - public static BunqResponse Create(byte[] requestBytes, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Create(byte[] requestBytes, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -60,20 +60,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Id != null) { return false; } - + return true; } - + /// /// public static AttachmentMonetaryAccount CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/AttachmentMonetaryAccountContent.cs b/BunqSdk/Model/Generated/Endpoint/AttachmentMonetaryAccountContent.cs index c42073ba..97ceb2f1 100644 --- a/BunqSdk/Model/Generated/Endpoint/AttachmentMonetaryAccountContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/AttachmentMonetaryAccountContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,43 +19,38 @@ public class AttachmentMonetaryAccountContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/attachment/{2}/content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "AttachmentMonetaryAccountContent"; - + /// /// Get the raw content of a specific attachment. /// - public static BunqResponse List(int attachmentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse List(int attachmentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), attachmentId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), attachmentId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static AttachmentMonetaryAccountContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/AttachmentPublic.cs b/BunqSdk/Model/Generated/Endpoint/AttachmentPublic.cs index 2b344be3..6491a791 100644 --- a/BunqSdk/Model/Generated/Endpoint/AttachmentPublic.cs +++ b/BunqSdk/Model/Generated/Endpoint/AttachmentPublic.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,71 +21,69 @@ public class AttachmentPublic : BunqModel /// protected const string ENDPOINT_URL_CREATE = "attachment-public"; protected const string ENDPOINT_URL_READ = "attachment-public/{0}"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "Uuid"; private const string OBJECT_TYPE_GET = "AttachmentPublic"; - + /// /// The UUID of the attachment. /// [JsonProperty(PropertyName = "uuid")] public string Uuid { get; set; } - + /// /// The timestamp of the attachment's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the attachment's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The attachment. /// [JsonProperty(PropertyName = "attachment")] public Attachment Attachment { get; set; } - - + + /// /// Create a new public attachment. Create a POST request with a payload that contains a binary representation /// of the file, without any JSON wrapping. Make sure you define the MIME type (i.e. image/jpeg, or image/png) /// in the Content-Type header. You are required to provide a description of the attachment using the /// X-Bunq-Attachment-Description header. /// - public static BunqResponse Create(byte[] requestBytes, IDictionary customHeaders = null) + public static BunqResponse Create(byte[] requestBytes, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); var responseRaw = apiClient.Post(ENDPOINT_URL_CREATE, requestBytes, customHeaders); - + return ProcessForUuid(responseRaw); } - + /// /// Get a specific attachment's metadata through its UUID. The Content-Type header of the response will describe /// the MIME type of the attachment file. /// - public static BunqResponse Get(string attachmentPublicUuid, - IDictionary customHeaders = null) + public static BunqResponse Get(string attachmentPublicUuid, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, attachmentPublicUuid), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, attachmentPublicUuid), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -90,30 +92,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static AttachmentPublic CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/AttachmentPublicContent.cs b/BunqSdk/Model/Generated/Endpoint/AttachmentPublicContent.cs index 26a6c6f2..7a0703db 100644 --- a/BunqSdk/Model/Generated/Endpoint/AttachmentPublicContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/AttachmentPublicContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,40 +19,38 @@ public class AttachmentPublicContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "attachment-public/{0}/content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "AttachmentPublicContent"; - + /// /// Get the raw content of a specific attachment. /// - public static BunqResponse List(string attachmentPublicUuid, - IDictionary customHeaders = null) + public static BunqResponse List(string attachmentPublicUuid, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, attachmentPublicUuid), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, attachmentPublicUuid), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static AttachmentPublicContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/AttachmentTab.cs b/BunqSdk/Model/Generated/Endpoint/AttachmentTab.cs index 1829bad0..4c68196c 100644 --- a/BunqSdk/Model/Generated/Endpoint/AttachmentTab.cs +++ b/BunqSdk/Model/Generated/Endpoint/AttachmentTab.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,75 +21,67 @@ public class AttachmentTab : BunqModel /// protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/attachment-tab"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/attachment-tab/{2}"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "AttachmentTab"; - + /// /// The id of the attachment. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the attachment's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the attachment's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The attachment. /// [JsonProperty(PropertyName = "attachment")] public Attachment Attachment { get; set; } - - + + /// /// Upload a new attachment to use with a tab, and to read its metadata. Create a POST request with a payload /// that contains the binary representation of the file, without any JSON wrapping. Make sure you define the /// MIME type (i.e. image/jpeg) in the Content-Type header. You are required to provide a description of the /// attachment using the X-Bunq-Attachment-Description header. /// - public static BunqResponse Create(byte[] requestBytes, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Create(byte[] requestBytes, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get a specific attachment. The header of the response contains the content-type of the attachment. /// - public static BunqResponse Get(int attachmentTabId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int attachmentTabId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - attachmentTabId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), attachmentTabId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -94,30 +90,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static AttachmentTab CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/AttachmentTabContent.cs b/BunqSdk/Model/Generated/Endpoint/AttachmentTabContent.cs index fa01446a..4a5e039c 100644 --- a/BunqSdk/Model/Generated/Endpoint/AttachmentTabContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/AttachmentTabContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,43 +19,38 @@ public class AttachmentTabContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/attachment-tab/{2}/content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "AttachmentTabContent"; - + /// /// Get the raw content of a specific attachment. /// - public static BunqResponse List(int attachmentTabId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse List(int attachmentTabId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), attachmentTabId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), attachmentTabId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static AttachmentTabContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/AttachmentUser.cs b/BunqSdk/Model/Generated/Endpoint/AttachmentUser.cs index 1b6a6d07..30727dda 100644 --- a/BunqSdk/Model/Generated/Endpoint/AttachmentUser.cs +++ b/BunqSdk/Model/Generated/Endpoint/AttachmentUser.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,53 +20,51 @@ public class AttachmentUser : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "user/{0}/attachment/{1}"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "AttachmentUser"; - + /// /// The id of the attachment. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the attachment's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the attachment's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The attachment. /// [JsonProperty(PropertyName = "attachment")] public Attachment Attachment { get; set; } - - + + /// /// Get a specific attachment. The header of the response contains the content-type of the attachment. /// - public static BunqResponse Get(int attachmentUserId, - IDictionary customHeaders = null) + public static BunqResponse Get(int attachmentUserId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), attachmentUserId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), attachmentUserId), new Dictionary(), customHeaders); + return FromJson(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -71,30 +73,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static AttachmentUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/AttachmentUserContent.cs b/BunqSdk/Model/Generated/Endpoint/AttachmentUserContent.cs index 684b714f..055dc5fa 100644 --- a/BunqSdk/Model/Generated/Endpoint/AttachmentUserContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/AttachmentUserContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,39 +19,38 @@ public class AttachmentUserContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/attachment/{1}/content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "AttachmentUserContent"; - + /// /// Get the raw content of a specific attachment. /// public static BunqResponse List(int attachmentId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), attachmentId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), attachmentId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static AttachmentUserContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Avatar.cs b/BunqSdk/Model/Generated/Endpoint/Avatar.cs index 621108f7..1fb624dd 100644 --- a/BunqSdk/Model/Generated/Endpoint/Avatar.cs +++ b/BunqSdk/Model/Generated/Endpoint/Avatar.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,72 +23,70 @@ public class Avatar : BunqModel /// protected const string ENDPOINT_URL_CREATE = "avatar"; protected const string ENDPOINT_URL_READ = "avatar/{0}"; - + /// /// Field constants. /// public const string FIELD_ATTACHMENT_PUBLIC_UUID = "attachment_public_uuid"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "Uuid"; private const string OBJECT_TYPE_GET = "Avatar"; - + /// /// The public UUID of the public attachment from which an avatar image must be created. /// [JsonProperty(PropertyName = "attachment_public_uuid")] public string AttachmentPublicUuid { get; set; } - + /// /// The UUID of the created avatar. /// [JsonProperty(PropertyName = "uuid")] public string Uuid { get; set; } - + /// /// The content type of the image. /// [JsonProperty(PropertyName = "image")] public List Image { get; set; } - - + + /// /// /// The public UUID of the public attachment from which an avatar image must be created. - public static BunqResponse Create(string attachmentPublicUuid, - IDictionary customHeaders = null) + public static BunqResponse Create(string attachmentPublicUuid, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_ATTACHMENT_PUBLIC_UUID, attachmentPublicUuid}, - }; - + { + {FIELD_ATTACHMENT_PUBLIC_UUID, attachmentPublicUuid}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); var responseRaw = apiClient.Post(ENDPOINT_URL_CREATE, requestBytes, customHeaders); - + return ProcessForUuid(responseRaw); } - + /// /// public static BunqResponse Get(string avatarUuid, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, avatarUuid), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, avatarUuid), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -95,20 +95,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Image != null) { return false; } - + return true; } - + /// /// public static Avatar CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/BankSwitchServiceNetherlandsIncoming.cs b/BunqSdk/Model/Generated/Endpoint/BankSwitchServiceNetherlandsIncoming.cs index db8eb2fb..72097bd8 100644 --- a/BunqSdk/Model/Generated/Endpoint/BankSwitchServiceNetherlandsIncoming.cs +++ b/BunqSdk/Model/Generated/Endpoint/BankSwitchServiceNetherlandsIncoming.cs @@ -1,6 +1,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,63 +16,64 @@ public class BankSwitchServiceNetherlandsIncoming : BunqModel public const string FIELD_ALIAS = "alias"; public const string FIELD_COUNTERPARTY_ALIAS = "counterparty_alias"; public const string FIELD_STATUS = "status"; - - + + /// /// The label of the monetary of this switch service. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The IBAN alias that's displayed for this switch service. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The status of the switch service. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The label of the user creator of this switch service. /// [JsonProperty(PropertyName = "user_alias")] public LabelUser UserAlias { get; set; } - + /// /// The sub status of the switch service. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The timestamp when the switch service desired to be start. /// [JsonProperty(PropertyName = "time_start_desired")] public string TimeStartDesired { get; set; } - + /// /// The timestamp when the switch service actually starts. /// [JsonProperty(PropertyName = "time_start_actual")] public string TimeStartActual { get; set; } - + /// /// The timestamp when the switch service ends. /// [JsonProperty(PropertyName = "time_end")] public string TimeEnd { get; set; } - + /// /// Reference to the bank transfer form for this switch-service. /// [JsonProperty(PropertyName = "attachment")] public Attachment Attachment { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -80,55 +82,55 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Alias != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.TimeStartDesired != null) { return false; } - + if (this.TimeStartActual != null) { return false; } - + if (this.TimeEnd != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static BankSwitchServiceNetherlandsIncoming CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/BankSwitchServiceNetherlandsIncomingPayment.cs b/BunqSdk/Model/Generated/Endpoint/BankSwitchServiceNetherlandsIncomingPayment.cs index 4fe00128..5e138c26 100644 --- a/BunqSdk/Model/Generated/Endpoint/BankSwitchServiceNetherlandsIncomingPayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/BankSwitchServiceNetherlandsIncomingPayment.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,44 +19,38 @@ public class BankSwitchServiceNetherlandsIncomingPayment : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/switch-service-payment/{2}"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "BankSwitchServiceNetherlandsIncomingPayment"; - + /// /// The bank switch service details. /// [JsonProperty(PropertyName = "bank_switch_service")] public BankSwitchServiceNetherlandsIncoming BankSwitchService { get; set; } - + /// /// The payment made using bank switch service. /// [JsonProperty(PropertyName = "payment")] public Payment Payment { get; set; } - - + + /// /// - public static BunqResponse Get( - int bankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int bankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bankSwitchServiceNetherlandsIncomingPaymentId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bankSwitchServiceNetherlandsIncomingPaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -61,20 +59,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Payment != null) { return false; } - + return true; } - + /// /// public static BankSwitchServiceNetherlandsIncomingPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/BillingContractSubscription.cs b/BunqSdk/Model/Generated/Endpoint/BillingContractSubscription.cs index 2d561602..93138c57 100644 --- a/BunqSdk/Model/Generated/Endpoint/BillingContractSubscription.cs +++ b/BunqSdk/Model/Generated/Endpoint/BillingContractSubscription.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,97 +18,95 @@ public class BillingContractSubscription : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/billing-contract-subscription"; - + /// /// Field constants. /// public const string FIELD_SUBSCRIPTION_TYPE = "subscription_type"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "BillingContractSubscription"; - + /// /// The subscription type of the user. Can be one of PERSON_SUPER_LIGHT_V1, PERSON_LIGHT_V1, PERSON_MORE_V1, /// PERSON_FREE_V1, PERSON_PREMIUM_V1, COMPANY_V1, or COMPANY_V2. /// [JsonProperty(PropertyName = "subscription_type")] public string SubscriptionType { get; set; } - + /// /// The id of the billing contract. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp when the billing contract was made. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp when the billing contract was last updated. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The date from when the billing contract is valid. /// [JsonProperty(PropertyName = "contract_date_start")] public string ContractDateStart { get; set; } - + /// /// The date until when the billing contract is valid. /// [JsonProperty(PropertyName = "contract_date_end")] public string ContractDateEnd { get; set; } - + /// /// The version of the billing contract. /// [JsonProperty(PropertyName = "contract_version")] public int? ContractVersion { get; set; } - + /// /// The subscription type the user will have after a subscription downgrade. Will be null if downgrading is not /// possible. /// [JsonProperty(PropertyName = "subscription_type_downgrade")] public string SubscriptionTypeDowngrade { get; set; } - + /// /// The subscription status. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The subscription substatus. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - - + + /// /// Get all subscription billing contract for the authenticated user. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -113,60 +115,60 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.ContractDateStart != null) { return false; } - + if (this.ContractDateEnd != null) { return false; } - + if (this.ContractVersion != null) { return false; } - + if (this.SubscriptionType != null) { return false; } - + if (this.SubscriptionTypeDowngrade != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + return true; } - + /// /// public static BillingContractSubscription CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserProfile.cs b/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserProfile.cs index 7513f6aa..729c0ba3 100644 --- a/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserProfile.cs +++ b/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserProfile.cs @@ -1,5 +1,7 @@ using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -12,58 +14,65 @@ public class BunqMeFundraiserProfile : BunqModel /// Field constants. /// public const string FIELD_POINTER = "pointer"; - - + + /// /// The pointer (url) which will be used to access the bunq.me fundraiser profile. /// [JsonProperty(PropertyName = "pointer")] public MonetaryAccountReference Pointer { get; set; } - + /// /// The color chosen for the bunq.me fundraiser profile in hexadecimal format. /// [JsonProperty(PropertyName = "color")] public string Color { get; set; } - + /// /// The LabelMonetaryAccount with the public information of the User and the MonetaryAccount that created the /// bunq.me fundraiser profile. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + + /// + /// The currency of the MonetaryAccount that created the bunq.me fundraiser profile. + /// + [JsonProperty(PropertyName = "currency")] + public string Currency { get; set; } + /// /// The description of the bunq.me fundraiser profile. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The attachment attached to the fundraiser profile. /// [JsonProperty(PropertyName = "attachment")] public AttachmentPublic Attachment { get; set; } - + /// /// The status of the bunq.me fundraiser profile, can be ACTIVE or DEACTIVATED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The URL which the user is sent to when a payment is completed. /// [JsonProperty(PropertyName = "redirect_url")] public string RedirectUrl { get; set; } - + /// /// Provided if the user has enabled their invite link. /// [JsonProperty(PropertyName = "invite_profile_name")] public string InviteProfileName { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -72,50 +81,55 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Alias != null) { return false; } - + + if (this.Currency != null) + { + return false; + } + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + if (this.Pointer != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.RedirectUrl != null) { return false; } - + if (this.InviteProfileName != null) { return false; } - + return true; } - + /// /// public static BunqMeFundraiserProfile CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserProfileUser.cs b/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserProfileUser.cs index 43f97ac1..41f83408 100644 --- a/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserProfileUser.cs +++ b/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserProfileUser.cs @@ -1,7 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,7 +20,7 @@ public class BunqMeFundraiserProfileUser : BunqModel /// protected const string ENDPOINT_URL_READ = "user/{0}/bunqme-fundraiser-profile/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/bunqme-fundraiser-profile"; - + /// /// Field constants. /// @@ -26,105 +31,106 @@ public class BunqMeFundraiserProfileUser : BunqModel public const string FIELD_POINTER = "pointer"; public const string FIELD_REDIRECT_URL = "redirect_url"; public const string FIELD_STATUS = "status"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "BunqMeFundraiserProfileModel"; - + /// /// Id of the monetary account on which you want to receive bunq.me payments. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The color chosen for the bunq.me fundraiser profile in hexadecimal format. /// [JsonProperty(PropertyName = "color")] public string Color { get; set; } - + /// /// The description of the bunq.me fundraiser profile. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The public UUID of the public attachment from which an avatar image must be created. /// [JsonProperty(PropertyName = "attachment_public_uuid")] public string AttachmentPublicUuid { get; set; } - + /// /// The pointer (url) which will be used to access the bunq.me fundraiser profile. /// [JsonProperty(PropertyName = "pointer")] public MonetaryAccountReference Pointer { get; set; } - + /// /// The URL which the user is sent to when a payment is completed. /// [JsonProperty(PropertyName = "redirect_url")] public string RedirectUrl { get; set; } - + /// /// The status of the bunq.me fundraiser profile, can be ACTIVE or DEACTIVATED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// Id of the user owning the profile. /// [JsonProperty(PropertyName = "owner_user_id")] public int? OwnerUserId { get; set; } - + /// /// The LabelMonetaryAccount with the public information of the User and the MonetaryAccount that created the /// bunq.me fundraiser profile. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + + /// + /// The currency of the MonetaryAccount that created the bunq.me fundraiser profile. + /// + [JsonProperty(PropertyName = "currency")] + public string Currency { get; set; } + /// /// The attachment used for the background of the bunq.me fundraiser profile. /// [JsonProperty(PropertyName = "attachment")] public AttachmentPublic Attachment { get; set; } - - + + /// /// - public static BunqResponse Get(int bunqMeFundraiserProfileUserId, - IDictionary customHeaders = null) + public static BunqResponse Get(int bunqMeFundraiserProfileUserId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), bunqMeFundraiserProfileUserId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), bunqMeFundraiserProfileUserId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -133,55 +139,60 @@ public override bool IsAllFieldNull() { return false; } - + if (this.OwnerUserId != null) { return false; } - + if (this.Color != null) { return false; } - + if (this.Alias != null) { return false; } - + + if (this.Currency != null) + { + return false; + } + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + if (this.Pointer != null) { return false; } - + if (this.RedirectUrl != null) { return false; } - + if (this.Status != null) { return false; } - + return true; } - + /// /// public static BunqMeFundraiserProfileUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserResult.cs b/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserResult.cs index 49034bb8..9b666651 100644 --- a/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserResult.cs +++ b/BunqSdk/Model/Generated/Endpoint/BunqMeFundraiserResult.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,60 +18,56 @@ public class BunqMeFundraiserResult : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "BunqMeFundraiserResult"; - + /// /// The id of the bunq.me. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp when the bunq.me was created. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp when the bunq.me was last updated. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The bunq.me fundraiser profile. /// [JsonProperty(PropertyName = "bunqme_fundraiser_profile")] public BunqMeFundraiserProfile BunqmeFundraiserProfile { get; set; } - + /// /// The list of payments, paid to the bunq.me fundraiser profile. /// [JsonProperty(PropertyName = "payments")] public List Payments { get; set; } - - + + /// /// - public static BunqResponse Get(int bunqMeFundraiserResultId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int bunqMeFundraiserResultId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqMeFundraiserResultId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqMeFundraiserResultId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -76,35 +76,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.BunqmeFundraiserProfile != null) { return false; } - + if (this.Payments != null) { return false; } - + return true; } - + /// /// public static BunqMeFundraiserResult CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/BunqMeTab.cs b/BunqSdk/Model/Generated/Endpoint/BunqMeTab.cs index f2b2c83d..c1360c3f 100644 --- a/BunqSdk/Model/Generated/Endpoint/BunqMeTab.cs +++ b/BunqSdk/Model/Generated/Endpoint/BunqMeTab.cs @@ -1,9 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,157 +23,160 @@ public class BunqMeTab : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/bunqme-tab/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/bunqme-tab"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/bunqme-tab/{2}"; - + /// /// Field constants. /// public const string FIELD_BUNQME_TAB_ENTRY = "bunqme_tab_entry"; public const string FIELD_STATUS = "status"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "BunqMeTab"; - + /// /// The bunq.me entry containing the payment information. /// [JsonProperty(PropertyName = "bunqme_tab_entry")] public BunqMeTabEntry BunqmeTabEntry { get; set; } - + /// /// The status of the bunq.me. Can be WAITING_FOR_PAYMENT, CANCELLED or EXPIRED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The id of the created bunq.me. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp when the bunq.me was created. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp when the bunq.me was last updated. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The timestamp of when the bunq.me expired or will expire. /// [JsonProperty(PropertyName = "time_expiry")] public string TimeExpiry { get; set; } - + /// /// The id of the MonetaryAccount the bunq.me was sent from. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + + /// + /// The type of the bunq.me Tab. Can be BUNQ_ME or SPLIT_RECEIPT. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// The LabelMonetaryAccount with the public information of the User and the MonetaryAccount that created the + /// bunq.me link. + /// + [JsonProperty(PropertyName = "alias_monetary_account")] + public MonetaryAccountReference AliasMonetaryAccount { get; set; } + /// /// The url that points to the bunq.me page. /// [JsonProperty(PropertyName = "bunqme_tab_share_url")] public string BunqmeTabShareUrl { get; set; } - + + /// + /// The bunq.me tab entries attached to this bunq.me Tab. + /// + [JsonProperty(PropertyName = "bunqme_tab_entries")] + public List BunqmeTabEntries { get; set; } + /// /// The list of bunq.me result Inquiries successfully made and paid. /// [JsonProperty(PropertyName = "result_inquiries")] public List ResultInquiries { get; set; } - - + + /// /// /// The bunq.me entry containing the payment information. /// The status of the bunq.me. Ignored in POST requests but can be used for cancelling the bunq.me by setting status as CANCELLED with a PUT request. - public static BunqResponse Create(BunqMeTabEntry bunqmeTabEntry, int? monetaryAccountId = null, - string status = null, IDictionary customHeaders = null) + public static BunqResponse Create(BunqMeTabEntry bunqmeTabEntry, int? monetaryAccountId= null, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_BUNQME_TAB_ENTRY, bunqmeTabEntry}, - {FIELD_STATUS, status}, - }; - + { + {FIELD_BUNQME_TAB_ENTRY, bunqmeTabEntry}, + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The status of the bunq.me. Ignored in POST requests but can be used for cancelling the bunq.me by setting status as CANCELLED with a PUT request. - public static BunqResponse Update(int bunqMeTabId, int? monetaryAccountId = null, string status = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int bunqMeTabId, int? monetaryAccountId= null, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - }; - + { + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqMeTabId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqMeTabId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int bunqMeTabId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int bunqMeTabId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqMeTabId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqMeTabId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -179,55 +185,70 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.TimeExpiry != null) { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.Status != null) { return false; } - + + if (this.Type != null) + { + return false; + } + + if (this.AliasMonetaryAccount != null) + { + return false; + } + if (this.BunqmeTabShareUrl != null) { return false; } - + if (this.BunqmeTabEntry != null) { return false; } - + + if (this.BunqmeTabEntries != null) + { + return false; + } + if (this.ResultInquiries != null) { return false; } - + return true; } - + /// /// public static BunqMeTab CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/BunqMeTabEntry.cs b/BunqSdk/Model/Generated/Endpoint/BunqMeTabEntry.cs index ce6167db..06706428 100644 --- a/BunqSdk/Model/Generated/Endpoint/BunqMeTabEntry.cs +++ b/BunqSdk/Model/Generated/Endpoint/BunqMeTabEntry.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,52 +17,53 @@ public class BunqMeTabEntry : BunqModel public const string FIELD_AMOUNT_INQUIRED = "amount_inquired"; public const string FIELD_DESCRIPTION = "description"; public const string FIELD_REDIRECT_URL = "redirect_url"; - - + + /// /// The requested Amount. /// [JsonProperty(PropertyName = "amount_inquired")] public Amount AmountInquired { get; set; } - + /// /// The description for the bunq.me. Maximum 9000 characters. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The URL which the user is sent to when a payment is completed. /// [JsonProperty(PropertyName = "redirect_url")] public string RedirectUrl { get; set; } - + /// /// The uuid of the bunq.me. /// [JsonProperty(PropertyName = "uuid")] public string Uuid { get; set; } - + /// /// The LabelMonetaryAccount with the public information of the User and the MonetaryAccount that created the /// bunq.me link. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The status of the bunq.me. Can be WAITING_FOR_PAYMENT, CANCELLED or EXPIRED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// List of available merchants. /// [JsonProperty(PropertyName = "merchant_available")] public List MerchantAvailable { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -71,45 +72,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.AmountInquired != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.RedirectUrl != null) { return false; } - + if (this.MerchantAvailable != null) { return false; } - + return true; } - + /// /// public static BunqMeTabEntry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/BunqMeTabResultInquiry.cs b/BunqSdk/Model/Generated/Endpoint/BunqMeTabResultInquiry.cs index ac4e912a..b043fae3 100644 --- a/BunqSdk/Model/Generated/Endpoint/BunqMeTabResultInquiry.cs +++ b/BunqSdk/Model/Generated/Endpoint/BunqMeTabResultInquiry.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,14 +15,15 @@ public class BunqMeTabResultInquiry : BunqModel /// [JsonProperty(PropertyName = "payment")] public Payment Payment { get; set; } - + /// /// The Id of the bunq.me tab that this BunqMeTabResultInquiry belongs to. /// [JsonProperty(PropertyName = "bunq_me_tab_id")] public int? BunqMeTabId { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -30,20 +32,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.BunqMeTabId != null) { return false; } - + return true; } - + /// /// public static BunqMeTabResultInquiry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/BunqMeTabResultResponse.cs b/BunqSdk/Model/Generated/Endpoint/BunqMeTabResultResponse.cs index 6823c02f..6c82fcb3 100644 --- a/BunqSdk/Model/Generated/Endpoint/BunqMeTabResultResponse.cs +++ b/BunqSdk/Model/Generated/Endpoint/BunqMeTabResultResponse.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,35 +19,31 @@ public class BunqMeTabResultResponse : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/bunqme-tab-result-response/{2}"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "BunqMeTabResultResponse"; - + /// /// The payment made for the bunq.me tab. /// [JsonProperty(PropertyName = "payment")] public Payment Payment { get; set; } - + /// /// - public static BunqResponse Get(int bunqMeTabResultResponseId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int bunqMeTabResultResponseId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqMeTabResultResponseId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqMeTabResultResponseId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -52,15 +52,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static BunqMeTabResultResponse CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Card.cs b/BunqSdk/Model/Generated/Endpoint/Card.cs index 184384a3..45b995d5 100644 --- a/BunqSdk/Model/Generated/Endpoint/Card.cs +++ b/BunqSdk/Model/Generated/Endpoint/Card.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,188 +21,189 @@ public class Card : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/card/{1}"; protected const string ENDPOINT_URL_READ = "user/{0}/card/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/card"; - + /// /// Field constants. /// public const string FIELD_PIN_CODE = "pin_code"; public const string FIELD_ACTIVATION_CODE = "activation_code"; public const string FIELD_STATUS = "status"; + public const string FIELD_ORDER_STATUS = "order_status"; public const string FIELD_CARD_LIMIT = "card_limit"; public const string FIELD_CARD_LIMIT_ATM = "card_limit_atm"; public const string FIELD_COUNTRY_PERMISSION = "country_permission"; public const string FIELD_PIN_CODE_ASSIGNMENT = "pin_code_assignment"; public const string FIELD_PRIMARY_ACCOUNT_NUMBERS = "primary_account_numbers"; public const string FIELD_MONETARY_ACCOUNT_ID_FALLBACK = "monetary_account_id_fallback"; - + /// /// Object type. /// private const string OBJECT_TYPE_PUT = "CardDebit"; private const string OBJECT_TYPE_GET = "CardDebit"; - + /// /// The plaintext pin code. Requests require encryption to be enabled. /// [JsonProperty(PropertyName = "pin_code")] public string PinCode { get; set; } - + /// /// DEPRECATED: Activate a card by setting status to ACTIVE when the order_status is ACCEPTED_FOR_PRODUCTION. /// [JsonProperty(PropertyName = "activation_code")] public string ActivationCode { get; set; } - + /// /// The status to set for the card. Can be ACTIVE, DEACTIVATED, LOST, STOLEN, CANCELLED, EXPIRED or /// PIN_TRIES_EXCEEDED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + + /// + /// The order status of the card. Can be NEW_CARD_REQUEST_RECEIVED, CARD_REQUEST_PENDING, SENT_FOR_PRODUCTION, + /// ACCEPTED_FOR_PRODUCTION, DELIVERED_TO_CUSTOMER, CARD_UPDATE_REQUESTED, CARD_UPDATE_PENDING, + /// CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED, VIRTUAL_DELIVERY, NEW_CARD_REQUEST_PENDING_USER_APPROVAL, + /// SENT_FOR_DELIVERY or NEW_CARD_REQUEST_CANCELLED. + /// + [JsonProperty(PropertyName = "order_status")] + public string OrderStatus { get; set; } + /// /// The spending limit for the card. /// [JsonProperty(PropertyName = "card_limit")] public Amount CardLimit { get; set; } - + /// /// The ATM spending limit for the card. /// [JsonProperty(PropertyName = "card_limit_atm")] public Amount CardLimitAtm { get; set; } - + /// /// The countries for which to grant (temporary) permissions to use the card. /// [JsonProperty(PropertyName = "country_permission")] public List CountryPermission { get; set; } - + /// /// Array of Types, PINs, account IDs assigned to the card. /// [JsonProperty(PropertyName = "pin_code_assignment")] public List PinCodeAssignment { get; set; } - + /// /// Array of PANs and their attributes. /// [JsonProperty(PropertyName = "primary_account_numbers")] public List PrimaryAccountNumbers { get; set; } - + /// /// ID of the MA to be used as fallback for this card if insufficient balance. Fallback account is removed if /// not supplied. /// [JsonProperty(PropertyName = "monetary_account_id_fallback")] public int? MonetaryAccountIdFallback { get; set; } - + /// /// The id of the card. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the card's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the card's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The public UUID of the card. /// [JsonProperty(PropertyName = "public_uuid")] public string PublicUuid { get; set; } - + /// /// The type of the card. Can be MAESTRO, MASTERCARD. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The sub-type of the card. /// [JsonProperty(PropertyName = "sub_type")] public string SubType { get; set; } - + /// /// The second line of text on the card /// [JsonProperty(PropertyName = "second_line")] public string SecondLine { get; set; } - + /// /// ID of the user who is owner of the card. /// [JsonProperty(PropertyName = "user_id")] public int? UserId { get; set; } - + /// /// The sub-status of the card. Can be NONE or REPLACED. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - - /// - /// The order status of the card. Can be NEW_CARD_REQUEST_RECEIVED, CARD_REQUEST_PENDING, SENT_FOR_PRODUCTION, - /// ACCEPTED_FOR_PRODUCTION, DELIVERED_TO_CUSTOMER, CARD_UPDATE_REQUESTED, CARD_UPDATE_PENDING, - /// CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED, VIRTUAL_DELIVERY, NEW_CARD_REQUEST_PENDING_USER_APPROVAL, - /// SENT_FOR_DELIVERY or NEW_CARD_REQUEST_CANCELLED. - /// - [JsonProperty(PropertyName = "order_status")] - public string OrderStatus { get; set; } - + /// /// Expiry date of the card. /// [JsonProperty(PropertyName = "expiry_date")] public string ExpiryDate { get; set; } - + /// /// The user's name on the card. /// [JsonProperty(PropertyName = "name_on_card")] public string NameOnCard { get; set; } - + /// /// The monetary account this card was ordered on and the label user that owns the card. /// [JsonProperty(PropertyName = "label_monetary_account_ordered")] public MonetaryAccountReference LabelMonetaryAccountOrdered { get; set; } - + /// /// The monetary account that this card is currently linked to and the label user viewing it. /// [JsonProperty(PropertyName = "label_monetary_account_current")] public MonetaryAccountReference LabelMonetaryAccountCurrent { get; set; } - + /// /// The country that is domestic to the card. Defaults to country of residence of user. /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// A tracking link provided by our shipment provider. /// [JsonProperty(PropertyName = "card_shipment_tracking_url")] public string CardShipmentTrackingUrl { get; set; } - + /// /// The amount saved through ZeroFX on this card. /// [JsonProperty(PropertyName = "amount_saved_zero_fx")] public Amount AmountSavedZeroFx { get; set; } - - + + /// /// Update the card details. Allow to change pin code, status, limits, country permissions and the monetary /// account connected to the card. When the card has been received, it can be also activated through this @@ -209,73 +212,67 @@ public class Card : BunqModel /// The plaintext pin code. Requests require encryption to be enabled. /// DEPRECATED: Activate a card by setting status to ACTIVE when the order_status is ACCEPTED_FOR_PRODUCTION. /// The status to set for the card. Can be ACTIVE, DEACTIVATED, LOST, STOLEN or CANCELLED, and can only be set to LOST/STOLEN/CANCELLED when order status is ACCEPTED_FOR_PRODUCTION/DELIVERED_TO_CUSTOMER/CARD_UPDATE_REQUESTED/CARD_UPDATE_SENT/CARD_UPDATE_ACCEPTED. Can only be set to DEACTIVATED after initial activation, i.e. order_status is DELIVERED_TO_CUSTOMER/CARD_UPDATE_REQUESTED/CARD_UPDATE_SENT/CARD_UPDATE_ACCEPTED. Mind that all the possible choices (apart from ACTIVE and DEACTIVATED) are permanent and cannot be changed after. + /// The order status to set for the card. Set to CARD_REQUEST_PENDING to get a virtual card produced. /// The spending limit for the card. /// The ATM spending limit for the card. /// The countries for which to grant (temporary) permissions to use the card. /// Array of Types, PINs, account IDs assigned to the card. /// Array of PANs and their attributes. /// ID of the MA to be used as fallback for this card if insufficient balance. Fallback account is removed if not supplied. - public static BunqResponse Update(int cardId, string pinCode = null, string activationCode = null, - string status = null, Amount cardLimit = null, Amount cardLimitAtm = null, - List countryPermission = null, List pinCodeAssignment = null, - List primaryAccountNumbers = null, int? monetaryAccountIdFallback = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int cardId, string pinCode = null, string activationCode = null, string status = null, string orderStatus = null, Amount cardLimit = null, Amount cardLimitAtm = null, List countryPermission = null, List pinCodeAssignment = null, List primaryAccountNumbers = null, int? monetaryAccountIdFallback = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_PIN_CODE, pinCode}, - {FIELD_ACTIVATION_CODE, activationCode}, - {FIELD_STATUS, status}, - {FIELD_CARD_LIMIT, cardLimit}, - {FIELD_CARD_LIMIT_ATM, cardLimitAtm}, - {FIELD_COUNTRY_PERMISSION, countryPermission}, - {FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment}, - {FIELD_PRIMARY_ACCOUNT_NUMBERS, primaryAccountNumbers}, - {FIELD_MONETARY_ACCOUNT_ID_FALLBACK, monetaryAccountIdFallback}, - }; - + { + {FIELD_PIN_CODE, pinCode}, + {FIELD_ACTIVATION_CODE, activationCode}, + {FIELD_STATUS, status}, + {FIELD_ORDER_STATUS, orderStatus}, + {FIELD_CARD_LIMIT, cardLimit}, + {FIELD_CARD_LIMIT_ATM, cardLimitAtm}, + {FIELD_COUNTRY_PERMISSION, countryPermission}, + {FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment}, + {FIELD_PRIMARY_ACCOUNT_NUMBERS, primaryAccountNumbers}, + {FIELD_MONETARY_ACCOUNT_ID_FALLBACK, monetaryAccountIdFallback}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), cardId), requestBytes, - customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), cardId), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_PUT); } - + /// /// Return the details of a specific card. /// public static BunqResponse Get(int cardId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), cardId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), cardId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Return all the cards available to the user. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -284,130 +281,130 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.PublicUuid != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.SubType != null) { return false; } - + if (this.SecondLine != null) { return false; } - + if (this.UserId != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.OrderStatus != null) { return false; } - + if (this.ExpiryDate != null) { return false; } - + if (this.NameOnCard != null) { return false; } - + if (this.PrimaryAccountNumbers != null) { return false; } - + if (this.CardLimit != null) { return false; } - + if (this.CardLimitAtm != null) { return false; } - + if (this.CountryPermission != null) { return false; } - + if (this.LabelMonetaryAccountOrdered != null) { return false; } - + if (this.LabelMonetaryAccountCurrent != null) { return false; } - + if (this.PinCodeAssignment != null) { return false; } - + if (this.MonetaryAccountIdFallback != null) { return false; } - + if (this.Country != null) { return false; } - + if (this.CardShipmentTrackingUrl != null) { return false; } - + if (this.AmountSavedZeroFx != null) { return false; } - + return true; } - + /// /// public static Card CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CardBatch.cs b/BunqSdk/Model/Generated/Endpoint/CardBatch.cs index 379f5a3b..22db5f6a 100644 --- a/BunqSdk/Model/Generated/Endpoint/CardBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/CardBatch.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,53 +19,51 @@ public class CardBatch : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/card-batch"; - + /// /// Field constants. /// public const string FIELD_CARDS = "cards"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "CardBatch"; - + /// /// The cards that need to be updated. /// [JsonProperty(PropertyName = "cards")] public List Cards { get; set; } - + /// /// The ids of the cards that have been updated. /// [JsonProperty(PropertyName = "updated_card_ids")] public List UpdatedCardIds { get; set; } - - + + /// /// /// The cards that need to be updated. - public static BunqResponse Create(List cards, - IDictionary customHeaders = null) + public static BunqResponse Create(List cards, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CARDS, cards}, - }; - + { + {FIELD_CARDS, cards}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_POST); } - - + + /// /// public override bool IsAllFieldNull() @@ -72,15 +72,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static CardBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CardBatchReplace.cs b/BunqSdk/Model/Generated/Endpoint/CardBatchReplace.cs new file mode 100644 index 00000000..a94d478a --- /dev/null +++ b/BunqSdk/Model/Generated/Endpoint/CardBatchReplace.cs @@ -0,0 +1,86 @@ +using Bunq.Sdk.Context; +using Bunq.Sdk.Http; +using Bunq.Sdk.Json; +using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; + +namespace Bunq.Sdk.Model.Generated.Endpoint +{ + /// + /// Used to replace multiple cards in a batch. + /// + public class CardBatchReplace : BunqModel + { + /// + /// Endpoint constants. + /// + protected const string ENDPOINT_URL_CREATE = "user/{0}/card-batch-replace"; + + /// + /// Field constants. + /// + public const string FIELD_CARDS = "cards"; + + /// + /// Object type. + /// + private const string OBJECT_TYPE_POST = "CardBatchReplace"; + + /// + /// The cards that need to be replaced. + /// + [JsonProperty(PropertyName = "cards")] + public List Cards { get; set; } + + /// + /// The ids of the cards that have been replaced. + /// + [JsonProperty(PropertyName = "updated_card_ids")] + public List UpdatedCardIds { get; set; } + + + /// + /// + /// The cards that need to be replaced. + public static BunqResponse Create(List cards, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + + var requestMap = new Dictionary + { + {FIELD_CARDS, cards}, + }; + + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + + return FromJson(responseRaw, OBJECT_TYPE_POST); + } + + + /// + /// + public override bool IsAllFieldNull() + { + if (this.UpdatedCardIds != null) + { + return false; + } + + return true; + } + + /// + /// + public static CardBatchReplace CreateFromJsonString(string json) + { + return BunqModel.CreateFromJsonString(json); + } + } +} diff --git a/BunqSdk/Model/Generated/Endpoint/CardCredit.cs b/BunqSdk/Model/Generated/Endpoint/CardCredit.cs index 2be52eed..119abd60 100644 --- a/BunqSdk/Model/Generated/Endpoint/CardCredit.cs +++ b/BunqSdk/Model/Generated/Endpoint/CardCredit.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,205 +20,214 @@ public class CardCredit : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/card-credit"; - + /// /// Field constants. /// public const string FIELD_SECOND_LINE = "second_line"; public const string FIELD_NAME_ON_CARD = "name_on_card"; + public const string FIELD_PREFERRED_NAME_ON_CARD = "preferred_name_on_card"; public const string FIELD_ALIAS = "alias"; public const string FIELD_TYPE = "type"; public const string FIELD_PRODUCT_TYPE = "product_type"; public const string FIELD_PIN_CODE_ASSIGNMENT = "pin_code_assignment"; public const string FIELD_MONETARY_ACCOUNT_ID_FALLBACK = "monetary_account_id_fallback"; - + public const string FIELD_ORDER_STATUS = "order_status"; + /// /// Object type. /// private const string OBJECT_TYPE_POST = "CardCredit"; - + /// /// The second line of text on the card /// [JsonProperty(PropertyName = "second_line")] public string SecondLine { get; set; } - + /// /// The user's name on the card. /// [JsonProperty(PropertyName = "name_on_card")] public string NameOnCard { get; set; } - + + /// + /// The user's preferred name that can be put on the card. + /// + [JsonProperty(PropertyName = "preferred_name_on_card")] + public string PreferredNameOnCard { get; set; } + /// /// The pointer to the monetary account that will be connected at first with the card. Its IBAN code is also the /// one that will be printed on the card itself. The pointer must be of type IBAN. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The type of the card. Can is MASTERCARD. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The product type of the card. /// [JsonProperty(PropertyName = "product_type")] public string ProductType { get; set; } - + /// /// Array of Types, PINs, account IDs assigned to the card. /// [JsonProperty(PropertyName = "pin_code_assignment")] public List PinCodeAssignment { get; set; } - + /// /// ID of the MA to be used as fallback for this card if insufficient balance. Fallback account is removed if /// not supplied. /// [JsonProperty(PropertyName = "monetary_account_id_fallback")] public int? MonetaryAccountIdFallback { get; set; } - + + /// + /// The order status of the card. Can be NEW_CARD_REQUEST_RECEIVED, CARD_REQUEST_PENDING, SENT_FOR_PRODUCTION, + /// ACCEPTED_FOR_PRODUCTION, DELIVERED_TO_CUSTOMER, CARD_UPDATE_REQUESTED, CARD_UPDATE_PENDING, + /// CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED, VIRTUAL_DELIVERY, NEW_CARD_REQUEST_PENDING_USER_APPROVAL, + /// SENT_FOR_DELIVERY or NEW_CARD_REQUEST_CANCELLED. + /// + [JsonProperty(PropertyName = "order_status")] + public string OrderStatus { get; set; } + /// /// The id of the card. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the card's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the card's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The public UUID of the card. /// [JsonProperty(PropertyName = "public_uuid")] public string PublicUuid { get; set; } - + /// /// The sub-type of the card. /// [JsonProperty(PropertyName = "sub_type")] public string SubType { get; set; } - + /// /// The status to set for the card. Can be ACTIVE, DEACTIVATED, LOST, STOLEN, CANCELLED, EXPIRED or /// PIN_TRIES_EXCEEDED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The sub-status of the card. Can be NONE or REPLACED. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - - /// - /// The order status of the card. Can be NEW_CARD_REQUEST_RECEIVED, CARD_REQUEST_PENDING, SENT_FOR_PRODUCTION, - /// ACCEPTED_FOR_PRODUCTION, DELIVERED_TO_CUSTOMER, CARD_UPDATE_REQUESTED, CARD_UPDATE_PENDING, - /// CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED, VIRTUAL_DELIVERY, NEW_CARD_REQUEST_PENDING_USER_APPROVAL, - /// SENT_FOR_DELIVERY or NEW_CARD_REQUEST_CANCELLED. - /// - [JsonProperty(PropertyName = "order_status")] - public string OrderStatus { get; set; } - + /// /// Expiry date of the card. /// [JsonProperty(PropertyName = "expiry_date")] public string ExpiryDate { get; set; } - + /// /// The spending limit for the card. /// [JsonProperty(PropertyName = "card_limit")] public Amount CardLimit { get; set; } - + /// /// The ATM spending limit for the card. /// [JsonProperty(PropertyName = "card_limit_atm")] public Amount CardLimitAtm { get; set; } - + /// /// The countries for which to grant (temporary) permissions to use the card. /// [JsonProperty(PropertyName = "country_permission")] public List CountryPermission { get; set; } - + /// /// The monetary account this card was ordered on and the label user that owns the card. /// [JsonProperty(PropertyName = "label_monetary_account_ordered")] public MonetaryAccountReference LabelMonetaryAccountOrdered { get; set; } - + /// /// The monetary account that this card is currently linked to and the label user viewing it. /// [JsonProperty(PropertyName = "label_monetary_account_current")] public MonetaryAccountReference LabelMonetaryAccountCurrent { get; set; } - + /// /// The country that is domestic to the card. Defaults to country of residence of user. /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// A tracking link provided by our shipment provider. /// [JsonProperty(PropertyName = "card_shipment_tracking_url")] public string CardShipmentTrackingUrl { get; set; } - - + + /// /// Create a new credit card request. /// /// The second line of text on the card, used as name/description for it. It can contain at most 17 characters and it can be empty. /// The user's name as it will be on the card. Check 'card-name' for the available card names for a user. /// The type of card to order. Can be MASTERCARD. + /// The user's preferred name that can be put on the card. /// The pointer to the monetary account that will be connected at first with the card. Its IBAN code is also the one that will be printed on the card itself. The pointer must be of type IBAN. /// The product type of the card to order. /// Array of Types, PINs, account IDs assigned to the card. /// ID of the MA to be used as fallback for this card if insufficient balance. Fallback account is removed if not supplied. - public static BunqResponse Create(string secondLine, string nameOnCard, string type, - Pointer alias = null, string productType = null, List pinCodeAssignment = null, - int? monetaryAccountIdFallback = null, IDictionary customHeaders = null) + /// The order status of this card. Can be CARD_REQUEST_PENDING or VIRTUAL_DELIVERY. + public static BunqResponse Create(string secondLine, string nameOnCard, string type, string preferredNameOnCard = null, Pointer alias = null, string productType = null, List pinCodeAssignment = null, int? monetaryAccountIdFallback = null, string orderStatus = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_SECOND_LINE, secondLine}, - {FIELD_NAME_ON_CARD, nameOnCard}, - {FIELD_ALIAS, alias}, - {FIELD_TYPE, type}, - {FIELD_PRODUCT_TYPE, productType}, - {FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment}, - {FIELD_MONETARY_ACCOUNT_ID_FALLBACK, monetaryAccountIdFallback}, - }; - + { + {FIELD_SECOND_LINE, secondLine}, + {FIELD_NAME_ON_CARD, nameOnCard}, + {FIELD_PREFERRED_NAME_ON_CARD, preferredNameOnCard}, + {FIELD_ALIAS, alias}, + {FIELD_TYPE, type}, + {FIELD_PRODUCT_TYPE, productType}, + {FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment}, + {FIELD_MONETARY_ACCOUNT_ID_FALLBACK, monetaryAccountIdFallback}, + {FIELD_ORDER_STATUS, orderStatus}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_POST); } - - + + /// /// public override bool IsAllFieldNull() @@ -225,120 +236,125 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.PublicUuid != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.SubType != null) { return false; } - + if (this.ProductType != null) { return false; } - + if (this.SecondLine != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.OrderStatus != null) { return false; } - + if (this.ExpiryDate != null) { return false; } - + if (this.NameOnCard != null) { return false; } - + + if (this.PreferredNameOnCard != null) + { + return false; + } + if (this.CardLimit != null) { return false; } - + if (this.CardLimitAtm != null) { return false; } - + if (this.CountryPermission != null) { return false; } - + if (this.LabelMonetaryAccountOrdered != null) { return false; } - + if (this.LabelMonetaryAccountCurrent != null) { return false; } - + if (this.PinCodeAssignment != null) { return false; } - + if (this.MonetaryAccountIdFallback != null) { return false; } - + if (this.Country != null) { return false; } - + if (this.CardShipmentTrackingUrl != null) { return false; } - + return true; } - + /// /// public static CardCredit CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CardDebit.cs b/BunqSdk/Model/Generated/Endpoint/CardDebit.cs index 22ee3f83..27307d1c 100644 --- a/BunqSdk/Model/Generated/Endpoint/CardDebit.cs +++ b/BunqSdk/Model/Generated/Endpoint/CardDebit.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,185 +20,194 @@ public class CardDebit : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/card-debit"; - + /// /// Field constants. /// public const string FIELD_SECOND_LINE = "second_line"; public const string FIELD_NAME_ON_CARD = "name_on_card"; + public const string FIELD_PREFERRED_NAME_ON_CARD = "preferred_name_on_card"; public const string FIELD_ALIAS = "alias"; public const string FIELD_TYPE = "type"; public const string FIELD_PRODUCT_TYPE = "product_type"; public const string FIELD_PIN_CODE_ASSIGNMENT = "pin_code_assignment"; public const string FIELD_MONETARY_ACCOUNT_ID_FALLBACK = "monetary_account_id_fallback"; - + public const string FIELD_ORDER_STATUS = "order_status"; + /// /// Object type. /// private const string OBJECT_TYPE_POST = "CardDebit"; - + /// /// The second line of text on the card /// [JsonProperty(PropertyName = "second_line")] public string SecondLine { get; set; } - + /// /// The user's name as will be on the card /// [JsonProperty(PropertyName = "name_on_card")] public string NameOnCard { get; set; } - + + /// + /// The user's preferred name that can be put on the card. + /// + [JsonProperty(PropertyName = "preferred_name_on_card")] + public string PreferredNameOnCard { get; set; } + /// /// The label for the user who requested the card. /// [JsonProperty(PropertyName = "alias")] public LabelUser Alias { get; set; } - + /// /// The type of the card. Can be MAESTRO, MASTERCARD. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The product type of the card to order. /// [JsonProperty(PropertyName = "product_type")] public string ProductType { get; set; } - + /// /// Array of Types, PINs, account IDs assigned to the card. /// [JsonProperty(PropertyName = "pin_code_assignment")] public List PinCodeAssignment { get; set; } - + /// /// ID of the MA to be used as fallback for this card if insufficient balance. Fallback account is removed if /// not supplied. /// [JsonProperty(PropertyName = "monetary_account_id_fallback")] public int? MonetaryAccountIdFallback { get; set; } - + + /// + /// The order status of the card. Can be NEW_CARD_REQUEST_RECEIVED, CARD_REQUEST_PENDING, SENT_FOR_PRODUCTION, + /// ACCEPTED_FOR_PRODUCTION, DELIVERED_TO_CUSTOMER, CARD_UPDATE_REQUESTED, CARD_UPDATE_PENDING, + /// CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED, VIRTUAL_DELIVERY, NEW_CARD_REQUEST_PENDING_USER_APPROVAL, + /// SENT_FOR_DELIVERY or NEW_CARD_REQUEST_CANCELLED. + /// + [JsonProperty(PropertyName = "order_status")] + public string OrderStatus { get; set; } + /// /// The id of the card. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp when the card was crated. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp when the card was last updated. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The public UUID of the card. /// [JsonProperty(PropertyName = "public_uuid")] public string PublicUuid { get; set; } - + /// /// The sub_type of card. /// [JsonProperty(PropertyName = "sub_type")] public string SubType { get; set; } - + /// /// The status to set for the card. After ordering the card it will be DEACTIVATED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - - /// - /// The order status of the card. Can be NEW_CARD_REQUEST_RECEIVED, CARD_REQUEST_PENDING, SENT_FOR_PRODUCTION, - /// ACCEPTED_FOR_PRODUCTION, DELIVERED_TO_CUSTOMER, CARD_UPDATE_REQUESTED, CARD_UPDATE_PENDING, - /// CARD_UPDATE_SENT, CARD_UPDATE_ACCEPTED, VIRTUAL_DELIVERY, NEW_CARD_REQUEST_PENDING_USER_APPROVAL, - /// SENT_FOR_DELIVERY or NEW_CARD_REQUEST_CANCELLED. - /// - [JsonProperty(PropertyName = "order_status")] - public string OrderStatus { get; set; } - + /// /// The expiry date of the card. /// [JsonProperty(PropertyName = "expiry_date")] public string ExpiryDate { get; set; } - + /// /// The countries for which to grant (temporary) permissions to use the card. /// [JsonProperty(PropertyName = "country_permission")] public List CountryPermission { get; set; } - + /// /// The monetary account this card was ordered on and the label user that owns the card. /// [JsonProperty(PropertyName = "label_monetary_account_ordered")] public MonetaryAccountReference LabelMonetaryAccountOrdered { get; set; } - + /// /// The monetary account that this card is currently linked to and the label user viewing it. /// [JsonProperty(PropertyName = "label_monetary_account_current")] public MonetaryAccountReference LabelMonetaryAccountCurrent { get; set; } - + /// /// The country that is domestic to the card. Defaults to country of residence of user. /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// A tracking link provided by our shipment provider. /// [JsonProperty(PropertyName = "card_shipment_tracking_url")] public string CardShipmentTrackingUrl { get; set; } - - + + /// /// Create a new debit card request. /// /// The second line of text on the card, used as name/description for it. It can contain at most 17 characters and it can be empty. /// The user's name as it will be on the card. Check 'card-name' for the available card names for a user. /// The type of card to order. Can be MAESTRO or MASTERCARD. + /// The user's preferred name that can be put on the card. /// The pointer to the monetary account that will be connected at first with the card. Its IBAN code is also the one that will be printed on the card itself. The pointer must be of type IBAN. /// The product type of the card to order. /// Array of Types, PINs, account IDs assigned to the card. /// ID of the MA to be used as fallback for this card if insufficient balance. Fallback account is removed if not supplied. - public static BunqResponse Create(string secondLine, string nameOnCard, string type, - Pointer alias = null, string productType = null, List pinCodeAssignment = null, - int? monetaryAccountIdFallback = null, IDictionary customHeaders = null) + /// The order status of this card. Can be CARD_REQUEST_PENDING or VIRTUAL_DELIVERY. + public static BunqResponse Create(string secondLine, string nameOnCard, string type, string preferredNameOnCard = null, Pointer alias = null, string productType = null, List pinCodeAssignment = null, int? monetaryAccountIdFallback = null, string orderStatus = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_SECOND_LINE, secondLine}, - {FIELD_NAME_ON_CARD, nameOnCard}, - {FIELD_ALIAS, alias}, - {FIELD_TYPE, type}, - {FIELD_PRODUCT_TYPE, productType}, - {FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment}, - {FIELD_MONETARY_ACCOUNT_ID_FALLBACK, monetaryAccountIdFallback}, - }; - + { + {FIELD_SECOND_LINE, secondLine}, + {FIELD_NAME_ON_CARD, nameOnCard}, + {FIELD_PREFERRED_NAME_ON_CARD, preferredNameOnCard}, + {FIELD_ALIAS, alias}, + {FIELD_TYPE, type}, + {FIELD_PRODUCT_TYPE, productType}, + {FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment}, + {FIELD_MONETARY_ACCOUNT_ID_FALLBACK, monetaryAccountIdFallback}, + {FIELD_ORDER_STATUS, orderStatus}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_POST); } - - + + /// /// public override bool IsAllFieldNull() @@ -205,105 +216,110 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.PublicUuid != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.SubType != null) { return false; } - + if (this.SecondLine != null) { return false; } - + if (this.NameOnCard != null) { return false; } - + + if (this.PreferredNameOnCard != null) + { + return false; + } + if (this.Status != null) { return false; } - + if (this.OrderStatus != null) { return false; } - + if (this.ExpiryDate != null) { return false; } - + if (this.CountryPermission != null) { return false; } - + if (this.LabelMonetaryAccountOrdered != null) { return false; } - + if (this.LabelMonetaryAccountCurrent != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.PinCodeAssignment != null) { return false; } - + if (this.MonetaryAccountIdFallback != null) { return false; } - + if (this.Country != null) { return false; } - + if (this.CardShipmentTrackingUrl != null) { return false; } - + return true; } - + /// /// public static CardDebit CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CardGeneratedCvc2.cs b/BunqSdk/Model/Generated/Endpoint/CardGeneratedCvc2.cs index ef122a72..b597d0ef 100644 --- a/BunqSdk/Model/Generated/Endpoint/CardGeneratedCvc2.cs +++ b/BunqSdk/Model/Generated/Endpoint/CardGeneratedCvc2.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,139 +21,129 @@ public class CardGeneratedCvc2 : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/card/{1}/generated-cvc2/{2}"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/card/{1}/generated-cvc2/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/card/{1}/generated-cvc2"; - + /// /// Field constants. /// public const string FIELD_TYPE = "type"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "CardGeneratedCvc2"; - + /// /// The type of generated cvc2. Can be STATIC or GENERATED. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The id of the cvc code. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the cvc code's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the cvc code's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The cvc2 code. /// [JsonProperty(PropertyName = "cvc2")] public string Cvc2 { get; set; } - + /// /// The status of the cvc2. Can be AVAILABLE, USED, EXPIRED, BLOCKED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// Expiry time of the cvc2. /// [JsonProperty(PropertyName = "expiry_time")] public string ExpiryTime { get; set; } - - + + /// /// Generate a new CVC2 code for a card. /// /// The type of generated cvc2. Can be STATIC or GENERATED. - public static BunqResponse Create(int cardId, string type = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int cardId, string type = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_TYPE, type}, - }; - + { + {FIELD_TYPE, type}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), cardId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), cardId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get the details for a specific generated CVC2 code. /// - public static BunqResponse Get(int cardId, int cardGeneratedCvc2Id, - IDictionary customHeaders = null) + public static BunqResponse Get(int cardId, int cardGeneratedCvc2Id, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), cardId, cardGeneratedCvc2Id), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), cardId, cardGeneratedCvc2Id), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// The type of generated cvc2. Can be STATIC or GENERATED. - public static BunqResponse Update(int cardId, int cardGeneratedCvc2Id, string type = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int cardId, int cardGeneratedCvc2Id, string type = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_TYPE, type}, - }; - + { + {FIELD_TYPE, type}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), cardId, cardGeneratedCvc2Id), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), cardId, cardGeneratedCvc2Id), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get all generated CVC2 codes for a card. /// - public static BunqResponse> List(int cardId, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int cardId, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), cardId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), cardId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -160,45 +152,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.Cvc2 != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.ExpiryTime != null) { return false; } - + return true; } - + /// /// public static CardGeneratedCvc2 CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CardName.cs b/BunqSdk/Model/Generated/Endpoint/CardName.cs index f2dbc6b0..e72ac903 100644 --- a/BunqSdk/Model/Generated/Endpoint/CardName.cs +++ b/BunqSdk/Model/Generated/Endpoint/CardName.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,35 +20,33 @@ public class CardName : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/card-name"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "CardUserNameArray"; - + /// /// All possible variations (of suitable length) of user's legal name for the debit card. /// [JsonProperty(PropertyName = "possible_card_name_array")] public List PossibleCardNameArray { get; set; } - + /// /// Return all the accepted card names for a specific user. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -53,15 +55,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static CardName CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CardReplace.cs b/BunqSdk/Model/Generated/Endpoint/CardReplace.cs index 2a18de71..ceaa7dc6 100644 --- a/BunqSdk/Model/Generated/Endpoint/CardReplace.cs +++ b/BunqSdk/Model/Generated/Endpoint/CardReplace.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,69 +22,75 @@ public class CardReplace : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/card/{1}/replace"; - + /// /// Field constants. /// public const string FIELD_NAME_ON_CARD = "name_on_card"; + public const string FIELD_PREFERRED_NAME_ON_CARD = "preferred_name_on_card"; public const string FIELD_PIN_CODE_ASSIGNMENT = "pin_code_assignment"; public const string FIELD_SECOND_LINE = "second_line"; - - + + /// /// The user's name as it will be on the card. Check 'card-name' for the available card names for a user. /// [JsonProperty(PropertyName = "name_on_card")] public string NameOnCard { get; set; } - + + /// + /// The user's preferred name that can be put on the card. + /// + [JsonProperty(PropertyName = "preferred_name_on_card")] + public string PreferredNameOnCard { get; set; } + /// /// Array of Types, PINs, account IDs assigned to the card. /// [JsonProperty(PropertyName = "pin_code_assignment")] public List PinCodeAssignment { get; set; } - + /// /// The second line on the card. /// [JsonProperty(PropertyName = "second_line")] public string SecondLine { get; set; } - + /// /// The id of the new card. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - - + + /// /// Request a card replacement. /// /// The user's name as it will be on the card. Check 'card-name' for the available card names for a user. + /// The user's preferred name that can be put on the card. /// Array of Types, PINs, account IDs assigned to the card. /// The second line on the card. - public static BunqResponse Create(int cardId, string nameOnCard = null, - List pinCodeAssignment = null, string secondLine = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int cardId, string nameOnCard = null, string preferredNameOnCard = null, List pinCodeAssignment = null, string secondLine = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_NAME_ON_CARD, nameOnCard}, - {FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment}, - {FIELD_SECOND_LINE, secondLine}, - }; - + { + {FIELD_NAME_ON_CARD, nameOnCard}, + {FIELD_PREFERRED_NAME_ON_CARD, preferredNameOnCard}, + {FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment}, + {FIELD_SECOND_LINE, secondLine}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), cardId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), cardId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -91,15 +99,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static CardReplace CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CashRegister.cs b/BunqSdk/Model/Generated/Endpoint/CashRegister.cs index 6670d1cb..af537c30 100644 --- a/BunqSdk/Model/Generated/Endpoint/CashRegister.cs +++ b/BunqSdk/Model/Generated/Endpoint/CashRegister.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -24,7 +26,7 @@ public class CashRegister : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/cash-register/{2}"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/cash-register/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/cash-register"; - + /// /// Field constants. /// @@ -33,68 +35,68 @@ public class CashRegister : BunqModel public const string FIELD_AVATAR_UUID = "avatar_uuid"; public const string FIELD_LOCATION = "location"; public const string FIELD_TAB_TEXT_WAITING_SCREEN = "tab_text_waiting_screen"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "CashRegister"; - + /// /// The name of the CashRegister. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - + /// /// The status of the CashRegister. Can be PENDING_APPROVAL, ACTIVE, DENIED or CLOSED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The UUID of the avatar of the CashRegister. Use the calls /attachment-public and /avatar to create a new /// Avatar and get its UUID. /// [JsonProperty(PropertyName = "avatar_uuid")] public string AvatarUuid { get; set; } - + /// /// The geolocation of the CashRegister. Can be null. /// [JsonProperty(PropertyName = "location")] public Geolocation Location { get; set; } - + /// /// The tab text for waiting screen of CashRegister. /// [JsonProperty(PropertyName = "tab_text_waiting_screen")] public List TabTextWaitingScreen { get; set; } - + /// /// The id of the created CashRegister. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the CashRegister's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the CashRegister's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The Avatar of the CashRegister. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - - + + /// /// Create a new CashRegister. Only an UserCompany can create a CashRegisters. They need to be created with /// status PENDING_APPROVAL, an bunq admin has to approve your CashRegister before you can use it. In the @@ -105,49 +107,40 @@ public class CashRegister : BunqModel /// The UUID of the avatar of the CashRegister. Use the calls /attachment-public and /avatar to create a new Avatar and get its UUID. /// The geolocation of the CashRegister. /// The tab text for waiting screen of CashRegister. - public static BunqResponse Create(string name, string status, string avatarUuid, - int? monetaryAccountId = null, Geolocation location = null, - List tabTextWaitingScreen = null, IDictionary customHeaders = null) + public static BunqResponse Create(string name, string status, string avatarUuid, int? monetaryAccountId= null, Geolocation location = null, List tabTextWaitingScreen = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_NAME, name}, - {FIELD_STATUS, status}, - {FIELD_AVATAR_UUID, avatarUuid}, - {FIELD_LOCATION, location}, - {FIELD_TAB_TEXT_WAITING_SCREEN, tabTextWaitingScreen}, - }; - + { + {FIELD_NAME, name}, + {FIELD_STATUS, status}, + {FIELD_AVATAR_UUID, avatarUuid}, + {FIELD_LOCATION, location}, + {FIELD_TAB_TEXT_WAITING_SCREEN, tabTextWaitingScreen}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get a specific CashRegister. /// - public static BunqResponse Get(int cashRegisterId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int cashRegisterId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Modify or close an existing CashRegister. You must set the status back to PENDING_APPROVAL if you modify the /// name, avatar or location of a CashRegister. To close a cash register put its status to CLOSED. @@ -157,51 +150,42 @@ public static BunqResponse Get(int cashRegisterId, int? monetaryAc /// The UUID of the avatar of the CashRegister. Use the calls /attachment-public and /avatar to create a new Avatar and get its UUID. /// The geolocation of the CashRegister. /// The tab text for waiting screen of CashRegister. - public static BunqResponse Update(int cashRegisterId, int? monetaryAccountId = null, string name = null, - string status = null, string avatarUuid = null, Geolocation location = null, - List tabTextWaitingScreen = null, IDictionary customHeaders = null) + public static BunqResponse Update(int cashRegisterId, int? monetaryAccountId= null, string name = null, string status = null, string avatarUuid = null, Geolocation location = null, List tabTextWaitingScreen = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_NAME, name}, - {FIELD_STATUS, status}, - {FIELD_AVATAR_UUID, avatarUuid}, - {FIELD_LOCATION, location}, - {FIELD_TAB_TEXT_WAITING_SCREEN, tabTextWaitingScreen}, - }; - + { + {FIELD_NAME, name}, + {FIELD_STATUS, status}, + {FIELD_AVATAR_UUID, avatarUuid}, + {FIELD_LOCATION, location}, + {FIELD_TAB_TEXT_WAITING_SCREEN, tabTextWaitingScreen}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get a collection of CashRegister for a given user and monetary account. /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -210,50 +194,50 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Name != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.Avatar != null) { return false; } - + if (this.Location != null) { return false; } - + if (this.TabTextWaitingScreen != null) { return false; } - + return true; } - + /// /// public static CashRegister CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CashRegisterQrCode.cs b/BunqSdk/Model/Generated/Endpoint/CashRegisterQrCode.cs index 66d7dd8c..349dee8f 100644 --- a/BunqSdk/Model/Generated/Endpoint/CashRegisterQrCode.cs +++ b/BunqSdk/Model/Generated/Endpoint/CashRegisterQrCode.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,142 +23,126 @@ public class CashRegisterQrCode : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/cash-register/{2}/qr-code/{3}"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/cash-register/{2}/qr-code/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/cash-register/{2}/qr-code"; - + /// /// Field constants. /// public const string FIELD_STATUS = "status"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TokenQrCashRegister"; - + /// /// The status of this QR code. If the status is "ACTIVE" the QR code can be scanned to see the linked /// CashRegister and tab. If the status is "INACTIVE" the QR code does not link to a anything. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The id of the created QR code. Use this id to get the RAW content of the QR code with: /// ../qr-code/{id}/content /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the QR code's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the TokenQrCashRegister's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The CashRegister that is linked to the token. /// [JsonProperty(PropertyName = "cash_register")] public CashRegister CashRegister { get; set; } - + /// /// Holds the Tab object. Can be TabUsageSingle, TabUsageMultiple or null /// [JsonProperty(PropertyName = "tab_object")] public Tab TabObject { get; set; } - - + + /// /// Create a new QR code for this CashRegister. You can only have one ACTIVE CashRegister QR code at the time. /// /// The status of the QR code. ACTIVE or INACTIVE. Only one QR code can be ACTIVE for a CashRegister at any time. Setting a QR code to ACTIVE will deactivate any other CashRegister QR codes. - public static BunqResponse Create(int cashRegisterId, string status, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int cashRegisterId, string status, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - }; - + { + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Modify a QR code in a given CashRegister. You can only have one ACTIVE CashRegister QR code at the time. /// /// The status of the QR code. ACTIVE or INACTIVE. Only one QR code can be ACTIVE for a CashRegister at any time. Setting a QR code to ACTIVE will deactivate any other CashRegister QR codes. - public static BunqResponse Update(int cashRegisterId, int cashRegisterQrCodeId, - int? monetaryAccountId = null, string status = null, IDictionary customHeaders = null) + public static BunqResponse Update(int cashRegisterId, int cashRegisterQrCodeId, int? monetaryAccountId= null, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - }; - + { + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, cashRegisterQrCodeId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, cashRegisterQrCodeId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get the information of a specific QR code. To get the RAW content of the QR code use ../qr-code/{id}/content /// - public static BunqResponse Get(int cashRegisterId, int cashRegisterQrCodeId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int cashRegisterId, int cashRegisterQrCodeId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, cashRegisterQrCodeId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, cashRegisterQrCodeId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get a collection of QR code information from a given CashRegister /// - public static BunqResponse> List(int cashRegisterId, int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int cashRegisterId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -165,40 +151,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.CashRegister != null) { return false; } - + if (this.TabObject != null) { return false; } - + return true; } - + /// /// public static CashRegisterQrCode CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CashRegisterQrCodeContent.cs b/BunqSdk/Model/Generated/Endpoint/CashRegisterQrCodeContent.cs index b28da5a6..e0e5e7be 100644 --- a/BunqSdk/Model/Generated/Endpoint/CashRegisterQrCodeContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/CashRegisterQrCodeContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -12,45 +17,39 @@ public class CashRegisterQrCodeContent : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/cash-register/{2}/qr-code/{3}/content"; - + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/cash-register/{2}/qr-code/{3}/content"; + /// /// Object type. /// private const string OBJECT_TYPE_GET = "CashRegisterQrCodeContent"; - + /// /// Show the raw contents of a QR code /// - public static BunqResponse List(int cashRegisterId, int qrCodeId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse List(int cashRegisterId, int qrCodeId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, qrCodeId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, qrCodeId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static CashRegisterQrCodeContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CertificatePinned.cs b/BunqSdk/Model/Generated/Endpoint/CertificatePinned.cs index 218ce071..e77f175e 100644 --- a/BunqSdk/Model/Generated/Endpoint/CertificatePinned.cs +++ b/BunqSdk/Model/Generated/Endpoint/CertificatePinned.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,101 +23,92 @@ public class CertificatePinned : BunqModel protected const string ENDPOINT_URL_DELETE = "user/{0}/certificate-pinned/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/certificate-pinned"; protected const string ENDPOINT_URL_READ = "user/{0}/certificate-pinned/{1}"; - + /// /// Field constants. /// public const string FIELD_CERTIFICATE_CHAIN = "certificate_chain"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "CertificatePinned"; - + /// /// The certificate chain in .PEM format. Certificates are glued with newline characters. /// [JsonProperty(PropertyName = "certificate_chain")] public string CertificateChain { get; set; } - + /// /// The id generated for the pinned certificate chain. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - - + + /// /// Pin the certificate chain. /// /// The certificate chain in .PEM format. - public static BunqResponse Create(List certificateChain, - IDictionary customHeaders = null) + public static BunqResponse Create(List certificateChain, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CERTIFICATE_CHAIN, certificateChain}, - }; - + { + {FIELD_CERTIFICATE_CHAIN, certificateChain}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Remove the pinned certificate chain with the specific ID. /// - public static BunqResponse Delete(int certificatePinnedId, - IDictionary customHeaders = null) + public static BunqResponse Delete(int certificatePinnedId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), certificatePinnedId), - customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), certificatePinnedId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// List all the pinned certificate chain for the given user. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get the pinned certificate chain with the specified ID. /// - public static BunqResponse Get(int certificatePinnedId, - IDictionary customHeaders = null) + public static BunqResponse Get(int certificatePinnedId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), certificatePinnedId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), certificatePinnedId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -124,20 +117,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Id != null) { return false; } - + return true; } - + /// /// public static CertificatePinned CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ChatMessage.cs b/BunqSdk/Model/Generated/Endpoint/ChatMessage.cs index f03ed98c..b08c505d 100644 --- a/BunqSdk/Model/Generated/Endpoint/ChatMessage.cs +++ b/BunqSdk/Model/Generated/Endpoint/ChatMessage.cs @@ -1,4 +1,6 @@ using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -7,18 +9,19 @@ namespace Bunq.Sdk.Model.Generated.Endpoint /// public class ChatMessage : BunqModel { + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static ChatMessage CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Company.cs b/BunqSdk/Model/Generated/Endpoint/Company.cs index 62968d74..4281a3f8 100644 --- a/BunqSdk/Model/Generated/Endpoint/Company.cs +++ b/BunqSdk/Model/Generated/Endpoint/Company.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,7 +22,7 @@ public class Company : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/company/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/company"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/company/{1}"; - + /// /// Field constants. /// @@ -33,72 +35,72 @@ public class Company : BunqModel public const string FIELD_LEGAL_FORM = "legal_form"; public const string FIELD_SUBSCRIPTION_TYPE = "subscription_type"; public const string FIELD_AVATAR_UUID = "avatar_uuid"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "UserCompany"; - + /// /// The company name. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - + /// /// The company's main address. /// [JsonProperty(PropertyName = "address_main")] public Address AddressMain { get; set; } - + /// /// The company's postal address. /// [JsonProperty(PropertyName = "address_postal")] public Address AddressPostal { get; set; } - + /// /// The country where the company is registered. /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// The names and birth dates of the company's ultimate beneficiary owners. Minimum zero, maximum four. /// [JsonProperty(PropertyName = "ubo")] public List Ubo { get; set; } - + /// /// The company's chamber of commerce number. /// [JsonProperty(PropertyName = "chamber_of_commerce_number")] public string ChamberOfCommerceNumber { get; set; } - + /// /// The company's legal form. /// [JsonProperty(PropertyName = "legal_form")] public string LegalForm { get; set; } - + /// /// The subscription type for the company. /// [JsonProperty(PropertyName = "subscription_type")] public string SubscriptionType { get; set; } - + /// /// The public UUID of the company's avatar. /// [JsonProperty(PropertyName = "avatar_uuid")] public string AvatarUuid { get; set; } - + /// /// [JsonProperty(PropertyName = "UserCompany")] public UserCompany UserCompany { get; set; } - - + + /// /// /// The company name. @@ -110,85 +112,77 @@ public class Company : BunqModel /// The company's chamber of commerce number. /// The subscription type for the company. /// The public UUID of the company's avatar. - public static BunqResponse Create(string name, Address addressMain, Address addressPostal, string country, - string legalForm, List ubo = null, string chamberOfCommerceNumber = null, - string subscriptionType = null, string avatarUuid = null, IDictionary customHeaders = null) + public static BunqResponse Create(string name, Address addressMain, Address addressPostal, string country, string legalForm, List ubo = null, string chamberOfCommerceNumber = null, string subscriptionType = null, string avatarUuid = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_NAME, name}, - {FIELD_ADDRESS_MAIN, addressMain}, - {FIELD_ADDRESS_POSTAL, addressPostal}, - {FIELD_COUNTRY, country}, - {FIELD_UBO, ubo}, - {FIELD_CHAMBER_OF_COMMERCE_NUMBER, chamberOfCommerceNumber}, - {FIELD_LEGAL_FORM, legalForm}, - {FIELD_SUBSCRIPTION_TYPE, subscriptionType}, - {FIELD_AVATAR_UUID, avatarUuid}, - }; - + { + {FIELD_NAME, name}, + {FIELD_ADDRESS_MAIN, addressMain}, + {FIELD_ADDRESS_POSTAL, addressPostal}, + {FIELD_COUNTRY, country}, + {FIELD_UBO, ubo}, + {FIELD_CHAMBER_OF_COMMERCE_NUMBER, chamberOfCommerceNumber}, + {FIELD_LEGAL_FORM, legalForm}, + {FIELD_SUBSCRIPTION_TYPE, subscriptionType}, + {FIELD_AVATAR_UUID, avatarUuid}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// public static BunqResponse Get(int companyId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), companyId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), companyId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// The public UUID of the company's avatar. - public static BunqResponse Update(int companyId, string avatarUuid = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int companyId, string avatarUuid = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_AVATAR_UUID, avatarUuid}, - }; - + { + {FIELD_AVATAR_UUID, avatarUuid}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), companyId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), companyId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -197,15 +191,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static Company CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ConfirmationOfFunds.cs b/BunqSdk/Model/Generated/Endpoint/ConfirmationOfFunds.cs index 2295e816..110c9376 100644 --- a/BunqSdk/Model/Generated/Endpoint/ConfirmationOfFunds.cs +++ b/BunqSdk/Model/Generated/Endpoint/ConfirmationOfFunds.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,62 +19,60 @@ public class ConfirmationOfFunds : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/confirmation-of-funds"; - + /// /// Field constants. /// public const string FIELD_POINTER_IBAN = "pointer_iban"; public const string FIELD_AMOUNT = "amount"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "ConfirmationOfFunds"; - + /// /// The pointer (IBAN) of the account we're querying. /// [JsonProperty(PropertyName = "pointer_iban")] public MonetaryAccountReference PointerIban { get; set; } - + /// /// The amount we want to check for. /// [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } - + /// /// Whether the account has sufficient funds. /// [JsonProperty(PropertyName = "has_sufficient_funds")] public bool? HasSufficientFunds { get; set; } - - + + /// /// /// The pointer (IBAN) of the account we're querying. /// The amount we want to check for. - public static BunqResponse Create(Pointer pointerIban, Amount amount, - IDictionary customHeaders = null) + public static BunqResponse Create(Pointer pointerIban, Amount amount, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_POINTER_IBAN, pointerIban}, - {FIELD_AMOUNT, amount}, - }; - + { + {FIELD_POINTER_IBAN, pointerIban}, + {FIELD_AMOUNT, amount}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_POST); } - - + + /// /// public override bool IsAllFieldNull() @@ -81,15 +81,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static ConfirmationOfFunds CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Customer.cs b/BunqSdk/Model/Generated/Endpoint/Customer.cs index bf844f94..596758fc 100644 --- a/BunqSdk/Model/Generated/Endpoint/Customer.cs +++ b/BunqSdk/Model/Generated/Endpoint/Customer.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -13,39 +14,40 @@ public class Customer : BunqModel /// public const string FIELD_BILLING_ACCOUNT_ID = "billing_account_id"; public const string FIELD_INVOICE_NOTIFICATION_PREFERENCE = "invoice_notification_preference"; - - + + /// /// The primary billing account account's id. /// [JsonProperty(PropertyName = "billing_account_id")] public string BillingAccountId { get; set; } - + /// /// The preferred notification type for invoices. /// [JsonProperty(PropertyName = "invoice_notification_preference")] public string InvoiceNotificationPreference { get; set; } - + /// /// The id of the customer. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the customer object's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the customer object's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -54,35 +56,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.BillingAccountId != null) { return false; } - + if (this.InvoiceNotificationPreference != null) { return false; } - + return true; } - + /// /// public static Customer CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/CustomerLimit.cs b/BunqSdk/Model/Generated/Endpoint/CustomerLimit.cs index 6e01ecd6..f0ca7e10 100644 --- a/BunqSdk/Model/Generated/Endpoint/CustomerLimit.cs +++ b/BunqSdk/Model/Generated/Endpoint/CustomerLimit.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,84 +19,82 @@ public class CustomerLimit : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/limit"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "CustomerLimit"; - + /// /// The limit of monetary accounts. /// [JsonProperty(PropertyName = "limit_monetary_account")] public int? LimitMonetaryAccount { get; set; } - + /// /// The amount of additional monetary accounts you can create. /// [JsonProperty(PropertyName = "limit_monetary_account_remaining")] public int? LimitMonetaryAccountRemaining { get; set; } - + /// /// The limit of Maestro cards. /// [JsonProperty(PropertyName = "limit_card_debit_maestro")] public int? LimitCardDebitMaestro { get; set; } - + /// /// The limit of MasterCard cards. /// [JsonProperty(PropertyName = "limit_card_debit_mastercard")] public int? LimitCardDebitMastercard { get; set; } - + /// /// DEPRECTATED: The limit of wildcards, e.g. Maestro or MasterCard cards. /// [JsonProperty(PropertyName = "limit_card_debit_wildcard")] public int? LimitCardDebitWildcard { get; set; } - + /// /// The limit of wildcards, e.g. Maestro or MasterCard cards. /// [JsonProperty(PropertyName = "limit_card_wildcard")] public int? LimitCardWildcard { get; set; } - + /// /// The limit of free replacement cards. /// [JsonProperty(PropertyName = "limit_card_replacement")] public int? LimitCardReplacement { get; set; } - + /// /// The maximum amount a user is allowed to spend in a month. /// [JsonProperty(PropertyName = "limit_amount_monthly")] public Amount LimitAmountMonthly { get; set; } - + /// /// The amount the user has spent in the last month. /// [JsonProperty(PropertyName = "spent_amount_monthly")] public Amount SpentAmountMonthly { get; set; } - - + + /// /// Get all limits for the authenticated user. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -101,55 +103,55 @@ public override bool IsAllFieldNull() { return false; } - + if (this.LimitMonetaryAccountRemaining != null) { return false; } - + if (this.LimitCardDebitMaestro != null) { return false; } - + if (this.LimitCardDebitMastercard != null) { return false; } - + if (this.LimitCardDebitWildcard != null) { return false; } - + if (this.LimitCardWildcard != null) { return false; } - + if (this.LimitCardReplacement != null) { return false; } - + if (this.LimitAmountMonthly != null) { return false; } - + if (this.SpentAmountMonthly != null) { return false; } - + return true; } - + /// /// public static CustomerLimit CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Device.cs b/BunqSdk/Model/Generated/Endpoint/Device.cs index c9c3255d..1848f7ed 100644 --- a/BunqSdk/Model/Generated/Endpoint/Device.cs +++ b/BunqSdk/Model/Generated/Endpoint/Device.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Exception; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,53 +19,51 @@ public class Device : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - + /// /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "device/{0}"; protected const string ENDPOINT_URL_LISTING = "device"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "Device"; - + /// /// [JsonProperty(PropertyName = "DeviceServer")] public DeviceServer DeviceServer { get; set; } - + /// /// Get a single Device. A Device is either a DevicePhone or a DeviceServer. /// public static BunqResponse Get(int deviceId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, deviceId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, deviceId), new Dictionary(), customHeaders); + return FromJson(responseRaw); } - + /// /// Get a collection of Devices. A Device is either a DevicePhone or a DeviceServer. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); var responseRaw = apiClient.Get(ENDPOINT_URL_LISTING, urlParams, customHeaders); - + return FromJsonList(responseRaw); } - - + + /// /// public BunqModel GetReferencedObject() @@ -70,10 +72,10 @@ public BunqModel GetReferencedObject() { return this.DeviceServer; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -82,15 +84,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static Device CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/DeviceServer.cs b/BunqSdk/Model/Generated/Endpoint/DeviceServer.cs index af4ff19c..f0a12e6f 100644 --- a/BunqSdk/Model/Generated/Endpoint/DeviceServer.cs +++ b/BunqSdk/Model/Generated/Endpoint/DeviceServer.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,69 +21,69 @@ public class DeviceServer : BunqModel protected const string ENDPOINT_URL_CREATE = "device-server"; protected const string ENDPOINT_URL_READ = "device-server/{0}"; protected const string ENDPOINT_URL_LISTING = "device-server"; - + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_SECRET = "secret"; public const string FIELD_PERMITTED_IPS = "permitted_ips"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "DeviceServer"; - + /// /// The description of the DeviceServer. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The API key. You can request an API key in the bunq app. /// [JsonProperty(PropertyName = "secret")] public string Secret { get; set; } - + /// /// An array of IPs (v4 or v6) this DeviceServer will be able to do calls from. These will be linked to the API /// key. /// [JsonProperty(PropertyName = "permitted_ips")] public List PermittedIps { get; set; } - + /// /// The id of the DeviceServer as created on the server. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the DeviceServer's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the DeviceServer's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The ip address which was used to create the DeviceServer. /// [JsonProperty(PropertyName = "ip")] public string Ip { get; set; } - + /// /// The status of the DeviceServer. Can be ACTIVE, BLOCKED, NEEDS_CONFIRMATION or OBSOLETE. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - - + + /// /// Create a new DeviceServer providing the installation token in the header and signing the request with the /// private part of the key you used to create the installation. The API Key that you are using will be bound to @@ -93,57 +95,53 @@ public class DeviceServer : BunqModel /// The description of the DeviceServer. This is only for your own reference when reading the DeviceServer again. /// The API key. You can request an API key in the bunq app. /// An array of IPs (v4 or v6) this DeviceServer will be able to do calls from. These will be linked to the API key. - public static BunqResponse Create(string description, string secret, List permittedIps = null, - IDictionary customHeaders = null) + public static BunqResponse Create(string description, string secret, List permittedIps = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_SECRET, secret}, - {FIELD_PERMITTED_IPS, permittedIps}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_SECRET, secret}, + {FIELD_PERMITTED_IPS, permittedIps}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); var responseRaw = apiClient.Post(ENDPOINT_URL_CREATE, requestBytes, customHeaders); - + return ProcessForId(responseRaw); } - + /// /// Get one of your DeviceServers. /// - public static BunqResponse Get(int deviceServerId, - IDictionary customHeaders = null) + public static BunqResponse Get(int deviceServerId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, deviceServerId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, deviceServerId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get a collection of all the DeviceServers you have created. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); var responseRaw = apiClient.Get(ENDPOINT_URL_LISTING, urlParams, customHeaders); - + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -152,40 +150,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Ip != null) { return false; } - + if (this.Status != null) { return false; } - + return true; } - + /// /// public static DeviceServer CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/DraftPayment.cs b/BunqSdk/Model/Generated/Endpoint/DraftPayment.cs index 767a8cc6..9b92561c 100644 --- a/BunqSdk/Model/Generated/Endpoint/DraftPayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/DraftPayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,7 +23,7 @@ public class DraftPayment : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/draft-payment/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/draft-payment"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/draft-payment/{2}"; - + /// /// Field constants. /// @@ -30,87 +32,87 @@ public class DraftPayment : BunqModel public const string FIELD_PREVIOUS_UPDATED_TIMESTAMP = "previous_updated_timestamp"; public const string FIELD_NUMBER_OF_REQUIRED_ACCEPTS = "number_of_required_accepts"; public const string FIELD_SCHEDULE = "schedule"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "DraftPayment"; - + /// /// The status of the DraftPayment. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The entries in the DraftPayment. /// [JsonProperty(PropertyName = "entries")] public List Entries { get; set; } - + /// /// The last updated_timestamp that you received for this DraftPayment. This needs to be provided to prevent /// race conditions. /// [JsonProperty(PropertyName = "previous_updated_timestamp")] public string PreviousUpdatedTimestamp { get; set; } - + /// /// The number of accepts that are required for the draft payment to receive status ACCEPTED. Currently only 1 /// is valid. /// [JsonProperty(PropertyName = "number_of_required_accepts")] public int? NumberOfRequiredAccepts { get; set; } - + /// /// The schedule details. /// [JsonProperty(PropertyName = "schedule")] public Schedule Schedule { get; set; } - + /// /// The id of the created DrafPayment. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The id of the MonetaryAccount the DraftPayment applies to. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The label of the User who created the DraftPayment. /// [JsonProperty(PropertyName = "user_alias_created")] public LabelUser UserAliasCreated { get; set; } - + /// /// All responses to this draft payment. /// [JsonProperty(PropertyName = "responses")] public List Responses { get; set; } - + /// /// The type of the DraftPayment. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The Payment or PaymentBatch. This will only be present after the DraftPayment has been accepted. /// [JsonProperty(PropertyName = "object")] public DraftPaymentAnchorObject Object { get; set; } - + /// /// The reference to the object used for split the bill. Can be RequestInquiry or RequestInquiryBatch /// [JsonProperty(PropertyName = "request_reference_split_the_bill")] public List RequestReferenceSplitTheBill { get; set; } - - + + /// /// Create a new DraftPayment. /// @@ -119,100 +121,80 @@ public class DraftPayment : BunqModel /// The status of the DraftPayment. /// The last updated_timestamp that you received for this DraftPayment. This needs to be provided to prevent race conditions. /// The schedule details when creating or updating a scheduled payment. - public static BunqResponse Create(List entries, int? numberOfRequiredAccepts, - int? monetaryAccountId = null, string status = null, string previousUpdatedTimestamp = null, - Schedule schedule = null, IDictionary customHeaders = null) + public static BunqResponse Create(List entries, int? numberOfRequiredAccepts, int? monetaryAccountId= null, string status = null, string previousUpdatedTimestamp = null, Schedule schedule = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - {FIELD_ENTRIES, entries}, - {FIELD_PREVIOUS_UPDATED_TIMESTAMP, previousUpdatedTimestamp}, - {FIELD_NUMBER_OF_REQUIRED_ACCEPTS, numberOfRequiredAccepts}, - {FIELD_SCHEDULE, schedule}, - }; - + { + {FIELD_STATUS, status}, + {FIELD_ENTRIES, entries}, + {FIELD_PREVIOUS_UPDATED_TIMESTAMP, previousUpdatedTimestamp}, + {FIELD_NUMBER_OF_REQUIRED_ACCEPTS, numberOfRequiredAccepts}, + {FIELD_SCHEDULE, schedule}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Update a DraftPayment. /// /// The status of the DraftPayment. - /// The list of entries in the DraftPayment. Each entry will result in a payment when the DraftPayment is accepted. /// The last updated_timestamp that you received for this DraftPayment. This needs to be provided to prevent race conditions. /// The schedule details when creating or updating a scheduled payment. - public static BunqResponse Update(int draftPaymentId, int? monetaryAccountId = null, string status = null, - List entries = null, string previousUpdatedTimestamp = null, Schedule schedule = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int draftPaymentId, int? monetaryAccountId= null, string status = null, string previousUpdatedTimestamp = null, Schedule schedule = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - {FIELD_ENTRIES, entries}, - {FIELD_PREVIOUS_UPDATED_TIMESTAMP, previousUpdatedTimestamp}, - {FIELD_SCHEDULE, schedule}, - }; - + { + {FIELD_STATUS, status}, + {FIELD_PREVIOUS_UPDATED_TIMESTAMP, previousUpdatedTimestamp}, + {FIELD_SCHEDULE, schedule}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - draftPaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get a listing of all DraftPayments from a given MonetaryAccount. /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get a specific DraftPayment. /// - public static BunqResponse Get(int draftPaymentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int draftPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - draftPaymentId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -221,60 +203,60 @@ public override bool IsAllFieldNull() { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.UserAliasCreated != null) { return false; } - + if (this.Responses != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.Entries != null) { return false; } - + if (this.Object != null) { return false; } - + if (this.RequestReferenceSplitTheBill != null) { return false; } - + if (this.Schedule != null) { return false; } - + return true; } - + /// /// public static DraftPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/DraftShareInviteBank.cs b/BunqSdk/Model/Generated/Endpoint/DraftShareInviteBank.cs index 7b464575..efbbf7fe 100644 --- a/BunqSdk/Model/Generated/Endpoint/DraftShareInviteBank.cs +++ b/BunqSdk/Model/Generated/Endpoint/DraftShareInviteBank.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -22,148 +24,138 @@ public class DraftShareInviteBank : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/draft-share-invite-bank/{1}"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/draft-share-invite-bank/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/draft-share-invite-bank"; - + /// /// Field constants. /// public const string FIELD_STATUS = "status"; public const string FIELD_EXPIRATION = "expiration"; public const string FIELD_DRAFT_SHARE_SETTINGS = "draft_share_settings"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "DraftShareInviteBank"; - + /// /// The status of the draft share invite. Can be USED, CANCELLED and PENDING. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The moment when this draft share invite expires. /// [JsonProperty(PropertyName = "expiration")] public string Expiration { get; set; } - + /// /// The draft share invite details. /// [JsonProperty(PropertyName = "draft_share_settings")] public DraftShareInviteEntry DraftShareSettings { get; set; } - + /// /// The user who created the draft share invite. /// [JsonProperty(PropertyName = "user_alias_created")] public LabelUser UserAliasCreated { get; set; } - + /// /// The id of the share invite bank response this draft share belongs to. /// [JsonProperty(PropertyName = "share_invite_bank_response_id")] public int? ShareInviteBankResponseId { get; set; } - + /// /// The URL redirecting user to the draft share invite in the app. Only works on mobile devices. /// [JsonProperty(PropertyName = "draft_share_url")] public string DraftShareUrl { get; set; } - + /// /// The id of the newly created draft share invite. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - - + + /// /// /// The moment when this draft share invite expires. /// The draft share invite details. /// The status of the draft share invite. Can be CANCELLED (the user cancels the draft share before it's used). - public static BunqResponse Create(string expiration, DraftShareInviteEntry draftShareSettings, - string status = null, IDictionary customHeaders = null) + public static BunqResponse Create(string expiration, DraftShareInviteEntry draftShareSettings, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - {FIELD_EXPIRATION, expiration}, - {FIELD_DRAFT_SHARE_SETTINGS, draftShareSettings}, - }; - + { + {FIELD_STATUS, status}, + {FIELD_EXPIRATION, expiration}, + {FIELD_DRAFT_SHARE_SETTINGS, draftShareSettings}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get the details of a specific draft of a share invite. /// - public static BunqResponse Get(int draftShareInviteBankId, - IDictionary customHeaders = null) + public static BunqResponse Get(int draftShareInviteBankId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), draftShareInviteBankId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), draftShareInviteBankId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Update a draft share invite. When sending status CANCELLED it is possible to cancel the draft share invite. /// /// The status of the draft share invite. Can be CANCELLED (the user cancels the draft share before it's used). /// The moment when this draft share invite expires. /// The draft share invite details. - public static BunqResponse Update(int draftShareInviteBankId, string status = null, - string expiration = null, DraftShareInviteEntry draftShareSettings = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int draftShareInviteBankId, string status = null, string expiration = null, DraftShareInviteEntry draftShareSettings = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - {FIELD_EXPIRATION, expiration}, - {FIELD_DRAFT_SHARE_SETTINGS, draftShareSettings}, - }; - + { + {FIELD_STATUS, status}, + {FIELD_EXPIRATION, expiration}, + {FIELD_DRAFT_SHARE_SETTINGS, draftShareSettings}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), draftShareInviteBankId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), draftShareInviteBankId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -172,45 +164,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Status != null) { return false; } - + if (this.Expiration != null) { return false; } - + if (this.ShareInviteBankResponseId != null) { return false; } - + if (this.DraftShareUrl != null) { return false; } - + if (this.DraftShareSettings != null) { return false; } - + if (this.Id != null) { return false; } - + return true; } - + /// /// public static DraftShareInviteBank CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/DraftShareInviteBankQrCodeContent.cs b/BunqSdk/Model/Generated/Endpoint/DraftShareInviteBankQrCodeContent.cs index 47b4714f..eb828689 100644 --- a/BunqSdk/Model/Generated/Endpoint/DraftShareInviteBankQrCodeContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/DraftShareInviteBankQrCodeContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,42 +19,39 @@ public class DraftShareInviteBankQrCodeContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/draft-share-invite-bank/{1}/qr-code-content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "DraftShareInviteBankQrCodeContent"; - + /// /// Returns the raw content of the QR code that links to this draft share invite. The raw content is the binary /// representation of a file, without any JSON wrapping. /// - public static BunqResponse List(int draftShareInviteBankId, - IDictionary customHeaders = null) + public static BunqResponse List(int draftShareInviteBankId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), draftShareInviteBankId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), draftShareInviteBankId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static DraftShareInviteBankQrCodeContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Event.cs b/BunqSdk/Model/Generated/Endpoint/Event.cs index 9e3c3266..bce07bf6 100644 --- a/BunqSdk/Model/Generated/Endpoint/Event.cs +++ b/BunqSdk/Model/Generated/Endpoint/Event.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,76 +22,87 @@ public class Event : BunqModel /// protected const string ENDPOINT_URL_READ = "user/{0}/event/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/event"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "Event"; - + /// /// The id of the event. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the event's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the event's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The performed action. Can be: CREATE or UPDATE. /// [JsonProperty(PropertyName = "action")] public string Action { get; set; } - + /// /// The id of the user the event applied to (if it was a user event). /// [JsonProperty(PropertyName = "user_id")] public string UserId { get; set; } - + /// /// The id of the monetary account the event applied to (if it was a monetary account event). /// [JsonProperty(PropertyName = "monetary_account_id")] public string MonetaryAccountId { get; set; } - + /// /// The details of the external object the event was created for. /// [JsonProperty(PropertyName = "object")] public EventObject Object { get; set; } - + /// /// The event status. Can be: FINALIZED or AWAITING_REPLY. An example of FINALIZED event is a payment received /// event, while an AWAITING_REPLY event is a request received event. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - - + + /// + /// Fields of the external model which we have stored so we know what they were at the time of the event. + /// + [JsonProperty(PropertyName = "object_data_at_event")] + public BunqModel ObjectDataAtEvent { get; set; } + + /// + /// Indicator whether this is the latest event for the object. + /// + [JsonProperty(PropertyName = "is_event_latest_for_object")] + public bool? IsEventLatestForObject { get; set; } + + /// /// Get a specific event for a given user. /// public static BunqResponse Get(int eventId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), eventId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), eventId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get a collection of events for a given user. You can add query the parameters monetary_account_id, status /// and/or display_user_event to filter the response. When monetary_account_id={id,id} is provided only events @@ -97,20 +112,18 @@ public static BunqResponse Get(int eventId, IDictionary c /// provided user events are displayed. User events are events that are not related to a monetary account (for /// example: connect invites). /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -119,50 +132,60 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Action != null) { return false; } - + if (this.UserId != null) { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.Object != null) { return false; } - + if (this.Status != null) { return false; } - + + if (this.ObjectDataAtEvent != null) + { + return false; + } + + if (this.IsEventLatestForObject != null) + { + return false; + } + return true; } - + /// /// public static Event CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ExportAnnualOverview.cs b/BunqSdk/Model/Generated/Endpoint/ExportAnnualOverview.cs index 79a93cb8..f6c0e8b2 100644 --- a/BunqSdk/Model/Generated/Endpoint/ExportAnnualOverview.cs +++ b/BunqSdk/Model/Generated/Endpoint/ExportAnnualOverview.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,48 +23,48 @@ public class ExportAnnualOverview : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/export-annual-overview/{1}"; protected const string ENDPOINT_URL_DELETE = "user/{0}/export-annual-overview/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/export-annual-overview"; - + /// /// Field constants. /// public const string FIELD_YEAR = "year"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ExportAnnualOverview"; - + /// /// The year for which the overview is. /// [JsonProperty(PropertyName = "year")] public int? Year { get; set; } - + /// /// The id of the annual overview as created on the server. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the annual overview 's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the annual overview 's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The user to which this annual overview belongs. /// [JsonProperty(PropertyName = "alias_user")] public LabelUser AliasUser { get; set; } - - + + /// /// Create a new annual overview for a specific year. An overview can be generated only for a past year. /// @@ -70,68 +72,60 @@ public class ExportAnnualOverview : BunqModel public static BunqResponse Create(int? year, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_YEAR, year}, - }; - + { + {FIELD_YEAR, year}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get an annual overview for a user by its id. /// - public static BunqResponse Get(int exportAnnualOverviewId, - IDictionary customHeaders = null) + public static BunqResponse Get(int exportAnnualOverviewId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), exportAnnualOverviewId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), exportAnnualOverviewId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Delete(int exportAnnualOverviewId, - IDictionary customHeaders = null) + public static BunqResponse Delete(int exportAnnualOverviewId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), exportAnnualOverviewId), - customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), exportAnnualOverviewId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// List all the annual overviews for a user. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -140,35 +134,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Year != null) { return false; } - + if (this.AliasUser != null) { return false; } - + return true; } - + /// /// public static ExportAnnualOverview CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ExportAnnualOverviewContent.cs b/BunqSdk/Model/Generated/Endpoint/ExportAnnualOverviewContent.cs index db7b7af7..b9abbb23 100644 --- a/BunqSdk/Model/Generated/Endpoint/ExportAnnualOverviewContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/ExportAnnualOverviewContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,41 +19,38 @@ public class ExportAnnualOverviewContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/export-annual-overview/{1}/content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ExportAnnualOverviewContent"; - + /// /// Used to retrieve the raw content of an annual overview. /// - public static BunqResponse List(int exportAnnualOverviewId, - IDictionary customHeaders = null) + public static BunqResponse List(int exportAnnualOverviewId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), exportAnnualOverviewId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), exportAnnualOverviewId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static ExportAnnualOverviewContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ExportRib.cs b/BunqSdk/Model/Generated/Endpoint/ExportRib.cs index d1ee772d..e58b5bd7 100644 --- a/BunqSdk/Model/Generated/Endpoint/ExportRib.cs +++ b/BunqSdk/Model/Generated/Endpoint/ExportRib.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,106 +21,90 @@ public class ExportRib : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/export-rib/{2}"; protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/export-rib/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/export-rib"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ExportRib"; - + /// /// The id of the rib as created on the server. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the RIB's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the RIB's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - - + + /// /// Create a new RIB. /// - public static BunqResponse Create(int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - }; - + { + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get a RIB for a monetary account by its id. /// - public static BunqResponse Get(int exportRibId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int exportRibId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - exportRibId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), exportRibId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Delete(int exportRibId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int exportRibId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - exportRibId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), exportRibId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// List all the RIBs for a monetary account. /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -127,25 +113,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + return true; } - + /// /// public static ExportRib CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ExportRibContent.cs b/BunqSdk/Model/Generated/Endpoint/ExportRibContent.cs index ed1eb59d..7daf606b 100644 --- a/BunqSdk/Model/Generated/Endpoint/ExportRibContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/ExportRibContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -13,43 +18,38 @@ public class ExportRibContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/export-rib/{2}/content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ExportRibContent"; - + /// /// Used to retrieve the raw content of an RIB. /// - public static BunqResponse List(int exportRibId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse List(int exportRibId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), exportRibId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), exportRibId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static ExportRibContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ExportStatement.cs b/BunqSdk/Model/Generated/Endpoint/ExportStatement.cs index 304913a3..def0866c 100644 --- a/BunqSdk/Model/Generated/Endpoint/ExportStatement.cs +++ b/BunqSdk/Model/Generated/Endpoint/ExportStatement.cs @@ -1,9 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,7 +23,7 @@ public class ExportStatement : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/customer-statement/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/customer-statement"; protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/customer-statement/{2}"; - + /// /// Field constants. /// @@ -29,79 +32,79 @@ public class ExportStatement : BunqModel public const string FIELD_DATE_END = "date_end"; public const string FIELD_REGIONAL_FORMAT = "regional_format"; public const string FIELD_INCLUDE_ATTACHMENT = "include_attachment"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "CustomerStatement"; - + /// /// The format of statement. /// [JsonProperty(PropertyName = "statement_format")] public string StatementFormat { get; set; } - + /// /// The date from when this statement shows transactions. /// [JsonProperty(PropertyName = "date_start")] public string DateStart { get; set; } - + /// /// The date until which statement shows transactions. /// [JsonProperty(PropertyName = "date_end")] public string DateEnd { get; set; } - + /// /// The regional format of a CSV statement. /// [JsonProperty(PropertyName = "regional_format")] public string RegionalFormat { get; set; } - + /// /// Only for PDF exports. Includes attachments to mutations in the export, such as scanned receipts. /// [JsonProperty(PropertyName = "include_attachment")] public bool? IncludeAttachment { get; set; } - + /// /// The id of the customer statement model. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the statement model's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the statement model's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The status of the export. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// MT940 Statement number. Unique per monetary account. /// [JsonProperty(PropertyName = "statement_number")] public int? StatementNumber { get; set; } - + /// /// The monetary account for which this statement was created. /// [JsonProperty(PropertyName = "alias_monetary_account")] public MonetaryAccountReference AliasMonetaryAccount { get; set; } - - + + /// /// /// The format type of statement. Allowed values: MT940, CSV, PDF. @@ -109,82 +112,65 @@ public class ExportStatement : BunqModel /// The end date for making statements. /// Required for CSV exports. The regional format of the statement, can be UK_US (comma-separated) or EUROPEAN (semicolon-separated). /// Only for PDF exports. Includes attachments to mutations in the export, such as scanned receipts. - public static BunqResponse Create(string statementFormat, string dateStart, string dateEnd, - int? monetaryAccountId = null, string regionalFormat = null, bool? includeAttachment = null, - IDictionary customHeaders = null) + public static BunqResponse Create(string statementFormat, string dateStart, string dateEnd, int? monetaryAccountId= null, string regionalFormat = null, bool? includeAttachment = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATEMENT_FORMAT, statementFormat}, - {FIELD_DATE_START, dateStart}, - {FIELD_DATE_END, dateEnd}, - {FIELD_REGIONAL_FORMAT, regionalFormat}, - {FIELD_INCLUDE_ATTACHMENT, includeAttachment}, - }; - + { + {FIELD_STATEMENT_FORMAT, statementFormat}, + {FIELD_DATE_START, dateStart}, + {FIELD_DATE_END, dateEnd}, + {FIELD_REGIONAL_FORMAT, regionalFormat}, + {FIELD_INCLUDE_ATTACHMENT, includeAttachment}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Get(int exportStatementId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int exportStatementId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - exportStatementId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), exportStatementId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Delete(int exportStatementId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int exportStatementId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - exportStatementId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), exportStatementId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() @@ -193,60 +179,60 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.DateStart != null) { return false; } - + if (this.DateEnd != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.StatementNumber != null) { return false; } - + if (this.StatementFormat != null) { return false; } - + if (this.RegionalFormat != null) { return false; } - + if (this.AliasMonetaryAccount != null) { return false; } - + return true; } - + /// /// public static ExportStatement CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ExportStatementContent.cs b/BunqSdk/Model/Generated/Endpoint/ExportStatementContent.cs index 8d1b82b9..dfd6ed6a 100644 --- a/BunqSdk/Model/Generated/Endpoint/ExportStatementContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/ExportStatementContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,42 +20,37 @@ public class ExportStatementContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/customer-statement/{2}/content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ExportStatementContent"; - + /// /// - public static BunqResponse List(int customerStatementId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse List(int customerStatementId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), customerStatementId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), customerStatementId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static ExportStatementContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ExportStatementPayment.cs b/BunqSdk/Model/Generated/Endpoint/ExportStatementPayment.cs index 69e30464..61141e1b 100644 --- a/BunqSdk/Model/Generated/Endpoint/ExportStatementPayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/ExportStatementPayment.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,76 +19,68 @@ public class ExportStatementPayment : BunqModel /// protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/event/{2}/statement"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/event/{2}/statement/{3}"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ExportStatementPayment"; - + /// /// The id of the single payment statement model. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the statement model's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the statement model's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The status of the export. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - - + + /// /// - public static BunqResponse Create(int eventId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int eventId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - }; - + { + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - eventId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), eventId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Get(int eventId, int exportStatementPaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int eventId, int exportStatementPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - eventId, exportStatementPaymentId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), eventId, exportStatementPaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -95,30 +89,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Status != null) { return false; } - + return true; } - + /// /// public static ExportStatementPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ExportStatementPaymentContent.cs b/BunqSdk/Model/Generated/Endpoint/ExportStatementPaymentContent.cs index 524d74a3..eb5ef8f4 100644 --- a/BunqSdk/Model/Generated/Endpoint/ExportStatementPaymentContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/ExportStatementPaymentContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -13,42 +18,37 @@ public class ExportStatementPaymentContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/event/{2}/statement/{3}/content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ExportStatementPayment"; - + /// /// - public static BunqResponse List(int eventId, int statementId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse List(int eventId, int statementId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), eventId, statementId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), eventId, statementId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static ExportStatementPaymentContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/FeatureAnnouncement.cs b/BunqSdk/Model/Generated/Endpoint/FeatureAnnouncement.cs index 45c3d3c8..c76d3297 100644 --- a/BunqSdk/Model/Generated/Endpoint/FeatureAnnouncement.cs +++ b/BunqSdk/Model/Generated/Endpoint/FeatureAnnouncement.cs @@ -1,7 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,46 +19,50 @@ public class FeatureAnnouncement : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "user/{0}/feature-announcement/{1}"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "FeatureAnnouncement"; - + /// /// The Avatar of the event overview. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - + /// /// The event overview title of the feature display /// [JsonProperty(PropertyName = "title")] public string Title { get; set; } - + /// /// The event overview subtitle of the feature display /// [JsonProperty(PropertyName = "sub_title")] public string SubTitle { get; set; } - - + /// + /// The type of the feature announcement so apps can override with their own stuff if desired /// - public static BunqResponse Get(int featureAnnouncementId, - IDictionary customHeaders = null) + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + + /// + /// + public static BunqResponse Get(int featureAnnouncementId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), featureAnnouncementId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), featureAnnouncementId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -62,25 +71,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Title != null) { return false; } - + if (this.SubTitle != null) { return false; } - + + if (this.Type != null) + { + return false; + } + return true; } - + /// /// public static FeatureAnnouncement CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/IdealMerchantTransaction.cs b/BunqSdk/Model/Generated/Endpoint/IdealMerchantTransaction.cs index 2059fb63..1fcea1d6 100644 --- a/BunqSdk/Model/Generated/Endpoint/IdealMerchantTransaction.cs +++ b/BunqSdk/Model/Generated/Endpoint/IdealMerchantTransaction.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,157 +21,145 @@ public class IdealMerchantTransaction : BunqModel protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/ideal-merchant-transaction"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/ideal-merchant-transaction"; - + /// /// Field constants. /// public const string FIELD_AMOUNT_REQUESTED = "amount_requested"; public const string FIELD_ISSUER = "issuer"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "IdealMerchantTransaction"; - + /// /// The requested amount of money to add. /// [JsonProperty(PropertyName = "amount_requested")] public Amount AmountRequested { get; set; } - + /// /// The BIC of the issuer. /// [JsonProperty(PropertyName = "issuer")] public string Issuer { get; set; } - + /// /// The id of the monetary account this ideal merchant transaction links to. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The alias of the monetary account to add money to. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The alias of the monetary account the money comes from. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// In case of a successful transaction, the amount of money that will be transferred. /// [JsonProperty(PropertyName = "amount_guaranteed")] public Amount AmountGuaranteed { get; set; } - + /// /// When the transaction will expire. /// [JsonProperty(PropertyName = "expiration")] public string Expiration { get; set; } - + /// /// The Name of the issuer. /// [JsonProperty(PropertyName = "issuer_name")] public string IssuerName { get; set; } - + /// /// The URL to visit to /// [JsonProperty(PropertyName = "issuer_authentication_url")] public string IssuerAuthenticationUrl { get; set; } - + /// /// The 'purchase ID' of the iDEAL transaction. /// [JsonProperty(PropertyName = "purchase_identifier")] public string PurchaseIdentifier { get; set; } - + /// /// The status of the transaction. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// When the status was last updated. /// [JsonProperty(PropertyName = "status_timestamp")] public string StatusTimestamp { get; set; } - + /// /// The 'transaction ID' of the iDEAL transaction. /// [JsonProperty(PropertyName = "transaction_identifier")] public string TransactionIdentifier { get; set; } - - + + /// /// /// The requested amount of money to add. /// The BIC of the issuing bank to ask for money. - public static BunqResponse Create(Amount amountRequested, string issuer, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Create(Amount amountRequested, string issuer, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_AMOUNT_REQUESTED, amountRequested}, - {FIELD_ISSUER, issuer}, - }; - + { + {FIELD_AMOUNT_REQUESTED, amountRequested}, + {FIELD_ISSUER, issuer}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Get(int idealMerchantTransactionId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int idealMerchantTransactionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - idealMerchantTransactionId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -178,75 +168,75 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Alias != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.AmountGuaranteed != null) { return false; } - + if (this.AmountRequested != null) { return false; } - + if (this.Expiration != null) { return false; } - + if (this.Issuer != null) { return false; } - + if (this.IssuerName != null) { return false; } - + if (this.IssuerAuthenticationUrl != null) { return false; } - + if (this.PurchaseIdentifier != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.StatusTimestamp != null) { return false; } - + if (this.TransactionIdentifier != null) { return false; } - + return true; } - + /// /// public static IdealMerchantTransaction CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Insight.cs b/BunqSdk/Model/Generated/Endpoint/Insight.cs index 0ff0537f..fb784cdf 100644 --- a/BunqSdk/Model/Generated/Endpoint/Insight.cs +++ b/BunqSdk/Model/Generated/Endpoint/Insight.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,53 +19,51 @@ public class Insight : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/insights"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "InsightCategory"; - + /// /// The category. /// [JsonProperty(PropertyName = "category")] public string Category { get; set; } - + /// /// The translated category. /// [JsonProperty(PropertyName = "category_translated")] public string CategoryTranslated { get; set; } - + /// /// The total amount of the transactions in the category. /// [JsonProperty(PropertyName = "amount_total")] public Amount AmountTotal { get; set; } - + /// /// The number of the transactions in the category. /// [JsonProperty(PropertyName = "number_of_transactions")] public double? NumberOfTransactions { get; set; } - - + + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -70,30 +72,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.CategoryTranslated != null) { return false; } - + if (this.AmountTotal != null) { return false; } - + if (this.NumberOfTransactions != null) { return false; } - + return true; } - + /// /// public static Insight CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/InsightBudget.cs b/BunqSdk/Model/Generated/Endpoint/InsightBudget.cs new file mode 100644 index 00000000..29af233e --- /dev/null +++ b/BunqSdk/Model/Generated/Endpoint/InsightBudget.cs @@ -0,0 +1,55 @@ +using Bunq.Sdk.Context; +using Bunq.Sdk.Http; +using Bunq.Sdk.Json; +using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; + +namespace Bunq.Sdk.Model.Generated.Endpoint +{ + /// + /// Used to get insights budgets between given time range. + /// + public class InsightBudget : BunqModel + { + /// + /// Endpoint constants. + /// + protected const string ENDPOINT_URL_LISTING = "user/{0}/insight-budget"; + + /// + /// Object type. + /// + private const string OBJECT_TYPE_GET = "InsightBudget"; + + /// + /// + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) + { + if (urlParams == null) urlParams = new Dictionary(); + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + + return FromJsonList(responseRaw, OBJECT_TYPE_GET); + } + + + /// + /// + public override bool IsAllFieldNull() + { + return true; + } + + /// + /// + public static InsightBudget CreateFromJsonString(string json) + { + return BunqModel.CreateFromJsonString(json); + } + } +} diff --git a/BunqSdk/Model/Generated/Endpoint/InsightEvent.cs b/BunqSdk/Model/Generated/Endpoint/InsightEvent.cs index 71780da6..b9e22234 100644 --- a/BunqSdk/Model/Generated/Endpoint/InsightEvent.cs +++ b/BunqSdk/Model/Generated/Endpoint/InsightEvent.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,78 +19,76 @@ public class InsightEvent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/insights-search"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "Event"; - + /// /// The id of the event. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the event's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the event's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The performed action. Can be: CREATE or UPDATE. /// [JsonProperty(PropertyName = "action")] public string Action { get; set; } - + /// /// The id of the user the event applied to (if it was a user event). /// [JsonProperty(PropertyName = "user_id")] public string UserId { get; set; } - + /// /// The id of the monetary account the event applied to (if it was a monetary account event). /// [JsonProperty(PropertyName = "monetary_account_id")] public string MonetaryAccountId { get; set; } - + /// /// The details of the external object the event was created for. /// [JsonProperty(PropertyName = "object")] public EventObject Object { get; set; } - + /// /// The event status. Can be: FINALIZED or AWAITING_REPLY. An example of FINALIZED event is a payment received /// event, while an AWAITING_REPLY event is a request received event. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - - + + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -95,50 +97,50 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Action != null) { return false; } - + if (this.UserId != null) { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.Object != null) { return false; } - + if (this.Status != null) { return false; } - + return true; } - + /// /// public static InsightEvent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/InsightPreferenceDate.cs b/BunqSdk/Model/Generated/Endpoint/InsightPreferenceDate.cs new file mode 100644 index 00000000..d5f9bccf --- /dev/null +++ b/BunqSdk/Model/Generated/Endpoint/InsightPreferenceDate.cs @@ -0,0 +1,71 @@ +using Bunq.Sdk.Context; +using Bunq.Sdk.Http; +using Bunq.Sdk.Json; +using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; + +namespace Bunq.Sdk.Model.Generated.Endpoint +{ + /// + /// Used to allow users to set insight/budget preferences. + /// + public class InsightPreferenceDate : BunqModel + { + /// + /// Endpoint constants. + /// + protected const string ENDPOINT_URL_LISTING = "user/{0}/insight-preference-date"; + + /// + /// Field constants. + /// + public const string FIELD_DAY_OF_MONTH = "day_of_month"; + + /// + /// Object type. + /// + private const string OBJECT_TYPE_GET = "InsightPreferenceDate"; + + /// + /// The day of month at which budgeting/insights should start. + /// + [JsonProperty(PropertyName = "day_of_month")] + public int? DayOfMonth { get; set; } + + /// + /// + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) + { + if (urlParams == null) urlParams = new Dictionary(); + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + + return FromJsonList(responseRaw); + } + + + /// + /// + public override bool IsAllFieldNull() + { + if (this.DayOfMonth != null) + { + return false; + } + + return true; + } + + /// + /// + public static InsightPreferenceDate CreateFromJsonString(string json) + { + return BunqModel.CreateFromJsonString(json); + } + } +} diff --git a/BunqSdk/Model/Generated/Endpoint/InstallationServerPublicKey.cs b/BunqSdk/Model/Generated/Endpoint/InstallationServerPublicKey.cs index ceb14d04..473da4d5 100644 --- a/BunqSdk/Model/Generated/Endpoint/InstallationServerPublicKey.cs +++ b/BunqSdk/Model/Generated/Endpoint/InstallationServerPublicKey.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,35 +19,33 @@ public class InstallationServerPublicKey : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "installation/{0}/server-public-key"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ServerPublicKey"; - + /// /// The server's public key for this Installation. /// [JsonProperty(PropertyName = "server_public_key")] public string ServerPublicKey { get; set; } - + /// /// Show the ServerPublicKey for this Installation. /// - public static BunqResponse> List(int installationId, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int installationId, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, installationId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, installationId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -52,15 +54,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static InstallationServerPublicKey CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Invoice.cs b/BunqSdk/Model/Generated/Endpoint/Invoice.cs index 5b1f89db..7fa29389 100644 --- a/BunqSdk/Model/Generated/Endpoint/Invoice.cs +++ b/BunqSdk/Model/Generated/Endpoint/Invoice.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,174 +20,166 @@ public class Invoice : BunqModel /// protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/invoice"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/invoice/{2}"; - + /// /// Field constants. /// public const string FIELD_STATUS = "status"; public const string FIELD_DESCRIPTION = "description"; public const string FIELD_EXTERNAL_URL = "external_url"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "Invoice"; - + /// /// The invoice status. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The description provided by the admin. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The external url provided by the admin. /// [JsonProperty(PropertyName = "external_url")] public string ExternalUrl { get; set; } - + /// /// The id of the invoice object. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the invoice object's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the invoice object's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The invoice date. /// [JsonProperty(PropertyName = "invoice_date")] public string InvoiceDate { get; set; } - + /// /// The invoice number. /// [JsonProperty(PropertyName = "invoice_number")] public string InvoiceNumber { get; set; } - + /// /// The category to display to the user. /// [JsonProperty(PropertyName = "category")] public string Category { get; set; } - + /// /// The invoice item groups. /// [JsonProperty(PropertyName = "group")] public List Group { get; set; } - + /// /// The total discounted item price including VAT. /// [JsonProperty(PropertyName = "total_vat_inclusive")] public Amount TotalVatInclusive { get; set; } - + /// /// The total discounted item price excluding VAT. /// [JsonProperty(PropertyName = "total_vat_exclusive")] public Amount TotalVatExclusive { get; set; } - + /// /// The VAT on the total discounted item price. /// [JsonProperty(PropertyName = "total_vat")] public Amount TotalVat { get; set; } - + /// /// The label that's displayed to the counterparty with the invoice. Includes user. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The customer's address. /// [JsonProperty(PropertyName = "address")] public Address Address { get; set; } - + /// /// The label of the counterparty of the invoice. Includes user. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The company's address. /// [JsonProperty(PropertyName = "counterparty_address")] public Address CounterpartyAddress { get; set; } - + /// /// The company's chamber of commerce number. /// [JsonProperty(PropertyName = "chamber_of_commerce_number")] public string ChamberOfCommerceNumber { get; set; } - + /// /// The company's chamber of commerce number. /// [JsonProperty(PropertyName = "vat_number")] public string VatNumber { get; set; } - + /// /// The reference to the object used for split the bill. Can be RequestInquiry or RequestInquiryBatch /// [JsonProperty(PropertyName = "request_reference_split_the_bill")] public List RequestReferenceSplitTheBill { get; set; } - - + + /// /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int invoiceId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int invoiceId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - invoiceId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), invoiceId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -192,100 +188,100 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.InvoiceDate != null) { return false; } - + if (this.InvoiceNumber != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.Category != null) { return false; } - + if (this.Group != null) { return false; } - + if (this.TotalVatInclusive != null) { return false; } - + if (this.TotalVatExclusive != null) { return false; } - + if (this.TotalVat != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.Address != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.CounterpartyAddress != null) { return false; } - + if (this.ChamberOfCommerceNumber != null) { return false; } - + if (this.VatNumber != null) { return false; } - + if (this.RequestReferenceSplitTheBill != null) { return false; } - + return true; } - + /// /// public static Invoice CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/InvoiceByUser.cs b/BunqSdk/Model/Generated/Endpoint/InvoiceByUser.cs index 8c3eb3b1..e138139d 100644 --- a/BunqSdk/Model/Generated/Endpoint/InvoiceByUser.cs +++ b/BunqSdk/Model/Generated/Endpoint/InvoiceByUser.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,139 +20,135 @@ public class InvoiceByUser : BunqModel /// protected const string ENDPOINT_URL_LISTING = "user/{0}/invoice"; protected const string ENDPOINT_URL_READ = "user/{0}/invoice/{1}"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "Invoice"; - + /// /// The id of the invoice object. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the invoice object's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the invoice object's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The invoice date. /// [JsonProperty(PropertyName = "invoice_date")] public string InvoiceDate { get; set; } - + /// /// The invoice number. /// [JsonProperty(PropertyName = "invoice_number")] public string InvoiceNumber { get; set; } - + /// /// The invoice status. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The invoice item groups. /// [JsonProperty(PropertyName = "group")] public List Group { get; set; } - + /// /// The total discounted item price including VAT. /// [JsonProperty(PropertyName = "total_vat_inclusive")] public Amount TotalVatInclusive { get; set; } - + /// /// The total discounted item price excluding VAT. /// [JsonProperty(PropertyName = "total_vat_exclusive")] public Amount TotalVatExclusive { get; set; } - + /// /// The VAT on the total discounted item price. /// [JsonProperty(PropertyName = "total_vat")] public Amount TotalVat { get; set; } - + /// /// The label that's displayed to the counterparty with the invoice. Includes user. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The customer's address. /// [JsonProperty(PropertyName = "address")] public Address Address { get; set; } - + /// /// The label of the counterparty of the invoice. Includes user. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The company's address. /// [JsonProperty(PropertyName = "counterparty_address")] public Address CounterpartyAddress { get; set; } - + /// /// The company's chamber of commerce number. /// [JsonProperty(PropertyName = "chamber_of_commerce_number")] public string ChamberOfCommerceNumber { get; set; } - + /// /// The company's chamber of commerce number. /// [JsonProperty(PropertyName = "vat_number")] public string VatNumber { get; set; } - - + + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int invoiceByUserId, - IDictionary customHeaders = null) + public static BunqResponse Get(int invoiceByUserId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), invoiceByUserId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), invoiceByUserId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -157,90 +157,90 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.InvoiceDate != null) { return false; } - + if (this.InvoiceNumber != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.Group != null) { return false; } - + if (this.TotalVatInclusive != null) { return false; } - + if (this.TotalVatExclusive != null) { return false; } - + if (this.TotalVat != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.Address != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.CounterpartyAddress != null) { return false; } - + if (this.ChamberOfCommerceNumber != null) { return false; } - + if (this.VatNumber != null) { return false; } - + return true; } - + /// /// public static InvoiceByUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/InvoiceExportPdfContent.cs b/BunqSdk/Model/Generated/Endpoint/InvoiceExportPdfContent.cs index a4e0676e..0573a37e 100644 --- a/BunqSdk/Model/Generated/Endpoint/InvoiceExportPdfContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/InvoiceExportPdfContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -13,38 +18,37 @@ public class InvoiceExportPdfContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/invoice/{1}/pdf-content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "InvoiceExportPdfContent"; - + /// /// public static BunqResponse List(int invoiceId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), invoiceId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), invoiceId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static InvoiceExportPdfContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/MasterCardAction.cs b/BunqSdk/Model/Generated/Endpoint/MasterCardAction.cs index 0bbbfc55..b5a7f102 100644 --- a/BunqSdk/Model/Generated/Endpoint/MasterCardAction.cs +++ b/BunqSdk/Model/Generated/Endpoint/MasterCardAction.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,242 +20,259 @@ public class MasterCardAction : BunqModel /// protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/mastercard-action/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/mastercard-action"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "MasterCardAction"; - + /// /// The id of the MastercardAction. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The id of the monetary account this action links to. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The id of the card this action links to. /// [JsonProperty(PropertyName = "card_id")] public int? CardId { get; set; } - + /// /// The amount of the transaction in local currency. /// [JsonProperty(PropertyName = "amount_local")] public Amount AmountLocal { get; set; } - + /// /// The amount of the transaction in local currency. /// [JsonProperty(PropertyName = "amount_converted")] public Amount AmountConverted { get; set; } - + /// /// The amount of the transaction in the monetary account's currency. /// [JsonProperty(PropertyName = "amount_billing")] public Amount AmountBilling { get; set; } - + /// /// The original amount in local currency. /// [JsonProperty(PropertyName = "amount_original_local")] public Amount AmountOriginalLocal { get; set; } - + /// /// The original amount in the monetary account's currency. /// [JsonProperty(PropertyName = "amount_original_billing")] public Amount AmountOriginalBilling { get; set; } - + /// /// The fee amount as charged by the merchant, if applicable. /// [JsonProperty(PropertyName = "amount_fee")] public Amount AmountFee { get; set; } - + /// /// The response code by which authorised transaction can be identified as authorised by bunq. /// [JsonProperty(PropertyName = "card_authorisation_id_response")] public string CardAuthorisationIdResponse { get; set; } - + /// /// Why the transaction was denied, if it was denied, or just ALLOWED. /// [JsonProperty(PropertyName = "decision")] public string Decision { get; set; } - + /// /// The payment status of the transaction. For example PAYMENT_SUCCESSFUL, for a successful payment. /// [JsonProperty(PropertyName = "payment_status")] public string PaymentStatus { get; set; } - + /// /// Empty if allowed, otherwise a textual explanation of why it was denied. /// [JsonProperty(PropertyName = "decision_description")] public string DecisionDescription { get; set; } - + /// /// Empty if allowed, otherwise a textual explanation of why it was denied in user's language. /// [JsonProperty(PropertyName = "decision_description_translated")] public string DecisionDescriptionTranslated { get; set; } - + + /// + /// Empty if allowed or if no relevant Together topic exists, otherwise contains the URL for a Together topic + /// with more information about the decision. + /// + [JsonProperty(PropertyName = "decision_together_url")] + public string DecisionTogetherUrl { get; set; } + /// /// The description for this transaction to display. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The status in the authorisation process. /// [JsonProperty(PropertyName = "authorisation_status")] public string AuthorisationStatus { get; set; } - + /// /// The type of transaction that was delivered using the card. /// [JsonProperty(PropertyName = "authorisation_type")] public string AuthorisationType { get; set; } - + /// /// The type of entry mode the user used. Can be 'ATM', 'ICC', 'MAGNETIC_STRIPE' or 'E_COMMERCE'. /// [JsonProperty(PropertyName = "pan_entry_mode_user")] public string PanEntryModeUser { get; set; } - + /// /// The setlement status in the authorisation process. /// [JsonProperty(PropertyName = "settlement_status")] public string SettlementStatus { get; set; } - + /// /// The clearing status of the authorisation. Can be 'PENDING', 'FIRST_PRESENTMENT_COMPLETE' or /// 'REFUND_LENIENCY'. /// [JsonProperty(PropertyName = "clearing_status")] public string ClearingStatus { get; set; } - + /// /// The maturity date. /// [JsonProperty(PropertyName = "maturity_date")] public string MaturityDate { get; set; } - + /// /// The city where the message originates from as announced by the terminal. /// [JsonProperty(PropertyName = "city")] public string City { get; set; } - + /// /// The monetary account label of the account that this action is created for. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The monetary account label of the counterparty. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The label of the card. /// [JsonProperty(PropertyName = "label_card")] public LabelCard LabelCard { get; set; } - + /// /// If this is a tokenisation action, this shows the status of the token. /// [JsonProperty(PropertyName = "token_status")] public string TokenStatus { get; set; } - + /// /// If this is a reservation, the moment the reservation will expire. /// [JsonProperty(PropertyName = "reservation_expiry_time")] public string ReservationExpiryTime { get; set; } - + /// /// The time when the processing of the clearing is expired, refunding the authorisation. /// [JsonProperty(PropertyName = "clearing_expiry_time")] public string ClearingExpiryTime { get; set; } - + /// /// The type of the limit applied to validate if this MasterCardAction was within the spending limits. The /// returned string matches the limit types as defined in the card endpoint. /// [JsonProperty(PropertyName = "applied_limit")] public string AppliedLimit { get; set; } - + /// /// The secure code id for this mastercard action or null. /// [JsonProperty(PropertyName = "secure_code_id")] public int? SecureCodeId { get; set; } - + /// /// The ID of the wallet provider as defined by MasterCard. 420 = bunq Android app with Tap&Pay; 103 = Apple /// Pay. /// [JsonProperty(PropertyName = "wallet_provider_id")] public string WalletProviderId { get; set; } - + /// /// The reference to the object used for split the bill. Can be RequestInquiry or RequestInquiryBatch /// [JsonProperty(PropertyName = "request_reference_split_the_bill")] public List RequestReferenceSplitTheBill { get; set; } - - + + /// + /// The Card Presence type of the POS. + /// + [JsonProperty(PropertyName = "pos_card_presence")] + public string PosCardPresence { get; set; } + + /// + /// The Card Holder Presence type of the POS. + /// + [JsonProperty(PropertyName = "pos_card_holder_presence")] + public string PosCardHolderPresence { get; set; } + /// + /// The whitelist id for this action or null. /// - public static BunqResponse Get(int masterCardActionId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + [JsonProperty(PropertyName = "eligible_whitelist_id")] + public int? EligibleWhitelistId { get; set; } + + + /// + /// + public static BunqResponse Get(int masterCardActionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - masterCardActionId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), masterCardActionId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -260,170 +281,190 @@ public override bool IsAllFieldNull() { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.CardId != null) { return false; } - + if (this.AmountLocal != null) { return false; } - + if (this.AmountConverted != null) { return false; } - + if (this.AmountBilling != null) { return false; } - + if (this.AmountOriginalLocal != null) { return false; } - + if (this.AmountOriginalBilling != null) { return false; } - + if (this.AmountFee != null) { return false; } - + if (this.CardAuthorisationIdResponse != null) { return false; } - + if (this.Decision != null) { return false; } - + if (this.PaymentStatus != null) { return false; } - + if (this.DecisionDescription != null) { return false; } - + if (this.DecisionDescriptionTranslated != null) { return false; } - + + if (this.DecisionTogetherUrl != null) + { + return false; + } + if (this.Description != null) { return false; } - + if (this.AuthorisationStatus != null) { return false; } - + if (this.AuthorisationType != null) { return false; } - + if (this.PanEntryModeUser != null) { return false; } - + if (this.SettlementStatus != null) { return false; } - + if (this.ClearingStatus != null) { return false; } - + if (this.MaturityDate != null) { return false; } - + if (this.City != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.LabelCard != null) { return false; } - + if (this.TokenStatus != null) { return false; } - + if (this.ReservationExpiryTime != null) { return false; } - + if (this.ClearingExpiryTime != null) { return false; } - + if (this.AppliedLimit != null) { return false; } - + if (this.SecureCodeId != null) { return false; } - + if (this.WalletProviderId != null) { return false; } - + if (this.RequestReferenceSplitTheBill != null) { return false; } - + + if (this.PosCardPresence != null) + { + return false; + } + + if (this.PosCardHolderPresence != null) + { + return false; + } + + if (this.EligibleWhitelistId != null) + { + return false; + } + return true; } - + /// /// public static MasterCardAction CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/MasterCardActionGreenAggregation.cs b/BunqSdk/Model/Generated/Endpoint/MasterCardActionGreenAggregation.cs index 79d51ed0..2f3f4d8e 100644 --- a/BunqSdk/Model/Generated/Endpoint/MasterCardActionGreenAggregation.cs +++ b/BunqSdk/Model/Generated/Endpoint/MasterCardActionGreenAggregation.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,41 +18,39 @@ public class MasterCardActionGreenAggregation : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/mastercard-action-green-aggregation"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "MasterCardActionGreenAggregation"; - + /// /// The date of the aggregation. /// [JsonProperty(PropertyName = "date")] public string Date { get; set; } - + /// /// The percentage of card payments that were done with a Green Card. /// [JsonProperty(PropertyName = "percentage")] public string Percentage { get; set; } - - + + /// /// - public static BunqResponse> List( - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -57,20 +59,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Percentage != null) { return false; } - + return true; } - + /// /// public static MasterCardActionGreenAggregation CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/MasterCardPayment.cs b/BunqSdk/Model/Generated/Endpoint/MasterCardPayment.cs new file mode 100644 index 00000000..8503aa62 --- /dev/null +++ b/BunqSdk/Model/Generated/Endpoint/MasterCardPayment.cs @@ -0,0 +1,55 @@ +using Bunq.Sdk.Context; +using Bunq.Sdk.Http; +using Bunq.Sdk.Json; +using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; + +namespace Bunq.Sdk.Model.Generated.Endpoint +{ + /// + /// MasterCard transaction view. + /// + public class MasterCardPayment : BunqModel + { + /// + /// Endpoint constants. + /// + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/mastercard-action/{2}/payment"; + + /// + /// Object type. + /// + private const string OBJECT_TYPE_GET = "Payment"; + + /// + /// + public static BunqResponse> List(int mastercardActionId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) + { + if (urlParams == null) urlParams = new Dictionary(); + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId), urlParams, customHeaders); + + return FromJsonList(responseRaw, OBJECT_TYPE_GET); + } + + + /// + /// + public override bool IsAllFieldNull() + { + return true; + } + + /// + /// + public static MasterCardPayment CreateFromJsonString(string json) + { + return BunqModel.CreateFromJsonString(json); + } + } +} diff --git a/BunqSdk/Model/Generated/Endpoint/MonetaryAccount.cs b/BunqSdk/Model/Generated/Endpoint/MonetaryAccount.cs index 5b183e34..831f7900 100644 --- a/BunqSdk/Model/Generated/Endpoint/MonetaryAccount.cs +++ b/BunqSdk/Model/Generated/Endpoint/MonetaryAccount.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Exception; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,73 +22,67 @@ public class MonetaryAccount : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - + /// /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "MonetaryAccount"; - + /// /// [JsonProperty(PropertyName = "MonetaryAccountBank")] public MonetaryAccountBank MonetaryAccountBank { get; set; } - + /// /// [JsonProperty(PropertyName = "MonetaryAccountJoint")] public MonetaryAccountJoint MonetaryAccountJoint { get; set; } - + /// /// [JsonProperty(PropertyName = "MonetaryAccountLight")] public MonetaryAccountLight MonetaryAccountLight { get; set; } - + /// /// [JsonProperty(PropertyName = "MonetaryAccountSavings")] public MonetaryAccountSavings MonetaryAccountSavings { get; set; } - - + + /// /// Get a specific MonetaryAccount. /// - public static BunqResponse Get(int monetaryAccountId, - IDictionary customHeaders = null) + public static BunqResponse Get(int monetaryAccountId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), new Dictionary(), customHeaders); + return FromJson(responseRaw); } - + /// /// Get a collection of all your MonetaryAccounts. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw); } - - + + /// /// public BunqModel GetReferencedObject() @@ -93,25 +91,25 @@ public BunqModel GetReferencedObject() { return this.MonetaryAccountBank; } - + if (this.MonetaryAccountJoint != null) { return this.MonetaryAccountJoint; } - + if (this.MonetaryAccountLight != null) { return this.MonetaryAccountLight; } - + if (this.MonetaryAccountSavings != null) { return this.MonetaryAccountSavings; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -120,30 +118,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.MonetaryAccountJoint != null) { return false; } - + if (this.MonetaryAccountLight != null) { return false; } - + if (this.MonetaryAccountSavings != null) { return false; } - + return true; } - + /// /// public static MonetaryAccount CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/MonetaryAccountBank.cs b/BunqSdk/Model/Generated/Endpoint/MonetaryAccountBank.cs index 39d6188d..43674ec1 100644 --- a/BunqSdk/Model/Generated/Endpoint/MonetaryAccountBank.cs +++ b/BunqSdk/Model/Generated/Endpoint/MonetaryAccountBank.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -24,7 +26,7 @@ public class MonetaryAccountBank : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account-bank/{1}"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account-bank/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account-bank"; - + /// /// Field constants. /// @@ -38,43 +40,44 @@ public class MonetaryAccountBank : BunqModel public const string FIELD_REASON_DESCRIPTION = "reason_description"; public const string FIELD_DISPLAY_NAME = "display_name"; public const string FIELD_SETTING = "setting"; - + public const string FIELD_COUNTRY_IBAN = "country_iban"; + /// /// Object type. /// private const string OBJECT_TYPE_GET = "MonetaryAccountBank"; - + /// /// The currency of the MonetaryAccountBank as an ISO 4217 formatted currency code. /// [JsonProperty(PropertyName = "currency")] public string Currency { get; set; } - + /// /// The description of the MonetaryAccountBank. Defaults to 'bunq account'. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The daily spending limit Amount of the MonetaryAccountBank. Defaults to 1000 EUR. Currency must match the /// MonetaryAccountBank's currency. Limited to 10000 EUR. /// [JsonProperty(PropertyName = "daily_limit")] public Amount DailyLimit { get; set; } - + /// /// The UUID of the Avatar of the MonetaryAccountBank. /// [JsonProperty(PropertyName = "avatar_uuid")] public string AvatarUuid { get; set; } - + /// /// The status of the MonetaryAccountBank. Can be: ACTIVE, BLOCKED, CANCELLED or PENDING_REOPEN /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The sub-status of the MonetaryAccountBank providing extra information regarding the status. Will be NONE for /// ACTIVE or PENDING_REOPEN, COMPLETELY or ONLY_ACCEPTING_INCOMING for BLOCKED and REDEMPTION_INVOLUNTARY, @@ -82,99 +85,105 @@ public class MonetaryAccountBank : BunqModel /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The reason for voluntarily cancelling (closing) the MonetaryAccountBank, can only be OTHER. /// [JsonProperty(PropertyName = "reason")] public string Reason { get; set; } - + /// /// The optional free-form reason for voluntarily cancelling (closing) the MonetaryAccountBank. Can be any user /// provided message. /// [JsonProperty(PropertyName = "reason_description")] public string ReasonDescription { get; set; } - + /// /// The legal name of the user / company using this monetary account. /// [JsonProperty(PropertyName = "display_name")] public string DisplayName { get; set; } - + /// /// The settings of the MonetaryAccountBank. /// [JsonProperty(PropertyName = "setting")] public MonetaryAccountSetting Setting { get; set; } - + + /// + /// The country of the monetary account IBAN. + /// + [JsonProperty(PropertyName = "country_iban")] + public string CountryIban { get; set; } + /// /// The id of the MonetaryAccountBank. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the MonetaryAccountBank's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the MonetaryAccountBank's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The Avatar of the MonetaryAccountBank. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - + /// /// The maximum Amount the MonetaryAccountBank can be 'in the red'. /// [JsonProperty(PropertyName = "overdraft_limit")] public Amount OverdraftLimit { get; set; } - + /// /// The current available balance Amount of the MonetaryAccountBank. /// [JsonProperty(PropertyName = "balance")] public Amount Balance { get; set; } - + /// /// The Aliases for the MonetaryAccountBank. /// [JsonProperty(PropertyName = "alias")] public List Alias { get; set; } - + /// /// The MonetaryAccountBank's public UUID. /// [JsonProperty(PropertyName = "public_uuid")] public string PublicUuid { get; set; } - + /// /// The id of the User who owns the MonetaryAccountBank. /// [JsonProperty(PropertyName = "user_id")] public int? UserId { get; set; } - + /// /// The profile of the account. /// [JsonProperty(PropertyName = "monetary_account_profile")] public MonetaryAccountProfile MonetaryAccountProfile { get; set; } - + /// /// The ids of the AutoSave. /// [JsonProperty(PropertyName = "all_auto_save_id")] public List AllAutoSaveId { get; set; } - - + + /// /// Create new MonetaryAccountBank. /// @@ -188,51 +197,47 @@ public class MonetaryAccountBank : BunqModel /// The optional free-form reason for voluntarily cancelling (closing) the MonetaryAccountBank. Can be any user provided message. Should only be specified if updating the status to CANCELLED. /// The legal name of the user / company using this monetary account. /// The settings of the MonetaryAccountBank. - public static BunqResponse Create(string currency, string description = null, Amount dailyLimit = null, - string avatarUuid = null, string status = null, string subStatus = null, string reason = null, - string reasonDescription = null, string displayName = null, MonetaryAccountSetting setting = null, - IDictionary customHeaders = null) + /// The country of the monetary account IBAN. + public static BunqResponse Create(string currency, string description = null, Amount dailyLimit = null, string avatarUuid = null, string status = null, string subStatus = null, string reason = null, string reasonDescription = null, string displayName = null, MonetaryAccountSetting setting = null, string countryIban = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CURRENCY, currency}, - {FIELD_DESCRIPTION, description}, - {FIELD_DAILY_LIMIT, dailyLimit}, - {FIELD_AVATAR_UUID, avatarUuid}, - {FIELD_STATUS, status}, - {FIELD_SUB_STATUS, subStatus}, - {FIELD_REASON, reason}, - {FIELD_REASON_DESCRIPTION, reasonDescription}, - {FIELD_DISPLAY_NAME, displayName}, - {FIELD_SETTING, setting}, - }; - + { + {FIELD_CURRENCY, currency}, + {FIELD_DESCRIPTION, description}, + {FIELD_DAILY_LIMIT, dailyLimit}, + {FIELD_AVATAR_UUID, avatarUuid}, + {FIELD_STATUS, status}, + {FIELD_SUB_STATUS, subStatus}, + {FIELD_REASON, reason}, + {FIELD_REASON_DESCRIPTION, reasonDescription}, + {FIELD_DISPLAY_NAME, displayName}, + {FIELD_SETTING, setting}, + {FIELD_COUNTRY_IBAN, countryIban}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get a specific MonetaryAccountBank. /// - public static BunqResponse Get(int monetaryAccountBankId, - IDictionary customHeaders = null) + public static BunqResponse Get(int monetaryAccountBankId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), monetaryAccountBankId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), monetaryAccountBankId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Update a specific existing MonetaryAccountBank. /// @@ -245,53 +250,46 @@ public static BunqResponse Get(int monetaryAccountBankId, /// The optional free-form reason for voluntarily cancelling (closing) the MonetaryAccountBank. Can be any user provided message. Should only be specified if updating the status to CANCELLED. /// The legal name of the user / company using this monetary account. /// The settings of the MonetaryAccountBank. - public static BunqResponse Update(int monetaryAccountBankId, string description = null, - Amount dailyLimit = null, string avatarUuid = null, string status = null, string subStatus = null, - string reason = null, string reasonDescription = null, string displayName = null, - MonetaryAccountSetting setting = null, IDictionary customHeaders = null) + public static BunqResponse Update(int monetaryAccountBankId, string description = null, Amount dailyLimit = null, string avatarUuid = null, string status = null, string subStatus = null, string reason = null, string reasonDescription = null, string displayName = null, MonetaryAccountSetting setting = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_DAILY_LIMIT, dailyLimit}, - {FIELD_AVATAR_UUID, avatarUuid}, - {FIELD_STATUS, status}, - {FIELD_SUB_STATUS, subStatus}, - {FIELD_REASON, reason}, - {FIELD_REASON_DESCRIPTION, reasonDescription}, - {FIELD_DISPLAY_NAME, displayName}, - {FIELD_SETTING, setting}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_DAILY_LIMIT, dailyLimit}, + {FIELD_AVATAR_UUID, avatarUuid}, + {FIELD_STATUS, status}, + {FIELD_SUB_STATUS, subStatus}, + {FIELD_REASON, reason}, + {FIELD_REASON_DESCRIPTION, reasonDescription}, + {FIELD_DISPLAY_NAME, displayName}, + {FIELD_SETTING, setting}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), monetaryAccountBankId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), monetaryAccountBankId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Gets a listing of all MonetaryAccountBanks of a given user. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -300,110 +298,110 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Avatar != null) { return false; } - + if (this.Currency != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.DailyLimit != null) { return false; } - + if (this.OverdraftLimit != null) { return false; } - + if (this.Balance != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.PublicUuid != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.Reason != null) { return false; } - + if (this.ReasonDescription != null) { return false; } - + if (this.UserId != null) { return false; } - + if (this.MonetaryAccountProfile != null) { return false; } - + if (this.DisplayName != null) { return false; } - + if (this.Setting != null) { return false; } - + if (this.AllAutoSaveId != null) { return false; } - + return true; } - + /// /// public static MonetaryAccountBank CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/MonetaryAccountJoint.cs b/BunqSdk/Model/Generated/Endpoint/MonetaryAccountJoint.cs index c2afd513..43b15620 100644 --- a/BunqSdk/Model/Generated/Endpoint/MonetaryAccountJoint.cs +++ b/BunqSdk/Model/Generated/Endpoint/MonetaryAccountJoint.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,7 +22,7 @@ public class MonetaryAccountJoint : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account-joint/{1}"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account-joint/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account-joint"; - + /// /// Field constants. /// @@ -36,55 +38,55 @@ public class MonetaryAccountJoint : BunqModel public const string FIELD_REASON_DESCRIPTION = "reason_description"; public const string FIELD_ALL_CO_OWNER = "all_co_owner"; public const string FIELD_SETTING = "setting"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "MonetaryAccountJoint"; - + /// /// The currency of the MonetaryAccountJoint as an ISO 4217 formatted currency code. /// [JsonProperty(PropertyName = "currency")] public string Currency { get; set; } - + /// /// The description of the MonetaryAccountJoint. Defaults to 'bunq account'. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The daily spending limit Amount of the MonetaryAccountJoint. Defaults to 1000 EUR. Currency must match the /// MonetaryAccountJoint's currency. Limited to 10000 EUR. /// [JsonProperty(PropertyName = "daily_limit")] public Amount DailyLimit { get; set; } - + /// /// The maximum Amount the MonetaryAccountJoint can be 'in the red'. /// [JsonProperty(PropertyName = "overdraft_limit")] public Amount OverdraftLimit { get; set; } - + /// /// The Aliases for the MonetaryAccountJoint. /// [JsonProperty(PropertyName = "alias")] public List Alias { get; set; } - + /// /// The UUID of the Avatar of the MonetaryAccountJoint. /// [JsonProperty(PropertyName = "avatar_uuid")] public string AvatarUuid { get; set; } - + /// /// The status of the MonetaryAccountJoint. Can be: ACTIVE, BLOCKED, CANCELLED or PENDING_REOPEN /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The sub-status of the MonetaryAccountJoint providing extra information regarding the status. Will be NONE /// for ACTIVE or PENDING_REOPEN, COMPLETELY or ONLY_ACCEPTING_INCOMING for BLOCKED and REDEMPTION_INVOLUNTARY, @@ -92,87 +94,87 @@ public class MonetaryAccountJoint : BunqModel /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The reason for voluntarily cancelling (closing) the MonetaryAccountJoint, can only be OTHER. /// [JsonProperty(PropertyName = "reason")] public string Reason { get; set; } - + /// /// The optional free-form reason for voluntarily cancelling (closing) the MonetaryAccountJoint. Can be any user /// provided message. /// [JsonProperty(PropertyName = "reason_description")] public string ReasonDescription { get; set; } - + /// /// The users the account will be joint with. /// [JsonProperty(PropertyName = "all_co_owner")] public List AllCoOwner { get; set; } - + /// /// The settings of the MonetaryAccountJoint. /// [JsonProperty(PropertyName = "setting")] public MonetaryAccountSetting Setting { get; set; } - + /// /// The id of the MonetaryAccountJoint. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the MonetaryAccountJoint's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the MonetaryAccountJoint's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The Avatar of the MonetaryAccountJoint. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - + /// /// The current available balance Amount of the MonetaryAccountJoint. /// [JsonProperty(PropertyName = "balance")] public Amount Balance { get; set; } - + /// /// The MonetaryAccountJoint's public UUID. /// [JsonProperty(PropertyName = "public_uuid")] public string PublicUuid { get; set; } - + /// /// The id of the User who owns the MonetaryAccountJoint. /// [JsonProperty(PropertyName = "user_id")] public int? UserId { get; set; } - + /// /// The profile of the account. /// [JsonProperty(PropertyName = "monetary_account_profile")] public MonetaryAccountProfile MonetaryAccountProfile { get; set; } - + /// /// The ids of the AutoSave. /// [JsonProperty(PropertyName = "all_auto_save_id")] public List AllAutoSaveId { get; set; } - - + + /// /// /// The currency of the MonetaryAccountJoint as an ISO 4217 formatted currency code. @@ -187,53 +189,46 @@ public class MonetaryAccountJoint : BunqModel /// The reason for voluntarily cancelling (closing) the MonetaryAccountJoint, can only be OTHER. Should only be specified if updating the status to CANCELLED. /// The optional free-form reason for voluntarily cancelling (closing) the MonetaryAccountJoint. Can be any user provided message. Should only be specified if updating the status to CANCELLED. /// The settings of the MonetaryAccountJoint. - public static BunqResponse Create(string currency, List allCoOwner, string description = null, - Amount dailyLimit = null, Amount overdraftLimit = null, List alias = null, - string avatarUuid = null, string status = null, string subStatus = null, string reason = null, - string reasonDescription = null, MonetaryAccountSetting setting = null, - IDictionary customHeaders = null) + public static BunqResponse Create(string currency, List allCoOwner, string description = null, Amount dailyLimit = null, Amount overdraftLimit = null, List alias = null, string avatarUuid = null, string status = null, string subStatus = null, string reason = null, string reasonDescription = null, MonetaryAccountSetting setting = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CURRENCY, currency}, - {FIELD_DESCRIPTION, description}, - {FIELD_DAILY_LIMIT, dailyLimit}, - {FIELD_OVERDRAFT_LIMIT, overdraftLimit}, - {FIELD_ALIAS, alias}, - {FIELD_AVATAR_UUID, avatarUuid}, - {FIELD_STATUS, status}, - {FIELD_SUB_STATUS, subStatus}, - {FIELD_REASON, reason}, - {FIELD_REASON_DESCRIPTION, reasonDescription}, - {FIELD_ALL_CO_OWNER, allCoOwner}, - {FIELD_SETTING, setting}, - }; - + { + {FIELD_CURRENCY, currency}, + {FIELD_DESCRIPTION, description}, + {FIELD_DAILY_LIMIT, dailyLimit}, + {FIELD_OVERDRAFT_LIMIT, overdraftLimit}, + {FIELD_ALIAS, alias}, + {FIELD_AVATAR_UUID, avatarUuid}, + {FIELD_STATUS, status}, + {FIELD_SUB_STATUS, subStatus}, + {FIELD_REASON, reason}, + {FIELD_REASON_DESCRIPTION, reasonDescription}, + {FIELD_ALL_CO_OWNER, allCoOwner}, + {FIELD_SETTING, setting}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Get(int monetaryAccountJointId, - IDictionary customHeaders = null) + public static BunqResponse Get(int monetaryAccountJointId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), monetaryAccountJointId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), monetaryAccountJointId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// The description of the MonetaryAccountJoint. Defaults to 'bunq account'. @@ -244,51 +239,44 @@ public static BunqResponse Get(int monetaryAccountJointId, /// The reason for voluntarily cancelling (closing) the MonetaryAccountJoint, can only be OTHER. Should only be specified if updating the status to CANCELLED. /// The optional free-form reason for voluntarily cancelling (closing) the MonetaryAccountJoint. Can be any user provided message. Should only be specified if updating the status to CANCELLED. /// The settings of the MonetaryAccountJoint. - public static BunqResponse Update(int monetaryAccountJointId, string description = null, - Amount dailyLimit = null, string avatarUuid = null, string status = null, string subStatus = null, - string reason = null, string reasonDescription = null, MonetaryAccountSetting setting = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int monetaryAccountJointId, string description = null, Amount dailyLimit = null, string avatarUuid = null, string status = null, string subStatus = null, string reason = null, string reasonDescription = null, MonetaryAccountSetting setting = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_DAILY_LIMIT, dailyLimit}, - {FIELD_AVATAR_UUID, avatarUuid}, - {FIELD_STATUS, status}, - {FIELD_SUB_STATUS, subStatus}, - {FIELD_REASON, reason}, - {FIELD_REASON_DESCRIPTION, reasonDescription}, - {FIELD_SETTING, setting}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_DAILY_LIMIT, dailyLimit}, + {FIELD_AVATAR_UUID, avatarUuid}, + {FIELD_STATUS, status}, + {FIELD_SUB_STATUS, subStatus}, + {FIELD_REASON, reason}, + {FIELD_REASON_DESCRIPTION, reasonDescription}, + {FIELD_SETTING, setting}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), monetaryAccountJointId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), monetaryAccountJointId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -297,110 +285,110 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Avatar != null) { return false; } - + if (this.Currency != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.DailyLimit != null) { return false; } - + if (this.OverdraftLimit != null) { return false; } - + if (this.Balance != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.PublicUuid != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.Reason != null) { return false; } - + if (this.ReasonDescription != null) { return false; } - + if (this.AllCoOwner != null) { return false; } - + if (this.UserId != null) { return false; } - + if (this.MonetaryAccountProfile != null) { return false; } - + if (this.Setting != null) { return false; } - + if (this.AllAutoSaveId != null) { return false; } - + return true; } - + /// /// public static MonetaryAccountJoint CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/MonetaryAccountLight.cs b/BunqSdk/Model/Generated/Endpoint/MonetaryAccountLight.cs index adccbfaf..64b43239 100644 --- a/BunqSdk/Model/Generated/Endpoint/MonetaryAccountLight.cs +++ b/BunqSdk/Model/Generated/Endpoint/MonetaryAccountLight.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -25,39 +25,39 @@ public class MonetaryAccountLight : BunqModel public const string FIELD_REASON = "reason"; public const string FIELD_REASON_DESCRIPTION = "reason_description"; public const string FIELD_SETTING = "setting"; - - + + /// /// The currency of the MonetaryAccountLight as an ISO 4217 formatted currency code. /// [JsonProperty(PropertyName = "currency")] public string Currency { get; set; } - + /// /// The description of the MonetaryAccountLight. Defaults to 'bunq account'. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The daily spending limit Amount of the MonetaryAccountLight. Defaults to 1000 EUR. Currency must match the /// MonetaryAccountLight's currency. Limited to 10000 EUR. /// [JsonProperty(PropertyName = "daily_limit")] public Amount DailyLimit { get; set; } - + /// /// The UUID of the Avatar of the MonetaryAccountLight. /// [JsonProperty(PropertyName = "avatar_uuid")] public string AvatarUuid { get; set; } - + /// /// The status of the MonetaryAccountLight. Can be: ACTIVE, BLOCKED, CANCELLED or PENDING_REOPEN /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The sub-status of the MonetaryAccountLight providing extra information regarding the status. Will be NONE /// for ACTIVE or PENDING_REOPEN, COMPLETELY or ONLY_ACCEPTING_INCOMING for BLOCKED and REDEMPTION_INVOLUNTARY, @@ -65,117 +65,118 @@ public class MonetaryAccountLight : BunqModel /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The reason for voluntarily cancelling (closing) the MonetaryAccountBank, can only be OTHER. /// [JsonProperty(PropertyName = "reason")] public string Reason { get; set; } - + /// /// The optional free-form reason for voluntarily cancelling (closing) the MonetaryAccountBank. Can be any user /// provided message. /// [JsonProperty(PropertyName = "reason_description")] public string ReasonDescription { get; set; } - + /// /// The settings of the MonetaryAccountLight. /// [JsonProperty(PropertyName = "setting")] public MonetaryAccountSetting Setting { get; set; } - + /// /// The id of the MonetaryAccountLight. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the MonetaryAccountLight's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the MonetaryAccountLight's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The Avatar of the MonetaryAccountLight. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - + /// /// The current available balance Amount of the MonetaryAccountLight. /// [JsonProperty(PropertyName = "balance")] public Amount Balance { get; set; } - + /// /// The Aliases for the MonetaryAccountLight. /// [JsonProperty(PropertyName = "alias")] public List Alias { get; set; } - + /// /// The MonetaryAccountLight's public UUID. /// [JsonProperty(PropertyName = "public_uuid")] public string PublicUuid { get; set; } - + /// /// The id of the User who owns the MonetaryAccountLight. /// [JsonProperty(PropertyName = "user_id")] public int? UserId { get; set; } - + /// /// The maximum balance Amount of the MonetaryAccountLight. /// [JsonProperty(PropertyName = "balance_maximum")] public Amount BalanceMaximum { get; set; } - + /// /// The amount of the monthly budget used. /// [JsonProperty(PropertyName = "budget_month_used")] public Amount BudgetMonthUsed { get; set; } - + /// /// The total amount of the monthly budget. /// [JsonProperty(PropertyName = "budget_month_maximum")] public Amount BudgetMonthMaximum { get; set; } - + /// /// The amount of the yearly budget used. /// [JsonProperty(PropertyName = "budget_year_used")] public Amount BudgetYearUsed { get; set; } - + /// /// The total amount of the yearly budget. /// [JsonProperty(PropertyName = "budget_year_maximum")] public Amount BudgetYearMaximum { get; set; } - + /// /// The amount of the yearly withdrawal budget used. /// [JsonProperty(PropertyName = "budget_withdrawal_year_used")] public Amount BudgetWithdrawalYearUsed { get; set; } - + /// /// The total amount of the yearly withdrawal budget. /// [JsonProperty(PropertyName = "budget_withdrawal_year_maximum")] public Amount BudgetWithdrawalYearMaximum { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -184,125 +185,125 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Avatar != null) { return false; } - + if (this.Currency != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.DailyLimit != null) { return false; } - + if (this.Balance != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.PublicUuid != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.Reason != null) { return false; } - + if (this.ReasonDescription != null) { return false; } - + if (this.UserId != null) { return false; } - + if (this.BalanceMaximum != null) { return false; } - + if (this.BudgetMonthUsed != null) { return false; } - + if (this.BudgetMonthMaximum != null) { return false; } - + if (this.BudgetYearUsed != null) { return false; } - + if (this.BudgetYearMaximum != null) { return false; } - + if (this.BudgetWithdrawalYearUsed != null) { return false; } - + if (this.BudgetWithdrawalYearMaximum != null) { return false; } - + if (this.Setting != null) { return false; } - + return true; } - + /// /// public static MonetaryAccountLight CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/MonetaryAccountProfile.cs b/BunqSdk/Model/Generated/Endpoint/MonetaryAccountProfile.cs index 73547894..7799a56a 100644 --- a/BunqSdk/Model/Generated/Endpoint/MonetaryAccountProfile.cs +++ b/BunqSdk/Model/Generated/Endpoint/MonetaryAccountProfile.cs @@ -1,6 +1,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,21 +15,22 @@ public class MonetaryAccountProfile : BunqModel /// public const string FIELD_PROFILE_FILL = "profile_fill"; public const string FIELD_PROFILE_DRAIN = "profile_drain"; - - + + /// /// The profile settings for triggering the fill of a monetary account. /// [JsonProperty(PropertyName = "profile_fill")] public MonetaryAccountProfileFill ProfileFill { get; set; } - + /// /// The profile settings for moving excesses to a savings account /// [JsonProperty(PropertyName = "profile_drain")] public MonetaryAccountProfileDrain ProfileDrain { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -37,20 +39,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.ProfileDrain != null) { return false; } - + return true; } - + /// /// public static MonetaryAccountProfile CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/MonetaryAccountSavings.cs b/BunqSdk/Model/Generated/Endpoint/MonetaryAccountSavings.cs index f26ff50a..a3dbd44d 100644 --- a/BunqSdk/Model/Generated/Endpoint/MonetaryAccountSavings.cs +++ b/BunqSdk/Model/Generated/Endpoint/MonetaryAccountSavings.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,7 +22,7 @@ public class MonetaryAccountSavings : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account-savings/{1}"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account-savings/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account-savings"; - + /// /// Field constants. /// @@ -35,43 +37,43 @@ public class MonetaryAccountSavings : BunqModel public const string FIELD_ALL_CO_OWNER = "all_co_owner"; public const string FIELD_SETTING = "setting"; public const string FIELD_SAVINGS_GOAL = "savings_goal"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "MonetaryAccountSavings"; - + /// /// The currency of the MonetaryAccountSavings as an ISO 4217 formatted currency code. /// [JsonProperty(PropertyName = "currency")] public string Currency { get; set; } - + /// /// The description of the MonetaryAccountSavings. Defaults to 'bunq account'. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The daily spending limit Amount of the MonetaryAccountSavings. Defaults to 1000 EUR. Currency must match the /// MonetaryAccountSavings's currency. Limited to 10000 EUR. /// [JsonProperty(PropertyName = "daily_limit")] public Amount DailyLimit { get; set; } - + /// /// The UUID of the Avatar of the MonetaryAccountSavings. /// [JsonProperty(PropertyName = "avatar_uuid")] public string AvatarUuid { get; set; } - + /// /// The status of the MonetaryAccountSavings. Can be: ACTIVE, BLOCKED, CANCELLED or PENDING_REOPEN /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The sub-status of the MonetaryAccountSavings providing extra information regarding the status. Will be NONE /// for ACTIVE or PENDING_REOPEN, COMPLETELY or ONLY_ACCEPTING_INCOMING for BLOCKED and REDEMPTION_INVOLUNTARY, @@ -79,111 +81,111 @@ public class MonetaryAccountSavings : BunqModel /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The reason for voluntarily cancelling (closing) the MonetaryAccountSavings, can only be OTHER. /// [JsonProperty(PropertyName = "reason")] public string Reason { get; set; } - + /// /// The optional free-form reason for voluntarily cancelling (closing) the MonetaryAccountSavings. Can be any /// user provided message. /// [JsonProperty(PropertyName = "reason_description")] public string ReasonDescription { get; set; } - + /// /// The users the account will be joint with. /// [JsonProperty(PropertyName = "all_co_owner")] public List AllCoOwner { get; set; } - + /// /// The settings of the MonetaryAccountSavings. /// [JsonProperty(PropertyName = "setting")] public MonetaryAccountSetting Setting { get; set; } - + /// /// The Savings Goal set for this MonetaryAccountSavings. /// [JsonProperty(PropertyName = "savings_goal")] public Amount SavingsGoal { get; set; } - + /// /// The id of the MonetaryAccountSavings. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the MonetaryAccountSavings's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the MonetaryAccountSavings's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The Avatar of the MonetaryAccountSavings. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - + /// /// The maximum Amount the MonetaryAccountSavings can be 'in the red'. Must be 0 EUR or omitted. /// [JsonProperty(PropertyName = "overdraft_limit")] public Amount OverdraftLimit { get; set; } - + /// /// The current available balance Amount of the MonetaryAccountSavings. /// [JsonProperty(PropertyName = "balance")] public Amount Balance { get; set; } - + /// /// The Aliases for the MonetaryAccountSavings. /// [JsonProperty(PropertyName = "alias")] public List Alias { get; set; } - + /// /// The MonetaryAccountSavings's public UUID. /// [JsonProperty(PropertyName = "public_uuid")] public string PublicUuid { get; set; } - + /// /// The id of the User who owns the MonetaryAccountSavings. /// [JsonProperty(PropertyName = "user_id")] public int? UserId { get; set; } - + /// /// The profile of the account. /// [JsonProperty(PropertyName = "monetary_account_profile")] public MonetaryAccountProfile MonetaryAccountProfile { get; set; } - + /// /// The progress in percentages for the Savings Goal set for this MonetaryAccountSavings. /// [JsonProperty(PropertyName = "savings_goal_progress")] public double? SavingsGoalProgress { get; set; } - + /// /// The ids of the AutoSave. /// [JsonProperty(PropertyName = "all_auto_save_id")] public List AllAutoSaveId { get; set; } - - + + /// /// Create new MonetaryAccountSavings. /// @@ -198,53 +200,46 @@ public class MonetaryAccountSavings : BunqModel /// The users the account will be joint with. /// The settings of the MonetaryAccountSavings. /// The Savings Goal set for this MonetaryAccountSavings. - public static BunqResponse Create(string currency, string description = null, Amount dailyLimit = null, - string avatarUuid = null, string status = null, string subStatus = null, string reason = null, - string reasonDescription = null, List allCoOwner = null, MonetaryAccountSetting setting = null, - Amount savingsGoal = null, IDictionary customHeaders = null) + public static BunqResponse Create(string currency, string description = null, Amount dailyLimit = null, string avatarUuid = null, string status = null, string subStatus = null, string reason = null, string reasonDescription = null, List allCoOwner = null, MonetaryAccountSetting setting = null, Amount savingsGoal = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CURRENCY, currency}, - {FIELD_DESCRIPTION, description}, - {FIELD_DAILY_LIMIT, dailyLimit}, - {FIELD_AVATAR_UUID, avatarUuid}, - {FIELD_STATUS, status}, - {FIELD_SUB_STATUS, subStatus}, - {FIELD_REASON, reason}, - {FIELD_REASON_DESCRIPTION, reasonDescription}, - {FIELD_ALL_CO_OWNER, allCoOwner}, - {FIELD_SETTING, setting}, - {FIELD_SAVINGS_GOAL, savingsGoal}, - }; - + { + {FIELD_CURRENCY, currency}, + {FIELD_DESCRIPTION, description}, + {FIELD_DAILY_LIMIT, dailyLimit}, + {FIELD_AVATAR_UUID, avatarUuid}, + {FIELD_STATUS, status}, + {FIELD_SUB_STATUS, subStatus}, + {FIELD_REASON, reason}, + {FIELD_REASON_DESCRIPTION, reasonDescription}, + {FIELD_ALL_CO_OWNER, allCoOwner}, + {FIELD_SETTING, setting}, + {FIELD_SAVINGS_GOAL, savingsGoal}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get a specific MonetaryAccountSavings. /// - public static BunqResponse Get(int monetaryAccountSavingsId, - IDictionary customHeaders = null) + public static BunqResponse Get(int monetaryAccountSavingsId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), monetaryAccountSavingsId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), monetaryAccountSavingsId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Update a specific existing MonetaryAccountSavings. /// @@ -257,53 +252,46 @@ public static BunqResponse Get(int monetaryAccountSaving /// The optional free-form reason for voluntarily cancelling (closing) the MonetaryAccountSavings. Can be any user provided message. Should only be specified if updating the status to CANCELLED. /// The settings of the MonetaryAccountSavings. /// The Savings Goal set for this MonetaryAccountSavings. - public static BunqResponse Update(int monetaryAccountSavingsId, string description = null, - Amount dailyLimit = null, string avatarUuid = null, string status = null, string subStatus = null, - string reason = null, string reasonDescription = null, MonetaryAccountSetting setting = null, - Amount savingsGoal = null, IDictionary customHeaders = null) + public static BunqResponse Update(int monetaryAccountSavingsId, string description = null, Amount dailyLimit = null, string avatarUuid = null, string status = null, string subStatus = null, string reason = null, string reasonDescription = null, MonetaryAccountSetting setting = null, Amount savingsGoal = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_DAILY_LIMIT, dailyLimit}, - {FIELD_AVATAR_UUID, avatarUuid}, - {FIELD_STATUS, status}, - {FIELD_SUB_STATUS, subStatus}, - {FIELD_REASON, reason}, - {FIELD_REASON_DESCRIPTION, reasonDescription}, - {FIELD_SETTING, setting}, - {FIELD_SAVINGS_GOAL, savingsGoal}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_DAILY_LIMIT, dailyLimit}, + {FIELD_AVATAR_UUID, avatarUuid}, + {FIELD_STATUS, status}, + {FIELD_SUB_STATUS, subStatus}, + {FIELD_REASON, reason}, + {FIELD_REASON_DESCRIPTION, reasonDescription}, + {FIELD_SETTING, setting}, + {FIELD_SAVINGS_GOAL, savingsGoal}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), monetaryAccountSavingsId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), monetaryAccountSavingsId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Gets a listing of all MonetaryAccountSavingss of a given user. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -312,120 +300,120 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Avatar != null) { return false; } - + if (this.Currency != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.DailyLimit != null) { return false; } - + if (this.OverdraftLimit != null) { return false; } - + if (this.Balance != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.PublicUuid != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.Reason != null) { return false; } - + if (this.ReasonDescription != null) { return false; } - + if (this.AllCoOwner != null) { return false; } - + if (this.UserId != null) { return false; } - + if (this.MonetaryAccountProfile != null) { return false; } - + if (this.Setting != null) { return false; } - + if (this.SavingsGoal != null) { return false; } - + if (this.SavingsGoalProgress != null) { return false; } - + if (this.AllAutoSaveId != null) { return false; } - + return true; } - + /// /// public static MonetaryAccountSavings CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment.cs index d980fa6c..648af21e 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,179 +18,147 @@ public class NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment : BunqMod /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int switchServicePaymentId, int? attachmentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int switchServicePaymentId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - switchServicePaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int switchServicePaymentId, - int noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId = null, - string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int switchServicePaymentId, int noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - switchServicePaymentId, noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId), requestBytes, - customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId, noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int switchServicePaymentId, - int noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int switchServicePaymentId, int noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - switchServicePaymentId, noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId), - customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId, noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List( - int switchServicePaymentId, int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int switchServicePaymentId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId), urlParams, - customHeaders); - - return FromJsonList(responseRaw, - OBJECT_TYPE_GET); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId), urlParams, customHeaders); + + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get( - int switchServicePaymentId, int noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int switchServicePaymentId, int noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - switchServicePaymentId, noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId, noteAttachmentBankSwitchServiceNetherlandsIncomingPaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -197,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentBankSwitchServiceNetherlandsIncomingPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentBunqMeFundraiserResult.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentBunqMeFundraiserResult.cs index 09b8741a..0b64a2c3 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentBunqMeFundraiserResult.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentBunqMeFundraiserResult.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,176 +18,147 @@ public class NoteAttachmentBunqMeFundraiserResult : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int bunqmeFundraiserResultId, int? attachmentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int bunqmeFundraiserResultId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqmeFundraiserResultId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int bunqmeFundraiserResultId, int noteAttachmentBunqMeFundraiserResultId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int bunqmeFundraiserResultId, int noteAttachmentBunqMeFundraiserResultId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqmeFundraiserResultId, noteAttachmentBunqMeFundraiserResultId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId, noteAttachmentBunqMeFundraiserResultId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int bunqmeFundraiserResultId, - int noteAttachmentBunqMeFundraiserResultId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int bunqmeFundraiserResultId, int noteAttachmentBunqMeFundraiserResultId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqmeFundraiserResultId, noteAttachmentBunqMeFundraiserResultId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId, noteAttachmentBunqMeFundraiserResultId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int bunqmeFundraiserResultId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int bunqmeFundraiserResultId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int bunqmeFundraiserResultId, - int noteAttachmentBunqMeFundraiserResultId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int bunqmeFundraiserResultId, int noteAttachmentBunqMeFundraiserResultId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqmeFundraiserResultId, noteAttachmentBunqMeFundraiserResultId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId, noteAttachmentBunqMeFundraiserResultId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -194,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentBunqMeFundraiserResult CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentDraftPayment.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentDraftPayment.cs index 5e9166fb..3861c8a4 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentDraftPayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentDraftPayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,170 +19,146 @@ public class NoteAttachmentDraftPayment : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/draft-payment/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/draft-payment/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/draft-payment/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/draft-payment/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/draft-payment/{2}/note-attachment/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/draft-payment/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/draft-payment/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/draft-payment/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int draftPaymentId, int? attachmentId, int? monetaryAccountId = null, - string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int draftPaymentId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - draftPaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int draftPaymentId, int noteAttachmentDraftPaymentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int draftPaymentId, int noteAttachmentDraftPaymentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - draftPaymentId, noteAttachmentDraftPaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId, noteAttachmentDraftPaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int draftPaymentId, int noteAttachmentDraftPaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int draftPaymentId, int noteAttachmentDraftPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - draftPaymentId, noteAttachmentDraftPaymentId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId, noteAttachmentDraftPaymentId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int draftPaymentId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int draftPaymentId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int draftPaymentId, int noteAttachmentDraftPaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int draftPaymentId, int noteAttachmentDraftPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - draftPaymentId, noteAttachmentDraftPaymentId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId, noteAttachmentDraftPaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -189,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentDraftPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentIdealMerchantTransaction.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentIdealMerchantTransaction.cs index 470f30a9..edb83245 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentIdealMerchantTransaction.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentIdealMerchantTransaction.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,178 +18,147 @@ public class NoteAttachmentIdealMerchantTransaction : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int idealMerchantTransactionId, int? attachmentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int idealMerchantTransactionId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - idealMerchantTransactionId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int idealMerchantTransactionId, - int noteAttachmentIdealMerchantTransactionId, int? monetaryAccountId = null, string description = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int idealMerchantTransactionId, int noteAttachmentIdealMerchantTransactionId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - idealMerchantTransactionId, noteAttachmentIdealMerchantTransactionId), requestBytes, - customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId, noteAttachmentIdealMerchantTransactionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int idealMerchantTransactionId, - int noteAttachmentIdealMerchantTransactionId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int idealMerchantTransactionId, int noteAttachmentIdealMerchantTransactionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - idealMerchantTransactionId, noteAttachmentIdealMerchantTransactionId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId, noteAttachmentIdealMerchantTransactionId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int idealMerchantTransactionId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int idealMerchantTransactionId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int idealMerchantTransactionId, - int noteAttachmentIdealMerchantTransactionId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int idealMerchantTransactionId, int noteAttachmentIdealMerchantTransactionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - idealMerchantTransactionId, noteAttachmentIdealMerchantTransactionId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId, noteAttachmentIdealMerchantTransactionId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -196,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentIdealMerchantTransaction CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentMasterCardAction.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentMasterCardAction.cs index c16c15e3..9300218d 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentMasterCardAction.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentMasterCardAction.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,175 +18,147 @@ public class NoteAttachmentMasterCardAction : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int mastercardActionId, int? attachmentId, int? monetaryAccountId = null, - string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int mastercardActionId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - mastercardActionId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int mastercardActionId, int noteAttachmentMasterCardActionId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int mastercardActionId, int noteAttachmentMasterCardActionId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - mastercardActionId, noteAttachmentMasterCardActionId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId, noteAttachmentMasterCardActionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int mastercardActionId, int noteAttachmentMasterCardActionId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int mastercardActionId, int noteAttachmentMasterCardActionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - mastercardActionId, noteAttachmentMasterCardActionId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId, noteAttachmentMasterCardActionId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int mastercardActionId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int mastercardActionId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int mastercardActionId, - int noteAttachmentMasterCardActionId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int mastercardActionId, int noteAttachmentMasterCardActionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - mastercardActionId, noteAttachmentMasterCardActionId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId, noteAttachmentMasterCardActionId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -193,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentMasterCardAction CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentPayment.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentPayment.cs index e238fdec..19d92673 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentPayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentPayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,162 +23,142 @@ public class NoteAttachmentPayment : BunqModel protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/payment/{2}/note-attachment/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/payment/{2}/note-attachment"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/payment/{2}/note-attachment/{3}"; - + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int paymentId, int? attachmentId, int? monetaryAccountId = null, - string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int paymentId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int paymentId, int noteAttachmentPaymentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int paymentId, int noteAttachmentPaymentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentId, noteAttachmentPaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId, noteAttachmentPaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int paymentId, int noteAttachmentPaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int paymentId, int noteAttachmentPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentId, noteAttachmentPaymentId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId, noteAttachmentPaymentId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int paymentId, int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int paymentId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), paymentId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int paymentId, int noteAttachmentPaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int paymentId, int noteAttachmentPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentId, noteAttachmentPaymentId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId, noteAttachmentPaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -185,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentPaymentBatch.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentPaymentBatch.cs index 05ef1704..7191cf6e 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentPaymentBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentPaymentBatch.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,170 +19,146 @@ public class NoteAttachmentPaymentBatch : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/payment-batch/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/payment-batch/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/payment-batch/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/payment-batch/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/payment-batch/{2}/note-attachment/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/payment-batch/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/payment-batch/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/payment-batch/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int paymentBatchId, int? attachmentId, int? monetaryAccountId = null, - string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int paymentBatchId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int paymentBatchId, int noteAttachmentPaymentBatchId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int paymentBatchId, int noteAttachmentPaymentBatchId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentBatchId, noteAttachmentPaymentBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId, noteAttachmentPaymentBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int paymentBatchId, int noteAttachmentPaymentBatchId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int paymentBatchId, int noteAttachmentPaymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentBatchId, noteAttachmentPaymentBatchId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId, noteAttachmentPaymentBatchId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int paymentBatchId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int paymentBatchId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int paymentBatchId, int noteAttachmentPaymentBatchId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int paymentBatchId, int noteAttachmentPaymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentBatchId, noteAttachmentPaymentBatchId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId, noteAttachmentPaymentBatchId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -189,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentPaymentBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestInquiry.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestInquiry.cs index 72c7d775..4caae71b 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestInquiry.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestInquiry.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,175 +18,147 @@ public class NoteAttachmentRequestInquiry : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int requestInquiryId, int? attachmentId, int? monetaryAccountId = null, - string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int requestInquiryId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int requestInquiryId, int noteAttachmentRequestInquiryId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int requestInquiryId, int noteAttachmentRequestInquiryId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryId, noteAttachmentRequestInquiryId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId, noteAttachmentRequestInquiryId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int requestInquiryId, int noteAttachmentRequestInquiryId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int requestInquiryId, int noteAttachmentRequestInquiryId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryId, noteAttachmentRequestInquiryId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId, noteAttachmentRequestInquiryId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int requestInquiryId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int requestInquiryId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int requestInquiryId, - int noteAttachmentRequestInquiryId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int requestInquiryId, int noteAttachmentRequestInquiryId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryId, noteAttachmentRequestInquiryId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId, noteAttachmentRequestInquiryId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -193,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentRequestInquiry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestInquiryBatch.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestInquiryBatch.cs index 41a4e5c5..bb87951e 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestInquiryBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestInquiryBatch.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,176 +18,147 @@ public class NoteAttachmentRequestInquiryBatch : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int requestInquiryBatchId, int? attachmentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int requestInquiryBatchId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int requestInquiryBatchId, int noteAttachmentRequestInquiryBatchId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int requestInquiryBatchId, int noteAttachmentRequestInquiryBatchId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryBatchId, noteAttachmentRequestInquiryBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId, noteAttachmentRequestInquiryBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int requestInquiryBatchId, int noteAttachmentRequestInquiryBatchId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int requestInquiryBatchId, int noteAttachmentRequestInquiryBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryBatchId, noteAttachmentRequestInquiryBatchId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId, noteAttachmentRequestInquiryBatchId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int requestInquiryBatchId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int requestInquiryBatchId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int requestInquiryBatchId, - int noteAttachmentRequestInquiryBatchId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int requestInquiryBatchId, int noteAttachmentRequestInquiryBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryBatchId, noteAttachmentRequestInquiryBatchId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId, noteAttachmentRequestInquiryBatchId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -194,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentRequestInquiryBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestResponse.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestResponse.cs index 0e0bc098..4ff8caff 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestResponse.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentRequestResponse.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,175 +18,147 @@ public class NoteAttachmentRequestResponse : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/request-response/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/request-response/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/request-response/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/request-response/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/request-response/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/request-response/{2}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/request-response/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/request-response/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/request-response/{2}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/request-response/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int requestResponseId, int? attachmentId, int? monetaryAccountId = null, - string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int requestResponseId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestResponseId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int requestResponseId, int noteAttachmentRequestResponseId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int requestResponseId, int noteAttachmentRequestResponseId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestResponseId, noteAttachmentRequestResponseId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId, noteAttachmentRequestResponseId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int requestResponseId, int noteAttachmentRequestResponseId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int requestResponseId, int noteAttachmentRequestResponseId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestResponseId, noteAttachmentRequestResponseId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId, noteAttachmentRequestResponseId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int requestResponseId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int requestResponseId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), requestResponseId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int requestResponseId, - int noteAttachmentRequestResponseId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int requestResponseId, int noteAttachmentRequestResponseId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestResponseId, noteAttachmentRequestResponseId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId, noteAttachmentRequestResponseId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -193,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentRequestResponse CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentScheduleInstance.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentScheduleInstance.cs index 23d4df6e..c29f5ab7 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentScheduleInstance.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentScheduleInstance.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,177 +18,147 @@ public class NoteAttachmentScheduleInstance : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-attachment/{4}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-attachment/{4}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-attachment/{4}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-attachment/{4}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-attachment/{4}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-attachment/{4}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int scheduleId, int scheduleInstanceId, int? attachmentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int scheduleId, int scheduleInstanceId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId, scheduleInstanceId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int scheduleId, int scheduleInstanceId, - int noteAttachmentScheduleInstanceId, int? monetaryAccountId = null, string description = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int scheduleId, int scheduleInstanceId, int noteAttachmentScheduleInstanceId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId, scheduleInstanceId, noteAttachmentScheduleInstanceId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId, noteAttachmentScheduleInstanceId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int scheduleId, int scheduleInstanceId, - int noteAttachmentScheduleInstanceId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int scheduleId, int scheduleInstanceId, int noteAttachmentScheduleInstanceId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId, scheduleInstanceId, noteAttachmentScheduleInstanceId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId, noteAttachmentScheduleInstanceId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int scheduleId, int scheduleInstanceId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int scheduleId, int scheduleInstanceId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int scheduleId, int scheduleInstanceId, - int noteAttachmentScheduleInstanceId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int scheduleId, int scheduleInstanceId, int noteAttachmentScheduleInstanceId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId, scheduleInstanceId, noteAttachmentScheduleInstanceId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId, noteAttachmentScheduleInstanceId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -195,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentScheduleInstance CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSchedulePayment.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSchedulePayment.cs index 247e12a6..d823e126 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSchedulePayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSchedulePayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,175 +18,147 @@ public class NoteAttachmentSchedulePayment : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int schedulePaymentId, int? attachmentId, int? monetaryAccountId = null, - string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int schedulePaymentId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int schedulePaymentId, int noteAttachmentSchedulePaymentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int schedulePaymentId, int noteAttachmentSchedulePaymentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId, noteAttachmentSchedulePaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId, noteAttachmentSchedulePaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int schedulePaymentId, int noteAttachmentSchedulePaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int schedulePaymentId, int noteAttachmentSchedulePaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId, noteAttachmentSchedulePaymentId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId, noteAttachmentSchedulePaymentId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int schedulePaymentId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int schedulePaymentId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int schedulePaymentId, - int noteAttachmentSchedulePaymentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int schedulePaymentId, int noteAttachmentSchedulePaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId, noteAttachmentSchedulePaymentId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId, noteAttachmentSchedulePaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -193,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentSchedulePayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSchedulePaymentBatch.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSchedulePaymentBatch.cs index 4b6f9f86..46a685ca 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSchedulePaymentBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSchedulePaymentBatch.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,176 +18,147 @@ public class NoteAttachmentSchedulePaymentBatch : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int schedulePaymentBatchId, int? attachmentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int schedulePaymentBatchId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int schedulePaymentBatchId, int noteAttachmentSchedulePaymentBatchId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Update(int schedulePaymentBatchId, int noteAttachmentSchedulePaymentBatchId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentBatchId, noteAttachmentSchedulePaymentBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId, noteAttachmentSchedulePaymentBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int schedulePaymentBatchId, int noteAttachmentSchedulePaymentBatchId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int schedulePaymentBatchId, int noteAttachmentSchedulePaymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentBatchId, noteAttachmentSchedulePaymentBatchId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId, noteAttachmentSchedulePaymentBatchId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int schedulePaymentBatchId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int schedulePaymentBatchId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int schedulePaymentBatchId, - int noteAttachmentSchedulePaymentBatchId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int schedulePaymentBatchId, int noteAttachmentSchedulePaymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentBatchId, noteAttachmentSchedulePaymentBatchId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId, noteAttachmentSchedulePaymentBatchId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -194,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentSchedulePaymentBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSofortMerchantTransaction.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSofortMerchantTransaction.cs index f5eb9a93..9884f654 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSofortMerchantTransaction.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentSofortMerchantTransaction.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,178 +18,147 @@ public class NoteAttachmentSofortMerchantTransaction : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-attachment/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-attachment/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-attachment/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-attachment/{3}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int sofortMerchantTransactionId, int? attachmentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int sofortMerchantTransactionId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - sofortMerchantTransactionId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int sofortMerchantTransactionId, - int noteAttachmentSofortMerchantTransactionId, int? monetaryAccountId = null, string description = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int sofortMerchantTransactionId, int noteAttachmentSofortMerchantTransactionId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - sofortMerchantTransactionId, noteAttachmentSofortMerchantTransactionId), requestBytes, - customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId, noteAttachmentSofortMerchantTransactionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int sofortMerchantTransactionId, - int noteAttachmentSofortMerchantTransactionId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int sofortMerchantTransactionId, int noteAttachmentSofortMerchantTransactionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - sofortMerchantTransactionId, noteAttachmentSofortMerchantTransactionId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId, noteAttachmentSofortMerchantTransactionId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int sofortMerchantTransactionId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int sofortMerchantTransactionId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int sofortMerchantTransactionId, - int noteAttachmentSofortMerchantTransactionId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int sofortMerchantTransactionId, int noteAttachmentSofortMerchantTransactionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - sofortMerchantTransactionId, noteAttachmentSofortMerchantTransactionId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId, noteAttachmentSofortMerchantTransactionId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -196,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentSofortMerchantTransaction CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentWhitelistResult.cs b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentWhitelistResult.cs index 853ef0b7..b086a964 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteAttachmentWhitelistResult.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteAttachmentWhitelistResult.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,177 +18,147 @@ public class NoteAttachmentWhitelistResult : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-attachment"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-attachment/{4}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-attachment/{4}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-attachment"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-attachment/{4}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-attachment"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-attachment/{4}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-attachment/{4}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-attachment"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-attachment/{4}"; + /// /// Field constants. /// public const string FIELD_DESCRIPTION = "description"; public const string FIELD_ATTACHMENT_ID = "attachment_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteAttachment"; - + /// /// Optional description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The reference to the uploaded file to attach to this note. /// [JsonProperty(PropertyName = "attachment_id")] public int? AttachmentId { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - + /// /// The attachment attached to the note. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - - + + /// /// /// The reference to the uploaded file to attach to this note. /// Optional description of the attachment. - public static BunqResponse Create(int whitelistId, int whitelistResultId, int? attachmentId, - int? monetaryAccountId = null, string description = null, IDictionary customHeaders = null) + public static BunqResponse Create(int whitelistId, int whitelistResultId, int? attachmentId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT_ID, attachmentId}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT_ID, attachmentId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - whitelistId, whitelistResultId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// Optional description of the attachment. - public static BunqResponse Update(int whitelistId, int whitelistResultId, - int noteAttachmentWhitelistResultId, int? monetaryAccountId = null, string description = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int whitelistId, int whitelistResultId, int noteAttachmentWhitelistResultId, int? monetaryAccountId= null, string description = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - }; - + { + {FIELD_DESCRIPTION, description}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - whitelistId, whitelistResultId, noteAttachmentWhitelistResultId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId, noteAttachmentWhitelistResultId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int whitelistId, int whitelistResultId, - int noteAttachmentWhitelistResultId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int whitelistId, int whitelistResultId, int noteAttachmentWhitelistResultId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - whitelistId, whitelistResultId, noteAttachmentWhitelistResultId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId, noteAttachmentWhitelistResultId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int whitelistId, int whitelistResultId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int whitelistId, int whitelistResultId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int whitelistId, int whitelistResultId, - int noteAttachmentWhitelistResultId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int whitelistId, int whitelistResultId, int noteAttachmentWhitelistResultId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - whitelistId, whitelistResultId, noteAttachmentWhitelistResultId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId, noteAttachmentWhitelistResultId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -195,40 +167,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static NoteAttachmentWhitelistResult CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextBankSwitchServiceNetherlandsIncomingPayment.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextBankSwitchServiceNetherlandsIncomingPayment.cs index 0e84e1b6..cb92f6d9 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextBankSwitchServiceNetherlandsIncomingPayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextBankSwitchServiceNetherlandsIncomingPayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,163 +18,132 @@ public class NoteTextBankSwitchServiceNetherlandsIncomingPayment : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-text"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-text"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-text/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-text"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-text"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/switch-service-payment/{2}/note-text/{3}"; + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int switchServicePaymentId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int switchServicePaymentId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - switchServicePaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int switchServicePaymentId, - int noteTextBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int switchServicePaymentId, int noteTextBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - switchServicePaymentId, noteTextBankSwitchServiceNetherlandsIncomingPaymentId), requestBytes, - customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId, noteTextBankSwitchServiceNetherlandsIncomingPaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int switchServicePaymentId, - int noteTextBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int switchServicePaymentId, int noteTextBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - switchServicePaymentId, noteTextBankSwitchServiceNetherlandsIncomingPaymentId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId, noteTextBankSwitchServiceNetherlandsIncomingPaymentId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List( - int switchServicePaymentId, int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int switchServicePaymentId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int switchServicePaymentId, - int noteTextBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int switchServicePaymentId, int noteTextBankSwitchServiceNetherlandsIncomingPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - switchServicePaymentId, noteTextBankSwitchServiceNetherlandsIncomingPaymentId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), switchServicePaymentId, noteTextBankSwitchServiceNetherlandsIncomingPaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -181,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextBankSwitchServiceNetherlandsIncomingPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextBunqMeFundraiserResult.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextBunqMeFundraiserResult.cs index d85c4326..b871b5b7 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextBunqMeFundraiserResult.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextBunqMeFundraiserResult.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,161 +18,132 @@ public class NoteTextBunqMeFundraiserResult : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-text"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-text"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-text/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-text"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-text"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/bunqme-fundraiser-result/{2}/note-text/{3}"; + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int bunqmeFundraiserResultId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int bunqmeFundraiserResultId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqmeFundraiserResultId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int bunqmeFundraiserResultId, int noteTextBunqMeFundraiserResultId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int bunqmeFundraiserResultId, int noteTextBunqMeFundraiserResultId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqmeFundraiserResultId, noteTextBunqMeFundraiserResultId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId, noteTextBunqMeFundraiserResultId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int bunqmeFundraiserResultId, int noteTextBunqMeFundraiserResultId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int bunqmeFundraiserResultId, int noteTextBunqMeFundraiserResultId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqmeFundraiserResultId, noteTextBunqMeFundraiserResultId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId, noteTextBunqMeFundraiserResultId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int bunqmeFundraiserResultId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int bunqmeFundraiserResultId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int bunqmeFundraiserResultId, - int noteTextBunqMeFundraiserResultId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int bunqmeFundraiserResultId, int noteTextBunqMeFundraiserResultId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - bunqmeFundraiserResultId, noteTextBunqMeFundraiserResultId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), bunqmeFundraiserResultId, noteTextBunqMeFundraiserResultId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -179,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextBunqMeFundraiserResult CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextDraftPayment.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextDraftPayment.cs index 74794db4..017bb573 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextDraftPayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextDraftPayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,147 +23,127 @@ public class NoteTextDraftPayment : BunqModel protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/draft-payment/{2}/note-text/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/draft-payment/{2}/note-text"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/draft-payment/{2}/note-text/{3}"; - + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int draftPaymentId, int? monetaryAccountId = null, string content = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int draftPaymentId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - draftPaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int draftPaymentId, int noteTextDraftPaymentId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int draftPaymentId, int noteTextDraftPaymentId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - draftPaymentId, noteTextDraftPaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId, noteTextDraftPaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int draftPaymentId, int noteTextDraftPaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int draftPaymentId, int noteTextDraftPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - draftPaymentId, noteTextDraftPaymentId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId, noteTextDraftPaymentId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int draftPaymentId, int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int draftPaymentId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int draftPaymentId, int noteTextDraftPaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int draftPaymentId, int noteTextDraftPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - draftPaymentId, noteTextDraftPaymentId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), draftPaymentId, noteTextDraftPaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -170,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextDraftPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextIdealMerchantTransaction.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextIdealMerchantTransaction.cs index 33042ca8..374b090c 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextIdealMerchantTransaction.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextIdealMerchantTransaction.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,161 +18,132 @@ public class NoteTextIdealMerchantTransaction : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-text"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-text"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-text/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-text"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-text"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/ideal-merchant-transaction/{2}/note-text/{3}"; + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int idealMerchantTransactionId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int idealMerchantTransactionId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - idealMerchantTransactionId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int idealMerchantTransactionId, int noteTextIdealMerchantTransactionId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int idealMerchantTransactionId, int noteTextIdealMerchantTransactionId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - idealMerchantTransactionId, noteTextIdealMerchantTransactionId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId, noteTextIdealMerchantTransactionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int idealMerchantTransactionId, - int noteTextIdealMerchantTransactionId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int idealMerchantTransactionId, int noteTextIdealMerchantTransactionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - idealMerchantTransactionId, noteTextIdealMerchantTransactionId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId, noteTextIdealMerchantTransactionId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int idealMerchantTransactionId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int idealMerchantTransactionId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int idealMerchantTransactionId, - int noteTextIdealMerchantTransactionId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int idealMerchantTransactionId, int noteTextIdealMerchantTransactionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - idealMerchantTransactionId, noteTextIdealMerchantTransactionId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), idealMerchantTransactionId, noteTextIdealMerchantTransactionId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -179,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextIdealMerchantTransaction CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextMasterCardAction.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextMasterCardAction.cs index 442c69ca..48cd2f92 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextMasterCardAction.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextMasterCardAction.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,155 +19,131 @@ public class NoteTextMasterCardAction : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-text"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-text/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-text"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/mastercard-action/{2}/note-text/{3}"; - + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int mastercardActionId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int mastercardActionId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - mastercardActionId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int mastercardActionId, int noteTextMasterCardActionId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int mastercardActionId, int noteTextMasterCardActionId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - mastercardActionId, noteTextMasterCardActionId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId, noteTextMasterCardActionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int mastercardActionId, int noteTextMasterCardActionId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int mastercardActionId, int noteTextMasterCardActionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - mastercardActionId, noteTextMasterCardActionId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId, noteTextMasterCardActionId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int mastercardActionId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int mastercardActionId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int mastercardActionId, int noteTextMasterCardActionId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int mastercardActionId, int noteTextMasterCardActionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - mastercardActionId, noteTextMasterCardActionId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), mastercardActionId, noteTextMasterCardActionId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -174,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextMasterCardAction CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextPayment.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextPayment.cs index a44b47ec..bab45d5d 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextPayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextPayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,147 +23,127 @@ public class NoteTextPayment : BunqModel protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/payment/{2}/note-text/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/payment/{2}/note-text"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/payment/{2}/note-text/{3}"; - + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int paymentId, int? monetaryAccountId = null, string content = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int paymentId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int paymentId, int noteTextPaymentId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int paymentId, int noteTextPaymentId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentId, noteTextPaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId, noteTextPaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int paymentId, int noteTextPaymentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int paymentId, int noteTextPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentId, noteTextPaymentId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId, noteTextPaymentId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int paymentId, int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int paymentId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), paymentId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int paymentId, int noteTextPaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int paymentId, int noteTextPaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentId, noteTextPaymentId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId, noteTextPaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -170,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextPaymentBatch.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextPaymentBatch.cs index 27ecaeb0..b4c810b0 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextPaymentBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextPaymentBatch.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,147 +23,127 @@ public class NoteTextPaymentBatch : BunqModel protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/payment-batch/{2}/note-text/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/payment-batch/{2}/note-text"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/payment-batch/{2}/note-text/{3}"; - + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int paymentBatchId, int? monetaryAccountId = null, string content = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int paymentBatchId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int paymentBatchId, int noteTextPaymentBatchId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int paymentBatchId, int noteTextPaymentBatchId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentBatchId, noteTextPaymentBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId, noteTextPaymentBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int paymentBatchId, int noteTextPaymentBatchId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int paymentBatchId, int noteTextPaymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentBatchId, noteTextPaymentBatchId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId, noteTextPaymentBatchId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int paymentBatchId, int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int paymentBatchId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int paymentBatchId, int noteTextPaymentBatchId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int paymentBatchId, int noteTextPaymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentBatchId, noteTextPaymentBatchId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId, noteTextPaymentBatchId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -170,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextPaymentBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextRequestInquiry.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextRequestInquiry.cs index ba0046de..85e05c96 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextRequestInquiry.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextRequestInquiry.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,148 +23,127 @@ public class NoteTextRequestInquiry : BunqModel protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-text/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-text"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/request-inquiry/{2}/note-text/{3}"; - + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int requestInquiryId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int requestInquiryId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int requestInquiryId, int noteTextRequestInquiryId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int requestInquiryId, int noteTextRequestInquiryId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryId, noteTextRequestInquiryId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId, noteTextRequestInquiryId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int requestInquiryId, int noteTextRequestInquiryId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int requestInquiryId, int noteTextRequestInquiryId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryId, noteTextRequestInquiryId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId, noteTextRequestInquiryId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int requestInquiryId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int requestInquiryId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int requestInquiryId, int noteTextRequestInquiryId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int requestInquiryId, int noteTextRequestInquiryId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryId, noteTextRequestInquiryId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId, noteTextRequestInquiryId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -171,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextRequestInquiry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextRequestInquiryBatch.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextRequestInquiryBatch.cs index a3c9e3aa..c0d3d1dd 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextRequestInquiryBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextRequestInquiryBatch.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,161 +18,132 @@ public class NoteTextRequestInquiryBatch : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-text"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-text"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-text/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-text"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-text"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}/note-text/{3}"; + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int requestInquiryBatchId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int requestInquiryBatchId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int requestInquiryBatchId, int noteTextRequestInquiryBatchId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int requestInquiryBatchId, int noteTextRequestInquiryBatchId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryBatchId, noteTextRequestInquiryBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId, noteTextRequestInquiryBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int requestInquiryBatchId, int noteTextRequestInquiryBatchId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int requestInquiryBatchId, int noteTextRequestInquiryBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryBatchId, noteTextRequestInquiryBatchId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId, noteTextRequestInquiryBatchId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int requestInquiryBatchId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int requestInquiryBatchId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int requestInquiryBatchId, - int noteTextRequestInquiryBatchId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int requestInquiryBatchId, int noteTextRequestInquiryBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryBatchId, noteTextRequestInquiryBatchId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId, noteTextRequestInquiryBatchId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -179,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextRequestInquiryBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextRequestResponse.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextRequestResponse.cs index cb1e8e94..9305dd66 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextRequestResponse.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextRequestResponse.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,148 +23,127 @@ public class NoteTextRequestResponse : BunqModel protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/request-response/{2}/note-text/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/request-response/{2}/note-text"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/request-response/{2}/note-text/{3}"; - + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int requestResponseId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int requestResponseId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestResponseId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int requestResponseId, int noteTextRequestResponseId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int requestResponseId, int noteTextRequestResponseId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestResponseId, noteTextRequestResponseId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId, noteTextRequestResponseId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int requestResponseId, int noteTextRequestResponseId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int requestResponseId, int noteTextRequestResponseId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestResponseId, noteTextRequestResponseId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId, noteTextRequestResponseId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int requestResponseId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int requestResponseId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), requestResponseId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int requestResponseId, int noteTextRequestResponseId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int requestResponseId, int noteTextRequestResponseId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestResponseId, noteTextRequestResponseId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId, noteTextRequestResponseId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -171,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextRequestResponse CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextScheduleInstance.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextScheduleInstance.cs index c1bcd68a..61ab9c4a 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextScheduleInstance.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextScheduleInstance.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,162 +18,132 @@ public class NoteTextScheduleInstance : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-text"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-text/{4}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-text/{4}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-text"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-text/{4}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-text"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-text/{4}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-text/{4}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-text"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}/note-text/{4}"; + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int scheduleId, int scheduleInstanceId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int scheduleId, int scheduleInstanceId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId, scheduleInstanceId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int scheduleId, int scheduleInstanceId, int noteTextScheduleInstanceId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int scheduleId, int scheduleInstanceId, int noteTextScheduleInstanceId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId, scheduleInstanceId, noteTextScheduleInstanceId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId, noteTextScheduleInstanceId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int scheduleId, int scheduleInstanceId, - int noteTextScheduleInstanceId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int scheduleId, int scheduleInstanceId, int noteTextScheduleInstanceId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId, scheduleInstanceId, noteTextScheduleInstanceId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId, noteTextScheduleInstanceId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int scheduleId, int scheduleInstanceId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int scheduleId, int scheduleInstanceId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int scheduleId, int scheduleInstanceId, - int noteTextScheduleInstanceId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int scheduleId, int scheduleInstanceId, int noteTextScheduleInstanceId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId, scheduleInstanceId, noteTextScheduleInstanceId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId, noteTextScheduleInstanceId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -180,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextScheduleInstance CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextSchedulePayment.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextSchedulePayment.cs index 1fc90f15..52ec1061 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextSchedulePayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextSchedulePayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,148 +23,127 @@ public class NoteTextSchedulePayment : BunqModel protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-text/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-text"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/schedule-payment/{2}/note-text/{3}"; - + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int schedulePaymentId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int schedulePaymentId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int schedulePaymentId, int noteTextSchedulePaymentId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int schedulePaymentId, int noteTextSchedulePaymentId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId, noteTextSchedulePaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId, noteTextSchedulePaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int schedulePaymentId, int noteTextSchedulePaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int schedulePaymentId, int noteTextSchedulePaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId, noteTextSchedulePaymentId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId, noteTextSchedulePaymentId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int schedulePaymentId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int schedulePaymentId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int schedulePaymentId, int noteTextSchedulePaymentId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int schedulePaymentId, int noteTextSchedulePaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId, noteTextSchedulePaymentId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId, noteTextSchedulePaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -171,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextSchedulePayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextSchedulePaymentBatch.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextSchedulePaymentBatch.cs index 34f8698f..d21a721f 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextSchedulePaymentBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextSchedulePaymentBatch.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,161 +18,132 @@ public class NoteTextSchedulePaymentBatch : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-text"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-text"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-text/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-text"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-text"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}/note-text/{3}"; + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int schedulePaymentBatchId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int schedulePaymentBatchId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int schedulePaymentBatchId, int noteTextSchedulePaymentBatchId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int schedulePaymentBatchId, int noteTextSchedulePaymentBatchId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentBatchId, noteTextSchedulePaymentBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId, noteTextSchedulePaymentBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int schedulePaymentBatchId, int noteTextSchedulePaymentBatchId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int schedulePaymentBatchId, int noteTextSchedulePaymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentBatchId, noteTextSchedulePaymentBatchId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId, noteTextSchedulePaymentBatchId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int schedulePaymentBatchId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int schedulePaymentBatchId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int schedulePaymentBatchId, - int noteTextSchedulePaymentBatchId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int schedulePaymentBatchId, int noteTextSchedulePaymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentBatchId, noteTextSchedulePaymentBatchId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId, noteTextSchedulePaymentBatchId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -179,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextSchedulePaymentBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextSofortMerchantTransaction.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextSofortMerchantTransaction.cs index 7fb60cca..a24fbceb 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextSofortMerchantTransaction.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextSofortMerchantTransaction.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,161 +18,132 @@ public class NoteTextSofortMerchantTransaction : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-text"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-text/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-text"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-text/{3}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-text"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-text/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-text"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}/note-text/{3}"; + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int sofortMerchantTransactionId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int sofortMerchantTransactionId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - sofortMerchantTransactionId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int sofortMerchantTransactionId, int noteTextSofortMerchantTransactionId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int sofortMerchantTransactionId, int noteTextSofortMerchantTransactionId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - sofortMerchantTransactionId, noteTextSofortMerchantTransactionId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId, noteTextSofortMerchantTransactionId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int sofortMerchantTransactionId, - int noteTextSofortMerchantTransactionId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int sofortMerchantTransactionId, int noteTextSofortMerchantTransactionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - sofortMerchantTransactionId, noteTextSofortMerchantTransactionId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId, noteTextSofortMerchantTransactionId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int sofortMerchantTransactionId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int sofortMerchantTransactionId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int sofortMerchantTransactionId, - int noteTextSofortMerchantTransactionId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int sofortMerchantTransactionId, int noteTextSofortMerchantTransactionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - sofortMerchantTransactionId, noteTextSofortMerchantTransactionId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId, noteTextSofortMerchantTransactionId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -179,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextSofortMerchantTransaction CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NoteTextWhitelistResult.cs b/BunqSdk/Model/Generated/Endpoint/NoteTextWhitelistResult.cs index 51a05a55..5c40e7d2 100644 --- a/BunqSdk/Model/Generated/Endpoint/NoteTextWhitelistResult.cs +++ b/BunqSdk/Model/Generated/Endpoint/NoteTextWhitelistResult.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,161 +18,132 @@ public class NoteTextWhitelistResult : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-text"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-text/{4}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-text/{4}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-text"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-text/{4}"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-text"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-text/{4}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-text/{4}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-text"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/whitelist/{2}/whitelist-result/{3}/note-text/{4}"; + /// /// Field constants. /// public const string FIELD_CONTENT = "content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NoteText"; - + /// /// The content of the note. /// [JsonProperty(PropertyName = "content")] public string Content { get; set; } - + /// /// The id of the note. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The label of the user who created this note. /// [JsonProperty(PropertyName = "label_user_creator")] public LabelUser LabelUserCreator { get; set; } - - + + /// /// /// The content of the note. - public static BunqResponse Create(int whitelistId, int whitelistResultId, int? monetaryAccountId = null, - string content = null, IDictionary customHeaders = null) + public static BunqResponse Create(int whitelistId, int whitelistResultId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - whitelistId, whitelistResultId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The content of the note. - public static BunqResponse Update(int whitelistId, int whitelistResultId, int noteTextWhitelistResultId, - int? monetaryAccountId = null, string content = null, IDictionary customHeaders = null) + public static BunqResponse Update(int whitelistId, int whitelistResultId, int noteTextWhitelistResultId, int? monetaryAccountId= null, string content = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CONTENT, content}, - }; - + { + {FIELD_CONTENT, content}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - whitelistId, whitelistResultId, noteTextWhitelistResultId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId, noteTextWhitelistResultId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int whitelistId, int whitelistResultId, int noteTextWhitelistResultId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int whitelistId, int whitelistResultId, int noteTextWhitelistResultId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - whitelistId, whitelistResultId, noteTextWhitelistResultId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId, noteTextWhitelistResultId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Manage the notes for a given user. /// - public static BunqResponse> List(int whitelistId, int whitelistResultId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int whitelistId, int whitelistResultId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int whitelistId, int whitelistResultId, - int noteTextWhitelistResultId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int whitelistId, int whitelistResultId, int noteTextWhitelistResultId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - whitelistId, whitelistResultId, noteTextWhitelistResultId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistId, whitelistResultId, noteTextWhitelistResultId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -179,35 +152,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.LabelUserCreator != null) { return false; } - + if (this.Content != null) { return false; } - + return true; } - + /// /// public static NoteTextWhitelistResult CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NotificationFilterPushUser.cs b/BunqSdk/Model/Generated/Endpoint/NotificationFilterPushUser.cs index 93518420..1a5149de 100644 --- a/BunqSdk/Model/Generated/Endpoint/NotificationFilterPushUser.cs +++ b/BunqSdk/Model/Generated/Endpoint/NotificationFilterPushUser.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,62 +20,58 @@ public class NotificationFilterPushUser : BunqModel /// protected const string ENDPOINT_URL_CREATE = "user/{0}/notification-filter-push"; protected const string ENDPOINT_URL_LISTING = "user/{0}/notification-filter-push"; - + /// /// Field constants. /// public const string FIELD_NOTIFICATION_FILTERS = "notification_filters"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "NotificationFilterPush"; private const string OBJECT_TYPE_GET = "NotificationFilterPush"; - + /// /// The types of notifications that will result in a push notification for this user. /// [JsonProperty(PropertyName = "notification_filters")] public List NotificationFilters { get; set; } - + /// /// /// The types of notifications that will result in a push notification for this user. - public static BunqResponse Create( - List notificationFilters = null, IDictionary customHeaders = null) + public static BunqResponse Create(List notificationFilters = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_NOTIFICATION_FILTERS, notificationFilters}, - }; - + { + {FIELD_NOTIFICATION_FILTERS, notificationFilters}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_POST); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -82,15 +80,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static NotificationFilterPushUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NotificationFilterUrlMonetaryAccount.cs b/BunqSdk/Model/Generated/Endpoint/NotificationFilterUrlMonetaryAccount.cs index 2bce4202..8bcb115a 100644 --- a/BunqSdk/Model/Generated/Endpoint/NotificationFilterUrlMonetaryAccount.cs +++ b/BunqSdk/Model/Generated/Endpoint/NotificationFilterUrlMonetaryAccount.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,65 +20,57 @@ public class NotificationFilterUrlMonetaryAccount : BunqModel /// protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/notification-filter-url"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/notification-filter-url"; - + /// /// Field constants. /// public const string FIELD_NOTIFICATION_FILTERS = "notification_filters"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NotificationFilterUrl"; - + /// /// The types of notifications that will result in a url notification for this monetary account. /// [JsonProperty(PropertyName = "notification_filters")] public List NotificationFilters { get; set; } - + /// /// /// The types of notifications that will result in a url notification for this monetary account. - public static BunqResponse Create(int? monetaryAccountId = null, - List notificationFilters = null, IDictionary customHeaders = null) + public static BunqResponse Create(int? monetaryAccountId= null, List notificationFilters = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_NOTIFICATION_FILTERS, notificationFilters}, - }; - + { + {FIELD_NOTIFICATION_FILTERS, notificationFilters}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -85,15 +79,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static NotificationFilterUrlMonetaryAccount CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/NotificationFilterUrlUser.cs b/BunqSdk/Model/Generated/Endpoint/NotificationFilterUrlUser.cs index abc821a2..b7d3e1dc 100644 --- a/BunqSdk/Model/Generated/Endpoint/NotificationFilterUrlUser.cs +++ b/BunqSdk/Model/Generated/Endpoint/NotificationFilterUrlUser.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,61 +20,57 @@ public class NotificationFilterUrlUser : BunqModel /// protected const string ENDPOINT_URL_CREATE = "user/{0}/notification-filter-url"; protected const string ENDPOINT_URL_LISTING = "user/{0}/notification-filter-url"; - + /// /// Field constants. /// public const string FIELD_NOTIFICATION_FILTERS = "notification_filters"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "NotificationFilterUrl"; - + /// /// The types of notifications that will result in a url notification for this user. /// [JsonProperty(PropertyName = "notification_filters")] public List NotificationFilters { get; set; } - + /// /// /// The types of notifications that will result in a url notification for this user. - public static BunqResponse Create(List notificationFilters = null, - IDictionary customHeaders = null) + public static BunqResponse Create(List notificationFilters = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_NOTIFICATION_FILTERS, notificationFilters}, - }; - + { + {FIELD_NOTIFICATION_FILTERS, notificationFilters}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -81,15 +79,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static NotificationFilterUrlUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/OauthCallbackUrl.cs b/BunqSdk/Model/Generated/Endpoint/OauthCallbackUrl.cs index 0868ee52..3a755c8d 100644 --- a/BunqSdk/Model/Generated/Endpoint/OauthCallbackUrl.cs +++ b/BunqSdk/Model/Generated/Endpoint/OauthCallbackUrl.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,115 +22,101 @@ public class OauthCallbackUrl : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/oauth-client/{1}/callback-url/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/oauth-client/{1}/callback-url"; protected const string ENDPOINT_URL_DELETE = "user/{0}/oauth-client/{1}/callback-url/{2}"; - + /// /// Field constants. /// public const string FIELD_URL = "url"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "OauthCallbackUrl"; - + /// /// The URL for this callback. /// [JsonProperty(PropertyName = "url")] public string Url { get; set; } - + /// /// - public static BunqResponse Get(int oauthClientId, int oauthCallbackUrlId, - IDictionary customHeaders = null) + public static BunqResponse Get(int oauthClientId, int oauthCallbackUrlId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), oauthClientId, oauthCallbackUrlId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), oauthClientId, oauthCallbackUrlId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// The URL for this callback. - public static BunqResponse Create(int oauthClientId, string url, - IDictionary customHeaders = null) + public static BunqResponse Create(int oauthClientId, string url, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_URL, url}, - }; - + { + {FIELD_URL, url}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), oauthClientId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), oauthClientId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The URL for this callback. - public static BunqResponse Update(int oauthClientId, int oauthCallbackUrlId, string url = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int oauthClientId, int oauthCallbackUrlId, string url = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_URL, url}, - }; - + { + {FIELD_URL, url}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), oauthClientId, oauthCallbackUrlId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), oauthClientId, oauthCallbackUrlId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(int oauthClientId, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int oauthClientId, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), oauthClientId), - urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), oauthClientId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Delete(int oauthClientId, int oauthCallbackUrlId, - IDictionary customHeaders = null) + public static BunqResponse Delete(int oauthClientId, int oauthCallbackUrlId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), oauthClientId, oauthCallbackUrlId), - customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), oauthClientId, oauthCallbackUrlId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() @@ -137,15 +125,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static OauthCallbackUrl CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/OauthClient.cs b/BunqSdk/Model/Generated/Endpoint/OauthClient.cs index 76d84754..b6dc8044 100644 --- a/BunqSdk/Model/Generated/Endpoint/OauthClient.cs +++ b/BunqSdk/Model/Generated/Endpoint/OauthClient.cs @@ -1,9 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,120 +22,120 @@ public class OauthClient : BunqModel protected const string ENDPOINT_URL_CREATE = "user/{0}/oauth-client"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/oauth-client/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/oauth-client"; - + /// /// Field constants. /// public const string FIELD_STATUS = "status"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "OauthClient"; - + /// /// The status of the pack group, can be ACTIVE, CANCELLED or CANCELLED_PENDING. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// Id of the client. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + + /// + /// The display name of this Oauth Client + /// + [JsonProperty(PropertyName = "display_name")] + public string DisplayName { get; set; } + /// /// The Client ID associated with this Oauth Client /// [JsonProperty(PropertyName = "client_id")] public string ClientId { get; set; } - + /// /// Secret associated with this Oauth Client /// [JsonProperty(PropertyName = "secret")] public string Secret { get; set; } - + /// /// The callback URLs which are bound to this Oauth Client /// [JsonProperty(PropertyName = "callback_url")] public List CallbackUrl { get; set; } - - + + /// /// public static BunqResponse Get(int oauthClientId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), oauthClientId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), oauthClientId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// The status of the Oauth Client, can be ACTIVE or CANCELLED. public static BunqResponse Create(string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - }; - + { + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The status of the Oauth Client, can be ACTIVE or CANCELLED. - public static BunqResponse Update(int oauthClientId, string status = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int oauthClientId, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - }; - + { + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), oauthClientId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), oauthClientId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -141,35 +144,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Status != null) { return false; } - + + if (this.DisplayName != null) + { + return false; + } + if (this.ClientId != null) { return false; } - + if (this.Secret != null) { return false; } - + if (this.CallbackUrl != null) { return false; } - + return true; } - + /// /// public static OauthClient CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Payment.cs b/BunqSdk/Model/Generated/Endpoint/Payment.cs index 70bbdd0e..174dedd6 100644 --- a/BunqSdk/Model/Generated/Endpoint/Payment.cs +++ b/BunqSdk/Model/Generated/Endpoint/Payment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -22,7 +24,7 @@ public class Payment : BunqModel protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/payment"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/payment/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/payment"; - + /// /// Field constants. /// @@ -32,166 +34,172 @@ public class Payment : BunqModel public const string FIELD_ATTACHMENT = "attachment"; public const string FIELD_MERCHANT_REFERENCE = "merchant_reference"; public const string FIELD_ALLOW_BUNQTO = "allow_bunqto"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "Payment"; - + /// /// The Amount transferred by the Payment. Will be negative for outgoing Payments and positive for incoming /// Payments (relative to the MonetaryAccount indicated by monetary_account_id). /// [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } - + /// /// The LabelMonetaryAccount containing the public information of the other (counterparty) side of the Payment. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The description for the Payment. Maximum 140 characters for Payments to external IBANs, 9000 characters for /// Payments to only other bunq MonetaryAccounts. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The Attachments attached to the Payment. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - + /// /// Optional data included with the Payment specific to the merchant. /// [JsonProperty(PropertyName = "merchant_reference")] public string MerchantReference { get; set; } - + /// /// Whether or not sending a bunq.to payment is allowed. /// [JsonProperty(PropertyName = "allow_bunqto")] public bool? AllowBunqto { get; set; } - + /// /// The id of the created Payment. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp when the Payment was done. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp when the Payment was last updated (will be updated when chat messages are received). /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The id of the MonetaryAccount the Payment was made to or from (depending on whether this is an incoming or /// outgoing Payment). /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The LabelMonetaryAccount containing the public information of 'this' (party) side of the Payment. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The type of Payment, can be BUNQ, EBA_SCT, EBA_SDD, IDEAL, SWIFT or FIS (card). /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The sub-type of the Payment, can be PAYMENT, WITHDRAWAL, REVERSAL, REQUEST, BILLING, SCT, SDD or NLO. /// [JsonProperty(PropertyName = "sub_type")] public string SubType { get; set; } - + /// /// The status of the bunq.to payment. /// [JsonProperty(PropertyName = "bunqto_status")] public string BunqtoStatus { get; set; } - + /// /// The sub status of the bunq.to payment. /// [JsonProperty(PropertyName = "bunqto_sub_status")] public string BunqtoSubStatus { get; set; } - + /// /// The status of the bunq.to payment. /// [JsonProperty(PropertyName = "bunqto_share_url")] public string BunqtoShareUrl { get; set; } - + /// /// When bunq.to payment is about to expire. /// [JsonProperty(PropertyName = "bunqto_expiry")] public string BunqtoExpiry { get; set; } - + /// /// The timestamp of when the bunq.to payment was responded to. /// [JsonProperty(PropertyName = "bunqto_time_responded")] public string BunqtoTimeResponded { get; set; } - + /// /// The id of the PaymentBatch if this Payment was part of one. /// [JsonProperty(PropertyName = "batch_id")] public int? BatchId { get; set; } - + /// /// The id of the JobScheduled if the Payment was scheduled. /// [JsonProperty(PropertyName = "scheduled_id")] public int? ScheduledId { get; set; } - + /// /// A shipping Address provided with the Payment, currently unused. /// [JsonProperty(PropertyName = "address_shipping")] public Address AddressShipping { get; set; } - + /// /// A billing Address provided with the Payment, currently unused. /// [JsonProperty(PropertyName = "address_billing")] public Address AddressBilling { get; set; } - + /// /// The Geolocation where the Payment was done from. /// [JsonProperty(PropertyName = "geolocation")] public Geolocation Geolocation { get; set; } - + /// /// The reference to the object used for split the bill. Can be RequestInquiry or RequestInquiryBatch /// [JsonProperty(PropertyName = "request_reference_split_the_bill")] public List RequestReferenceSplitTheBill { get; set; } - + /// /// The new balance of the monetary account after the mutation. /// [JsonProperty(PropertyName = "balance_after_mutation")] public Amount BalanceAfterMutation { get; set; } - - + + /// + /// A reference to the PaymentAutoAllocateInstance if it exists. + /// + [JsonProperty(PropertyName = "payment_auto_allocate_instance")] + public PaymentAutoAllocateInstance PaymentAutoAllocateInstance { get; set; } + + /// /// Create a new Payment. /// @@ -201,69 +209,56 @@ public class Payment : BunqModel /// The Attachments to attach to the Payment. /// Optional data to be included with the Payment specific to the merchant. /// Whether or not sending a bunq.to payment is allowed. - public static BunqResponse Create(Amount amount, Pointer counterpartyAlias, string description, - int? monetaryAccountId = null, List attachment = null, - string merchantReference = null, bool? allowBunqto = null, IDictionary customHeaders = null) + public static BunqResponse Create(Amount amount, Pointer counterpartyAlias, string description, int? monetaryAccountId= null, List attachment = null, string merchantReference = null, bool? allowBunqto = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_AMOUNT, amount}, - {FIELD_COUNTERPARTY_ALIAS, counterpartyAlias}, - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT, attachment}, - {FIELD_MERCHANT_REFERENCE, merchantReference}, - {FIELD_ALLOW_BUNQTO, allowBunqto}, - }; - + { + {FIELD_AMOUNT, amount}, + {FIELD_COUNTERPARTY_ALIAS, counterpartyAlias}, + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT, attachment}, + {FIELD_MERCHANT_REFERENCE, merchantReference}, + {FIELD_ALLOW_BUNQTO, allowBunqto}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get a specific previous Payment. /// - public static BunqResponse Get(int paymentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int paymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get a listing of all Payments performed on a given MonetaryAccount (incoming and outgoing). /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -272,130 +267,135 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.Amount != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.SubType != null) { return false; } - + if (this.BunqtoStatus != null) { return false; } - + if (this.BunqtoSubStatus != null) { return false; } - + if (this.BunqtoShareUrl != null) { return false; } - + if (this.BunqtoExpiry != null) { return false; } - + if (this.BunqtoTimeResponded != null) { return false; } - + if (this.Attachment != null) { return false; } - + if (this.MerchantReference != null) { return false; } - + if (this.BatchId != null) { return false; } - + if (this.ScheduledId != null) { return false; } - + if (this.AddressShipping != null) { return false; } - + if (this.AddressBilling != null) { return false; } - + if (this.Geolocation != null) { return false; } - + if (this.RequestReferenceSplitTheBill != null) { return false; } - + if (this.BalanceAfterMutation != null) { return false; } - + + if (this.PaymentAutoAllocateInstance != null) + { + return false; + } + return true; } - + /// /// public static Payment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocate.cs b/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocate.cs index f74acf56..d5b2eff9 100644 --- a/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocate.cs +++ b/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocate.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,177 +23,156 @@ public class PaymentAutoAllocate : BunqModel protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/payment-auto-allocate"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/payment-auto-allocate/{2}"; protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/payment-auto-allocate/{2}"; - + /// /// Field constants. /// public const string FIELD_PAYMENT_ID = "payment_id"; public const string FIELD_TYPE = "type"; public const string FIELD_DEFINITION = "definition"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "PaymentAutoAllocate"; - + /// /// The payment that should be used to define the triggers for the payment auto allocate. /// [JsonProperty(PropertyName = "payment_id")] public int? PaymentId { get; set; } - + /// /// The type. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The definition of how the money should be allocated. /// [JsonProperty(PropertyName = "definition")] public List Definition { get; set; } - + /// /// The id of the PaymentAutoAllocate. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp when the PaymentAutoAllocate was created. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp when the PaymentAutoAllocate was last updated. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The status. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The amount on which this payment auto allocate will be triggered. /// [JsonProperty(PropertyName = "trigger_amount")] public Amount TriggerAmount { get; set; } - + /// /// The payment that was used to define the triggers for this payment auto allocate. /// [JsonProperty(PropertyName = "payment")] public Payment Payment { get; set; } - - + + /// /// /// The payment that should be used to define the triggers for the payment auto allocate. /// Whether a payment should be sorted ONCE or RECURRING. /// The definition of how the money should be allocated. - public static BunqResponse Create(int? paymentId, string type, - List definition, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int? paymentId, string type, List definition, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_PAYMENT_ID, paymentId}, - {FIELD_TYPE, type}, - {FIELD_DEFINITION, definition}, - }; - + { + {FIELD_PAYMENT_ID, paymentId}, + {FIELD_TYPE, type}, + {FIELD_DEFINITION, definition}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Get(int paymentAutoAllocateId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int paymentAutoAllocateId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentAutoAllocateId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentAutoAllocateId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// The definition of how the money should be allocated. - public static BunqResponse Update(int paymentAutoAllocateId, int? monetaryAccountId = null, - List definition = null, IDictionary customHeaders = null) + public static BunqResponse Update(int paymentAutoAllocateId, int? monetaryAccountId= null, List definition = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DEFINITION, definition}, - }; - + { + {FIELD_DEFINITION, definition}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentAutoAllocateId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentAutoAllocateId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int paymentAutoAllocateId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int paymentAutoAllocateId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentAutoAllocateId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentAutoAllocateId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() @@ -200,45 +181,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.TriggerAmount != null) { return false; } - + if (this.Payment != null) { return false; } - + return true; } - + /// /// public static PaymentAutoAllocate CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateDefinition.cs b/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateDefinition.cs index 5e7a1341..0a80725a 100644 --- a/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateDefinition.cs +++ b/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateDefinition.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,9 +18,8 @@ public class PaymentAutoAllocateDefinition : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/payment-auto-allocate/{2}/definition"; - + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/payment-auto-allocate/{2}/definition"; + /// /// Field constants. /// @@ -25,81 +28,75 @@ public class PaymentAutoAllocateDefinition : BunqModel public const string FIELD_DESCRIPTION = "description"; public const string FIELD_AMOUNT = "amount"; public const string FIELD_FRACTION = "fraction"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "PaymentAutoAllocateDefinition"; - + /// /// The type of definition. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The alias of the party we are allocating the money to. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The description for the payment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The amount to allocate. /// [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } - + /// /// The percentage of the triggering payment's amount to allocate. /// [JsonProperty(PropertyName = "fraction")] public double? Fraction { get; set; } - + /// /// The id of the PaymentAutoAllocateDefinition. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp when the PaymentAutoAllocateDefinition was created. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp when the PaymentAutoAllocateDefinition was last updated. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - - + + /// /// - public static BunqResponse> List(int paymentAutoAllocateId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int paymentAutoAllocateId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), paymentAutoAllocateId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentAutoAllocateId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -108,45 +105,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Amount != null) { return false; } - + if (this.Fraction != null) { return false; } - + return true; } - + /// /// public static PaymentAutoAllocateDefinition CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateInstance.cs b/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateInstance.cs index 458c030b..cb704e78 100644 --- a/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateInstance.cs +++ b/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateInstance.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,103 +18,89 @@ public class PaymentAutoAllocateInstance : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/payment-auto-allocate/{2}/instance"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/payment-auto-allocate/{2}/instance/{3}"; - + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/payment-auto-allocate/{2}/instance"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/payment-auto-allocate/{2}/instance/{3}"; + /// /// Object type. /// private const string OBJECT_TYPE_GET = "PaymentAutoAllocateInstance"; - + /// /// The id of the PaymentAutoAllocateInstance. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp when the PaymentAutoAllocateInstance was created. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp when the PaymentAutoAllocateInstance was last updated. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The ID of the payment auto allocate this instance belongs to. /// [JsonProperty(PropertyName = "payment_auto_allocate_id")] public int? PaymentAutoAllocateId { get; set; } - + /// /// The status of the payment auto allocate instance. SUCCEEDED or FAILED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The error message, if the payment auto allocating failed. /// [JsonProperty(PropertyName = "error_message")] public List ErrorMessage { get; set; } - + /// /// The payment batch allocating all the payments. /// [JsonProperty(PropertyName = "payment_batch")] public PaymentBatch PaymentBatch { get; set; } - + /// /// The ID of the payment that triggered the allocating of the payments. /// [JsonProperty(PropertyName = "payment_id")] public int? PaymentId { get; set; } - - + + /// /// - public static BunqResponse> List(int paymentAutoAllocateId, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int paymentAutoAllocateId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), paymentAutoAllocateId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentAutoAllocateId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int paymentAutoAllocateId, - int paymentAutoAllocateInstanceId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int paymentAutoAllocateId, int paymentAutoAllocateInstanceId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentAutoAllocateId, paymentAutoAllocateInstanceId), new Dictionary(), - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentAutoAllocateId, paymentAutoAllocateInstanceId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -119,50 +109,50 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.PaymentAutoAllocateId != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.ErrorMessage != null) { return false; } - + if (this.PaymentBatch != null) { return false; } - + if (this.PaymentId != null) { return false; } - + return true; } - + /// /// public static PaymentAutoAllocateInstance CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateUser.cs b/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateUser.cs index 26394f46..4c992631 100644 --- a/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateUser.cs +++ b/BunqSdk/Model/Generated/Endpoint/PaymentAutoAllocateUser.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Exception; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,38 +19,36 @@ public class PaymentAutoAllocateUser : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - + /// /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/payment-auto-allocate"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "PaymentAutoAllocate"; - + /// /// [JsonProperty(PropertyName = "PaymentAutoAllocate")] public PaymentAutoAllocate PaymentAutoAllocate { get; set; } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public BunqModel GetReferencedObject() @@ -55,10 +57,10 @@ public BunqModel GetReferencedObject() { return this.PaymentAutoAllocate; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -67,15 +69,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static PaymentAutoAllocateUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/PaymentBatch.cs b/BunqSdk/Model/Generated/Endpoint/PaymentBatch.cs index 0d252ff3..ad448c86 100644 --- a/BunqSdk/Model/Generated/Endpoint/PaymentBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/PaymentBatch.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,107 +22,91 @@ public class PaymentBatch : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/payment-batch/{2}"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/payment-batch/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/payment-batch"; - + /// /// Field constants. /// public const string FIELD_PAYMENTS = "payments"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "PaymentBatch"; - + /// /// The list of mutations that were made. /// [JsonProperty(PropertyName = "payments")] public PaymentBatchAnchoredPayment Payments { get; set; } - + /// /// Create a payment batch by sending an array of single payment objects, that will become part of the batch. /// /// The list of payments we want to send in a single batch. - public static BunqResponse Create(List payments, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Create(List payments, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_PAYMENTS, payments}, - }; - + { + {FIELD_PAYMENTS, payments}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Revoke a bunq.to payment batch. The status of all the payments will be set to REVOKED. /// - public static BunqResponse Update(int paymentBatchId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int paymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - }; - + { + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Return the details of a specific payment batch. /// - public static BunqResponse Get(int paymentBatchId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int paymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - paymentBatchId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), paymentBatchId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Return all the payment batches for a monetary account. /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -129,15 +115,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static PaymentBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/PaymentServiceProviderCredential.cs b/BunqSdk/Model/Generated/Endpoint/PaymentServiceProviderCredential.cs index f8941f0a..1d6602aa 100644 --- a/BunqSdk/Model/Generated/Endpoint/PaymentServiceProviderCredential.cs +++ b/BunqSdk/Model/Generated/Endpoint/PaymentServiceProviderCredential.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,124 +20,118 @@ public class PaymentServiceProviderCredential : BunqModel /// protected const string ENDPOINT_URL_READ = "payment-service-provider-credential/{0}"; protected const string ENDPOINT_URL_CREATE = "payment-service-provider-credential"; - + /// /// Field constants. /// - public const string FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE = - "client_payment_service_provider_certificate"; - public const string FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE_CHAIN = - "client_payment_service_provider_certificate_chain"; + public const string FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE = "client_payment_service_provider_certificate"; + public const string FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE_CHAIN = "client_payment_service_provider_certificate_chain"; public const string FIELD_CLIENT_PUBLIC_KEY_SIGNATURE = "client_public_key_signature"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "CredentialPasswordIp"; - + /// /// Payment Services Directive 2 compatible QSEAL certificate /// [JsonProperty(PropertyName = "client_payment_service_provider_certificate")] public string ClientPaymentServiceProviderCertificate { get; set; } - + /// /// Intermediate and root certificate belonging to the provided certificate. /// [JsonProperty(PropertyName = "client_payment_service_provider_certificate_chain")] public string ClientPaymentServiceProviderCertificateChain { get; set; } - + /// /// The Base64 encoded signature of the public key provided during installation and with the installation token /// appended as a nonce. Signed with the private key belonging to the QSEAL certificate. /// [JsonProperty(PropertyName = "client_public_key_signature")] public string ClientPublicKeySignature { get; set; } - + /// /// The id of the credential. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the credential object's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the credential object's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The status of the credential. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// When the status is PENDING_FIRST_USE: when the credential expires. /// [JsonProperty(PropertyName = "expiry_time")] public string ExpiryTime { get; set; } - + /// /// When the status is PENDING_FIRST_USE: the value of the token. /// [JsonProperty(PropertyName = "token_value")] public string TokenValue { get; set; } - + /// /// When the status is ACTIVE: the details of the device that may use the credential. /// [JsonProperty(PropertyName = "permitted_device")] public PermittedDevice PermittedDevice { get; set; } - - + + /// /// - public static BunqResponse Get(int paymentServiceProviderCredentialId, - IDictionary customHeaders = null) + public static BunqResponse Get(int paymentServiceProviderCredentialId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, paymentServiceProviderCredentialId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, paymentServiceProviderCredentialId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// Payment Services Directive 2 compatible QSEAL certificate /// Intermediate and root certificate belonging to the provided certificate. /// The Base64 encoded signature of the public key provided during installation and with the installation token appended as a nonce. Signed with the private key belonging to the QSEAL certificate. - public static BunqResponse Create(string clientPaymentServiceProviderCertificate, - string clientPaymentServiceProviderCertificateChain, string clientPublicKeySignature, - IDictionary customHeaders = null) + public static BunqResponse Create(string clientPaymentServiceProviderCertificate, string clientPaymentServiceProviderCertificateChain, string clientPublicKeySignature, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE, clientPaymentServiceProviderCertificate}, - {FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE_CHAIN, clientPaymentServiceProviderCertificateChain}, - {FIELD_CLIENT_PUBLIC_KEY_SIGNATURE, clientPublicKeySignature}, - }; - + { + {FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE, clientPaymentServiceProviderCertificate}, + {FIELD_CLIENT_PAYMENT_SERVICE_PROVIDER_CERTIFICATE_CHAIN, clientPaymentServiceProviderCertificateChain}, + {FIELD_CLIENT_PUBLIC_KEY_SIGNATURE, clientPublicKeySignature}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); var responseRaw = apiClient.Post(ENDPOINT_URL_CREATE, requestBytes, customHeaders); - + return ProcessForId(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -144,45 +140,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.ExpiryTime != null) { return false; } - + if (this.TokenValue != null) { return false; } - + if (this.PermittedDevice != null) { return false; } - + return true; } - + /// /// public static PaymentServiceProviderCredential CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/PaymentServiceProviderDraftPayment.cs b/BunqSdk/Model/Generated/Endpoint/PaymentServiceProviderDraftPayment.cs index 3b7ec8d3..53ddaa12 100644 --- a/BunqSdk/Model/Generated/Endpoint/PaymentServiceProviderDraftPayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/PaymentServiceProviderDraftPayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,7 +22,7 @@ public class PaymentServiceProviderDraftPayment : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/payment-service-provider-draft-payment/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/payment-service-provider-draft-payment"; protected const string ENDPOINT_URL_READ = "user/{0}/payment-service-provider-draft-payment/{1}"; - + /// /// Field constants. /// @@ -31,61 +33,61 @@ public class PaymentServiceProviderDraftPayment : BunqModel public const string FIELD_DESCRIPTION = "description"; public const string FIELD_AMOUNT = "amount"; public const string FIELD_STATUS = "status"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "PaymentServiceProviderDraftPayment"; - + /// /// The sender IBAN. /// [JsonProperty(PropertyName = "sender_iban")] public string SenderIban { get; set; } - + /// /// The name of the sender. /// [JsonProperty(PropertyName = "sender_name")] public string SenderName { get; set; } - + /// /// The IBAN of the counterparty. /// [JsonProperty(PropertyName = "counterparty_iban")] public string CounterpartyIban { get; set; } - + /// /// The name of the counterparty. /// [JsonProperty(PropertyName = "counterparty_name")] public string CounterpartyName { get; set; } - + /// /// Description of the payment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The amount of the draft payment /// [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } - + /// /// The status of the draft payment /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The sender IBAN. /// [JsonProperty(PropertyName = "receiver_iban")] public string ReceiverIban { get; set; } - - + + /// /// /// The IBAN of the sender. @@ -95,87 +97,75 @@ public class PaymentServiceProviderDraftPayment : BunqModel /// The Amount to transfer with the Payment. Must be bigger than 0. /// The name of the sender. /// The new status of the Draft Payment. Can only be set to REJECTED or CANCELLED by update. - public static BunqResponse Create(string senderIban, string counterpartyIban, string counterpartyName, - string description, Amount amount, string senderName = null, string status = null, - IDictionary customHeaders = null) + public static BunqResponse Create(string senderIban, string counterpartyIban, string counterpartyName, string description, Amount amount, string senderName = null, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_SENDER_IBAN, senderIban}, - {FIELD_SENDER_NAME, senderName}, - {FIELD_COUNTERPARTY_IBAN, counterpartyIban}, - {FIELD_COUNTERPARTY_NAME, counterpartyName}, - {FIELD_DESCRIPTION, description}, - {FIELD_AMOUNT, amount}, - {FIELD_STATUS, status}, - }; - + { + {FIELD_SENDER_IBAN, senderIban}, + {FIELD_SENDER_NAME, senderName}, + {FIELD_COUNTERPARTY_IBAN, counterpartyIban}, + {FIELD_COUNTERPARTY_NAME, counterpartyName}, + {FIELD_DESCRIPTION, description}, + {FIELD_AMOUNT, amount}, + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The new status of the Draft Payment. Can only be set to REJECTED or CANCELLED by update. - public static BunqResponse Update(int paymentServiceProviderDraftPaymentId, string status = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int paymentServiceProviderDraftPaymentId, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - }; - + { + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), paymentServiceProviderDraftPaymentId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), paymentServiceProviderDraftPaymentId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List( - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Get(int paymentServiceProviderDraftPaymentId, - IDictionary customHeaders = null) + public static BunqResponse Get(int paymentServiceProviderDraftPaymentId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), paymentServiceProviderDraftPaymentId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), paymentServiceProviderDraftPaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -184,30 +174,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.ReceiverIban != null) { return false; } - + if (this.Amount != null) { return false; } - + if (this.Status != null) { return false; } - + return true; } - + /// /// public static PaymentServiceProviderDraftPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/PermittedIp.cs b/BunqSdk/Model/Generated/Endpoint/PermittedIp.cs index 79b88ad8..88bc1ef0 100644 --- a/BunqSdk/Model/Generated/Endpoint/PermittedIp.cs +++ b/BunqSdk/Model/Generated/Endpoint/PermittedIp.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,114 +21,100 @@ public class PermittedIp : BunqModel protected const string ENDPOINT_URL_CREATE = "user/{0}/credential-password-ip/{1}/ip"; protected const string ENDPOINT_URL_LISTING = "user/{0}/credential-password-ip/{1}/ip"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/credential-password-ip/{1}/ip/{2}"; - + /// /// Field constants. /// public const string FIELD_IP = "ip"; public const string FIELD_STATUS = "status"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "PermittedIp"; - + /// /// The IP address. /// [JsonProperty(PropertyName = "ip")] public string Ip { get; set; } - + /// /// The status of the IP. May be "ACTIVE" or "INACTIVE". It is only possible to make requests from "ACTIVE" IP /// addresses. Only "ACTIVE" IPs will be billed. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - - + + /// /// - public static BunqResponse Get(int credentialPasswordIpId, int permittedIpId, - IDictionary customHeaders = null) + public static BunqResponse Get(int credentialPasswordIpId, int permittedIpId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), credentialPasswordIpId, permittedIpId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), credentialPasswordIpId, permittedIpId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// The IP address. /// The status of the IP. May be "ACTIVE" or "INACTIVE". It is only possible to make requests from "ACTIVE" IP addresses. Only "ACTIVE" IPs will be billed. - public static BunqResponse Create(int credentialPasswordIpId, string ip, string status = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int credentialPasswordIpId, string ip, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_IP, ip}, - {FIELD_STATUS, status}, - }; - + { + {FIELD_IP, ip}, + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), credentialPasswordIpId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), credentialPasswordIpId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(int credentialPasswordIpId, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int credentialPasswordIpId, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), credentialPasswordIpId), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), credentialPasswordIpId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// The status of the IP. May be "ACTIVE" or "INACTIVE". It is only possible to make requests from "ACTIVE" IP addresses. Only "ACTIVE" IPs will be billed. - public static BunqResponse Update(int credentialPasswordIpId, int permittedIpId, string status = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int credentialPasswordIpId, int permittedIpId, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - }; - + { + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), credentialPasswordIpId, permittedIpId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), credentialPasswordIpId, permittedIpId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -135,20 +123,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Status != null) { return false; } - + return true; } - + /// /// public static PermittedIp CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/PlacePhotoLookupContent.cs b/BunqSdk/Model/Generated/Endpoint/PlacePhotoLookupContent.cs new file mode 100644 index 00000000..35e0f004 --- /dev/null +++ b/BunqSdk/Model/Generated/Endpoint/PlacePhotoLookupContent.cs @@ -0,0 +1,54 @@ +using Bunq.Sdk.Context; +using Bunq.Sdk.Http; +using Bunq.Sdk.Json; +using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; + +namespace Bunq.Sdk.Model.Generated.Endpoint +{ + /// + /// View endpoint for place opening periods. + /// + public class PlacePhotoLookupContent : BunqModel + { + /// + /// Endpoint constants. + /// + protected const string ENDPOINT_URL_LISTING = "place-lookup/{0}/photo/{1}/content"; + + /// + /// Object type. + /// + private const string OBJECT_TYPE_GET = "PlacePhotoLookupContent"; + + /// + /// + public static BunqResponse List(int placeLookupId, int photoId, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, placeLookupId, photoId), new Dictionary(), customHeaders); + + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); + } + + + /// + /// + public override bool IsAllFieldNull() + { + return true; + } + + /// + /// + public static PlacePhotoLookupContent CreateFromJsonString(string json) + { + return BunqModel.CreateFromJsonString(json); + } + } +} diff --git a/BunqSdk/Model/Generated/Endpoint/Registry.cs b/BunqSdk/Model/Generated/Endpoint/Registry.cs deleted file mode 100644 index 2ba9c311..00000000 --- a/BunqSdk/Model/Generated/Endpoint/Registry.cs +++ /dev/null @@ -1,334 +0,0 @@ -using System.Collections.Generic; -using System.Text; -using Bunq.Sdk.Http; -using Bunq.Sdk.Json; -using Bunq.Sdk.Model.Core; -using Bunq.Sdk.Model.Generated.Object; -using Newtonsoft.Json; - -namespace Bunq.Sdk.Model.Generated.Endpoint -{ - /// - /// Used to manage Slice groups. - /// - public class Registry : BunqModel - { - /// - /// Endpoint constants. - /// - protected const string ENDPOINT_URL_CREATE = "user/{0}/registry"; - protected const string ENDPOINT_URL_UPDATE = "user/{0}/registry/{1}"; - protected const string ENDPOINT_URL_LISTING = "user/{0}/registry"; - protected const string ENDPOINT_URL_READ = "user/{0}/registry/{1}"; - protected const string ENDPOINT_URL_DELETE = "user/{0}/registry/{1}"; - - /// - /// Field constants. - /// - public const string FIELD_CURRENCY = "currency"; - public const string FIELD_TITLE = "title"; - public const string FIELD_DESCRIPTION = "description"; - public const string FIELD_STATUS = "status"; - public const string FIELD_LAST_REGISTRY_ENTRY_SEEN_ID = "last_registry_entry_seen_id"; - public const string FIELD_PREVIOUS_UPDATED_TIMESTAMP = "previous_updated_timestamp"; - public const string FIELD_MEMBERSHIPS = "memberships"; - public const string FIELD_MEMBERSHIPS_PREVIOUS = "memberships_previous"; - - /// - /// Object type. - /// - private const string OBJECT_TYPE_GET = "Registry"; - - /// - /// The currency for the Registry as an ISO 4217 formatted currency code. - /// - [JsonProperty(PropertyName = "currency")] - public string Currency { get; set; } - - /// - /// The title of the Registry. - /// - [JsonProperty(PropertyName = "title")] - public string Title { get; set; } - - /// - /// A description about the Registry. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// The status of the Registry. - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// The id of the last RegistryEntry that the user has seen. - /// - [JsonProperty(PropertyName = "last_registry_entry_seen_id")] - public int? LastRegistryEntrySeenId { get; set; } - - /// - /// The previous updated timestamp that you received for this Registry. - /// - [JsonProperty(PropertyName = "previous_updated_timestamp")] - public string PreviousUpdatedTimestamp { get; set; } - - /// - /// List of memberships to replace the current one. - /// - [JsonProperty(PropertyName = "memberships")] - public List Memberships { get; set; } - - /// - /// Previous list of memberships. - /// - [JsonProperty(PropertyName = "memberships_previous")] - public List MembershipsPrevious { get; set; } - - /// - /// The id of the Registry. - /// - [JsonProperty(PropertyName = "id")] - public int? Id { get; set; } - - /// - /// The timestamp of the Registry's creation. - /// - [JsonProperty(PropertyName = "created")] - public string Created { get; set; } - - /// - /// The timestamp of the Registry's last update. - /// - [JsonProperty(PropertyName = "updated")] - public string Updated { get; set; } - - /// - /// The number of RegistryEntries in this Registry that the user has not seen. - /// - [JsonProperty(PropertyName = "unseen_entries_count")] - public int? UnseenEntriesCount { get; set; } - - /// - /// The total amount spent in this Registry since the last settlement. - /// - [JsonProperty(PropertyName = "total_amount_spent")] - public Amount TotalAmountSpent { get; set; } - - /// - /// Whether the Registry has previously been settled. - /// - [JsonProperty(PropertyName = "is_previously_settled")] - public bool? IsPreviouslySettled { get; set; } - - /// - /// The settings for this Registry. - /// - [JsonProperty(PropertyName = "setting")] - public RegistrySetting Setting { get; set; } - - /// - /// The ID of the registry that currently has auto_add_card_transaction set to ALL. - /// - [JsonProperty(PropertyName = "registry_auto_add_card_transaction_enabled_id")] - public int? RegistryAutoAddCardTransactionEnabledId { get; set; } - - - /// - /// Create a new Slice group. - /// - /// The currency for the Registry as an ISO 4217 formatted currency code. - /// The title of the Registry. - /// A description about the Registry. - /// The status of the Registry. - /// The id of the last RegistryEntry that the user has seen. - /// The previous updated timestamp that you received for this Registry. - /// New list of memberships. - /// Previous list of memberships. - public static BunqResponse Create(string currency, string title = null, string description = null, - string status = null, int? lastRegistryEntrySeenId = null, string previousUpdatedTimestamp = null, - List memberships = null, List membershipsPrevious = null, - IDictionary customHeaders = null) - { - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - - var requestMap = new Dictionary - { - {FIELD_CURRENCY, currency}, - {FIELD_TITLE, title}, - {FIELD_DESCRIPTION, description}, - {FIELD_STATUS, status}, - {FIELD_LAST_REGISTRY_ENTRY_SEEN_ID, lastRegistryEntrySeenId}, - {FIELD_PREVIOUS_UPDATED_TIMESTAMP, previousUpdatedTimestamp}, - {FIELD_MEMBERSHIPS, memberships}, - {FIELD_MEMBERSHIPS_PREVIOUS, membershipsPrevious}, - }; - - var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - - return ProcessForId(responseRaw); - } - - /// - /// Update a specific Slice group. - /// - /// The title of the Registry. - /// A description about the Registry. - /// The status of the Registry. - /// The id of the last RegistryEntry that the user has seen. - /// The previous updated timestamp that you received for this Registry. - /// New list of memberships. - /// Previous list of memberships. - public static BunqResponse Update(int registryId, string title = null, string description = null, - string status = null, int? lastRegistryEntrySeenId = null, string previousUpdatedTimestamp = null, - List memberships = null, List membershipsPrevious = null, - IDictionary customHeaders = null) - { - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - - var requestMap = new Dictionary - { - {FIELD_TITLE, title}, - {FIELD_DESCRIPTION, description}, - {FIELD_STATUS, status}, - {FIELD_LAST_REGISTRY_ENTRY_SEEN_ID, lastRegistryEntrySeenId}, - {FIELD_PREVIOUS_UPDATED_TIMESTAMP, previousUpdatedTimestamp}, - {FIELD_MEMBERSHIPS, memberships}, - {FIELD_MEMBERSHIPS_PREVIOUS, membershipsPrevious}, - }; - - var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), registryId), - requestBytes, customHeaders); - - return ProcessForId(responseRaw); - } - - /// - /// Get a listing of all Slice groups. - /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) - { - if (urlParams == null) urlParams = new Dictionary(); - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - - return FromJsonList(responseRaw, OBJECT_TYPE_GET); - } - - /// - /// Get a specific Slice group. - /// - public static BunqResponse Get(int registryId, IDictionary customHeaders = null) - { - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), registryId), - new Dictionary(), customHeaders); - - return FromJson(responseRaw, OBJECT_TYPE_GET); - } - - /// - /// Delete a specific Slice group. - /// - public static BunqResponse Delete(int registryId, IDictionary customHeaders = null) - { - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), registryId), - customHeaders); - - return new BunqResponse(null, responseRaw.Headers); - } - - - /// - /// - public override bool IsAllFieldNull() - { - if (this.Id != null) - { - return false; - } - - if (this.Created != null) - { - return false; - } - - if (this.Updated != null) - { - return false; - } - - if (this.Currency != null) - { - return false; - } - - if (this.Title != null) - { - return false; - } - - if (this.Status != null) - { - return false; - } - - if (this.UnseenEntriesCount != null) - { - return false; - } - - if (this.TotalAmountSpent != null) - { - return false; - } - - if (this.IsPreviouslySettled != null) - { - return false; - } - - if (this.Memberships != null) - { - return false; - } - - if (this.Setting != null) - { - return false; - } - - if (this.RegistryAutoAddCardTransactionEnabledId != null) - { - return false; - } - - return true; - } - - /// - /// - public static Registry CreateFromJsonString(string json) - { - return CreateFromJsonString(json); - } - } -} \ No newline at end of file diff --git a/BunqSdk/Model/Generated/Endpoint/RegistryEntry.cs b/BunqSdk/Model/Generated/Endpoint/RegistryEntry.cs deleted file mode 100644 index c100531a..00000000 --- a/BunqSdk/Model/Generated/Endpoint/RegistryEntry.cs +++ /dev/null @@ -1,344 +0,0 @@ -using System.Collections.Generic; -using System.Text; -using Bunq.Sdk.Http; -using Bunq.Sdk.Json; -using Bunq.Sdk.Model.Core; -using Bunq.Sdk.Model.Generated.Object; -using Newtonsoft.Json; - -namespace Bunq.Sdk.Model.Generated.Endpoint -{ - /// - /// Used to manage Slice group payment. - /// - public class RegistryEntry : BunqModel - { - /// - /// Endpoint constants. - /// - protected const string ENDPOINT_URL_CREATE = "user/{0}/registry/{1}/registry-entry"; - protected const string ENDPOINT_URL_UPDATE = "user/{0}/registry/{1}/registry-entry/{2}"; - protected const string ENDPOINT_URL_LISTING = "user/{0}/registry/{1}/registry-entry"; - protected const string ENDPOINT_URL_READ = "user/{0}/registry/{1}/registry-entry/{2}"; - protected const string ENDPOINT_URL_DELETE = "user/{0}/registry/{1}/registry-entry/{2}"; - - /// - /// Field constants. - /// - public const string FIELD_ALIAS_OWNER = "alias_owner"; - public const string FIELD_AMOUNT = "amount"; - public const string FIELD_OBJECT_REFERENCE = "object_reference"; - public const string FIELD_DESCRIPTION = "description"; - public const string FIELD_ALLOCATIONS = "allocations"; - public const string FIELD_ATTACHMENT = "attachment"; - - /// - /// Object type. - /// - private const string OBJECT_TYPE_GET = "RegistryEntry"; - - /// - /// The Alias of the party we are allocating money for. - /// - [JsonProperty(PropertyName = "alias_owner")] - public MonetaryAccountReference AliasOwner { get; set; } - - /// - /// The Amount of the RegistryEntry. - /// - [JsonProperty(PropertyName = "amount")] - public Amount Amount { get; set; } - - /// - /// The object linked to the RegistryEntry. - /// - [JsonProperty(PropertyName = "object_reference")] - public RegistryEntryReference ObjectReference { get; set; } - - /// - /// A description about the RegistryEntry. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - - /// - /// An array of AllocationItems. - /// - [JsonProperty(PropertyName = "allocations")] - public List Allocations { get; set; } - - /// - /// The attachments attached to the payment. - /// - [JsonProperty(PropertyName = "attachment")] - public List Attachment { get; set; } - - /// - /// The id of the RegistryEntry. - /// - [JsonProperty(PropertyName = "id")] - public int? Id { get; set; } - - /// - /// The timestamp of the MonetaryAccountBank's creation. - /// - [JsonProperty(PropertyName = "created")] - public string Created { get; set; } - - /// - /// The timestamp of the MonetaryAccountBank's last update. - /// - [JsonProperty(PropertyName = "updated")] - public string Updated { get; set; } - - /// - /// The id of the Registry. - /// - [JsonProperty(PropertyName = "registry_id")] - public int? RegistryId { get; set; } - - /// - /// The status of the RegistryEntry. - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// The RegistryEntry type. AUTO if created by Auto Slice, MANUAL for manually added entries. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// The LabelUser with the public information of the party of this RegistryEntry. - /// - [JsonProperty(PropertyName = "alias")] - public LabelUser Alias { get; set; } - - /// - /// The LabelUser with the public information of the counter party of this RegistryEntry. - /// - [JsonProperty(PropertyName = "counterparty_alias")] - public LabelUser CounterpartyAlias { get; set; } - - /// - /// The LabelUser with the public information of the User that created the RegistryEntry. - /// - [JsonProperty(PropertyName = "user_alias_created")] - public LabelUser UserAliasCreated { get; set; } - - /// - /// The membership of the creator. - /// - [JsonProperty(PropertyName = "membership_created")] - public RegistryMembership MembershipCreated { get; set; } - - /// - /// The membership of the owner. - /// - [JsonProperty(PropertyName = "membership_owned")] - public RegistryMembership MembershipOwned { get; set; } - - - /// - /// Create a new Slice group payment. - /// - /// The Amount of the RegistryEntry. - /// An array of AllocationItems. - /// The Alias of the party we are allocating money for. - /// The object linked to the RegistryEntry. - /// A description about the RegistryEntry. - /// The attachments attached to the payment. - public static BunqResponse Create(int registryId, Amount amount, List allocations, - Pointer aliasOwner = null, RegistryEntryReference objectReference = null, string description = null, - List attachment = null, IDictionary customHeaders = null) - { - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - - var requestMap = new Dictionary - { - {FIELD_ALIAS_OWNER, aliasOwner}, - {FIELD_AMOUNT, amount}, - {FIELD_OBJECT_REFERENCE, objectReference}, - {FIELD_DESCRIPTION, description}, - {FIELD_ALLOCATIONS, allocations}, - {FIELD_ATTACHMENT, attachment}, - }; - - var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), registryId), - requestBytes, customHeaders); - - return ProcessForId(responseRaw); - } - - /// - /// Update a specific Slice group payment. - /// - /// A description about the RegistryEntry. - /// An array of AllocationItems. - /// The attachments attached to the payment. - public static BunqResponse Update(int registryId, int registryEntryId, string description = null, - List allocations = null, List attachment = null, - IDictionary customHeaders = null) - { - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - - var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_ALLOCATIONS, allocations}, - {FIELD_ATTACHMENT, attachment}, - }; - - var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), registryId, registryEntryId), - requestBytes, customHeaders); - - return ProcessForId(responseRaw); - } - - /// - /// Get a listing of all Slice group payments. - /// - public static BunqResponse> List(int registryId, - IDictionary urlParams = null, IDictionary customHeaders = null) - { - if (urlParams == null) urlParams = new Dictionary(); - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), registryId), - urlParams, customHeaders); - - return FromJsonList(responseRaw, OBJECT_TYPE_GET); - } - - /// - /// Get a specific Slice group payment. - /// - public static BunqResponse Get(int registryId, int registryEntryId, - IDictionary customHeaders = null) - { - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), registryId, registryEntryId), - new Dictionary(), customHeaders); - - return FromJson(responseRaw, OBJECT_TYPE_GET); - } - - /// - /// Delete a specific Slice group payment. - /// - public static BunqResponse Delete(int registryId, int registryEntryId, - IDictionary customHeaders = null) - { - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), registryId, registryEntryId), - customHeaders); - - return new BunqResponse(null, responseRaw.Headers); - } - - - /// - /// - public override bool IsAllFieldNull() - { - if (this.Id != null) - { - return false; - } - - if (this.Created != null) - { - return false; - } - - if (this.Updated != null) - { - return false; - } - - if (this.RegistryId != null) - { - return false; - } - - if (this.Status != null) - { - return false; - } - - if (this.Amount != null) - { - return false; - } - - if (this.Description != null) - { - return false; - } - - if (this.Type != null) - { - return false; - } - - if (this.Alias != null) - { - return false; - } - - if (this.CounterpartyAlias != null) - { - return false; - } - - if (this.UserAliasCreated != null) - { - return false; - } - - if (this.MembershipCreated != null) - { - return false; - } - - if (this.MembershipOwned != null) - { - return false; - } - - if (this.Allocations != null) - { - return false; - } - - if (this.Attachment != null) - { - return false; - } - - return true; - } - - /// - /// - public static RegistryEntry CreateFromJsonString(string json) - { - return CreateFromJsonString(json); - } - } -} \ No newline at end of file diff --git a/BunqSdk/Model/Generated/Endpoint/RegistryMembership.cs b/BunqSdk/Model/Generated/Endpoint/RegistryMembership.cs index 6ad66146..06d5453f 100644 --- a/BunqSdk/Model/Generated/Endpoint/RegistryMembership.cs +++ b/BunqSdk/Model/Generated/Endpoint/RegistryMembership.cs @@ -1,6 +1,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,33 +15,65 @@ public class RegistryMembership : BunqModel /// public const string FIELD_ALIAS = "alias"; public const string FIELD_STATUS = "status"; - - + public const string FIELD_AUTO_ADD_CARD_TRANSACTION = "auto_add_card_transaction"; + + /// /// The LabelMonetaryAccount of the user who belongs to this RegistryMembership. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The status of the RegistryMembership. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + + /// + /// The setting for for adding automatically card transactions to the registry. + /// + [JsonProperty(PropertyName = "auto_add_card_transaction")] + public string AutoAddCardTransaction { get; set; } + /// /// The balance of this RegistryMembership. /// [JsonProperty(PropertyName = "balance")] public Amount Balance { get; set; } - + /// /// The total amount spent of this RegistryMembership. /// [JsonProperty(PropertyName = "total_amount_spent")] public Amount TotalAmountSpent { get; set; } - - + + /// + /// The status of the settlement of the Registry. Can be PENDING or SETTLED. + /// + [JsonProperty(PropertyName = "status_settlement")] + public string StatusSettlement { get; set; } + + /// + /// The registry id. + /// + [JsonProperty(PropertyName = "registry_id")] + public int? RegistryId { get; set; } + + /// + /// The registry title. + /// + [JsonProperty(PropertyName = "registry_title")] + public string RegistryTitle { get; set; } + + /// + /// The label of the user that sent the invite. + /// + [JsonProperty(PropertyName = "invitor")] + public LabelUser Invitor { get; set; } + + + /// /// public override bool IsAllFieldNull() @@ -49,30 +82,55 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Balance != null) { return false; } - + if (this.TotalAmountSpent != null) { return false; } - + if (this.Status != null) { return false; } - + + if (this.StatusSettlement != null) + { + return false; + } + + if (this.AutoAddCardTransaction != null) + { + return false; + } + + if (this.RegistryId != null) + { + return false; + } + + if (this.RegistryTitle != null) + { + return false; + } + + if (this.Invitor != null) + { + return false; + } + return true; } - + /// /// public static RegistryMembership CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/RegistrySetting.cs b/BunqSdk/Model/Generated/Endpoint/RegistrySetting.cs deleted file mode 100644 index e816ba53..00000000 --- a/BunqSdk/Model/Generated/Endpoint/RegistrySetting.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.Collections.Generic; -using System.Text; -using Bunq.Sdk.Http; -using Bunq.Sdk.Json; -using Bunq.Sdk.Model.Core; -using Newtonsoft.Json; - -namespace Bunq.Sdk.Model.Generated.Endpoint -{ - /// - /// Used to manage Slice group settings. - /// - public class RegistrySetting : BunqModel - { - /// - /// Endpoint constants. - /// - protected const string ENDPOINT_URL_UPDATE = "user/{0}/registry/{1}/registry-setting/{2}"; - protected const string ENDPOINT_URL_READ = "user/{0}/registry/{1}/registry-setting/{2}"; - - /// - /// Field constants. - /// - public const string FIELD_AUTO_ADD_CARD_TRANSACTION = "auto_add_card_transaction"; - - /// - /// Object type. - /// - private const string OBJECT_TYPE_GET = "RegistrySetting"; - - /// - /// The setting for for adding automatically card transactions to the registry. - /// - [JsonProperty(PropertyName = "auto_add_card_transaction")] - public string AutoAddCardTransaction { get; set; } - - /// - /// Update a specific Slice group setting. - /// - /// The setting for for adding automatically card transactions to the registry. - public static BunqResponse Update(int registryId, int registrySettingId, - string autoAddCardTransaction = null, IDictionary customHeaders = null) - { - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - - var requestMap = new Dictionary - { - {FIELD_AUTO_ADD_CARD_TRANSACTION, autoAddCardTransaction}, - }; - - var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), registryId, registrySettingId), - requestBytes, customHeaders); - - return ProcessForId(responseRaw); - } - - /// - /// Get a specific Slice group setting. - /// - public static BunqResponse Get(int registryId, int registrySettingId, - IDictionary customHeaders = null) - { - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), registryId, registrySettingId), - new Dictionary(), customHeaders); - - return FromJson(responseRaw, OBJECT_TYPE_GET); - } - - - /// - /// - public override bool IsAllFieldNull() - { - if (this.AutoAddCardTransaction != null) - { - return false; - } - - return true; - } - - /// - /// - public static RegistrySetting CreateFromJsonString(string json) - { - return CreateFromJsonString(json); - } - } -} \ No newline at end of file diff --git a/BunqSdk/Model/Generated/Endpoint/RegistrySettlement.cs b/BunqSdk/Model/Generated/Endpoint/RegistrySettlement.cs index be9a9fdf..3df854a5 100644 --- a/BunqSdk/Model/Generated/Endpoint/RegistrySettlement.cs +++ b/BunqSdk/Model/Generated/Endpoint/RegistrySettlement.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,120 +21,114 @@ public class RegistrySettlement : BunqModel protected const string ENDPOINT_URL_CREATE = "user/{0}/registry/{1}/registry-settlement"; protected const string ENDPOINT_URL_READ = "user/{0}/registry/{1}/registry-settlement/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/registry/{1}/registry-settlement"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "RegistrySettlement"; - + /// /// The id of the RegistrySettlement. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the RegistrySettlement's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the RegistrySettlement's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The timestamp of the Registry's settlement. /// [JsonProperty(PropertyName = "settlement_time")] public string SettlementTime { get; set; } - + /// /// The total amount spent for the RegistrySettlement. /// [JsonProperty(PropertyName = "total_amount_spent")] public Amount TotalAmountSpent { get; set; } - + /// /// The number of RegistryEntry's associated with this RegistrySettlement. /// [JsonProperty(PropertyName = "number_of_entries")] public int? NumberOfEntries { get; set; } - + /// /// The membership of the user that settled the Registry. /// [JsonProperty(PropertyName = "settled_by_alias")] public RegistryMembership SettledByAlias { get; set; } - + /// /// The membership of the user that has settled the registry. /// [JsonProperty(PropertyName = "membership_settled")] public RegistryMembership MembershipSettled { get; set; } - + /// /// List of RegistrySettlementItems /// [JsonProperty(PropertyName = "items")] public List Items { get; set; } - - + + /// /// Create a new Slice group settlement. /// public static BunqResponse Create(int registryId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - }; - + { + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), registryId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), registryId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Get a specific Slice group settlement. /// - public static BunqResponse Get(int registryId, int registrySettlementId, - IDictionary customHeaders = null) + public static BunqResponse Get(int registryId, int registrySettlementId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), registryId, registrySettlementId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), registryId, registrySettlementId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get a listing of all Slice group settlements. /// - public static BunqResponse> List(int registryId, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int registryId, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), registryId), - urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), registryId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -141,55 +137,55 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.SettlementTime != null) { return false; } - + if (this.TotalAmountSpent != null) { return false; } - + if (this.NumberOfEntries != null) { return false; } - + if (this.SettledByAlias != null) { return false; } - + if (this.MembershipSettled != null) { return false; } - + if (this.Items != null) { return false; } - + return true; } - + /// /// public static RegistrySettlement CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/RegistrySettlementPending.cs b/BunqSdk/Model/Generated/Endpoint/RegistrySettlementPending.cs deleted file mode 100644 index 548ba5b1..00000000 --- a/BunqSdk/Model/Generated/Endpoint/RegistrySettlementPending.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Collections.Generic; -using Bunq.Sdk.Http; -using Bunq.Sdk.Model.Core; -using Bunq.Sdk.Model.Generated.Object; -using Newtonsoft.Json; - -namespace Bunq.Sdk.Model.Generated.Endpoint -{ - /// - /// Used to manage pending Slice group settlements. - /// - public class RegistrySettlementPending : BunqModel - { - /// - /// Endpoint constants. - /// - protected const string ENDPOINT_URL_LISTING = "user/{0}/registry/{1}/registry-settlement-pending"; - - /// - /// Object type. - /// - private const string OBJECT_TYPE_GET = "RegistrySettlementPending"; - - /// - /// List of RegistrySettlementItems - /// - [JsonProperty(PropertyName = "items")] - public List Items { get; set; } - - /// - /// Get a listing of all pending Slice group settlements. - /// - public static BunqResponse> List(int registryId, - IDictionary urlParams = null, IDictionary customHeaders = null) - { - if (urlParams == null) urlParams = new Dictionary(); - if (customHeaders == null) customHeaders = new Dictionary(); - - var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), registryId), - urlParams, customHeaders); - - return FromJsonList(responseRaw, OBJECT_TYPE_GET); - } - - - /// - /// - public override bool IsAllFieldNull() - { - if (this.Items != null) - { - return false; - } - - return true; - } - - /// - /// - public static RegistrySettlementPending CreateFromJsonString(string json) - { - return CreateFromJsonString(json); - } - } -} \ No newline at end of file diff --git a/BunqSdk/Model/Generated/Endpoint/RelationUser.cs b/BunqSdk/Model/Generated/Endpoint/RelationUser.cs index 79a4d668..b06a80a3 100644 --- a/BunqSdk/Model/Generated/Endpoint/RelationUser.cs +++ b/BunqSdk/Model/Generated/Endpoint/RelationUser.cs @@ -1,6 +1,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,38 +15,39 @@ public class RelationUser : BunqModel /// [JsonProperty(PropertyName = "user_id")] public string UserId { get; set; } - + /// /// The counter user's ID. /// [JsonProperty(PropertyName = "counter_user_id")] public string CounterUserId { get; set; } - + /// /// The user's label. /// [JsonProperty(PropertyName = "label_user")] public LabelUser LabelUser { get; set; } - + /// /// The counter user's label. /// [JsonProperty(PropertyName = "counter_label_user")] public LabelUser CounterLabelUser { get; set; } - + /// /// The requested relation type. /// [JsonProperty(PropertyName = "relationship")] public string Relationship { get; set; } - + /// /// The request's status, only for UPDATE. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -54,40 +56,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.CounterUserId != null) { return false; } - + if (this.LabelUser != null) { return false; } - + if (this.CounterLabelUser != null) { return false; } - + if (this.Relationship != null) { return false; } - + if (this.Status != null) { return false; } - + return true; } - + /// /// public static RelationUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/RequestInquiry.cs b/BunqSdk/Model/Generated/Endpoint/RequestInquiry.cs index a82ca3e2..f46079c9 100644 --- a/BunqSdk/Model/Generated/Endpoint/RequestInquiry.cs +++ b/BunqSdk/Model/Generated/Endpoint/RequestInquiry.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -23,7 +25,7 @@ public class RequestInquiry : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/request-inquiry/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/request-inquiry"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/request-inquiry/{2}"; - + /// /// Field constants. /// @@ -41,198 +43,198 @@ public class RequestInquiry : BunqModel public const string FIELD_ALLOW_BUNQME = "allow_bunqme"; public const string FIELD_REDIRECT_URL = "redirect_url"; public const string FIELD_EVENT_ID = "event_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_PUT = "RequestInquiry"; private const string OBJECT_TYPE_GET = "RequestInquiry"; - + /// /// The requested amount. /// [JsonProperty(PropertyName = "amount_inquired")] public Amount AmountInquired { get; set; } - + /// /// The LabelMonetaryAccount with the public information of the MonetaryAccount the money was requested from. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The description of the inquiry. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The attachments attached to the payment. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - + /// /// The client's custom reference that was attached to the request and the mutation. /// [JsonProperty(PropertyName = "merchant_reference")] public string MerchantReference { get; set; } - + /// /// The status of the request. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The minimum age the user accepting the RequestInquiry must have. /// [JsonProperty(PropertyName = "minimum_age")] public int? MinimumAge { get; set; } - + /// /// Whether or not an address must be provided on accept. /// [JsonProperty(PropertyName = "require_address")] public string RequireAddress { get; set; } - + /// /// [DEPRECATED] Whether or not the accepting user can give an extra tip on top of the requested Amount. /// Defaults to false. /// [JsonProperty(PropertyName = "want_tip")] public bool? WantTip { get; set; } - + /// /// [DEPRECATED] Whether or not the accepting user can choose to accept with a lower amount than requested. /// Defaults to false. /// [JsonProperty(PropertyName = "allow_amount_lower")] public bool? AllowAmountLower { get; set; } - + /// /// [DEPRECATED] Whether or not the accepting user can choose to accept with a higher amount than requested. /// Defaults to false. /// [JsonProperty(PropertyName = "allow_amount_higher")] public bool? AllowAmountHigher { get; set; } - + /// /// Whether or not sending a bunq.me request is allowed. /// [JsonProperty(PropertyName = "allow_bunqme")] public bool? AllowBunqme { get; set; } - + /// /// The URL which the user is sent to after accepting or rejecting the Request. /// [JsonProperty(PropertyName = "redirect_url")] public string RedirectUrl { get; set; } - + /// /// The ID of the associated event if the request was made using 'split the bill'. /// [JsonProperty(PropertyName = "event_id")] public int? EventId { get; set; } - + /// /// The id of the created RequestInquiry. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the payment request's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the payment request's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The timestamp of when the payment request was responded to. /// [JsonProperty(PropertyName = "time_responded")] public string TimeResponded { get; set; } - + /// /// The timestamp of when the payment request expired. /// [JsonProperty(PropertyName = "time_expiry")] public string TimeExpiry { get; set; } - + /// /// The id of the monetary account the request response applies to. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The responded amount. /// [JsonProperty(PropertyName = "amount_responded")] public Amount AmountResponded { get; set; } - + /// /// The label that's displayed to the counterparty with the mutation. Includes user. /// [JsonProperty(PropertyName = "user_alias_created")] public LabelUser UserAliasCreated { get; set; } - + /// /// The label that's displayed to the counterparty with the mutation. Includes user. /// [JsonProperty(PropertyName = "user_alias_revoked")] public LabelUser UserAliasRevoked { get; set; } - + /// /// The id of the batch if the request was part of a batch. /// [JsonProperty(PropertyName = "batch_id")] public int? BatchId { get; set; } - + /// /// The id of the scheduled job if the request was scheduled. /// [JsonProperty(PropertyName = "scheduled_id")] public int? ScheduledId { get; set; } - + /// /// The url that points to the bunq.me request. /// [JsonProperty(PropertyName = "bunqme_share_url")] public string BunqmeShareUrl { get; set; } - + /// /// The shipping address provided by the accepting user if an address was requested. /// [JsonProperty(PropertyName = "address_shipping")] public Address AddressShipping { get; set; } - + /// /// The billing address provided by the accepting user if an address was requested. /// [JsonProperty(PropertyName = "address_billing")] public Address AddressBilling { get; set; } - + /// /// The geolocation where the payment was done. /// [JsonProperty(PropertyName = "geolocation")] public Geolocation Geolocation { get; set; } - + /// /// The reference to the object used for split the bill. Can be Payment, PaymentBatch, ScheduleInstance, /// RequestResponse and MasterCardAction /// [JsonProperty(PropertyName = "reference_split_the_bill")] public RequestReferenceSplitTheBillAnchorObject ReferenceSplitTheBill { get; set; } - - + + /// /// Create a new payment request. /// @@ -250,106 +252,87 @@ public class RequestInquiry : BunqModel /// [DEPRECATED] Whether or not the accepting user can choose to accept with a higher amount than requested. Defaults to false. /// The URL which the user is sent to after accepting or rejecting the Request. /// The ID of the associated event if the request was made using 'split the bill'. - public static BunqResponse Create(Amount amountInquired, Pointer counterpartyAlias, string description, - bool? allowBunqme, int? monetaryAccountId = null, List attachment = null, - string merchantReference = null, string status = null, int? minimumAge = null, string requireAddress = null, - bool? wantTip = null, bool? allowAmountLower = null, bool? allowAmountHigher = null, - string redirectUrl = null, int? eventId = null, IDictionary customHeaders = null) + public static BunqResponse Create(Amount amountInquired, Pointer counterpartyAlias, string description, bool? allowBunqme, int? monetaryAccountId= null, List attachment = null, string merchantReference = null, string status = null, int? minimumAge = null, string requireAddress = null, bool? wantTip = null, bool? allowAmountLower = null, bool? allowAmountHigher = null, string redirectUrl = null, int? eventId = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_AMOUNT_INQUIRED, amountInquired}, - {FIELD_COUNTERPARTY_ALIAS, counterpartyAlias}, - {FIELD_DESCRIPTION, description}, - {FIELD_ATTACHMENT, attachment}, - {FIELD_MERCHANT_REFERENCE, merchantReference}, - {FIELD_STATUS, status}, - {FIELD_MINIMUM_AGE, minimumAge}, - {FIELD_REQUIRE_ADDRESS, requireAddress}, - {FIELD_WANT_TIP, wantTip}, - {FIELD_ALLOW_AMOUNT_LOWER, allowAmountLower}, - {FIELD_ALLOW_AMOUNT_HIGHER, allowAmountHigher}, - {FIELD_ALLOW_BUNQME, allowBunqme}, - {FIELD_REDIRECT_URL, redirectUrl}, - {FIELD_EVENT_ID, eventId}, - }; - + { + {FIELD_AMOUNT_INQUIRED, amountInquired}, + {FIELD_COUNTERPARTY_ALIAS, counterpartyAlias}, + {FIELD_DESCRIPTION, description}, + {FIELD_ATTACHMENT, attachment}, + {FIELD_MERCHANT_REFERENCE, merchantReference}, + {FIELD_STATUS, status}, + {FIELD_MINIMUM_AGE, minimumAge}, + {FIELD_REQUIRE_ADDRESS, requireAddress}, + {FIELD_WANT_TIP, wantTip}, + {FIELD_ALLOW_AMOUNT_LOWER, allowAmountLower}, + {FIELD_ALLOW_AMOUNT_HIGHER, allowAmountHigher}, + {FIELD_ALLOW_BUNQME, allowBunqme}, + {FIELD_REDIRECT_URL, redirectUrl}, + {FIELD_EVENT_ID, eventId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Revoke a request for payment, by updating the status to REVOKED. /// /// The status of the RequestInquiry. Ignored in POST requests but can be used for revoking (cancelling) the RequestInquiry by setting REVOKED with a PUT request. - public static BunqResponse Update(int requestInquiryId, int? monetaryAccountId = null, - string status = null, IDictionary customHeaders = null) + public static BunqResponse Update(int requestInquiryId, int? monetaryAccountId= null, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - }; - + { + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_PUT); } - + /// /// Get all payment requests for a user's monetary account. bunqme_share_url is always null if the counterparty /// is a bunq user. /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get the details of a specific payment request, including its status. bunqme_share_url is always null if the /// counterparty is a bunq user. /// - public static BunqResponse Get(int requestInquiryId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int requestInquiryId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -358,135 +341,135 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.TimeResponded != null) { return false; } - + if (this.TimeExpiry != null) { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.AmountInquired != null) { return false; } - + if (this.AmountResponded != null) { return false; } - + if (this.UserAliasCreated != null) { return false; } - + if (this.UserAliasRevoked != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.MerchantReference != null) { return false; } - + if (this.Attachment != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.BatchId != null) { return false; } - + if (this.ScheduledId != null) { return false; } - + if (this.MinimumAge != null) { return false; } - + if (this.RequireAddress != null) { return false; } - + if (this.BunqmeShareUrl != null) { return false; } - + if (this.RedirectUrl != null) { return false; } - + if (this.AddressShipping != null) { return false; } - + if (this.AddressBilling != null) { return false; } - + if (this.Geolocation != null) { return false; } - + if (this.ReferenceSplitTheBill != null) { return false; } - + return true; } - + /// /// public static RequestInquiry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/RequestInquiryBatch.cs b/BunqSdk/Model/Generated/Endpoint/RequestInquiryBatch.cs index 9338055d..2f0d1ab1 100644 --- a/BunqSdk/Model/Generated/Endpoint/RequestInquiryBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/RequestInquiryBatch.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,7 +22,7 @@ public class RequestInquiryBatch : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/request-inquiry-batch/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/request-inquiry-batch"; - + /// /// Field constants. /// @@ -28,44 +30,44 @@ public class RequestInquiryBatch : BunqModel public const string FIELD_STATUS = "status"; public const string FIELD_TOTAL_AMOUNT_INQUIRED = "total_amount_inquired"; public const string FIELD_EVENT_ID = "event_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "RequestInquiryBatch"; - + /// /// The list of requests that were made. /// [JsonProperty(PropertyName = "request_inquiries")] public List RequestInquiries { get; set; } - + /// /// The status of the request. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The total amount originally inquired for this batch. /// [JsonProperty(PropertyName = "total_amount_inquired")] public Amount TotalAmountInquired { get; set; } - + /// /// The ID of the associated event if the request batch was made using 'split the bill'. /// [JsonProperty(PropertyName = "event_id")] public int? EventId { get; set; } - + /// /// The reference to the object used for split the bill. Can be Payment, PaymentBatch, ScheduleInstance, /// RequestResponse and MasterCardAction /// [JsonProperty(PropertyName = "reference_split_the_bill")] public RequestReferenceSplitTheBillAnchorObject ReferenceSplitTheBill { get; set; } - - + + /// /// Create a request batch by sending an array of single request objects, that will become part of the batch. /// @@ -73,92 +75,75 @@ public class RequestInquiryBatch : BunqModel /// The total amount originally inquired for this batch. /// The status of the request. /// The ID of the associated event if the request batch was made using 'split the bill'. - public static BunqResponse Create(List requestInquiries, Amount totalAmountInquired, - int? monetaryAccountId = null, string status = null, int? eventId = null, - IDictionary customHeaders = null) + public static BunqResponse Create(List requestInquiries, Amount totalAmountInquired, int? monetaryAccountId= null, string status = null, int? eventId = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_REQUEST_INQUIRIES, requestInquiries}, - {FIELD_STATUS, status}, - {FIELD_TOTAL_AMOUNT_INQUIRED, totalAmountInquired}, - {FIELD_EVENT_ID, eventId}, - }; - + { + {FIELD_REQUEST_INQUIRIES, requestInquiries}, + {FIELD_STATUS, status}, + {FIELD_TOTAL_AMOUNT_INQUIRED, totalAmountInquired}, + {FIELD_EVENT_ID, eventId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Revoke a request batch. The status of all the requests will be set to REVOKED. /// /// The status of the request. - public static BunqResponse Update(int requestInquiryBatchId, int? monetaryAccountId = null, - string status = null, IDictionary customHeaders = null) + public static BunqResponse Update(int requestInquiryBatchId, int? monetaryAccountId= null, string status = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - }; - + { + {FIELD_STATUS, status}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Return the details of a specific request batch. /// - public static BunqResponse Get(int requestInquiryBatchId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int requestInquiryBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestInquiryBatchId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Return all the request batches for a monetary account. /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -167,25 +152,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.TotalAmountInquired != null) { return false; } - + if (this.ReferenceSplitTheBill != null) { return false; } - + return true; } - + /// /// public static RequestInquiryBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/RequestResponse.cs b/BunqSdk/Model/Generated/Endpoint/RequestResponse.cs index 62db4956..eaf1edbf 100644 --- a/BunqSdk/Model/Generated/Endpoint/RequestResponse.cs +++ b/BunqSdk/Model/Generated/Endpoint/RequestResponse.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -22,7 +24,7 @@ public class RequestResponse : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/request-response/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/request-response"; protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/request-response/{2}"; - + /// /// Field constants. /// @@ -30,186 +32,186 @@ public class RequestResponse : BunqModel public const string FIELD_STATUS = "status"; public const string FIELD_ADDRESS_SHIPPING = "address_shipping"; public const string FIELD_ADDRESS_BILLING = "address_billing"; - + /// /// Object type. /// private const string OBJECT_TYPE_PUT = "RequestResponse"; private const string OBJECT_TYPE_GET = "RequestResponse"; - + /// /// The Amount the RequestResponse was accepted with. /// [JsonProperty(PropertyName = "amount_responded")] public Amount AmountResponded { get; set; } - + /// /// The status of the RequestResponse. Can be ACCEPTED, PENDING, REJECTED, REFUND_REQUESTED, REFUNDED or /// REVOKED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The shipping address provided by the accepting user if an address was requested. /// [JsonProperty(PropertyName = "address_shipping")] public Address AddressShipping { get; set; } - + /// /// The billing address provided by the accepting user if an address was requested. /// [JsonProperty(PropertyName = "address_billing")] public Address AddressBilling { get; set; } - + /// /// The id of the Request Response. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp when the Request Response was created. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp when the Request Response was last updated (will be updated when chat messages are received). /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The timestamp of when the RequestResponse was responded to. /// [JsonProperty(PropertyName = "time_responded")] public string TimeResponded { get; set; } - + /// /// The timestamp of when the RequestResponse expired or will expire. /// [JsonProperty(PropertyName = "time_expiry")] public string TimeExpiry { get; set; } - + /// /// The timestamp of when a refund request for the RequestResponse was claimed. /// [JsonProperty(PropertyName = "time_refund_requested")] public string TimeRefundRequested { get; set; } - + /// /// The timestamp of when the RequestResponse was refunded. /// [JsonProperty(PropertyName = "time_refunded")] public string TimeRefunded { get; set; } - + /// /// The label of the user that requested the refund. /// [JsonProperty(PropertyName = "user_refund_requested")] public LabelUser UserRefundRequested { get; set; } - + /// /// The id of the MonetaryAccount the RequestResponse was received on. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The requested Amount. /// [JsonProperty(PropertyName = "amount_inquired")] public Amount AmountInquired { get; set; } - + /// /// The description for the RequestResponse provided by the requesting party. Maximum 9000 characters. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The LabelMonetaryAccount with the public information of the MonetaryAccount this RequestResponse was /// received on. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The LabelMonetaryAccount with the public information of the MonetaryAccount that is requesting money with /// this RequestResponse. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The Attachments attached to the RequestResponse. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - + /// /// The minimum age the user accepting the RequestResponse must have. /// [JsonProperty(PropertyName = "minimum_age")] public int? MinimumAge { get; set; } - + /// /// Whether or not an address must be provided on accept. /// [JsonProperty(PropertyName = "require_address")] public string RequireAddress { get; set; } - + /// /// The Geolocation where the RequestResponse was created. /// [JsonProperty(PropertyName = "geolocation")] public Geolocation Geolocation { get; set; } - + /// /// The type of the RequestInquiry. Can be DIRECT_DEBIT, DIRECT_DEBIT_B2B, IDEAL, SOFORT or INTERNAL. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The subtype of the RequestInquiry. Can be ONCE or RECURRING for DIRECT_DEBIT RequestInquiries and NONE for /// all other. /// [JsonProperty(PropertyName = "sub_type")] public string SubType { get; set; } - + /// /// The URL which the user is sent to after accepting or rejecting the Request. /// [JsonProperty(PropertyName = "redirect_url")] public string RedirectUrl { get; set; } - + /// /// The credit scheme id provided by the counterparty for DIRECT_DEBIT inquiries. /// [JsonProperty(PropertyName = "credit_scheme_identifier")] public string CreditSchemeIdentifier { get; set; } - + /// /// The mandate id provided by the counterparty for DIRECT_DEBIT inquiries. /// [JsonProperty(PropertyName = "mandate_identifier")] public string MandateIdentifier { get; set; } - + /// /// The whitelist id for this action or null. /// [JsonProperty(PropertyName = "eligible_whitelist_id")] public int? EligibleWhitelistId { get; set; } - + /// /// The reference to the object used for split the bill. Can be RequestInquiry or RequestInquiryBatch /// [JsonProperty(PropertyName = "request_reference_split_the_bill")] public List RequestReferenceSplitTheBill { get; set; } - - + + /// /// Update the status to accept or reject the RequestResponse. /// @@ -217,67 +219,54 @@ public class RequestResponse : BunqModel /// The responding status of the RequestResponse. Can be ACCEPTED or REJECTED. /// The shipping Address to return to the user who created the RequestInquiry. Should only be provided if 'require_address' is set to SHIPPING, BILLING_SHIPPING or OPTIONAL. /// The billing Address to return to the user who created the RequestInquiry. Should only be provided if 'require_address' is set to BILLING, BILLING_SHIPPING or OPTIONAL. - public static BunqResponse Update(int requestResponseId, int? monetaryAccountId = null, - Amount amountResponded = null, string status = null, Address addressShipping = null, - Address addressBilling = null, IDictionary customHeaders = null) + public static BunqResponse Update(int requestResponseId, int? monetaryAccountId= null, Amount amountResponded = null, string status = null, Address addressShipping = null, Address addressBilling = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_AMOUNT_RESPONDED, amountResponded}, - {FIELD_STATUS, status}, - {FIELD_ADDRESS_SHIPPING, addressShipping}, - {FIELD_ADDRESS_BILLING, addressBilling}, - }; - + { + {FIELD_AMOUNT_RESPONDED, amountResponded}, + {FIELD_STATUS, status}, + {FIELD_ADDRESS_SHIPPING, addressShipping}, + {FIELD_ADDRESS_BILLING, addressBilling}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestResponseId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_PUT); } - + /// /// Get all RequestResponses for a MonetaryAccount. /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get the details for a specific existing RequestResponse. /// - public static BunqResponse Get(int requestResponseId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int requestResponseId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - requestResponseId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), requestResponseId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -286,150 +275,150 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.TimeResponded != null) { return false; } - + if (this.TimeExpiry != null) { return false; } - + if (this.TimeRefundRequested != null) { return false; } - + if (this.TimeRefunded != null) { return false; } - + if (this.UserRefundRequested != null) { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.AmountInquired != null) { return false; } - + if (this.AmountResponded != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.Attachment != null) { return false; } - + if (this.MinimumAge != null) { return false; } - + if (this.RequireAddress != null) { return false; } - + if (this.Geolocation != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.SubType != null) { return false; } - + if (this.RedirectUrl != null) { return false; } - + if (this.AddressBilling != null) { return false; } - + if (this.AddressShipping != null) { return false; } - + if (this.CreditSchemeIdentifier != null) { return false; } - + if (this.MandateIdentifier != null) { return false; } - + if (this.EligibleWhitelistId != null) { return false; } - + if (this.RequestReferenceSplitTheBill != null) { return false; } - + return true; } - + /// /// public static RequestResponse CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Reward.cs b/BunqSdk/Model/Generated/Endpoint/Reward.cs index 181f5b16..47d6f8e5 100644 --- a/BunqSdk/Model/Generated/Endpoint/Reward.cs +++ b/BunqSdk/Model/Generated/Endpoint/Reward.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,90 +20,87 @@ public class Reward : BunqModel /// protected const string ENDPOINT_URL_READ = "user/{0}/reward/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/reward"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "Reward"; - + /// /// The id of the reward. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The time the reward was created. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The time the reward was last updated. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The status of the reward. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The subStatus of the reward. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The type of the reward. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The alias of the other user eligible for the reward award. /// [JsonProperty(PropertyName = "counterparty_alias")] public LabelUser CounterpartyAlias { get; set; } - + /// /// The amount that will be/was awarded as reward for the reward. /// [JsonProperty(PropertyName = "amount_reward")] public Amount AmountReward { get; set; } - - + + /// /// public static BunqResponse Get(int rewardId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), rewardId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), rewardId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -108,50 +109,50 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.AmountReward != null) { return false; } - + return true; } - + /// /// public static Reward CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/RewardRecipient.cs b/BunqSdk/Model/Generated/Endpoint/RewardRecipient.cs index bb19c960..17e6208d 100644 --- a/BunqSdk/Model/Generated/Endpoint/RewardRecipient.cs +++ b/BunqSdk/Model/Generated/Endpoint/RewardRecipient.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,91 +20,87 @@ public class RewardRecipient : BunqModel /// protected const string ENDPOINT_URL_READ = "user/{0}/reward-recipient/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/reward-recipient"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "RewardRecipient"; - + /// /// The id of the reward. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The time the reward was created. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The time the reward was last updated. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The status of the reward. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The subStatus of the reward. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The type of the reward. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The alias of the other user eligible for the reward award. /// [JsonProperty(PropertyName = "counterparty_alias")] public LabelUser CounterpartyAlias { get; set; } - + /// /// The amount that will be/was awarded as reward for the reward. /// [JsonProperty(PropertyName = "amount_reward")] public Amount AmountReward { get; set; } - - + + /// /// - public static BunqResponse Get(int rewardRecipientId, - IDictionary customHeaders = null) + public static BunqResponse Get(int rewardRecipientId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), rewardRecipientId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), rewardRecipientId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -109,50 +109,50 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.AmountReward != null) { return false; } - + return true; } - + /// /// public static RewardRecipient CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/RewardSender.cs b/BunqSdk/Model/Generated/Endpoint/RewardSender.cs index 7519910d..2b29ac57 100644 --- a/BunqSdk/Model/Generated/Endpoint/RewardSender.cs +++ b/BunqSdk/Model/Generated/Endpoint/RewardSender.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,91 +20,87 @@ public class RewardSender : BunqModel /// protected const string ENDPOINT_URL_READ = "user/{0}/reward-sender/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/reward-sender"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "RewardSender"; - + /// /// The id of the reward. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The time the reward was created. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The time the reward was last updated. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The status of the reward. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The subStatus of the reward. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The type of the reward. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The alias of the other user eligible for the reward award. /// [JsonProperty(PropertyName = "counterparty_alias")] public LabelUser CounterpartyAlias { get; set; } - + /// /// The amount that will be/was awarded as reward for the reward. /// [JsonProperty(PropertyName = "amount_reward")] public Amount AmountReward { get; set; } - - + + /// /// - public static BunqResponse Get(int rewardSenderId, - IDictionary customHeaders = null) + public static BunqResponse Get(int rewardSenderId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), rewardSenderId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), rewardSenderId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -109,50 +109,50 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.AmountReward != null) { return false; } - + return true; } - + /// /// public static RewardSender CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/SandboxUserCompany.cs b/BunqSdk/Model/Generated/Endpoint/SandboxUserCompany.cs index 35a75d78..64760257 100644 --- a/BunqSdk/Model/Generated/Endpoint/SandboxUserCompany.cs +++ b/BunqSdk/Model/Generated/Endpoint/SandboxUserCompany.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,37 +18,37 @@ public class SandboxUserCompany : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "sandbox-user-company"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "ApiKey"; - + /// /// The API key of the newly created sandbox userCompany. /// [JsonProperty(PropertyName = "api_key")] public string ApiKey { get; set; } - + /// /// - public static BunqResponse Create(IDictionary customHeaders = null) + public static BunqResponse Create( IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - }; - + { + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); var responseRaw = apiClient.Post(ENDPOINT_URL_CREATE, requestBytes, customHeaders); - + return FromJson(responseRaw, OBJECT_TYPE_POST); } - - + + /// /// public override bool IsAllFieldNull() @@ -55,15 +57,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static SandboxUserCompany CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/SandboxUserPerson.cs b/BunqSdk/Model/Generated/Endpoint/SandboxUserPerson.cs index 9c5831c0..c2629740 100644 --- a/BunqSdk/Model/Generated/Endpoint/SandboxUserPerson.cs +++ b/BunqSdk/Model/Generated/Endpoint/SandboxUserPerson.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,37 +18,37 @@ public class SandboxUserPerson : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "sandbox-user-person"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "ApiKey"; - + /// /// The API key of the newly created sandbox userPerson. /// [JsonProperty(PropertyName = "api_key")] public string ApiKey { get; set; } - + /// /// - public static BunqResponse Create(IDictionary customHeaders = null) + public static BunqResponse Create( IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - }; - + { + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); var responseRaw = apiClient.Post(ENDPOINT_URL_CREATE, requestBytes, customHeaders); - + return FromJson(responseRaw, OBJECT_TYPE_POST); } - - + + /// /// public override bool IsAllFieldNull() @@ -55,15 +57,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static SandboxUserPerson CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Schedule.cs b/BunqSdk/Model/Generated/Endpoint/Schedule.cs index 504e65be..c3bba585 100644 --- a/BunqSdk/Model/Generated/Endpoint/Schedule.cs +++ b/BunqSdk/Model/Generated/Endpoint/Schedule.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,7 +20,7 @@ public class Schedule : BunqModel /// protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/schedule/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/schedule"; - + /// /// Field constants. /// @@ -24,87 +28,79 @@ public class Schedule : BunqModel public const string FIELD_TIME_END = "time_end"; public const string FIELD_RECURRENCE_UNIT = "recurrence_unit"; public const string FIELD_RECURRENCE_SIZE = "recurrence_size"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "Schedule"; - + /// /// The schedule start time (UTC). /// [JsonProperty(PropertyName = "time_start")] public string TimeStart { get; set; } - + /// /// The schedule end time (UTC). /// [JsonProperty(PropertyName = "time_end")] public string TimeEnd { get; set; } - + /// /// The schedule recurrence unit, options: ONCE, HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY /// [JsonProperty(PropertyName = "recurrence_unit")] public string RecurrenceUnit { get; set; } - + /// /// The schedule recurrence size. For example size 4 and unit WEEKLY means the recurrence is every 4 weeks. /// [JsonProperty(PropertyName = "recurrence_size")] public int? RecurrenceSize { get; set; } - + /// /// The schedule status, options: ACTIVE, FINISHED, CANCELLED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The scheduled object. (Payment, PaymentBatch) /// [JsonProperty(PropertyName = "object")] public ScheduleAnchorObject Object { get; set; } - - + + /// /// Get a specific schedule definition for a given monetary account. /// - public static BunqResponse Get(int scheduleId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int scheduleId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get a collection of scheduled definition for a given monetary account. You can add the parameter type to /// filter the response. When type={SCHEDULE_DEFINITION_PAYMENT,SCHEDULE_DEFINITION_PAYMENT_BATCH} is provided /// only schedule definition object that relate to these definitions are returned. /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -113,40 +109,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.TimeEnd != null) { return false; } - + if (this.RecurrenceUnit != null) { return false; } - + if (this.RecurrenceSize != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.Object != null) { return false; } - + return true; } - + /// /// public static Schedule CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ScheduleInstance.cs b/BunqSdk/Model/Generated/Endpoint/ScheduleInstance.cs index a46199a7..578d9315 100644 --- a/BunqSdk/Model/Generated/Endpoint/ScheduleInstance.cs +++ b/BunqSdk/Model/Generated/Endpoint/ScheduleInstance.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,118 +21,106 @@ public class ScheduleInstance : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/schedule/{2}/schedule-instance"; - + /// /// Field constants. /// public const string FIELD_STATE = "state"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ScheduledInstance"; - + /// /// The state of the scheduleInstance. (FINISHED_SUCCESSFULLY, RETRY, FAILED_USER_ERROR) /// [JsonProperty(PropertyName = "state")] public string State { get; set; } - + /// /// The schedule start time (UTC). /// [JsonProperty(PropertyName = "time_start")] public string TimeStart { get; set; } - + /// /// The schedule end time (UTC). /// [JsonProperty(PropertyName = "time_end")] public string TimeEnd { get; set; } - + /// /// The message when the scheduled instance has run and failed due to user error. /// [JsonProperty(PropertyName = "error_message")] public List ErrorMessage { get; set; } - + /// /// The scheduled object. (Payment, PaymentBatch) /// [JsonProperty(PropertyName = "scheduled_object")] public ScheduleAnchorObject ScheduledObject { get; set; } - + /// /// The result object of this schedule instance. (Payment, PaymentBatch) /// [JsonProperty(PropertyName = "result_object")] public ScheduleInstanceAnchorObject ResultObject { get; set; } - + /// /// The reference to the object used for split the bill. Can be RequestInquiry or RequestInquiryBatch /// [JsonProperty(PropertyName = "request_reference_split_the_bill")] public List RequestReferenceSplitTheBill { get; set; } - - + + /// /// - public static BunqResponse Get(int scheduleId, int scheduleInstanceId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int scheduleId, int scheduleInstanceId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId, scheduleInstanceId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// Change the state of the scheduleInstance from FAILED_USER_ERROR to RETRY. - public static BunqResponse Update(int scheduleId, int scheduleInstanceId, int? monetaryAccountId = null, - string state = null, IDictionary customHeaders = null) + public static BunqResponse Update(int scheduleId, int scheduleInstanceId, int? monetaryAccountId= null, string state = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATE, state}, - }; - + { + {FIELD_STATE, state}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - scheduleId, scheduleInstanceId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(int scheduleId, int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int scheduleId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), scheduleId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), scheduleId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -139,45 +129,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.TimeStart != null) { return false; } - + if (this.TimeEnd != null) { return false; } - + if (this.ErrorMessage != null) { return false; } - + if (this.ScheduledObject != null) { return false; } - + if (this.ResultObject != null) { return false; } - + if (this.RequestReferenceSplitTheBill != null) { return false; } - + return true; } - + /// /// public static ScheduleInstance CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/SchedulePayment.cs b/BunqSdk/Model/Generated/Endpoint/SchedulePayment.cs index cf318396..547223b3 100644 --- a/BunqSdk/Model/Generated/Endpoint/SchedulePayment.cs +++ b/BunqSdk/Model/Generated/Endpoint/SchedulePayment.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,141 +23,120 @@ public class SchedulePayment : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/schedule-payment/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/schedule-payment"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/schedule-payment/{2}"; - + /// /// Field constants. /// public const string FIELD_PAYMENT = "payment"; public const string FIELD_SCHEDULE = "schedule"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ScheduledPayment"; private const string OBJECT_TYPE_PUT = "ScheduledPayment"; - + /// /// The payment details. /// [JsonProperty(PropertyName = "payment")] public SchedulePaymentEntry Payment { get; set; } - + /// /// The schedule details. /// [JsonProperty(PropertyName = "schedule")] public Schedule Schedule { get; set; } - + /// /// The schedule status, options: ACTIVE, FINISHED, CANCELLED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - - + + /// /// /// The payment details. /// The schedule details when creating or updating a scheduled payment. - public static BunqResponse Create(SchedulePaymentEntry payment, Schedule schedule, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Create(SchedulePaymentEntry payment, Schedule schedule, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_PAYMENT, payment}, - {FIELD_SCHEDULE, schedule}, - }; - + { + {FIELD_PAYMENT, payment}, + {FIELD_SCHEDULE, schedule}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int schedulePaymentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int schedulePaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// - public static BunqResponse Get(int schedulePaymentId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int schedulePaymentId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// /// The payment details. /// The schedule details when creating or updating a scheduled payment. - public static BunqResponse Update(int schedulePaymentId, int? monetaryAccountId = null, - SchedulePaymentEntry payment = null, Schedule schedule = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int schedulePaymentId, int? monetaryAccountId= null, SchedulePaymentEntry payment = null, Schedule schedule = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_PAYMENT, payment}, - {FIELD_SCHEDULE, schedule}, - }; - + { + {FIELD_PAYMENT, payment}, + {FIELD_SCHEDULE, schedule}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentId), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_PUT); } - - + + /// /// public override bool IsAllFieldNull() @@ -164,25 +145,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Schedule != null) { return false; } - + if (this.Status != null) { return false; } - + return true; } - + /// /// public static SchedulePayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/SchedulePaymentBatch.cs b/BunqSdk/Model/Generated/Endpoint/SchedulePaymentBatch.cs index 6d7970dd..f7b8a8cb 100644 --- a/BunqSdk/Model/Generated/Endpoint/SchedulePaymentBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/SchedulePaymentBatch.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,97 +21,84 @@ public class SchedulePaymentBatch : BunqModel protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/schedule-payment-batch"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}"; protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/schedule-payment-batch/{2}"; - + /// /// Field constants. /// public const string FIELD_PAYMENTS = "payments"; public const string FIELD_SCHEDULE = "schedule"; - - + + /// /// The payment details. /// [JsonProperty(PropertyName = "payments")] public List Payments { get; set; } - + /// /// The schedule details. /// [JsonProperty(PropertyName = "schedule")] public Schedule Schedule { get; set; } - - + + /// /// /// The payment details. /// The schedule details when creating a scheduled payment. - public static BunqResponse Create(List payments, Schedule schedule, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Create(List payments, Schedule schedule, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_PAYMENTS, payments}, - {FIELD_SCHEDULE, schedule}, - }; - + { + {FIELD_PAYMENTS, payments}, + {FIELD_SCHEDULE, schedule}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// The payment details. /// The schedule details when creating a scheduled payment. - public static BunqResponse Update(int schedulePaymentBatchId, int? monetaryAccountId = null, - List payments = null, Schedule schedule = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int schedulePaymentBatchId, int? monetaryAccountId= null, List payments = null, Schedule schedule = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_PAYMENTS, payments}, - {FIELD_SCHEDULE, schedule}, - }; - + { + {FIELD_PAYMENTS, payments}, + {FIELD_SCHEDULE, schedule}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentBatchId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Delete(int schedulePaymentBatchId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int schedulePaymentBatchId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - schedulePaymentBatchId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() @@ -118,20 +107,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Schedule != null) { return false; } - + return true; } - + /// /// public static SchedulePaymentBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ScheduleUser.cs b/BunqSdk/Model/Generated/Endpoint/ScheduleUser.cs index ec0bf3f0..e0724460 100644 --- a/BunqSdk/Model/Generated/Endpoint/ScheduleUser.cs +++ b/BunqSdk/Model/Generated/Endpoint/ScheduleUser.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -13,44 +18,42 @@ public class ScheduleUser : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/schedule"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ScheduleUser"; - + /// /// Get a collection of scheduled definition for all accessible monetary accounts of the user. You can add the /// parameter type to filter the response. When /// type={SCHEDULE_DEFINITION_PAYMENT,SCHEDULE_DEFINITION_PAYMENT_BATCH} is provided only schedule definition /// object that relate to these definitions are returned. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static ScheduleUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Session.cs b/BunqSdk/Model/Generated/Endpoint/Session.cs index d49187aa..e7c6446d 100644 --- a/BunqSdk/Model/Generated/Endpoint/Session.cs +++ b/BunqSdk/Model/Generated/Endpoint/Session.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -13,34 +18,34 @@ public class Session : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_DELETE = "session/{0}"; - - + + /// /// Deletes the current session. /// public static BunqResponse Delete(int sessionId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, sessionId), customHeaders); - + return new BunqResponse(null, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static Session CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ShareInviteBankInquiryBatch.cs b/BunqSdk/Model/Generated/Endpoint/ShareInviteBankInquiryBatch.cs index a97d77ec..329cc800 100644 --- a/BunqSdk/Model/Generated/Endpoint/ShareInviteBankInquiryBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/ShareInviteBankInquiryBatch.cs @@ -1,6 +1,7 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,14 +17,15 @@ public class ShareInviteBankInquiryBatch : BunqModel /// [JsonProperty(PropertyName = "share_invite_bank_inquiries")] public List ShareInviteBankInquiries { get; set; } - + /// /// The LabelMonetaryAccount containing the public information of this share invite inquiry batch. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -32,20 +34,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Alias != null) { return false; } - + return true; } - + /// /// public static ShareInviteBankInquiryBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountAmountUsed.cs b/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountAmountUsed.cs index 5c4a192c..c94cb62e 100644 --- a/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountAmountUsed.cs +++ b/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountAmountUsed.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,41 +19,35 @@ public class ShareInviteMonetaryAccountAmountUsed : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/share-invite-monetary-account-inquiry/{2}/amount-used/{3}"; - - + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/share-invite-monetary-account-inquiry/{2}/amount-used/{3}"; + + /// /// Reset the available budget for an account share. To be called without any ID at the end of the path. /// - public static BunqResponse Delete(int shareInviteMonetaryAccountInquiryId, - int shareInviteMonetaryAccountAmountUsedId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Delete(int shareInviteMonetaryAccountInquiryId, int shareInviteMonetaryAccountAmountUsedId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - shareInviteMonetaryAccountInquiryId, shareInviteMonetaryAccountAmountUsedId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), shareInviteMonetaryAccountInquiryId, shareInviteMonetaryAccountAmountUsedId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static ShareInviteMonetaryAccountAmountUsed CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountInquiry.cs b/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountInquiry.cs index bedc3b7a..32c1086a 100644 --- a/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountInquiry.cs +++ b/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountInquiry.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,15 +20,11 @@ public class ShareInviteMonetaryAccountInquiry : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/share-invite-monetary-account-inquiry"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/share-invite-monetary-account-inquiry/{2}"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/share-invite-monetary-account-inquiry/{2}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/share-invite-monetary-account-inquiry"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/share-invite-monetary-account-inquiry"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/share-invite-monetary-account-inquiry/{2}"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/share-invite-monetary-account-inquiry/{2}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/share-invite-monetary-account-inquiry"; + /// /// Field constants. /// @@ -38,30 +36,30 @@ public class ShareInviteMonetaryAccountInquiry : BunqModel public const string FIELD_SHARE_TYPE = "share_type"; public const string FIELD_START_DATE = "start_date"; public const string FIELD_END_DATE = "end_date"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ShareInviteMonetaryAccountInquiry"; - + /// /// The label of the user to share with. /// [JsonProperty(PropertyName = "counter_user_alias")] public LabelUser CounterUserAlias { get; set; } - + /// /// The id of the draft share invite bank. /// [JsonProperty(PropertyName = "draft_share_invite_bank_id")] public int? DraftShareInviteBankId { get; set; } - + /// /// The share details. Only one of these objects is returned. /// [JsonProperty(PropertyName = "share_detail")] public ShareDetail ShareDetail { get; set; } - + /// /// The status of the share. Can be PENDING, REVOKED (the user deletes the share inquiry before it's accepted), /// ACCEPTED, CANCELLED (the user deletes an active share) or CANCELLATION_PENDING, CANCELLATION_ACCEPTED, @@ -69,62 +67,62 @@ public class ShareInviteMonetaryAccountInquiry : BunqModel /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The relationship: COMPANY_DIRECTOR, COMPANY_EMPLOYEE, etc /// [JsonProperty(PropertyName = "relationship")] public string Relationship { get; set; } - + /// /// The share type, either STANDARD or MUTUAL. /// [JsonProperty(PropertyName = "share_type")] public string ShareType { get; set; } - + /// /// The start date of this share. /// [JsonProperty(PropertyName = "start_date")] public string StartDate { get; set; } - + /// /// The expiration date of this share. /// [JsonProperty(PropertyName = "end_date")] public string EndDate { get; set; } - + /// /// The label of the monetary account that's being shared. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The user who created the share. /// [JsonProperty(PropertyName = "user_alias_created")] public LabelUser UserAliasCreated { get; set; } - + /// /// The user who revoked the share. /// [JsonProperty(PropertyName = "user_alias_revoked")] public LabelUser UserAliasRevoked { get; set; } - + /// /// The id of the monetary account the share applies to. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The id of the newly created share invite. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - - + + /// /// [DEPRECATED - use /share-invite-monetary-account-response] Create a new share inquiry for a monetary /// account, specifying the permission the other bunq user will have on it. @@ -137,53 +135,43 @@ public class ShareInviteMonetaryAccountInquiry : BunqModel /// The share type, either STANDARD or MUTUAL. /// The start date of this share. /// The expiration date of this share. - public static BunqResponse Create(Pointer counterUserAlias, ShareDetail shareDetail, string status, - int? monetaryAccountId = null, int? draftShareInviteBankId = null, string relationship = null, - string shareType = null, string startDate = null, string endDate = null, - IDictionary customHeaders = null) + public static BunqResponse Create(Pointer counterUserAlias, ShareDetail shareDetail, string status, int? monetaryAccountId= null, int? draftShareInviteBankId = null, string relationship = null, string shareType = null, string startDate = null, string endDate = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_COUNTER_USER_ALIAS, counterUserAlias}, - {FIELD_DRAFT_SHARE_INVITE_BANK_ID, draftShareInviteBankId}, - {FIELD_SHARE_DETAIL, shareDetail}, - {FIELD_STATUS, status}, - {FIELD_RELATIONSHIP, relationship}, - {FIELD_SHARE_TYPE, shareType}, - {FIELD_START_DATE, startDate}, - {FIELD_END_DATE, endDate}, - }; - + { + {FIELD_COUNTER_USER_ALIAS, counterUserAlias}, + {FIELD_DRAFT_SHARE_INVITE_BANK_ID, draftShareInviteBankId}, + {FIELD_SHARE_DETAIL, shareDetail}, + {FIELD_STATUS, status}, + {FIELD_RELATIONSHIP, relationship}, + {FIELD_SHARE_TYPE, shareType}, + {FIELD_START_DATE, startDate}, + {FIELD_END_DATE, endDate}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// [DEPRECATED - use /share-invite-monetary-account-response] Get the details of a specific share inquiry. /// - public static BunqResponse Get(int shareInviteMonetaryAccountInquiryId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int shareInviteMonetaryAccountInquiryId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - shareInviteMonetaryAccountInquiryId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), shareInviteMonetaryAccountInquiryId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// [DEPRECATED - use /share-invite-monetary-account-response] Update the details of a share. This includes /// updating status (revoking or cancelling it), granted permission and validity period of this share. @@ -192,51 +180,42 @@ public static BunqResponse Get(int shareInvit /// The status of the share. Can be PENDING, REVOKED (the user deletes the share inquiry before it's accepted), ACCEPTED, CANCELLED (the user deletes an active share) or CANCELLATION_PENDING, CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual connects). /// The start date of this share. /// The expiration date of this share. - public static BunqResponse Update(int shareInviteMonetaryAccountInquiryId, int? monetaryAccountId = null, - ShareDetail shareDetail = null, string status = null, string startDate = null, string endDate = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int shareInviteMonetaryAccountInquiryId, int? monetaryAccountId= null, ShareDetail shareDetail = null, string status = null, string startDate = null, string endDate = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_SHARE_DETAIL, shareDetail}, - {FIELD_STATUS, status}, - {FIELD_START_DATE, startDate}, - {FIELD_END_DATE, endDate}, - }; - + { + {FIELD_SHARE_DETAIL, shareDetail}, + {FIELD_STATUS, status}, + {FIELD_START_DATE, startDate}, + {FIELD_END_DATE, endDate}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - shareInviteMonetaryAccountInquiryId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), shareInviteMonetaryAccountInquiryId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// [DEPRECATED - use /share-invite-monetary-account-response] Get a list with all the share inquiries for a /// monetary account, only if the requesting user has permission to change the details of the various ones. /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -245,75 +224,75 @@ public override bool IsAllFieldNull() { return false; } - + if (this.UserAliasCreated != null) { return false; } - + if (this.UserAliasRevoked != null) { return false; } - + if (this.CounterUserAlias != null) { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.DraftShareInviteBankId != null) { return false; } - + if (this.ShareDetail != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.Relationship != null) { return false; } - + if (this.ShareType != null) { return false; } - + if (this.StartDate != null) { return false; } - + if (this.EndDate != null) { return false; } - + if (this.Id != null) { return false; } - + return true; } - + /// /// public static ShareInviteMonetaryAccountInquiry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountResponse.cs b/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountResponse.cs index cf80eb36..7cf5cf29 100644 --- a/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountResponse.cs +++ b/BunqSdk/Model/Generated/Endpoint/ShareInviteMonetaryAccountResponse.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,18 +22,18 @@ public class ShareInviteMonetaryAccountResponse : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/share-invite-monetary-account-response/{1}"; protected const string ENDPOINT_URL_UPDATE = "user/{0}/share-invite-monetary-account-response/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/share-invite-monetary-account-response"; - + /// /// Field constants. /// public const string FIELD_STATUS = "status"; public const string FIELD_CARD_ID = "card_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "ShareInviteMonetaryAccountResponse"; - + /// /// The status of the share. Can be PENDING, REVOKED (the user deletes the share inquiry before it's accepted), /// ACCEPTED, CANCELLED (the user deletes an active share) or CANCELLATION_PENDING, CANCELLATION_ACCEPTED, @@ -39,152 +41,143 @@ public class ShareInviteMonetaryAccountResponse : BunqModel /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The card to link to the shared monetary account. Used only if share_detail is ShareDetailCardPayment. /// [JsonProperty(PropertyName = "card_id")] public int? CardId { get; set; } - + /// /// The id of the ShareInviteBankResponse. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the ShareInviteBankResponse creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the ShareInviteBankResponse last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The monetary account and user who created the share. /// [JsonProperty(PropertyName = "counter_alias")] public MonetaryAccountReference CounterAlias { get; set; } - + /// /// The user who cancelled the share if it has been revoked or rejected. /// [JsonProperty(PropertyName = "user_alias_cancelled")] public LabelUser UserAliasCancelled { get; set; } - + /// /// The id of the monetary account the ACCEPTED share applies to. null otherwise. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The id of the draft share invite bank. /// [JsonProperty(PropertyName = "draft_share_invite_bank_id")] public int? DraftShareInviteBankId { get; set; } - + /// /// The share details. /// [JsonProperty(PropertyName = "share_detail")] public ShareDetail ShareDetail { get; set; } - + /// /// All of the relation users towards this MA. /// [JsonProperty(PropertyName = "relation_user")] public RelationUser RelationUser { get; set; } - + /// /// The share type, either STANDARD or MUTUAL. /// [JsonProperty(PropertyName = "share_type")] public string ShareType { get; set; } - + /// /// The start date of this share. /// [JsonProperty(PropertyName = "start_date")] public string StartDate { get; set; } - + /// /// The expiration date of this share. /// [JsonProperty(PropertyName = "end_date")] public string EndDate { get; set; } - + /// /// The description of this share. It is basically the monetary account description. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - - + + /// /// Return the details of a specific share a user was invited to. /// - public static BunqResponse Get(int shareInviteMonetaryAccountResponseId, - IDictionary customHeaders = null) + public static BunqResponse Get(int shareInviteMonetaryAccountResponseId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), shareInviteMonetaryAccountResponseId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), shareInviteMonetaryAccountResponseId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Accept or reject a share a user was invited to. /// /// The status of the share. Can be PENDING, REVOKED (the user deletes the share inquiry before it's accepted), ACCEPTED, CANCELLED (the user deletes an active share) or CANCELLATION_PENDING, CANCELLATION_ACCEPTED, CANCELLATION_REJECTED (for canceling mutual connects) /// The card to link to the shared monetary account. Used only if share_detail is ShareDetailCardPayment. - public static BunqResponse Update(int shareInviteMonetaryAccountResponseId, string status = null, - int? cardId = null, IDictionary customHeaders = null) + public static BunqResponse Update(int shareInviteMonetaryAccountResponseId, string status = null, int? cardId = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - {FIELD_CARD_ID, cardId}, - }; - + { + {FIELD_STATUS, status}, + {FIELD_CARD_ID, cardId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), shareInviteMonetaryAccountResponseId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), shareInviteMonetaryAccountResponseId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Return all the shares a user was invited to. /// - public static BunqResponse> List( - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -193,80 +186,80 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.CounterAlias != null) { return false; } - + if (this.UserAliasCancelled != null) { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.DraftShareInviteBankId != null) { return false; } - + if (this.ShareDetail != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.RelationUser != null) { return false; } - + if (this.ShareType != null) { return false; } - + if (this.StartDate != null) { return false; } - + if (this.EndDate != null) { return false; } - + if (this.Description != null) { return false; } - + return true; } - + /// /// public static ShareInviteMonetaryAccountResponse CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/SofortMerchantTransaction.cs b/BunqSdk/Model/Generated/Endpoint/SofortMerchantTransaction.cs index c19f50eb..072f14bc 100644 --- a/BunqSdk/Model/Generated/Endpoint/SofortMerchantTransaction.cs +++ b/BunqSdk/Model/Generated/Endpoint/SofortMerchantTransaction.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,113 +20,105 @@ public class SofortMerchantTransaction : BunqModel /// protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/sofort-merchant-transaction/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/sofort-merchant-transaction"; - + /// /// Field constants. /// public const string FIELD_AMOUNT_REQUESTED = "amount_requested"; public const string FIELD_ISSUER = "issuer"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "SofortMerchantTransaction"; - + /// /// The requested amount of money to add. /// [JsonProperty(PropertyName = "amount_requested")] public Amount AmountRequested { get; set; } - + /// /// The BIC of the issuer. /// [JsonProperty(PropertyName = "issuer")] public string Issuer { get; set; } - + /// /// The id of the monetary account this sofort merchant transaction links to. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The alias of the monetary account to add money to. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The alias of the monetary account the money comes from. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// In case of a successful transaction, the amount of money that will be transferred. /// [JsonProperty(PropertyName = "amount_guaranteed")] public Amount AmountGuaranteed { get; set; } - + /// /// The URL to visit to /// [JsonProperty(PropertyName = "issuer_authentication_url")] public string IssuerAuthenticationUrl { get; set; } - + /// /// The status of the transaction. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The error message of the transaction. /// [JsonProperty(PropertyName = "error_message")] public List ErrorMessage { get; set; } - + /// /// The 'transaction ID' of the Sofort transaction. /// [JsonProperty(PropertyName = "transaction_identifier")] public string TransactionIdentifier { get; set; } - - + + /// /// - public static BunqResponse Get(int sofortMerchantTransactionId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int sofortMerchantTransactionId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - sofortMerchantTransactionId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), sofortMerchantTransactionId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -131,60 +127,60 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Alias != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.AmountGuaranteed != null) { return false; } - + if (this.AmountRequested != null) { return false; } - + if (this.Issuer != null) { return false; } - + if (this.IssuerAuthenticationUrl != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.ErrorMessage != null) { return false; } - + if (this.TransactionIdentifier != null) { return false; } - + return true; } - + /// /// public static SofortMerchantTransaction CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Tab.cs b/BunqSdk/Model/Generated/Endpoint/Tab.cs index 3772e405..f4f44a3c 100644 --- a/BunqSdk/Model/Generated/Endpoint/Tab.cs +++ b/BunqSdk/Model/Generated/Endpoint/Tab.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Exception; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,65 +23,57 @@ public class Tab : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - + /// /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/cash-register/{2}/tab"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "Tab"; - + /// /// [JsonProperty(PropertyName = "TabUsageSingle")] public TabUsageSingle TabUsageSingle { get; set; } - + /// /// [JsonProperty(PropertyName = "TabUsageMultiple")] public TabUsageMultiple TabUsageMultiple { get; set; } - - + + /// /// Get a specific tab. This returns a TabUsageSingle or TabUsageMultiple. /// - public static BunqResponse Get(int cashRegisterId, string tabUuid, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int cashRegisterId, string tabUuid, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUuid), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), new Dictionary(), customHeaders); + return FromJson(responseRaw); } - + /// /// Get a collection of tabs. /// - public static BunqResponse> List(int cashRegisterId, int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int cashRegisterId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), urlParams, customHeaders); + return FromJsonList(responseRaw); } - - + + /// /// public BunqModel GetReferencedObject() @@ -86,15 +82,15 @@ public BunqModel GetReferencedObject() { return this.TabUsageSingle; } - + if (this.TabUsageMultiple != null) { return this.TabUsageMultiple; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -103,20 +99,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.TabUsageMultiple != null) { return false; } - + return true; } - + /// /// public static Tab CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TabAttachmentTab.cs b/BunqSdk/Model/Generated/Endpoint/TabAttachmentTab.cs index 6f188581..c915bfb1 100644 --- a/BunqSdk/Model/Generated/Endpoint/TabAttachmentTab.cs +++ b/BunqSdk/Model/Generated/Endpoint/TabAttachmentTab.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,53 +19,51 @@ public class TabAttachmentTab : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "tab/{0}/attachment/{1}"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TabAttachmentTab"; - + /// /// The id of the attachment. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the attachment's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the attachment's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The attachment. /// [JsonProperty(PropertyName = "attachment")] public Attachment Attachment { get; set; } - - + + /// /// Get a specific attachment. The header of the response contains the content-type of the attachment. /// - public static BunqResponse Get(string tabUuid, int tabAttachmentTabId, - IDictionary customHeaders = null) + public static BunqResponse Get(string tabUuid, int tabAttachmentTabId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, tabUuid, tabAttachmentTabId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, tabUuid, tabAttachmentTabId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -70,30 +72,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static TabAttachmentTab CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TabAttachmentTabContent.cs b/BunqSdk/Model/Generated/Endpoint/TabAttachmentTabContent.cs index 9a6f62e7..5bc23890 100644 --- a/BunqSdk/Model/Generated/Endpoint/TabAttachmentTabContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/TabAttachmentTabContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,40 +19,38 @@ public class TabAttachmentTabContent : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "tab/{0}/attachment/{1}/content"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TabAttachmentTabContent"; - + /// /// Get the raw content of a specific attachment. /// - public static BunqResponse List(string tabUuid, int attachmentId, - IDictionary customHeaders = null) + public static BunqResponse List(string tabUuid, int attachmentId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, tabUuid, attachmentId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, tabUuid, attachmentId), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static TabAttachmentTabContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TabItem.cs b/BunqSdk/Model/Generated/Endpoint/TabItem.cs index 3343d1d9..424e3e0b 100644 --- a/BunqSdk/Model/Generated/Endpoint/TabItem.cs +++ b/BunqSdk/Model/Generated/Endpoint/TabItem.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,45 +15,46 @@ public class TabItem : BunqModel /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The item's brief description. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The item's EAN code. /// [JsonProperty(PropertyName = "ean_code")] public string EanCode { get; set; } - + /// /// A struct with an AttachmentPublic UUID that used as an avatar for the TabItem. /// [JsonProperty(PropertyName = "avatar_attachment")] public AttachmentPublic AvatarAttachment { get; set; } - + /// /// A list of AttachmentTab attached to the TabItem. /// [JsonProperty(PropertyName = "tab_attachment")] public List TabAttachment { get; set; } - + /// /// The quantity of the item. Formatted as a number containing up to 15 digits, up to 15 decimals and using a /// dot. /// [JsonProperty(PropertyName = "quantity")] public string Quantity { get; set; } - + /// /// The money amount of the item. /// [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -62,45 +63,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Description != null) { return false; } - + if (this.EanCode != null) { return false; } - + if (this.AvatarAttachment != null) { return false; } - + if (this.TabAttachment != null) { return false; } - + if (this.Quantity != null) { return false; } - + if (this.Amount != null) { return false; } - + return true; } - + /// /// public static TabItem CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TabItemShop.cs b/BunqSdk/Model/Generated/Endpoint/TabItemShop.cs index 7ba5e88d..e5e6a6d7 100644 --- a/BunqSdk/Model/Generated/Endpoint/TabItemShop.cs +++ b/BunqSdk/Model/Generated/Endpoint/TabItemShop.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,15 +23,11 @@ public class TabItemShop : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item/{4}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item/{4}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item/{4}"; - + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item/{4}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item/{4}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item/{4}"; + /// /// Field constants. /// @@ -39,61 +37,61 @@ public class TabItemShop : BunqModel public const string FIELD_TAB_ATTACHMENT = "tab_attachment"; public const string FIELD_QUANTITY = "quantity"; public const string FIELD_AMOUNT = "amount"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TabItem"; - + /// /// The TabItem's brief description. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The TabItem's EAN code. /// [JsonProperty(PropertyName = "ean_code")] public string EanCode { get; set; } - + /// /// An AttachmentPublic UUID that used as an avatar for the TabItem. /// [JsonProperty(PropertyName = "avatar_attachment_uuid")] public string AvatarAttachmentUuid { get; set; } - + /// /// A list of AttachmentTab attached to the TabItem. /// [JsonProperty(PropertyName = "tab_attachment")] public List TabAttachment { get; set; } - + /// /// The quantity of the TabItem. /// [JsonProperty(PropertyName = "quantity")] public double? Quantity { get; set; } - + /// /// The money amount of the TabItem. /// [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } - + /// /// The id of the created TabItem. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// A struct with an AttachmentPublic UUID that used as an avatar for the TabItem. /// [JsonProperty(PropertyName = "avatar_attachment")] public AttachmentPublic AvatarAttachment { get; set; } - - + + /// /// Create a new TabItem for a given Tab. /// @@ -103,34 +101,28 @@ public class TabItemShop : BunqModel /// A list of AttachmentTab attached to the TabItem. /// The quantity of the TabItem. Formatted as a number containing up to 15 digits, up to 15 decimals and using a dot. /// The money amount of the TabItem. Will not change the value of the corresponding Tab. - public static BunqResponse Create(int cashRegisterId, string tabUuid, string description, - int? monetaryAccountId = null, string eanCode = null, string avatarAttachmentUuid = null, - List tabAttachment = null, string quantity = null, Amount amount = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int cashRegisterId, string tabUuid, string description, int? monetaryAccountId= null, string eanCode = null, string avatarAttachmentUuid = null, List tabAttachment = null, string quantity = null, Amount amount = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_EAN_CODE, eanCode}, - {FIELD_AVATAR_ATTACHMENT_UUID, avatarAttachmentUuid}, - {FIELD_TAB_ATTACHMENT, tabAttachment}, - {FIELD_QUANTITY, quantity}, - {FIELD_AMOUNT, amount}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_EAN_CODE, eanCode}, + {FIELD_AVATAR_ATTACHMENT_UUID, avatarAttachmentUuid}, + {FIELD_TAB_ATTACHMENT, tabAttachment}, + {FIELD_QUANTITY, quantity}, + {FIELD_AMOUNT, amount}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUuid), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Modify a TabItem from a given Tab. /// @@ -140,89 +132,69 @@ public static BunqResponse Create(int cashRegisterId, string tabUuid, strin /// A list of AttachmentTab attached to the TabItem. /// The quantity of the TabItem. Formatted as a number containing up to 15 digits, up to 15 decimals and using a dot. /// The money amount of the TabItem. Will not change the value of the corresponding Tab. - public static BunqResponse Update(int cashRegisterId, string tabUuid, int tabItemShopId, - int? monetaryAccountId = null, string description = null, string eanCode = null, - string avatarAttachmentUuid = null, List tabAttachment = null, string quantity = null, - Amount amount = null, IDictionary customHeaders = null) + public static BunqResponse Update(int cashRegisterId, string tabUuid, int tabItemShopId, int? monetaryAccountId= null, string description = null, string eanCode = null, string avatarAttachmentUuid = null, List tabAttachment = null, string quantity = null, Amount amount = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_EAN_CODE, eanCode}, - {FIELD_AVATAR_ATTACHMENT_UUID, avatarAttachmentUuid}, - {FIELD_TAB_ATTACHMENT, tabAttachment}, - {FIELD_QUANTITY, quantity}, - {FIELD_AMOUNT, amount}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_EAN_CODE, eanCode}, + {FIELD_AVATAR_ATTACHMENT_UUID, avatarAttachmentUuid}, + {FIELD_TAB_ATTACHMENT, tabAttachment}, + {FIELD_QUANTITY, quantity}, + {FIELD_AMOUNT, amount}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUuid, tabItemShopId), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid, tabItemShopId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// Delete a specific TabItem from a Tab. /// - public static BunqResponse Delete(int cashRegisterId, string tabUuid, int tabItemShopId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int cashRegisterId, string tabUuid, int tabItemShopId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUuid, tabItemShopId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid, tabItemShopId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Get a collection of TabItems from a given Tab. /// - public static BunqResponse> List(int cashRegisterId, string tabUuid, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int cashRegisterId, string tabUuid, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get a specific TabItem from a given Tab. /// - public static BunqResponse Get(int cashRegisterId, string tabUuid, int tabItemShopId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int cashRegisterId, string tabUuid, int tabItemShopId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUuid, tabItemShopId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid, tabItemShopId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -231,45 +203,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Description != null) { return false; } - + if (this.EanCode != null) { return false; } - + if (this.AvatarAttachment != null) { return false; } - + if (this.TabAttachment != null) { return false; } - + if (this.Quantity != null) { return false; } - + if (this.Amount != null) { return false; } - + return true; } - + /// /// public static TabItemShop CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TabItemShopBatch.cs b/BunqSdk/Model/Generated/Endpoint/TabItemShopBatch.cs index c5adc46e..e440dadb 100644 --- a/BunqSdk/Model/Generated/Endpoint/TabItemShopBatch.cs +++ b/BunqSdk/Model/Generated/Endpoint/TabItemShopBatch.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,47 +17,42 @@ public class TabItemShopBatch : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item-batch"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-item-batch"; + /// /// Field constants. /// public const string FIELD_TAB_ITEMS = "tab_items"; - - + + /// /// The list of tab items in the batch. /// [JsonProperty(PropertyName = "tab_items")] public List TabItems { get; set; } - + /// /// Create tab items as a batch. /// /// The list of tab items we want to create in a single batch. Limited to 50 items per batch. - public static BunqResponse Create(int cashRegisterId, string tabUuid, List tabItems, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Create(int cashRegisterId, string tabUuid, List tabItems, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_TAB_ITEMS, tabItems}, - }; - + { + {FIELD_TAB_ITEMS, tabItems}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUuid), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -64,15 +61,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static TabItemShopBatch CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TabQrCodeContent.cs b/BunqSdk/Model/Generated/Endpoint/TabQrCodeContent.cs index 409a5830..e850ac6e 100644 --- a/BunqSdk/Model/Generated/Endpoint/TabQrCodeContent.cs +++ b/BunqSdk/Model/Generated/Endpoint/TabQrCodeContent.cs @@ -1,6 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -13,46 +18,40 @@ public class TabQrCodeContent : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/qr-code-content"; - + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/qr-code-content"; + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TabQrCodeContent"; - + /// /// Returns the raw content of the QR code that links to this Tab. The raw content is the binary representation /// of a file, without any JSON wrapping. /// - public static BunqResponse List(int cashRegisterId, string tabUuid, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse List(int cashRegisterId, string tabUuid, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), new Dictionary(), customHeaders); + return new BunqResponse(responseRaw.BodyBytes, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static TabQrCodeContent CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TabResultInquiry.cs b/BunqSdk/Model/Generated/Endpoint/TabResultInquiry.cs index 9c5c4e4d..349dd97d 100644 --- a/BunqSdk/Model/Generated/Endpoint/TabResultInquiry.cs +++ b/BunqSdk/Model/Generated/Endpoint/TabResultInquiry.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,67 +18,55 @@ public class TabResultInquiry : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-result-inquiry/{4}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-result-inquiry"; - + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-result-inquiry/{4}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/cash-register/{2}/tab/{3}/tab-result-inquiry"; + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TabResultInquiry"; - + /// /// The Tab details. /// [JsonProperty(PropertyName = "tab")] public Tab Tab { get; set; } - + /// /// The payment made for the Tab. /// [JsonProperty(PropertyName = "payment")] public Payment Payment { get; set; } - - + + /// /// Used to view a single TabResultInquiry belonging to a tab. /// - public static BunqResponse Get(int cashRegisterId, string tabUuid, int tabResultInquiryId, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int cashRegisterId, string tabUuid, int tabResultInquiryId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUuid, tabResultInquiryId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid, tabResultInquiryId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Used to view a list of TabResultInquiry objects belonging to a tab. /// - public static BunqResponse> List(int cashRegisterId, string tabUuid, - int? monetaryAccountId = null, IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List(int cashRegisterId, string tabUuid, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -83,20 +75,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Payment != null) { return false; } - + return true; } - + /// /// public static TabResultInquiry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TabResultResponse.cs b/BunqSdk/Model/Generated/Endpoint/TabResultResponse.cs index 0eec9a29..bb72530a 100644 --- a/BunqSdk/Model/Generated/Endpoint/TabResultResponse.cs +++ b/BunqSdk/Model/Generated/Endpoint/TabResultResponse.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,67 +21,59 @@ public class TabResultResponse : BunqModel /// protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/tab-result-response/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/tab-result-response"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TabResultResponse"; - + /// /// The Tab details. /// [JsonProperty(PropertyName = "tab")] public Tab Tab { get; set; } - + /// /// The payment made for the Tab. /// [JsonProperty(PropertyName = "payment")] public Payment Payment { get; set; } - + /// /// The reference to the object used for split the bill. Can be RequestInquiry or RequestInquiryBatch /// [JsonProperty(PropertyName = "request_reference_split_the_bill")] public List RequestReferenceSplitTheBill { get; set; } - - + + /// /// Used to view a single TabResultResponse belonging to a tab. /// - public static BunqResponse Get(int tabResultResponseId, int? monetaryAccountId = null, - IDictionary customHeaders = null) + public static BunqResponse Get(int tabResultResponseId, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - tabResultResponseId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), tabResultResponseId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Used to view a list of TabResultResponse objects belonging to a tab. /// - public static BunqResponse> List(int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -86,25 +82,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Payment != null) { return false; } - + if (this.RequestReferenceSplitTheBill != null) { return false; } - + return true; } - + /// /// public static TabResultResponse CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TabUsageMultiple.cs b/BunqSdk/Model/Generated/Endpoint/TabUsageMultiple.cs index 4dbe3d6e..84e6c811 100644 --- a/BunqSdk/Model/Generated/Endpoint/TabUsageMultiple.cs +++ b/BunqSdk/Model/Generated/Endpoint/TabUsageMultiple.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -21,17 +23,12 @@ public class TabUsageMultiple : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-multiple"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-multiple/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-multiple/{3}"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-multiple/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-multiple"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-multiple"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-multiple/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-multiple/{3}"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-multiple/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-multiple"; + /// /// Field constants. /// @@ -47,138 +44,138 @@ public class TabUsageMultiple : BunqModel public const string FIELD_VISIBILITY = "visibility"; public const string FIELD_EXPIRATION = "expiration"; public const string FIELD_TAB_ATTACHMENT = "tab_attachment"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "Uuid"; private const string OBJECT_TYPE_PUT = "Uuid"; private const string OBJECT_TYPE_GET = "TabUsageMultiple"; - + /// /// The description of the TabUsageMultiple. Maximum 9000 characters. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The status of the Tab. Can be OPEN, PAYABLE or CLOSED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The total amount of the Tab. /// [JsonProperty(PropertyName = "amount_total")] public Amount AmountTotal { get; set; } - + /// /// [DEPRECATED] Whether or not a higher amount can be paid. /// [JsonProperty(PropertyName = "allow_amount_higher")] public bool? AllowAmountHigher { get; set; } - + /// /// [DEPRECATED] Whether or not a lower amount can be paid. /// [JsonProperty(PropertyName = "allow_amount_lower")] public bool? AllowAmountLower { get; set; } - + /// /// [DEPRECATED] Whether or not the user paying the Tab should be asked if he wants to give a tip. When want_tip /// is set to true, allow_amount_higher must also be set to true and allow_amount_lower must be false. /// [JsonProperty(PropertyName = "want_tip")] public bool? WantTip { get; set; } - + /// /// The minimum age of the user paying the Tab. /// [JsonProperty(PropertyName = "minimum_age")] public bool? MinimumAge { get; set; } - + /// /// Whether or not an billing and shipping address must be provided when paying the Tab. /// [JsonProperty(PropertyName = "require_address")] public string RequireAddress { get; set; } - + /// /// The URL which the user is sent to after paying the Tab. /// [JsonProperty(PropertyName = "redirect_url")] public string RedirectUrl { get; set; } - + /// /// The visibility of a Tab. A Tab can be visible trough NearPay, the QR code of the CashRegister and its own QR /// code. /// [JsonProperty(PropertyName = "visibility")] public TabVisibility Visibility { get; set; } - + /// /// The moment when this Tab expires. /// [JsonProperty(PropertyName = "expiration")] public string Expiration { get; set; } - + /// /// An array of attachments that describe the tab. Viewable through the GET /// /tab/{tabid}/attachment/{attachmentid}/content endpoint. /// [JsonProperty(PropertyName = "tab_attachment")] public List TabAttachment { get; set; } - + /// /// The uuid of the created TabUsageMultiple. /// [JsonProperty(PropertyName = "uuid")] public string Uuid { get; set; } - + /// /// The timestamp of the Tab's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the Tab's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The token used to redirect mobile devices directly to the bunq app. Because they can't scan a QR code. /// [JsonProperty(PropertyName = "qr_code_token")] public string QrCodeToken { get; set; } - + /// /// The URL redirecting user to the tab payment in the bunq app. Only works on mobile devices. /// [JsonProperty(PropertyName = "tab_url")] public string TabUrl { get; set; } - + /// /// The alias of the party that owns this tab. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The location of the cash register that created this tab. /// [JsonProperty(PropertyName = "cash_register_location")] public Geolocation CashRegisterLocation { get; set; } - + /// /// The tab items of this tab. /// [JsonProperty(PropertyName = "tab_item")] public List TabItem { get; set; } - - + + /// /// Create a TabUsageMultiple. On creation the status must be set to OPEN /// @@ -194,41 +191,34 @@ public class TabUsageMultiple : BunqModel /// The visibility of a Tab. A Tab can be visible trough NearPay, the QR code of the CashRegister and its own QR code. /// The moment when this Tab expires. Can be at most 365 days into the future. /// An array of attachments that describe the tab. Uploaded through the POST /user/{userid}/attachment-tab endpoint. - public static BunqResponse Create(int cashRegisterId, string description, string status, - Amount amountTotal, int? monetaryAccountId = null, bool? allowAmountHigher = null, - bool? allowAmountLower = null, bool? wantTip = null, int? minimumAge = null, string requireAddress = null, - string redirectUrl = null, TabVisibility visibility = null, string expiration = null, - List tabAttachment = null, IDictionary customHeaders = null) + public static BunqResponse Create(int cashRegisterId, string description, string status, Amount amountTotal, int? monetaryAccountId= null, bool? allowAmountHigher = null, bool? allowAmountLower = null, bool? wantTip = null, int? minimumAge = null, string requireAddress = null, string redirectUrl = null, TabVisibility visibility = null, string expiration = null, List tabAttachment = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_DESCRIPTION, description}, - {FIELD_STATUS, status}, - {FIELD_AMOUNT_TOTAL, amountTotal}, - {FIELD_ALLOW_AMOUNT_HIGHER, allowAmountHigher}, - {FIELD_ALLOW_AMOUNT_LOWER, allowAmountLower}, - {FIELD_WANT_TIP, wantTip}, - {FIELD_MINIMUM_AGE, minimumAge}, - {FIELD_REQUIRE_ADDRESS, requireAddress}, - {FIELD_REDIRECT_URL, redirectUrl}, - {FIELD_VISIBILITY, visibility}, - {FIELD_EXPIRATION, expiration}, - {FIELD_TAB_ATTACHMENT, tabAttachment}, - }; - + { + {FIELD_DESCRIPTION, description}, + {FIELD_STATUS, status}, + {FIELD_AMOUNT_TOTAL, amountTotal}, + {FIELD_ALLOW_AMOUNT_HIGHER, allowAmountHigher}, + {FIELD_ALLOW_AMOUNT_LOWER, allowAmountLower}, + {FIELD_WANT_TIP, wantTip}, + {FIELD_MINIMUM_AGE, minimumAge}, + {FIELD_REQUIRE_ADDRESS, requireAddress}, + {FIELD_REDIRECT_URL, redirectUrl}, + {FIELD_VISIBILITY, visibility}, + {FIELD_EXPIRATION, expiration}, + {FIELD_TAB_ATTACHMENT, tabAttachment}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), requestBytes, customHeaders); + return ProcessForUuid(responseRaw); } - + /// /// Modify a specific TabUsageMultiple. You can change the amount_total, status and visibility. Once you change /// the status to PAYABLE the TabUsageMultiple will expire after a year (default). If you've created any @@ -240,86 +230,68 @@ public static BunqResponse Create(int cashRegisterId, string description /// The visibility of a Tab. A Tab can be visible trough NearPay, the QR code of the CashRegister and its own QR code. /// The moment when this Tab expires. Can be at most 365 days into the future. /// An array of attachments that describe the tab. Uploaded through the POST /user/{userid}/attachment-tab endpoint. - public static BunqResponse Update(int cashRegisterId, string tabUsageMultipleUuid, - int? monetaryAccountId = null, string status = null, Amount amountTotal = null, - TabVisibility visibility = null, string expiration = null, List tabAttachment = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int cashRegisterId, string tabUsageMultipleUuid, int? monetaryAccountId= null, string status = null, Amount amountTotal = null, TabVisibility visibility = null, string expiration = null, List tabAttachment = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - {FIELD_AMOUNT_TOTAL, amountTotal}, - {FIELD_VISIBILITY, visibility}, - {FIELD_EXPIRATION, expiration}, - {FIELD_TAB_ATTACHMENT, tabAttachment}, - }; - + { + {FIELD_STATUS, status}, + {FIELD_AMOUNT_TOTAL, amountTotal}, + {FIELD_VISIBILITY, visibility}, + {FIELD_EXPIRATION, expiration}, + {FIELD_TAB_ATTACHMENT, tabAttachment}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUsageMultipleUuid), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUsageMultipleUuid), requestBytes, customHeaders); + return ProcessForUuid(responseRaw); } - + /// /// Close a specific TabUsageMultiple. /// - public static BunqResponse Delete(int cashRegisterId, string tabUsageMultipleUuid, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int cashRegisterId, string tabUsageMultipleUuid, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUsageMultipleUuid), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUsageMultipleUuid), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Get a specific TabUsageMultiple. /// - public static BunqResponse Get(int cashRegisterId, string tabUsageMultipleUuid, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int cashRegisterId, string tabUsageMultipleUuid, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUsageMultipleUuid), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUsageMultipleUuid), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get a collection of TabUsageMultiple. /// - public static BunqResponse> List(int cashRegisterId, int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int cashRegisterId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -328,95 +300,95 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.AmountTotal != null) { return false; } - + if (this.QrCodeToken != null) { return false; } - + if (this.TabUrl != null) { return false; } - + if (this.Visibility != null) { return false; } - + if (this.MinimumAge != null) { return false; } - + if (this.RequireAddress != null) { return false; } - + if (this.RedirectUrl != null) { return false; } - + if (this.Expiration != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.CashRegisterLocation != null) { return false; } - + if (this.TabItem != null) { return false; } - + if (this.TabAttachment != null) { return false; } - + return true; } - + /// /// public static TabUsageMultiple CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TabUsageSingle.cs b/BunqSdk/Model/Generated/Endpoint/TabUsageSingle.cs index ff832493..af826863 100644 --- a/BunqSdk/Model/Generated/Endpoint/TabUsageSingle.cs +++ b/BunqSdk/Model/Generated/Endpoint/TabUsageSingle.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -22,15 +24,11 @@ public class TabUsageSingle : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-single"; - protected const string ENDPOINT_URL_UPDATE = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-single/{3}"; - protected const string ENDPOINT_URL_DELETE = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-single/{3}"; - protected const string ENDPOINT_URL_READ = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-single/{3}"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-single"; - + protected const string ENDPOINT_URL_UPDATE = "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-single/{3}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-single/{3}"; + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-single/{3}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/cash-register/{2}/tab-usage-single"; + /// /// Field constants. /// @@ -47,150 +45,150 @@ public class TabUsageSingle : BunqModel public const string FIELD_VISIBILITY = "visibility"; public const string FIELD_EXPIRATION = "expiration"; public const string FIELD_TAB_ATTACHMENT = "tab_attachment"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "Uuid"; private const string OBJECT_TYPE_PUT = "Uuid"; private const string OBJECT_TYPE_GET = "TabUsageSingle"; - + /// /// The merchant reference of the Tab, as defined by the owner. /// [JsonProperty(PropertyName = "merchant_reference")] public string MerchantReference { get; set; } - + /// /// The description of the TabUsageMultiple. Maximum 9000 characters. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The status of the Tab. Can be OPEN, WAITING_FOR_PAYMENT, PAID or CANCELED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The total amount of the Tab. /// [JsonProperty(PropertyName = "amount_total")] public Amount AmountTotal { get; set; } - + /// /// [DEPRECATED] Whether or not a higher amount can be paid. /// [JsonProperty(PropertyName = "allow_amount_higher")] public bool? AllowAmountHigher { get; set; } - + /// /// [DEPRECATED] Whether or not a lower amount can be paid. /// [JsonProperty(PropertyName = "allow_amount_lower")] public bool? AllowAmountLower { get; set; } - + /// /// [DEPRECATED] Whether or not the user paying the Tab should be asked if he wants to give a tip. When want_tip /// is set to true, allow_amount_higher must also be set to true and allow_amount_lower must be false. /// [JsonProperty(PropertyName = "want_tip")] public bool? WantTip { get; set; } - + /// /// The minimum age of the user paying the Tab. /// [JsonProperty(PropertyName = "minimum_age")] public bool? MinimumAge { get; set; } - + /// /// Whether or not an billing and shipping address must be provided when paying the Tab. /// [JsonProperty(PropertyName = "require_address")] public string RequireAddress { get; set; } - + /// /// The URL which the user is sent to after paying the Tab. /// [JsonProperty(PropertyName = "redirect_url")] public string RedirectUrl { get; set; } - + /// /// The visibility of a Tab. A Tab can be visible trough NearPay, the QR code of the CashRegister and its own QR /// code. /// [JsonProperty(PropertyName = "visibility")] public TabVisibility Visibility { get; set; } - + /// /// The moment when this Tab expires. /// [JsonProperty(PropertyName = "expiration")] public string Expiration { get; set; } - + /// /// An array of attachments that describe the tab. Uploaded through the POST /user/{userid}/attachment-tab /// endpoint. /// [JsonProperty(PropertyName = "tab_attachment")] public List TabAttachment { get; set; } - + /// /// The uuid of the created TabUsageSingle. /// [JsonProperty(PropertyName = "uuid")] public string Uuid { get; set; } - + /// /// The timestamp of the Tab's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the Tab's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The amount that has been paid for this Tab. /// [JsonProperty(PropertyName = "amount_paid")] public Amount AmountPaid { get; set; } - + /// /// The token used to redirect mobile devices directly to the bunq app. Because they can't scan a QR code. /// [JsonProperty(PropertyName = "qr_code_token")] public string QrCodeToken { get; set; } - + /// /// The URL redirecting user to the tab payment in the bunq app. Only works on mobile devices. /// [JsonProperty(PropertyName = "tab_url")] public string TabUrl { get; set; } - + /// /// The alias of the party that owns this tab. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The location of the cash register that created this tab. /// [JsonProperty(PropertyName = "cash_register_location")] public Geolocation CashRegisterLocation { get; set; } - + /// /// The tab items of this tab. /// [JsonProperty(PropertyName = "tab_item")] public List TabItem { get; set; } - - + + /// /// Create a TabUsageSingle. The initial status must be OPEN /// @@ -207,43 +205,35 @@ public class TabUsageSingle : BunqModel /// The visibility of a Tab. A Tab can be visible trough NearPay, the QR code of the CashRegister and its own QR code. /// The moment when this Tab expires. Can be at most 1 hour into the future. /// An array of attachments that describe the tab. Uploaded through the POST /user/{userid}/attachment-tab endpoint. - public static BunqResponse Create(int cashRegisterId, string description, string status, - Amount amountTotal, int? monetaryAccountId = null, string merchantReference = null, - bool? allowAmountHigher = null, bool? allowAmountLower = null, bool? wantTip = null, int? minimumAge = null, - string requireAddress = null, string redirectUrl = null, TabVisibility visibility = null, - string expiration = null, List tabAttachment = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int cashRegisterId, string description, string status, Amount amountTotal, int? monetaryAccountId= null, string merchantReference = null, bool? allowAmountHigher = null, bool? allowAmountLower = null, bool? wantTip = null, int? minimumAge = null, string requireAddress = null, string redirectUrl = null, TabVisibility visibility = null, string expiration = null, List tabAttachment = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_MERCHANT_REFERENCE, merchantReference}, - {FIELD_DESCRIPTION, description}, - {FIELD_STATUS, status}, - {FIELD_AMOUNT_TOTAL, amountTotal}, - {FIELD_ALLOW_AMOUNT_HIGHER, allowAmountHigher}, - {FIELD_ALLOW_AMOUNT_LOWER, allowAmountLower}, - {FIELD_WANT_TIP, wantTip}, - {FIELD_MINIMUM_AGE, minimumAge}, - {FIELD_REQUIRE_ADDRESS, requireAddress}, - {FIELD_REDIRECT_URL, redirectUrl}, - {FIELD_VISIBILITY, visibility}, - {FIELD_EXPIRATION, expiration}, - {FIELD_TAB_ATTACHMENT, tabAttachment}, - }; - + { + {FIELD_MERCHANT_REFERENCE, merchantReference}, + {FIELD_DESCRIPTION, description}, + {FIELD_STATUS, status}, + {FIELD_AMOUNT_TOTAL, amountTotal}, + {FIELD_ALLOW_AMOUNT_HIGHER, allowAmountHigher}, + {FIELD_ALLOW_AMOUNT_LOWER, allowAmountLower}, + {FIELD_WANT_TIP, wantTip}, + {FIELD_MINIMUM_AGE, minimumAge}, + {FIELD_REQUIRE_ADDRESS, requireAddress}, + {FIELD_REDIRECT_URL, redirectUrl}, + {FIELD_VISIBILITY, visibility}, + {FIELD_EXPIRATION, expiration}, + {FIELD_TAB_ATTACHMENT, tabAttachment}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Post( - string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId), requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), requestBytes, customHeaders); + return ProcessForUuid(responseRaw); } - + /// /// Modify a specific TabUsageSingle. You can change the amount_total, status and visibility. Once you change /// the status to WAITING_FOR_PAYMENT the TabUsageSingle will expire after 5 minutes (default) or up to 1 hour @@ -254,86 +244,68 @@ public static BunqResponse Create(int cashRegisterId, string description /// The visibility of a Tab. A Tab can be visible trough NearPay, the QR code of the CashRegister and its own QR code. /// The moment when this Tab expires. Can be at most 1 hour into the future. /// An array of attachments that describe the tab. Uploaded through the POST /user/{userid}/attachment-tab endpoint. - public static BunqResponse Update(int cashRegisterId, string tabUsageSingleUuid, - int? monetaryAccountId = null, string status = null, Amount amountTotal = null, - TabVisibility visibility = null, string expiration = null, List tabAttachment = null, - IDictionary customHeaders = null) + public static BunqResponse Update(int cashRegisterId, string tabUsageSingleUuid, int? monetaryAccountId= null, string status = null, Amount amountTotal = null, TabVisibility visibility = null, string expiration = null, List tabAttachment = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_STATUS, status}, - {FIELD_AMOUNT_TOTAL, amountTotal}, - {FIELD_VISIBILITY, visibility}, - {FIELD_EXPIRATION, expiration}, - {FIELD_TAB_ATTACHMENT, tabAttachment}, - }; - + { + {FIELD_STATUS, status}, + {FIELD_AMOUNT_TOTAL, amountTotal}, + {FIELD_VISIBILITY, visibility}, + {FIELD_EXPIRATION, expiration}, + {FIELD_TAB_ATTACHMENT, tabAttachment}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = - apiClient.Put( - string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUsageSingleUuid), requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUsageSingleUuid), requestBytes, customHeaders); + return ProcessForUuid(responseRaw); } - + /// /// Cancel a specific TabUsageSingle. /// - public static BunqResponse Delete(int cashRegisterId, string tabUsageSingleUuid, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Delete(int cashRegisterId, string tabUsageSingleUuid, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUsageSingleUuid), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUsageSingleUuid), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// /// Get a specific TabUsageSingle. /// - public static BunqResponse Get(int cashRegisterId, string tabUsageSingleUuid, - int? monetaryAccountId = null, IDictionary customHeaders = null) + public static BunqResponse Get(int cashRegisterId, string tabUsageSingleUuid, int? monetaryAccountId= null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), - cashRegisterId, tabUsageSingleUuid), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUsageSingleUuid), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Get a collection of TabUsageSingle. /// - public static BunqResponse> List(int cashRegisterId, int? monetaryAccountId = null, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int cashRegisterId, int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), - DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), cashRegisterId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -342,105 +314,105 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.MerchantReference != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.AmountTotal != null) { return false; } - + if (this.AmountPaid != null) { return false; } - + if (this.QrCodeToken != null) { return false; } - + if (this.TabUrl != null) { return false; } - + if (this.Visibility != null) { return false; } - + if (this.MinimumAge != null) { return false; } - + if (this.RequireAddress != null) { return false; } - + if (this.RedirectUrl != null) { return false; } - + if (this.Expiration != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.CashRegisterLocation != null) { return false; } - + if (this.TabItem != null) { return false; } - + if (this.TabAttachment != null) { return false; } - + return true; } - + /// /// public static TabUsageSingle CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TokenQrRequestIdeal.cs b/BunqSdk/Model/Generated/Endpoint/TokenQrRequestIdeal.cs index f2eff8ef..7f4a04aa 100644 --- a/BunqSdk/Model/Generated/Endpoint/TokenQrRequestIdeal.cs +++ b/BunqSdk/Model/Generated/Endpoint/TokenQrRequestIdeal.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,170 +22,168 @@ public class TokenQrRequestIdeal : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/token-qr-request-ideal"; - + /// /// Field constants. /// public const string FIELD_TOKEN = "token"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "RequestResponse"; - + /// /// The token passed from a site or read from a QR code. /// [JsonProperty(PropertyName = "token")] public string Token { get; set; } - + /// /// The id of the RequestResponse. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of when the RequestResponse was responded to. /// [JsonProperty(PropertyName = "time_responded")] public string TimeResponded { get; set; } - + /// /// The timestamp of when the RequestResponse expired or will expire. /// [JsonProperty(PropertyName = "time_expiry")] public string TimeExpiry { get; set; } - + /// /// The id of the MonetaryAccount the RequestResponse was received on. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The requested Amount. /// [JsonProperty(PropertyName = "amount_inquired")] public Amount AmountInquired { get; set; } - + /// /// The Amount the RequestResponse was accepted with. /// [JsonProperty(PropertyName = "amount_responded")] public Amount AmountResponded { get; set; } - + /// /// The LabelMonetaryAccount with the public information of the MonetaryAccount this RequestResponse was /// received on. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The LabelMonetaryAccount with the public information of the MonetaryAccount that is requesting money with /// this RequestResponse. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The description for the RequestResponse provided by the requesting party. Maximum 9000 characters. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The Attachments attached to the RequestResponse. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - + /// /// The status of the created RequestResponse. Can only be PENDING. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The minimum age the user accepting the RequestResponse must have. /// [JsonProperty(PropertyName = "minimum_age")] public int? MinimumAge { get; set; } - + /// /// Whether or not an address must be provided on accept. /// [JsonProperty(PropertyName = "require_address")] public string RequireAddress { get; set; } - + /// /// The shipping address provided by the accepting user if an address was requested. /// [JsonProperty(PropertyName = "address_shipping")] public Address AddressShipping { get; set; } - + /// /// The billing address provided by the accepting user if an address was requested. /// [JsonProperty(PropertyName = "address_billing")] public Address AddressBilling { get; set; } - + /// /// The Geolocation where the RequestResponse was created. /// [JsonProperty(PropertyName = "geolocation")] public Geolocation Geolocation { get; set; } - + /// /// The URL which the user is sent to after accepting or rejecting the Request. /// [JsonProperty(PropertyName = "redirect_url")] public string RedirectUrl { get; set; } - + /// /// The type of the RequestResponse. Can be only be IDEAL. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The subtype of the RequestResponse. Can be only be NONE. /// [JsonProperty(PropertyName = "sub_type")] public string SubType { get; set; } - + /// /// The whitelist id for this action or null. /// [JsonProperty(PropertyName = "eligible_whitelist_id")] public int? EligibleWhitelistId { get; set; } - - + + /// /// Create a request from an ideal transaction. /// /// The token passed from a site or read from a QR code. - public static BunqResponse Create(string token, - IDictionary customHeaders = null) + public static BunqResponse Create(string token, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_TOKEN, token}, - }; - + { + {FIELD_TOKEN, token}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_POST); } - - + + /// /// public override bool IsAllFieldNull() @@ -192,110 +192,110 @@ public override bool IsAllFieldNull() { return false; } - + if (this.TimeResponded != null) { return false; } - + if (this.TimeExpiry != null) { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.AmountInquired != null) { return false; } - + if (this.AmountResponded != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.MinimumAge != null) { return false; } - + if (this.RequireAddress != null) { return false; } - + if (this.AddressShipping != null) { return false; } - + if (this.AddressBilling != null) { return false; } - + if (this.Geolocation != null) { return false; } - + if (this.RedirectUrl != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.SubType != null) { return false; } - + if (this.EligibleWhitelistId != null) { return false; } - + return true; } - + /// /// public static TokenQrRequestIdeal CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TokenQrRequestSofort.cs b/BunqSdk/Model/Generated/Endpoint/TokenQrRequestSofort.cs index c54b1072..3fca876c 100644 --- a/BunqSdk/Model/Generated/Endpoint/TokenQrRequestSofort.cs +++ b/BunqSdk/Model/Generated/Endpoint/TokenQrRequestSofort.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,59 +18,57 @@ public class TokenQrRequestSofort : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_CREATE = "user/{0}/token-qr-request-sofort"; - + /// /// Field constants. /// public const string FIELD_TOKEN = "token"; - + /// /// Object type. /// private const string OBJECT_TYPE_POST = "RequestResponse"; - + /// /// The token passed from a site or read from a QR code. /// [JsonProperty(PropertyName = "token")] public string Token { get; set; } - + /// /// Create a request from an SOFORT transaction. /// /// The token passed from a site or read from a QR code. - public static BunqResponse Create(string token, - IDictionary customHeaders = null) + public static BunqResponse Create(string token, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_TOKEN, token}, - }; - + { + {FIELD_TOKEN, token}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_POST); } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static TokenQrRequestSofort CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TransferwiseAccountQuote.cs b/BunqSdk/Model/Generated/Endpoint/TransferwiseAccountQuote.cs index 76054e6e..0983446f 100644 --- a/BunqSdk/Model/Generated/Endpoint/TransferwiseAccountQuote.cs +++ b/BunqSdk/Model/Generated/Endpoint/TransferwiseAccountQuote.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,7 +22,7 @@ public class TransferwiseAccountQuote : BunqModel protected const string ENDPOINT_URL_READ = "user/{0}/transferwise-quote/{1}/transferwise-recipient/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/transferwise-quote/{1}/transferwise-recipient"; protected const string ENDPOINT_URL_DELETE = "user/{0}/transferwise-quote/{1}/transferwise-recipient/{2}"; - + /// /// Field constants. /// @@ -28,139 +30,126 @@ public class TransferwiseAccountQuote : BunqModel public const string FIELD_NAME_ACCOUNT_HOLDER = "name_account_holder"; public const string FIELD_TYPE = "type"; public const string FIELD_DETAIL = "detail"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TransferwiseRecipient"; - + /// /// The country of the account. /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// The name of the account holder. /// [JsonProperty(PropertyName = "name_account_holder")] public string NameAccountHolder { get; set; } - + /// /// The chosen recipient account type. The possible options are provided dynamically in the response endpoint. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The fields which were specified as "required" and have since been filled by the user. Always provide the /// full list. /// [JsonProperty(PropertyName = "detail")] public List Detail { get; set; } - + /// /// Transferwise's id of the account. /// [JsonProperty(PropertyName = "account_id")] public string AccountId { get; set; } - + /// /// The currency the account. /// [JsonProperty(PropertyName = "currency")] public string Currency { get; set; } - + /// /// The account number. /// [JsonProperty(PropertyName = "account_number")] public string AccountNumber { get; set; } - + /// /// The bank code. /// [JsonProperty(PropertyName = "bank_code")] public string BankCode { get; set; } - - + + /// /// /// The name of the account holder. /// The chosen recipient account type. The possible options are provided dynamically in the response endpoint. /// The country of the receiving account. /// The fields which were specified as "required" and have since been filled by the user. Always provide the full list. - public static BunqResponse Create(int transferwiseQuoteId, string nameAccountHolder, string type, - string country = null, List detail = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int transferwiseQuoteId, string nameAccountHolder, string type, string country = null, List detail = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_COUNTRY, country}, - {FIELD_NAME_ACCOUNT_HOLDER, nameAccountHolder}, - {FIELD_TYPE, type}, - {FIELD_DETAIL, detail}, - }; - + { + {FIELD_COUNTRY, country}, + {FIELD_NAME_ACCOUNT_HOLDER, nameAccountHolder}, + {FIELD_TYPE, type}, + {FIELD_DETAIL, detail}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), transferwiseQuoteId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), transferwiseQuoteId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Get(int transferwiseQuoteId, - int transferwiseAccountQuoteId, IDictionary customHeaders = null) + public static BunqResponse Get(int transferwiseQuoteId, int transferwiseAccountQuoteId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), transferwiseQuoteId, - transferwiseAccountQuoteId), new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), transferwiseQuoteId, transferwiseAccountQuoteId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(int transferwiseQuoteId, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int transferwiseQuoteId, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), transferwiseQuoteId), - urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), transferwiseQuoteId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse Delete(int transferwiseQuoteId, int transferwiseAccountQuoteId, - IDictionary customHeaders = null) + public static BunqResponse Delete(int transferwiseQuoteId, int transferwiseAccountQuoteId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Delete( - string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), transferwiseQuoteId, - transferwiseAccountQuoteId), customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), transferwiseQuoteId, transferwiseAccountQuoteId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - - + + /// /// public override bool IsAllFieldNull() @@ -169,40 +158,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Currency != null) { return false; } - + if (this.Country != null) { return false; } - + if (this.NameAccountHolder != null) { return false; } - + if (this.AccountNumber != null) { return false; } - + if (this.BankCode != null) { return false; } - + return true; } - + /// /// public static TransferwiseAccountQuote CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TransferwiseAccountRequirement.cs b/BunqSdk/Model/Generated/Endpoint/TransferwiseAccountRequirement.cs index efc0aa98..3bf9f3d9 100644 --- a/BunqSdk/Model/Generated/Endpoint/TransferwiseAccountRequirement.cs +++ b/BunqSdk/Model/Generated/Endpoint/TransferwiseAccountRequirement.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,11 +18,9 @@ public class TransferwiseAccountRequirement : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/transferwise-quote/{1}/transferwise-recipient-requirement"; - protected const string ENDPOINT_URL_LISTING = - "user/{0}/transferwise-quote/{1}/transferwise-recipient-requirement"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/transferwise-quote/{1}/transferwise-recipient-requirement"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/transferwise-quote/{1}/transferwise-recipient-requirement"; + /// /// Field constants. /// @@ -28,95 +28,90 @@ public class TransferwiseAccountRequirement : BunqModel public const string FIELD_NAME_ACCOUNT_HOLDER = "name_account_holder"; public const string FIELD_TYPE = "type"; public const string FIELD_DETAIL = "detail"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TransferwiseRequirement"; - + /// /// The country of the receiving account. /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// The name of the account holder. /// [JsonProperty(PropertyName = "name_account_holder")] public string NameAccountHolder { get; set; } - + /// /// A possible recipient account type. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The fields which were specified as "required" and have since been filled by the user. Always provide the /// full list. /// [JsonProperty(PropertyName = "detail")] public List Detail { get; set; } - + /// /// The label of the possible recipient account type to show to the user. /// [JsonProperty(PropertyName = "label")] public string Label { get; set; } - + /// /// The fields which the user needs to fill. /// [JsonProperty(PropertyName = "fields")] public List Fields { get; set; } - - + + /// /// /// The name of the account holder. /// The chosen recipient account type. The possible options are provided dynamically in the response endpoint. /// The country of the receiving account. /// The fields which were specified as "required" and have since been filled by the user. Always provide the full list. - public static BunqResponse Create(int transferwiseQuoteId, string nameAccountHolder, string type, - string country = null, List detail = null, - IDictionary customHeaders = null) + public static BunqResponse Create(int transferwiseQuoteId, string nameAccountHolder, string type, string country = null, List detail = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_COUNTRY, country}, - {FIELD_NAME_ACCOUNT_HOLDER, nameAccountHolder}, - {FIELD_TYPE, type}, - {FIELD_DETAIL, detail}, - }; - + { + {FIELD_COUNTRY, country}, + {FIELD_NAME_ACCOUNT_HOLDER, nameAccountHolder}, + {FIELD_TYPE, type}, + {FIELD_DETAIL, detail}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), transferwiseQuoteId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), transferwiseQuoteId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(int transferwiseQuoteId, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int transferwiseQuoteId, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), transferwiseQuoteId), - urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), transferwiseQuoteId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -125,25 +120,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Label != null) { return false; } - + if (this.Fields != null) { return false; } - + return true; } - + /// /// public static TransferwiseAccountRequirement CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TransferwiseCurrency.cs b/BunqSdk/Model/Generated/Endpoint/TransferwiseCurrency.cs index aa075452..89b5792a 100644 --- a/BunqSdk/Model/Generated/Endpoint/TransferwiseCurrency.cs +++ b/BunqSdk/Model/Generated/Endpoint/TransferwiseCurrency.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,47 +18,45 @@ public class TransferwiseCurrency : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/transferwise-currency"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TransferwiseCurrency"; - + /// /// The currency code. /// [JsonProperty(PropertyName = "currency")] public string Currency { get; set; } - + /// /// The currency name. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - + /// /// The country code associated with the currency. /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - - + + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -63,25 +65,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Name != null) { return false; } - + if (this.Country != null) { return false; } - + return true; } - + /// /// public static TransferwiseCurrency CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TransferwiseQuote.cs b/BunqSdk/Model/Generated/Endpoint/TransferwiseQuote.cs index 7e017180..14d3df57 100644 --- a/BunqSdk/Model/Generated/Endpoint/TransferwiseQuote.cs +++ b/BunqSdk/Model/Generated/Endpoint/TransferwiseQuote.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,7 +20,7 @@ public class TransferwiseQuote : BunqModel /// protected const string ENDPOINT_URL_CREATE = "user/{0}/transferwise-quote"; protected const string ENDPOINT_URL_READ = "user/{0}/transferwise-quote/{1}"; - + /// /// Field constants. /// @@ -26,128 +28,124 @@ public class TransferwiseQuote : BunqModel public const string FIELD_CURRENCY_TARGET = "currency_target"; public const string FIELD_AMOUNT_SOURCE = "amount_source"; public const string FIELD_AMOUNT_TARGET = "amount_target"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TransferwiseQuote"; - + /// /// The source currency. /// [JsonProperty(PropertyName = "currency_source")] public string CurrencySource { get; set; } - + /// /// The target currency. /// [JsonProperty(PropertyName = "currency_target")] public string CurrencyTarget { get; set; } - + /// /// The source amount. /// [JsonProperty(PropertyName = "amount_source")] public Amount AmountSource { get; set; } - + /// /// The target amount. /// [JsonProperty(PropertyName = "amount_target")] public Amount AmountTarget { get; set; } - + /// /// The id of the quote. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the quote's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the quote's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The expiration timestamp of the quote. /// [JsonProperty(PropertyName = "time_expiry")] public string TimeExpiry { get; set; } - + /// /// The quote id Transferwise needs. /// [JsonProperty(PropertyName = "quote_id")] public string QuoteId { get; set; } - + /// /// The fee amount. /// [JsonProperty(PropertyName = "amount_fee")] public Amount AmountFee { get; set; } - + /// /// The rate. /// [JsonProperty(PropertyName = "rate")] public string Rate { get; set; } - + /// /// The estimated delivery time. /// [JsonProperty(PropertyName = "time_delivery_estimate")] public string TimeDeliveryEstimate { get; set; } - - + + /// /// /// The source currency. /// The target currency. /// The source amount. Required if target amount is left empty. /// The target amount. Required if source amount is left empty. - public static BunqResponse Create(string currencySource, string currencyTarget, Amount amountSource = null, - Amount amountTarget = null, IDictionary customHeaders = null) + public static BunqResponse Create(string currencySource, string currencyTarget, Amount amountSource = null, Amount amountTarget = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CURRENCY_SOURCE, currencySource}, - {FIELD_CURRENCY_TARGET, currencyTarget}, - {FIELD_AMOUNT_SOURCE, amountSource}, - {FIELD_AMOUNT_TARGET, amountTarget}, - }; - + { + {FIELD_CURRENCY_SOURCE, currencySource}, + {FIELD_CURRENCY_TARGET, currencyTarget}, + {FIELD_AMOUNT_SOURCE, amountSource}, + {FIELD_AMOUNT_TARGET, amountTarget}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Get(int transferwiseQuoteId, - IDictionary customHeaders = null) + public static BunqResponse Get(int transferwiseQuoteId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), transferwiseQuoteId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), transferwiseQuoteId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -156,60 +154,60 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.TimeExpiry != null) { return false; } - + if (this.QuoteId != null) { return false; } - + if (this.AmountSource != null) { return false; } - + if (this.AmountTarget != null) { return false; } - + if (this.AmountFee != null) { return false; } - + if (this.Rate != null) { return false; } - + if (this.TimeDeliveryEstimate != null) { return false; } - + return true; } - + /// /// public static TransferwiseQuote CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TransferwiseQuoteTemporary.cs b/BunqSdk/Model/Generated/Endpoint/TransferwiseQuoteTemporary.cs index 37fce76b..a217c53e 100644 --- a/BunqSdk/Model/Generated/Endpoint/TransferwiseQuoteTemporary.cs +++ b/BunqSdk/Model/Generated/Endpoint/TransferwiseQuoteTemporary.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -18,7 +20,7 @@ public class TransferwiseQuoteTemporary : BunqModel /// protected const string ENDPOINT_URL_CREATE = "user/{0}/transferwise-quote-temporary"; protected const string ENDPOINT_URL_READ = "user/{0}/transferwise-quote-temporary/{1}"; - + /// /// Field constants. /// @@ -26,117 +28,112 @@ public class TransferwiseQuoteTemporary : BunqModel public const string FIELD_CURRENCY_TARGET = "currency_target"; public const string FIELD_AMOUNT_SOURCE = "amount_source"; public const string FIELD_AMOUNT_TARGET = "amount_target"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TransferwiseQuote"; - + /// /// The source currency. /// [JsonProperty(PropertyName = "currency_source")] public string CurrencySource { get; set; } - + /// /// The target currency. /// [JsonProperty(PropertyName = "currency_target")] public string CurrencyTarget { get; set; } - + /// /// The source amount. /// [JsonProperty(PropertyName = "amount_source")] public Amount AmountSource { get; set; } - + /// /// The target amount. /// [JsonProperty(PropertyName = "amount_target")] public Amount AmountTarget { get; set; } - + /// /// The id of the quote. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the note's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the note's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The expiration timestamp of the quote. Will always be null for temporary quotes. /// [JsonProperty(PropertyName = "time_expiry")] public string TimeExpiry { get; set; } - + /// /// The quote id Transferwise needs. Will always be null for temporary quotes. /// [JsonProperty(PropertyName = "quote_id")] public string QuoteId { get; set; } - + /// /// The rate. /// [JsonProperty(PropertyName = "rate")] public string Rate { get; set; } - - + + /// /// /// The source currency. /// The target currency. /// The source amount. Required if target amount is left empty. /// The target amount. Required if source amount is left empty. - public static BunqResponse Create(string currencySource, string currencyTarget, Amount amountSource = null, - Amount amountTarget = null, IDictionary customHeaders = null) + public static BunqResponse Create(string currencySource, string currencyTarget, Amount amountSource = null, Amount amountTarget = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_CURRENCY_SOURCE, currencySource}, - {FIELD_CURRENCY_TARGET, currencyTarget}, - {FIELD_AMOUNT_SOURCE, amountSource}, - {FIELD_AMOUNT_TARGET, amountTarget}, - }; - + { + {FIELD_CURRENCY_SOURCE, currencySource}, + {FIELD_CURRENCY_TARGET, currencyTarget}, + {FIELD_AMOUNT_SOURCE, amountSource}, + {FIELD_AMOUNT_TARGET, amountTarget}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Get(int transferwiseQuoteTemporaryId, - IDictionary customHeaders = null) + public static BunqResponse Get(int transferwiseQuoteTemporaryId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), transferwiseQuoteTemporaryId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), transferwiseQuoteTemporaryId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -145,50 +142,50 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.TimeExpiry != null) { return false; } - + if (this.QuoteId != null) { return false; } - + if (this.AmountSource != null) { return false; } - + if (this.AmountTarget != null) { return false; } - + if (this.Rate != null) { return false; } - + return true; } - + /// /// public static TransferwiseQuoteTemporary CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TransferwiseTransfer.cs b/BunqSdk/Model/Generated/Endpoint/TransferwiseTransfer.cs index c31d96a2..8acfa3bd 100644 --- a/BunqSdk/Model/Generated/Endpoint/TransferwiseTransfer.cs +++ b/BunqSdk/Model/Generated/Endpoint/TransferwiseTransfer.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -19,165 +21,157 @@ public class TransferwiseTransfer : BunqModel protected const string ENDPOINT_URL_CREATE = "user/{0}/transferwise-quote/{1}/transferwise-transfer"; protected const string ENDPOINT_URL_READ = "user/{0}/transferwise-quote/{1}/transferwise-transfer/{2}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/transferwise-quote/{1}/transferwise-transfer"; - + /// /// Field constants. /// public const string FIELD_MONETARY_ACCOUNT_ID = "monetary_account_id"; public const string FIELD_RECIPIENT_ID = "recipient_id"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TransferwisePayment"; - + /// /// The id of the monetary account the payment should be made from. /// [JsonProperty(PropertyName = "monetary_account_id")] public string MonetaryAccountId { get; set; } - + /// /// The id of the target account. /// [JsonProperty(PropertyName = "recipient_id")] public string RecipientId { get; set; } - + /// /// The LabelMonetaryAccount containing the public information of 'this' (party) side of the Payment. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The LabelMonetaryAccount containing the public information of the other (counterparty) side of the Payment. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The status. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The subStatus. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The status as Transferwise reports it. /// [JsonProperty(PropertyName = "status_transferwise")] public string StatusTransferwise { get; set; } - + /// /// A status to indicatie if Transferwise has an issue with this payment and requires more information. /// [JsonProperty(PropertyName = "status_transferwise_issue")] public string StatusTransferwiseIssue { get; set; } - + /// /// The source amount. /// [JsonProperty(PropertyName = "amount_source")] public Amount AmountSource { get; set; } - + /// /// The target amount. /// [JsonProperty(PropertyName = "amount_target")] public Amount AmountTarget { get; set; } - + /// /// The rate of the payment. /// [JsonProperty(PropertyName = "rate")] public string Rate { get; set; } - + /// /// The reference of the payment. /// [JsonProperty(PropertyName = "reference")] public string Reference { get; set; } - + /// /// The Pay-In reference of the payment. /// [JsonProperty(PropertyName = "pay_in_reference")] public string PayInReference { get; set; } - + /// /// The estimated delivery time. /// [JsonProperty(PropertyName = "time_delivery_estimate")] public string TimeDeliveryEstimate { get; set; } - + /// /// The quote details used to created the payment. /// [JsonProperty(PropertyName = "quote")] public TransferwiseQuote Quote { get; set; } - - + + /// /// /// The id of the monetary account the payment should be made from. /// The id of the target account. - public static BunqResponse Create(int transferwiseQuoteId, string monetaryAccountId, string recipientId, - IDictionary customHeaders = null) + public static BunqResponse Create(int transferwiseQuoteId, string monetaryAccountId, string recipientId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_MONETARY_ACCOUNT_ID, monetaryAccountId}, - {FIELD_RECIPIENT_ID, recipientId}, - }; - + { + {FIELD_MONETARY_ACCOUNT_ID, monetaryAccountId}, + {FIELD_RECIPIENT_ID, recipientId}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), transferwiseQuoteId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), transferwiseQuoteId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse Get(int transferwiseQuoteId, int transferwiseTransferId, - IDictionary customHeaders = null) + public static BunqResponse Get(int transferwiseQuoteId, int transferwiseTransferId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get( - string.Format(ENDPOINT_URL_READ, DetermineUserId(), transferwiseQuoteId, transferwiseTransferId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), transferwiseQuoteId, transferwiseTransferId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(int transferwiseQuoteId, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int transferwiseQuoteId, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), transferwiseQuoteId), - urlParams, customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), transferwiseQuoteId), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -186,75 +180,75 @@ public override bool IsAllFieldNull() { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.StatusTransferwise != null) { return false; } - + if (this.StatusTransferwiseIssue != null) { return false; } - + if (this.AmountSource != null) { return false; } - + if (this.AmountTarget != null) { return false; } - + if (this.Rate != null) { return false; } - + if (this.Reference != null) { return false; } - + if (this.PayInReference != null) { return false; } - + if (this.TimeDeliveryEstimate != null) { return false; } - + if (this.Quote != null) { return false; } - + return true; } - + /// /// public static TransferwiseTransfer CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TransferwiseTransferRequirement.cs b/BunqSdk/Model/Generated/Endpoint/TransferwiseTransferRequirement.cs index 23211c9c..e86fea53 100644 --- a/BunqSdk/Model/Generated/Endpoint/TransferwiseTransferRequirement.cs +++ b/BunqSdk/Model/Generated/Endpoint/TransferwiseTransferRequirement.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,73 +18,70 @@ public class TransferwiseTransferRequirement : BunqModel /// /// Endpoint constants. /// - protected const string ENDPOINT_URL_CREATE = - "user/{0}/transferwise-quote/{1}/transferwise-transfer-requirement"; - + protected const string ENDPOINT_URL_CREATE = "user/{0}/transferwise-quote/{1}/transferwise-transfer-requirement"; + /// /// Field constants. /// public const string FIELD_RECIPIENT_ID = "recipient_id"; public const string FIELD_DETAIL = "detail"; - - + + /// /// The id of the target account. /// [JsonProperty(PropertyName = "recipient_id")] public string RecipientId { get; set; } - + /// /// The fields which were specified as "required" and have since been filled by the user. Always provide the /// full list. /// [JsonProperty(PropertyName = "detail")] public List Detail { get; set; } - + /// /// A possible transfer type. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The label of the possible transfer type to show to the user. /// [JsonProperty(PropertyName = "label")] public string Label { get; set; } - + /// /// The fields which the user needs to fill. /// [JsonProperty(PropertyName = "fields")] public List Fields { get; set; } - - + + /// /// /// The id of the target account. /// The fields which were specified as "required" and have since been filled by the user. Always provide the full list. - public static BunqResponse Create(int transferwiseQuoteId, string recipientId, - List detail = null, IDictionary customHeaders = null) + public static BunqResponse Create(int transferwiseQuoteId, string recipientId, List detail = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_RECIPIENT_ID, recipientId}, - {FIELD_DETAIL, detail}, - }; - + { + {FIELD_RECIPIENT_ID, recipientId}, + {FIELD_DETAIL, detail}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), transferwiseQuoteId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId(), transferwiseQuoteId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -91,25 +90,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Label != null) { return false; } - + if (this.Fields != null) { return false; } - + return true; } - + /// /// public static TransferwiseTransferRequirement CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TransferwiseUser.cs b/BunqSdk/Model/Generated/Endpoint/TransferwiseUser.cs index 0a6e4376..98e8b586 100644 --- a/BunqSdk/Model/Generated/Endpoint/TransferwiseUser.cs +++ b/BunqSdk/Model/Generated/Endpoint/TransferwiseUser.cs @@ -1,9 +1,11 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,93 +19,89 @@ public class TransferwiseUser : BunqModel /// protected const string ENDPOINT_URL_CREATE = "user/{0}/transferwise-user"; protected const string ENDPOINT_URL_LISTING = "user/{0}/transferwise-user"; - + /// /// Field constants. /// public const string FIELD_OAUTH_CODE = "oauth_code"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TransferwiseUser"; - + /// /// The OAuth code returned by Transferwise we should be using to gain access to the user's Transferwise /// account. /// [JsonProperty(PropertyName = "oauth_code")] public string OauthCode { get; set; } - + /// /// The id of the TransferwiseUser. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the TransferwiseUser's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the TransferwiseUser's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The name the user is registered with at TransferWise. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - + /// /// The email the user is registered with at TransferWise. /// [JsonProperty(PropertyName = "email")] public string Email { get; set; } - - + + /// /// /// The OAuth code returned by Transferwise we should be using to gain access to the user's Transferwise account. - public static BunqResponse Create(string oauthCode = null, - IDictionary customHeaders = null) + public static BunqResponse Create(string oauthCode = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_OAUTH_CODE, oauthCode}, - }; - + { + {FIELD_OAUTH_CODE, oauthCode}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -112,35 +110,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Name != null) { return false; } - + if (this.Email != null) { return false; } - + return true; } - + /// /// public static TransferwiseUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/TreeProgress.cs b/BunqSdk/Model/Generated/Endpoint/TreeProgress.cs index 60eb07d0..eec02863 100644 --- a/BunqSdk/Model/Generated/Endpoint/TreeProgress.cs +++ b/BunqSdk/Model/Generated/Endpoint/TreeProgress.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,47 +19,45 @@ public class TreeProgress : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/tree-progress"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "TreeProgress"; - + /// /// The number of trees this user and all users have planted. /// [JsonProperty(PropertyName = "number_of_tree")] public double? NumberOfTree { get; set; } - + /// /// The progress towards the next tree. /// [JsonProperty(PropertyName = "progress_tree_next")] public double? ProgressTreeNext { get; set; } - + /// /// The label of the user the progress belongs to. /// [JsonProperty(PropertyName = "label_user")] public LabelUser LabelUser { get; set; } - - + + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -64,25 +66,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.ProgressTreeNext != null) { return false; } - + if (this.LabelUser != null) { return false; } - + return true; } - + /// /// public static TreeProgress CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/User.cs b/BunqSdk/Model/Generated/Endpoint/User.cs index a5954137..8594a4a6 100644 --- a/BunqSdk/Model/Generated/Endpoint/User.cs +++ b/BunqSdk/Model/Generated/Endpoint/User.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Exception; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -16,143 +20,126 @@ public class User : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - + /// /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "user/{0}"; protected const string ENDPOINT_URL_LISTING = "user"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "User"; - - /// - /// - [JsonProperty(PropertyName = "UserLight")] - public UserLight UserLight { get; set; } - + /// /// [JsonProperty(PropertyName = "UserPerson")] public UserPerson UserPerson { get; set; } - + /// /// [JsonProperty(PropertyName = "UserCompany")] public UserCompany UserCompany { get; set; } - + /// /// [JsonProperty(PropertyName = "UserApiKey")] public UserApiKey UserApiKey { get; set; } - + /// /// [JsonProperty(PropertyName = "UserPaymentServiceProvider")] public UserPaymentServiceProvider UserPaymentServiceProvider { get; set; } - - + + /// /// Get a specific user. /// - public static BunqResponse Get(IDictionary customHeaders = null) + public static BunqResponse Get( IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId()), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId()), new Dictionary(), customHeaders); + return FromJson(responseRaw); } - + /// /// Get a collection of all available users. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); var responseRaw = apiClient.Get(ENDPOINT_URL_LISTING, urlParams, customHeaders); - + return FromJsonList(responseRaw); } - - + + /// /// public BunqModel GetReferencedObject() { - if (this.UserLight != null) - { - return this.UserLight; - } - if (this.UserPerson != null) { return this.UserPerson; } - + if (this.UserCompany != null) { return this.UserCompany; } - + if (this.UserApiKey != null) { return this.UserApiKey; } - + if (this.UserPaymentServiceProvider != null) { return this.UserPaymentServiceProvider; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() { - if (this.UserLight != null) - { - return false; - } - if (this.UserPerson != null) { return false; } - + if (this.UserCompany != null) { return false; } - + if (this.UserApiKey != null) { return false; } - + if (this.UserPaymentServiceProvider != null) { return false; } - + return true; } - + /// /// public static User CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/UserApiKey.cs b/BunqSdk/Model/Generated/Endpoint/UserApiKey.cs index 6c85557c..81e9854b 100644 --- a/BunqSdk/Model/Generated/Endpoint/UserApiKey.cs +++ b/BunqSdk/Model/Generated/Endpoint/UserApiKey.cs @@ -1,6 +1,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,32 +15,33 @@ public class UserApiKey : BunqModel /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the user object's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the user object's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The user who requested access. /// [JsonProperty(PropertyName = "requested_by_user")] public UserApiKeyAnchoredUser RequestedByUser { get; set; } - + /// /// The user who granted access. /// [JsonProperty(PropertyName = "granted_by_user")] public UserApiKeyAnchoredUser GrantedByUser { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -48,35 +50,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.RequestedByUser != null) { return false; } - + if (this.GrantedByUser != null) { return false; } - + return true; } - + /// /// public static UserApiKey CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/UserCompany.cs b/BunqSdk/Model/Generated/Endpoint/UserCompany.cs index c2bcd8ed..047d94bb 100644 --- a/BunqSdk/Model/Generated/Endpoint/UserCompany.cs +++ b/BunqSdk/Model/Generated/Endpoint/UserCompany.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,7 +22,7 @@ public class UserCompany : BunqModel /// protected const string ENDPOINT_URL_READ = "user-company/{0}"; protected const string ENDPOINT_URL_UPDATE = "user-company/{0}"; - + /// /// Field constants. /// @@ -39,234 +41,227 @@ public class UserCompany : BunqModel public const string FIELD_SUB_STATUS = "sub_status"; public const string FIELD_SESSION_TIMEOUT = "session_timeout"; public const string FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN = "daily_limit_without_confirmation_login"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "UserCompany"; - + /// /// The company name. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - + /// /// The company's public nick name. /// [JsonProperty(PropertyName = "public_nick_name")] public string PublicNickName { get; set; } - + /// /// The public UUID of the company's avatar. /// [JsonProperty(PropertyName = "avatar_uuid")] public string AvatarUuid { get; set; } - + /// /// The company's main address. /// [JsonProperty(PropertyName = "address_main")] public Address AddressMain { get; set; } - + /// /// The company's postal address. /// [JsonProperty(PropertyName = "address_postal")] public Address AddressPostal { get; set; } - + /// /// The person's preferred language. Formatted as a ISO 639-1 language code plus a ISO 3166-1 alpha-2 country /// code, seperated by an underscore. /// [JsonProperty(PropertyName = "language")] public string Language { get; set; } - + /// /// The person's preferred region. Formatted as a ISO 639-1 language code plus a ISO 3166-1 alpha-2 country /// code, seperated by an underscore. /// [JsonProperty(PropertyName = "region")] public string Region { get; set; } - + /// /// The country as an ISO 3166-1 alpha-2 country code. /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// The names of the company's ultimate beneficiary owners. Minimum zero, maximum four. /// [JsonProperty(PropertyName = "ubo")] public List Ubo { get; set; } - + /// /// The company's chamber of commerce number. /// [JsonProperty(PropertyName = "chamber_of_commerce_number")] public string ChamberOfCommerceNumber { get; set; } - + /// /// The company's legal form. /// [JsonProperty(PropertyName = "legal_form")] public string LegalForm { get; set; } - + /// /// The user status. Can be: ACTIVE, SIGNUP, RECOVERY. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The user sub-status. Can be: NONE, FACE_RESET, APPROVAL, APPROVAL_DIRECTOR, APPROVAL_PARENT, /// APPROVAL_SUPPORT, COUNTER_IBAN, IDEAL or SUBMIT. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The setting for the session timeout of the company in seconds. /// [JsonProperty(PropertyName = "session_timeout")] public int? SessionTimeout { get; set; } - + /// /// The amount the company can pay in the session without asking for credentials. /// [JsonProperty(PropertyName = "daily_limit_without_confirmation_login")] public Amount DailyLimitWithoutConfirmationLogin { get; set; } - + /// /// The id of the modified company. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the company object's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the company object's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The company's public UUID. /// [JsonProperty(PropertyName = "public_uuid")] public string PublicUuid { get; set; } - + /// /// The company's display name. /// [JsonProperty(PropertyName = "display_name")] public string DisplayName { get; set; } - + /// /// The aliases of the account. /// [JsonProperty(PropertyName = "alias")] public List Alias { get; set; } - + /// /// The type of business entity. /// [JsonProperty(PropertyName = "type_of_business_entity")] public string TypeOfBusinessEntity { get; set; } - + /// /// The sector of industry. /// [JsonProperty(PropertyName = "sector_of_industry")] public string SectorOfIndustry { get; set; } - + /// /// The company's other bank account IBAN, through which we verify it. /// [JsonProperty(PropertyName = "counter_bank_iban")] public string CounterBankIban { get; set; } - + /// /// The company's avatar. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - + /// /// The version of the terms of service accepted by the user. /// [JsonProperty(PropertyName = "version_terms_of_service")] public string VersionTermsOfService { get; set; } - - /// - /// The existing bunq alias for the company's primary director. - /// - [JsonProperty(PropertyName = "director_alias")] - public LabelUser DirectorAlias { get; set; } - + /// /// The existing bunq aliases for the company's directors. /// [JsonProperty(PropertyName = "directors")] public List Directors { get; set; } - + /// /// The types of notifications that will result in a push notification or URL callback for this UserCompany. /// [JsonProperty(PropertyName = "notification_filters")] public List NotificationFilters { get; set; } - + /// /// The customer profile of the company. /// [JsonProperty(PropertyName = "customer")] public Customer Customer { get; set; } - + /// /// The customer limits of the company. /// [JsonProperty(PropertyName = "customer_limit")] public CustomerLimit CustomerLimit { get; set; } - + /// /// The subscription of the company. /// [JsonProperty(PropertyName = "billing_contract")] public List BillingContract { get; set; } - + /// /// The user deny reason. /// [JsonProperty(PropertyName = "deny_reason")] public string DenyReason { get; set; } - + /// /// The relations for this user. /// [JsonProperty(PropertyName = "relations")] public List Relations { get; set; } - - + + /// /// Get a specific company. /// - public static BunqResponse Get(IDictionary customHeaders = null) + public static BunqResponse Get( IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId()), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId()), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Modify a specific company's data. /// @@ -285,43 +280,38 @@ public static BunqResponse Get(IDictionary customHe /// The user sub-status. Can be: NONE, FACE_RESET, APPROVAL, APPROVAL_DIRECTOR, APPROVAL_PARENT, APPROVAL_SUPPORT, COUNTER_IBAN, IDEAL or SUBMIT. /// The setting for the session timeout of the company in seconds. /// The amount the company can pay in the session without asking for credentials. - public static BunqResponse Update(string name = null, string publicNickName = null, - string avatarUuid = null, Address addressMain = null, Address addressPostal = null, string language = null, - string region = null, string country = null, List ubo = null, string chamberOfCommerceNumber = null, - string legalForm = null, string status = null, string subStatus = null, int? sessionTimeout = null, - Amount dailyLimitWithoutConfirmationLogin = null, IDictionary customHeaders = null) + public static BunqResponse Update(string name = null, string publicNickName = null, string avatarUuid = null, Address addressMain = null, Address addressPostal = null, string language = null, string region = null, string country = null, List ubo = null, string chamberOfCommerceNumber = null, string legalForm = null, string status = null, string subStatus = null, int? sessionTimeout = null, Amount dailyLimitWithoutConfirmationLogin = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_NAME, name}, - {FIELD_PUBLIC_NICK_NAME, publicNickName}, - {FIELD_AVATAR_UUID, avatarUuid}, - {FIELD_ADDRESS_MAIN, addressMain}, - {FIELD_ADDRESS_POSTAL, addressPostal}, - {FIELD_LANGUAGE, language}, - {FIELD_REGION, region}, - {FIELD_COUNTRY, country}, - {FIELD_UBO, ubo}, - {FIELD_CHAMBER_OF_COMMERCE_NUMBER, chamberOfCommerceNumber}, - {FIELD_LEGAL_FORM, legalForm}, - {FIELD_STATUS, status}, - {FIELD_SUB_STATUS, subStatus}, - {FIELD_SESSION_TIMEOUT, sessionTimeout}, - {FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN, dailyLimitWithoutConfirmationLogin}, - }; - + { + {FIELD_NAME, name}, + {FIELD_PUBLIC_NICK_NAME, publicNickName}, + {FIELD_AVATAR_UUID, avatarUuid}, + {FIELD_ADDRESS_MAIN, addressMain}, + {FIELD_ADDRESS_POSTAL, addressPostal}, + {FIELD_LANGUAGE, language}, + {FIELD_REGION, region}, + {FIELD_COUNTRY, country}, + {FIELD_UBO, ubo}, + {FIELD_CHAMBER_OF_COMMERCE_NUMBER, chamberOfCommerceNumber}, + {FIELD_LEGAL_FORM, legalForm}, + {FIELD_STATUS, status}, + {FIELD_SUB_STATUS, subStatus}, + {FIELD_SESSION_TIMEOUT, sessionTimeout}, + {FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN, dailyLimitWithoutConfirmationLogin}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -330,175 +320,170 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.PublicUuid != null) { return false; } - + if (this.Name != null) { return false; } - + if (this.DisplayName != null) { return false; } - + if (this.PublicNickName != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.ChamberOfCommerceNumber != null) { return false; } - + if (this.LegalForm != null) { return false; } - + if (this.TypeOfBusinessEntity != null) { return false; } - + if (this.SectorOfIndustry != null) { return false; } - + if (this.CounterBankIban != null) { return false; } - + if (this.Avatar != null) { return false; } - + if (this.AddressMain != null) { return false; } - + if (this.AddressPostal != null) { return false; } - + if (this.VersionTermsOfService != null) { return false; } - - if (this.DirectorAlias != null) - { - return false; - } - + if (this.Directors != null) { return false; } - + if (this.Language != null) { return false; } - + if (this.Country != null) { return false; } - + if (this.Region != null) { return false; } - + if (this.Ubo != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.SessionTimeout != null) { return false; } - + if (this.DailyLimitWithoutConfirmationLogin != null) { return false; } - + if (this.NotificationFilters != null) { return false; } - + if (this.Customer != null) { return false; } - + if (this.CustomerLimit != null) { return false; } - + if (this.BillingContract != null) { return false; } - + if (this.DenyReason != null) { return false; } - + if (this.Relations != null) { return false; } - + return true; } - + /// /// public static UserCompany CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/UserCompanyName.cs b/BunqSdk/Model/Generated/Endpoint/UserCompanyName.cs index 60cc5508..bb01bb97 100644 --- a/BunqSdk/Model/Generated/Endpoint/UserCompanyName.cs +++ b/BunqSdk/Model/Generated/Endpoint/UserCompanyName.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,35 +19,33 @@ public class UserCompanyName : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user-company/{0}/name"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "UserCompanyNameArray"; - + /// /// All known (trade) names for a user company. /// [JsonProperty(PropertyName = "name_array")] public List NameArray { get; set; } - + /// /// Return all the known (trade) names for a specific user company. /// - public static BunqResponse> List(int userCompanyId, - IDictionary urlParams = null, IDictionary customHeaders = null) + public static BunqResponse> List(int userCompanyId, IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -52,15 +54,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static UserCompanyName CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/UserCredentialPasswordIp.cs b/BunqSdk/Model/Generated/Endpoint/UserCredentialPasswordIp.cs index 9ef004d3..83cec93c 100644 --- a/BunqSdk/Model/Generated/Endpoint/UserCredentialPasswordIp.cs +++ b/BunqSdk/Model/Generated/Endpoint/UserCredentialPasswordIp.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -17,86 +21,81 @@ public class UserCredentialPasswordIp : BunqModel /// protected const string ENDPOINT_URL_READ = "user/{0}/credential-password-ip/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/credential-password-ip"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "CredentialPasswordIp"; - + /// /// The id of the credential. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the credential object's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the credential object's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The status of the credential. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// When the status is PENDING_FIRST_USE: when the credential expires. /// [JsonProperty(PropertyName = "expiry_time")] public string ExpiryTime { get; set; } - + /// /// When the status is PENDING_FIRST_USE: the value of the token. /// [JsonProperty(PropertyName = "token_value")] public string TokenValue { get; set; } - + /// /// When the status is ACTIVE: the details of the device that may use the credential. /// [JsonProperty(PropertyName = "permitted_device")] public PermittedDevice PermittedDevice { get; set; } - - + + /// /// - public static BunqResponse Get(int userCredentialPasswordIpId, - IDictionary customHeaders = null) + public static BunqResponse Get(int userCredentialPasswordIpId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = - apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), userCredentialPasswordIpId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), userCredentialPasswordIpId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -105,45 +104,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.ExpiryTime != null) { return false; } - + if (this.TokenValue != null) { return false; } - + if (this.PermittedDevice != null) { return false; } - + return true; } - + /// /// public static UserCredentialPasswordIp CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/UserLegalName.cs b/BunqSdk/Model/Generated/Endpoint/UserLegalName.cs index 3d321d07..9c0d41d1 100644 --- a/BunqSdk/Model/Generated/Endpoint/UserLegalName.cs +++ b/BunqSdk/Model/Generated/Endpoint/UserLegalName.cs @@ -1,7 +1,11 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -14,34 +18,32 @@ public class UserLegalName : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_LISTING = "user/{0}/legal-name"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "UserLegalNameArray"; - + /// /// All legal names that can be used by the user /// [JsonProperty(PropertyName = "legal_names")] public List LegalNames { get; set; } - + /// /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + return FromJsonList(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -50,15 +52,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static UserLegalName CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/UserLight.cs b/BunqSdk/Model/Generated/Endpoint/UserLight.cs deleted file mode 100644 index d501fb32..00000000 --- a/BunqSdk/Model/Generated/Endpoint/UserLight.cs +++ /dev/null @@ -1,445 +0,0 @@ -using System.Collections.Generic; -using Bunq.Sdk.Model.Core; -using Bunq.Sdk.Model.Generated.Object; -using Newtonsoft.Json; - -namespace Bunq.Sdk.Model.Generated.Endpoint -{ - /// - /// Show the authenticated user, if it is a light user. - /// - public class UserLight : BunqModel - { - /// - /// Field constants. - /// - public const string FIELD_FIRST_NAME = "first_name"; - public const string FIELD_MIDDLE_NAME = "middle_name"; - public const string FIELD_LAST_NAME = "last_name"; - public const string FIELD_PUBLIC_NICK_NAME = "public_nick_name"; - public const string FIELD_ADDRESS_MAIN = "address_main"; - public const string FIELD_ADDRESS_POSTAL = "address_postal"; - public const string FIELD_AVATAR_UUID = "avatar_uuid"; - public const string FIELD_SOCIAL_SECURITY_NUMBER = "social_security_number"; - public const string FIELD_TAX_RESIDENT = "tax_resident"; - public const string FIELD_DOCUMENT_TYPE = "document_type"; - public const string FIELD_DOCUMENT_NUMBER = "document_number"; - public const string FIELD_DOCUMENT_COUNTRY_OF_ISSUANCE = "document_country_of_issuance"; - public const string FIELD_DOCUMENT_FRONT_ATTACHMENT_ID = "document_front_attachment_id"; - public const string FIELD_DOCUMENT_BACK_ATTACHMENT_ID = "document_back_attachment_id"; - public const string FIELD_DATE_OF_BIRTH = "date_of_birth"; - public const string FIELD_PLACE_OF_BIRTH = "place_of_birth"; - public const string FIELD_COUNTRY_OF_BIRTH = "country_of_birth"; - public const string FIELD_NATIONALITY = "nationality"; - public const string FIELD_LANGUAGE = "language"; - public const string FIELD_REGION = "region"; - public const string FIELD_GENDER = "gender"; - public const string FIELD_STATUS = "status"; - public const string FIELD_SUB_STATUS = "sub_status"; - public const string FIELD_LEGAL_GUARDIAN_ALIAS = "legal_guardian_alias"; - public const string FIELD_SESSION_TIMEOUT = "session_timeout"; - public const string FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN = "daily_limit_without_confirmation_login"; - - - /// - /// The user's first name. - /// - [JsonProperty(PropertyName = "first_name")] - public string FirstName { get; set; } - - /// - /// The user's middle name. - /// - [JsonProperty(PropertyName = "middle_name")] - public string MiddleName { get; set; } - - /// - /// The user's last name. - /// - [JsonProperty(PropertyName = "last_name")] - public string LastName { get; set; } - - /// - /// The public nick name for the user. - /// - [JsonProperty(PropertyName = "public_nick_name")] - public string PublicNickName { get; set; } - - /// - /// The user's main address. - /// - [JsonProperty(PropertyName = "address_main")] - public Address AddressMain { get; set; } - - /// - /// The user's postal address. - /// - [JsonProperty(PropertyName = "address_postal")] - public Address AddressPostal { get; set; } - - /// - /// The public UUID of the user's avatar. - /// - [JsonProperty(PropertyName = "avatar_uuid")] - public string AvatarUuid { get; set; } - - /// - /// The user's social security number. - /// - [JsonProperty(PropertyName = "social_security_number")] - public string SocialSecurityNumber { get; set; } - - /// - /// The user's tax residence numbers for different countries. - /// - [JsonProperty(PropertyName = "tax_resident")] - public List TaxResident { get; set; } - - /// - /// The type of identification document the user registered with. - /// - [JsonProperty(PropertyName = "document_type")] - public string DocumentType { get; set; } - - /// - /// The identification document number the user registered with. - /// - [JsonProperty(PropertyName = "document_number")] - public string DocumentNumber { get; set; } - - /// - /// The country which issued the identification document the user registered with. - /// - [JsonProperty(PropertyName = "document_country_of_issuance")] - public string DocumentCountryOfIssuance { get; set; } - - /// - /// The reference to the uploaded picture/scan of the front side of the identification document. - /// - [JsonProperty(PropertyName = "document_front_attachment_id")] - public int? DocumentFrontAttachmentId { get; set; } - - /// - /// The reference to the uploaded picture/scan of the back side of the identification document. - /// - [JsonProperty(PropertyName = "document_back_attachment_id")] - public int? DocumentBackAttachmentId { get; set; } - - /// - /// The user's date of birth. Accepts ISO8601 date formats. - /// - [JsonProperty(PropertyName = "date_of_birth")] - public string DateOfBirth { get; set; } - - /// - /// The user's place of birth. - /// - [JsonProperty(PropertyName = "place_of_birth")] - public string PlaceOfBirth { get; set; } - - /// - /// The user's country of birth. Formatted as a SO 3166-1 alpha-2 country code. - /// - [JsonProperty(PropertyName = "country_of_birth")] - public string CountryOfBirth { get; set; } - - /// - /// The user's nationality. Formatted as a SO 3166-1 alpha-2 country code. - /// - [JsonProperty(PropertyName = "nationality")] - public string Nationality { get; set; } - - /// - /// The user's preferred language. Formatted as a ISO 639-1 language code plus a ISO 3166-1 alpha-2 country - /// code, seperated by an underscore. - /// - [JsonProperty(PropertyName = "language")] - public string Language { get; set; } - - /// - /// The user's preferred region. Formatted as a ISO 639-1 language code plus a ISO 3166-1 alpha-2 country code, - /// seperated by an underscore. - /// - [JsonProperty(PropertyName = "region")] - public string Region { get; set; } - - /// - /// The user's gender. Can be MALE, FEMALE or UNKNOWN. - /// - [JsonProperty(PropertyName = "gender")] - public string Gender { get; set; } - - /// - /// The user status. The user status. Can be: ACTIVE, BLOCKED, SIGNUP, DENIED or ABORTED. - /// - [JsonProperty(PropertyName = "status")] - public string Status { get; set; } - - /// - /// The user sub-status. Can be: NONE, FACE_RESET, APPROVAL, APPROVAL_PARENT, AWAITING_PARENT, APPROVAL_SUPPORT, - /// COUNTER_IBAN, IDEAL or SUBMIT. - /// - [JsonProperty(PropertyName = "sub_status")] - public string SubStatus { get; set; } - - /// - /// The legal guardian of the user. Required for minors. - /// - [JsonProperty(PropertyName = "legal_guardian_alias")] - public MonetaryAccountReference LegalGuardianAlias { get; set; } - - /// - /// The setting for the session timeout of the user in seconds. - /// - [JsonProperty(PropertyName = "session_timeout")] - public int? SessionTimeout { get; set; } - - /// - /// The amount the user can pay in the session without asking for credentials. - /// - [JsonProperty(PropertyName = "daily_limit_without_confirmation_login")] - public Amount DailyLimitWithoutConfirmationLogin { get; set; } - - /// - /// The id of the user. - /// - [JsonProperty(PropertyName = "id")] - public int? Id { get; set; } - - /// - /// The timestamp of the user object's creation. - /// - [JsonProperty(PropertyName = "created")] - public string Created { get; set; } - - /// - /// The timestamp of the user object's last update. - /// - [JsonProperty(PropertyName = "updated")] - public string Updated { get; set; } - - /// - /// The user's public UUID. - /// - [JsonProperty(PropertyName = "public_uuid")] - public string PublicUuid { get; set; } - - /// - /// The user's legal name. - /// - [JsonProperty(PropertyName = "legal_name")] - public string LegalName { get; set; } - - /// - /// The display name for the user. - /// - [JsonProperty(PropertyName = "display_name")] - public string DisplayName { get; set; } - - /// - /// The aliases of the user. - /// - [JsonProperty(PropertyName = "alias")] - public List Alias { get; set; } - - /// - /// The user's avatar. - /// - [JsonProperty(PropertyName = "avatar")] - public Avatar Avatar { get; set; } - - /// - /// The version of the terms of service accepted by the user. - /// - [JsonProperty(PropertyName = "version_terms_of_service")] - public string VersionTermsOfService { get; set; } - - /// - /// The types of notifications that will result in a push notification or URL callback for this UserLight. - /// - [JsonProperty(PropertyName = "notification_filters")] - public List NotificationFilters { get; set; } - - /// - /// The user deny reason. - /// - [JsonProperty(PropertyName = "deny_reason")] - public string DenyReason { get; set; } - - /// - /// The relations for this user. - /// - [JsonProperty(PropertyName = "relations")] - public List Relations { get; set; } - - - /// - /// - public override bool IsAllFieldNull() - { - if (this.Id != null) - { - return false; - } - - if (this.Created != null) - { - return false; - } - - if (this.Updated != null) - { - return false; - } - - if (this.PublicUuid != null) - { - return false; - } - - if (this.FirstName != null) - { - return false; - } - - if (this.MiddleName != null) - { - return false; - } - - if (this.LastName != null) - { - return false; - } - - if (this.LegalName != null) - { - return false; - } - - if (this.DisplayName != null) - { - return false; - } - - if (this.PublicNickName != null) - { - return false; - } - - if (this.Alias != null) - { - return false; - } - - if (this.SocialSecurityNumber != null) - { - return false; - } - - if (this.TaxResident != null) - { - return false; - } - - if (this.AddressMain != null) - { - return false; - } - - if (this.AddressPostal != null) - { - return false; - } - - if (this.DateOfBirth != null) - { - return false; - } - - if (this.PlaceOfBirth != null) - { - return false; - } - - if (this.CountryOfBirth != null) - { - return false; - } - - if (this.Nationality != null) - { - return false; - } - - if (this.Language != null) - { - return false; - } - - if (this.Region != null) - { - return false; - } - - if (this.Gender != null) - { - return false; - } - - if (this.Avatar != null) - { - return false; - } - - if (this.VersionTermsOfService != null) - { - return false; - } - - if (this.Status != null) - { - return false; - } - - if (this.SubStatus != null) - { - return false; - } - - if (this.SessionTimeout != null) - { - return false; - } - - if (this.DailyLimitWithoutConfirmationLogin != null) - { - return false; - } - - if (this.NotificationFilters != null) - { - return false; - } - - if (this.DenyReason != null) - { - return false; - } - - if (this.Relations != null) - { - return false; - } - - return true; - } - - /// - /// - public static UserLight CreateFromJsonString(string json) - { - return CreateFromJsonString(json); - } - } -} \ No newline at end of file diff --git a/BunqSdk/Model/Generated/Endpoint/UserPaymentServiceProvider.cs b/BunqSdk/Model/Generated/Endpoint/UserPaymentServiceProvider.cs index 2761dd60..916c63ef 100644 --- a/BunqSdk/Model/Generated/Endpoint/UserPaymentServiceProvider.cs +++ b/BunqSdk/Model/Generated/Endpoint/UserPaymentServiceProvider.cs @@ -1,8 +1,12 @@ -using System.Collections.Generic; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; +using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,114 +19,112 @@ public class UserPaymentServiceProvider : BunqModel /// Endpoint constants. /// protected const string ENDPOINT_URL_READ = "user-payment-service-provider/{0}"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "UserPaymentServiceProvider"; - + /// /// The id of the user. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the user object's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the user object's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The distinguished name from the certificate used to identify this user. /// [JsonProperty(PropertyName = "certificate_distinguished_name")] public string CertificateDistinguishedName { get; set; } - + /// /// The aliases of the user. /// [JsonProperty(PropertyName = "alias")] public List Alias { get; set; } - + /// /// The user's avatar. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - + /// /// The user status. The user status. Can be: ACTIVE, BLOCKED or DENIED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The user sub-status. Can be: NONE /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The providers's public UUID. /// [JsonProperty(PropertyName = "public_uuid")] public string PublicUuid { get; set; } - + /// /// The display name for the provider. /// [JsonProperty(PropertyName = "display_name")] public string DisplayName { get; set; } - + /// /// The public nick name for the provider. /// [JsonProperty(PropertyName = "public_nick_name")] public string PublicNickName { get; set; } - + /// /// The provider's language. Formatted as a ISO 639-1 language code plus a ISO 3166-1 alpha-2 country code, /// separated by an underscore. /// [JsonProperty(PropertyName = "language")] public string Language { get; set; } - + /// /// The provider's region. Formatted as a ISO 639-1 language code plus a ISO 3166-1 alpha-2 country code, /// separated by an underscore. /// [JsonProperty(PropertyName = "region")] public string Region { get; set; } - + /// /// The setting for the session timeout of the user in seconds. /// [JsonProperty(PropertyName = "session_timeout")] public int? SessionTimeout { get; set; } - - + + /// /// - public static BunqResponse Get(int userPaymentServiceProviderId, - IDictionary customHeaders = null) + public static BunqResponse Get(int userPaymentServiceProviderId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, userPaymentServiceProviderId), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, userPaymentServiceProviderId), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - - + + /// /// public override bool IsAllFieldNull() @@ -131,80 +133,80 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.CertificateDistinguishedName != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.Avatar != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.PublicUuid != null) { return false; } - + if (this.DisplayName != null) { return false; } - + if (this.PublicNickName != null) { return false; } - + if (this.Language != null) { return false; } - + if (this.Region != null) { return false; } - + if (this.SessionTimeout != null) { return false; } - + return true; } - + /// /// public static UserPaymentServiceProvider CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/UserPerson.cs b/BunqSdk/Model/Generated/Endpoint/UserPerson.cs index 5ee2d5a1..e11f800b 100644 --- a/BunqSdk/Model/Generated/Endpoint/UserPerson.cs +++ b/BunqSdk/Model/Generated/Endpoint/UserPerson.cs @@ -1,10 +1,12 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -20,7 +22,7 @@ public class UserPerson : BunqModel /// protected const string ENDPOINT_URL_READ = "user-person/{0}"; protected const string ENDPOINT_URL_UPDATE = "user-person/{0}"; - + /// /// Field constants. /// @@ -50,246 +52,245 @@ public class UserPerson : BunqModel public const string FIELD_SESSION_TIMEOUT = "session_timeout"; public const string FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN = "daily_limit_without_confirmation_login"; public const string FIELD_DISPLAY_NAME = "display_name"; - + /// /// Object type. /// private const string OBJECT_TYPE_GET = "UserPerson"; - + /// /// The person's first name. /// [JsonProperty(PropertyName = "first_name")] public string FirstName { get; set; } - + /// /// The person's middle name. /// [JsonProperty(PropertyName = "middle_name")] public string MiddleName { get; set; } - + /// /// The person's last name. /// [JsonProperty(PropertyName = "last_name")] public string LastName { get; set; } - + /// /// The public nick name for the person. /// [JsonProperty(PropertyName = "public_nick_name")] public string PublicNickName { get; set; } - + /// /// The person's main address. /// [JsonProperty(PropertyName = "address_main")] public Address AddressMain { get; set; } - + /// /// The person's postal address. /// [JsonProperty(PropertyName = "address_postal")] public Address AddressPostal { get; set; } - + /// /// The public UUID of the user's avatar. /// [JsonProperty(PropertyName = "avatar_uuid")] public string AvatarUuid { get; set; } - + /// /// The user's tax residence numbers for different countries. /// [JsonProperty(PropertyName = "tax_resident")] public List TaxResident { get; set; } - + /// /// The type of identification document the person registered with. /// [JsonProperty(PropertyName = "document_type")] public string DocumentType { get; set; } - + /// /// The identification document number the person registered with. /// [JsonProperty(PropertyName = "document_number")] public string DocumentNumber { get; set; } - + /// /// The country which issued the identification document the person registered with. /// [JsonProperty(PropertyName = "document_country_of_issuance")] public string DocumentCountryOfIssuance { get; set; } - + /// /// The reference to the uploaded picture/scan of the front side of the identification document. /// [JsonProperty(PropertyName = "document_front_attachment_id")] public int? DocumentFrontAttachmentId { get; set; } - + /// /// The reference to the uploaded picture/scan of the back side of the identification document. /// [JsonProperty(PropertyName = "document_back_attachment_id")] public int? DocumentBackAttachmentId { get; set; } - + /// /// The person's date of birth. Accepts ISO8601 date formats. /// [JsonProperty(PropertyName = "date_of_birth")] public string DateOfBirth { get; set; } - + /// /// The person's place of birth. /// [JsonProperty(PropertyName = "place_of_birth")] public string PlaceOfBirth { get; set; } - + /// /// The person's country of birth. Formatted as a SO 3166-1 alpha-2 country code. /// [JsonProperty(PropertyName = "country_of_birth")] public string CountryOfBirth { get; set; } - + /// /// The person's nationality. Formatted as a SO 3166-1 alpha-2 country code. /// [JsonProperty(PropertyName = "nationality")] public string Nationality { get; set; } - + /// /// The person's preferred language. Formatted as a ISO 639-1 language code plus a ISO 3166-1 alpha-2 country /// code, seperated by an underscore. /// [JsonProperty(PropertyName = "language")] public string Language { get; set; } - + /// /// The person's preferred region. Formatted as a ISO 639-1 language code plus a ISO 3166-1 alpha-2 country /// code, seperated by an underscore. /// [JsonProperty(PropertyName = "region")] public string Region { get; set; } - + /// /// The person's gender. Can be MALE, FEMALE or UNKNOWN. /// [JsonProperty(PropertyName = "gender")] public string Gender { get; set; } - + /// /// The user status. The user status. Can be: ACTIVE, BLOCKED, SIGNUP, RECOVERY, DENIED or ABORTED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The user sub-status. Can be: NONE, FACE_RESET, APPROVAL, APPROVAL_DIRECTOR, APPROVAL_PARENT, /// APPROVAL_SUPPORT, COUNTER_IBAN, IDEAL or SUBMIT. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The legal guardian of the user. Required for minors. /// [JsonProperty(PropertyName = "legal_guardian_alias")] public MonetaryAccountReference LegalGuardianAlias { get; set; } - + /// /// The setting for the session timeout of the user in seconds. /// [JsonProperty(PropertyName = "session_timeout")] public int? SessionTimeout { get; set; } - + /// /// The amount the user can pay in the session without asking for credentials. /// [JsonProperty(PropertyName = "daily_limit_without_confirmation_login")] public Amount DailyLimitWithoutConfirmationLogin { get; set; } - + /// /// The display name for the person. /// [JsonProperty(PropertyName = "display_name")] public string DisplayName { get; set; } - + /// /// The id of the modified person object. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the person object's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the person object's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The person's public UUID. /// [JsonProperty(PropertyName = "public_uuid")] public string PublicUuid { get; set; } - + /// /// The person's legal name. /// [JsonProperty(PropertyName = "legal_name")] public string LegalName { get; set; } - + /// /// The aliases of the user. /// [JsonProperty(PropertyName = "alias")] public List Alias { get; set; } - + /// /// The user's avatar. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - + /// /// The version of the terms of service accepted by the user. /// [JsonProperty(PropertyName = "version_terms_of_service")] public string VersionTermsOfService { get; set; } - + /// /// The types of notifications that will result in a push notification or URL callback for this UserPerson. /// [JsonProperty(PropertyName = "notification_filters")] public List NotificationFilters { get; set; } - + /// /// The relations for this user. /// [JsonProperty(PropertyName = "relations")] public List Relations { get; set; } - - + + /// /// Get a specific person. /// - public static BunqResponse Get(IDictionary customHeaders = null) + public static BunqResponse Get( IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId()), - new Dictionary(), customHeaders); - + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId()), new Dictionary(), customHeaders); + return FromJson(responseRaw, OBJECT_TYPE_GET); } - + /// /// Modify a specific person object's data. /// @@ -319,59 +320,49 @@ public static BunqResponse Get(IDictionary customHea /// The setting for the session timeout of the user in seconds. /// The amount the user can pay in the session without asking for credentials. /// The person's legal name. Available legal names can be listed via the 'user/{user_id}/legal-name' endpoint. - public static BunqResponse Update(string firstName = null, string middleName = null, - string lastName = null, string publicNickName = null, Address addressMain = null, - Address addressPostal = null, string avatarUuid = null, List taxResident = null, - string documentType = null, string documentNumber = null, string documentCountryOfIssuance = null, - int? documentFrontAttachmentId = null, int? documentBackAttachmentId = null, string dateOfBirth = null, - string placeOfBirth = null, string countryOfBirth = null, string nationality = null, string language = null, - string region = null, string gender = null, string status = null, string subStatus = null, - Pointer legalGuardianAlias = null, int? sessionTimeout = null, - Amount dailyLimitWithoutConfirmationLogin = null, string displayName = null, - IDictionary customHeaders = null) + public static BunqResponse Update(string firstName = null, string middleName = null, string lastName = null, string publicNickName = null, Address addressMain = null, Address addressPostal = null, string avatarUuid = null, List taxResident = null, string documentType = null, string documentNumber = null, string documentCountryOfIssuance = null, int? documentFrontAttachmentId = null, int? documentBackAttachmentId = null, string dateOfBirth = null, string placeOfBirth = null, string countryOfBirth = null, string nationality = null, string language = null, string region = null, string gender = null, string status = null, string subStatus = null, Pointer legalGuardianAlias = null, int? sessionTimeout = null, Amount dailyLimitWithoutConfirmationLogin = null, string displayName = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_FIRST_NAME, firstName}, - {FIELD_MIDDLE_NAME, middleName}, - {FIELD_LAST_NAME, lastName}, - {FIELD_PUBLIC_NICK_NAME, publicNickName}, - {FIELD_ADDRESS_MAIN, addressMain}, - {FIELD_ADDRESS_POSTAL, addressPostal}, - {FIELD_AVATAR_UUID, avatarUuid}, - {FIELD_TAX_RESIDENT, taxResident}, - {FIELD_DOCUMENT_TYPE, documentType}, - {FIELD_DOCUMENT_NUMBER, documentNumber}, - {FIELD_DOCUMENT_COUNTRY_OF_ISSUANCE, documentCountryOfIssuance}, - {FIELD_DOCUMENT_FRONT_ATTACHMENT_ID, documentFrontAttachmentId}, - {FIELD_DOCUMENT_BACK_ATTACHMENT_ID, documentBackAttachmentId}, - {FIELD_DATE_OF_BIRTH, dateOfBirth}, - {FIELD_PLACE_OF_BIRTH, placeOfBirth}, - {FIELD_COUNTRY_OF_BIRTH, countryOfBirth}, - {FIELD_NATIONALITY, nationality}, - {FIELD_LANGUAGE, language}, - {FIELD_REGION, region}, - {FIELD_GENDER, gender}, - {FIELD_STATUS, status}, - {FIELD_SUB_STATUS, subStatus}, - {FIELD_LEGAL_GUARDIAN_ALIAS, legalGuardianAlias}, - {FIELD_SESSION_TIMEOUT, sessionTimeout}, - {FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN, dailyLimitWithoutConfirmationLogin}, - {FIELD_DISPLAY_NAME, displayName}, - }; - + { + {FIELD_FIRST_NAME, firstName}, + {FIELD_MIDDLE_NAME, middleName}, + {FIELD_LAST_NAME, lastName}, + {FIELD_PUBLIC_NICK_NAME, publicNickName}, + {FIELD_ADDRESS_MAIN, addressMain}, + {FIELD_ADDRESS_POSTAL, addressPostal}, + {FIELD_AVATAR_UUID, avatarUuid}, + {FIELD_TAX_RESIDENT, taxResident}, + {FIELD_DOCUMENT_TYPE, documentType}, + {FIELD_DOCUMENT_NUMBER, documentNumber}, + {FIELD_DOCUMENT_COUNTRY_OF_ISSUANCE, documentCountryOfIssuance}, + {FIELD_DOCUMENT_FRONT_ATTACHMENT_ID, documentFrontAttachmentId}, + {FIELD_DOCUMENT_BACK_ATTACHMENT_ID, documentBackAttachmentId}, + {FIELD_DATE_OF_BIRTH, dateOfBirth}, + {FIELD_PLACE_OF_BIRTH, placeOfBirth}, + {FIELD_COUNTRY_OF_BIRTH, countryOfBirth}, + {FIELD_NATIONALITY, nationality}, + {FIELD_LANGUAGE, language}, + {FIELD_REGION, region}, + {FIELD_GENDER, gender}, + {FIELD_STATUS, status}, + {FIELD_SUB_STATUS, subStatus}, + {FIELD_LEGAL_GUARDIAN_ALIAS, legalGuardianAlias}, + {FIELD_SESSION_TIMEOUT, sessionTimeout}, + {FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN, dailyLimitWithoutConfirmationLogin}, + {FIELD_DISPLAY_NAME, displayName}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -380,155 +371,155 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.PublicUuid != null) { return false; } - + if (this.FirstName != null) { return false; } - + if (this.MiddleName != null) { return false; } - + if (this.LastName != null) { return false; } - + if (this.LegalName != null) { return false; } - + if (this.DisplayName != null) { return false; } - + if (this.PublicNickName != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.TaxResident != null) { return false; } - + if (this.AddressMain != null) { return false; } - + if (this.AddressPostal != null) { return false; } - + if (this.DateOfBirth != null) { return false; } - + if (this.PlaceOfBirth != null) { return false; } - + if (this.CountryOfBirth != null) { return false; } - + if (this.Nationality != null) { return false; } - + if (this.Language != null) { return false; } - + if (this.Region != null) { return false; } - + if (this.Gender != null) { return false; } - + if (this.Avatar != null) { return false; } - + if (this.VersionTermsOfService != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.SessionTimeout != null) { return false; } - + if (this.DailyLimitWithoutConfirmationLogin != null) { return false; } - + if (this.NotificationFilters != null) { return false; } - + if (this.Relations != null) { return false; } - + return true; } - + /// /// public static UserPerson CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/Whitelist.cs b/BunqSdk/Model/Generated/Endpoint/Whitelist.cs index 07c7891a..2805fe8c 100644 --- a/BunqSdk/Model/Generated/Endpoint/Whitelist.cs +++ b/BunqSdk/Model/Generated/Endpoint/Whitelist.cs @@ -1,4 +1,6 @@ using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -7,18 +9,19 @@ namespace Bunq.Sdk.Model.Generated.Endpoint /// public class Whitelist : BunqModel { + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static Whitelist CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/WhitelistResult.cs b/BunqSdk/Model/Generated/Endpoint/WhitelistResult.cs index e35bf9ea..2215d434 100644 --- a/BunqSdk/Model/Generated/Endpoint/WhitelistResult.cs +++ b/BunqSdk/Model/Generated/Endpoint/WhitelistResult.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Endpoint { @@ -15,50 +15,51 @@ public class WhitelistResult : BunqModel /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The account from which payments will be deducted when a transaction is matched with this whitelist. /// [JsonProperty(PropertyName = "monetary_account_paying_id")] public int? MonetaryAccountPayingId { get; set; } - + /// /// The status of the WhitelistResult. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The subStatus of the WhitelistResult. /// [JsonProperty(PropertyName = "sub_status")] public string SubStatus { get; set; } - + /// /// The message when the whitelist result has failed due to user error. /// [JsonProperty(PropertyName = "error_message")] public List ErrorMessage { get; set; } - + /// /// The corresponding whitelist. /// [JsonProperty(PropertyName = "whitelist")] public Whitelist Whitelist { get; set; } - + /// /// The details of the external object the event was created for. /// [JsonProperty(PropertyName = "object")] public WhitelistResultViewAnchoredObject Object { get; set; } - + /// /// The reference to the object used for split the bill. Can be RequestInquiry or RequestInquiryBatch /// [JsonProperty(PropertyName = "request_reference_split_the_bill")] public List RequestReferenceSplitTheBill { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -67,50 +68,50 @@ public override bool IsAllFieldNull() { return false; } - + if (this.MonetaryAccountPayingId != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.SubStatus != null) { return false; } - + if (this.ErrorMessage != null) { return false; } - + if (this.Whitelist != null) { return false; } - + if (this.Object != null) { return false; } - + if (this.RequestReferenceSplitTheBill != null) { return false; } - + return true; } - + /// /// public static WhitelistResult CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/WhitelistSdd.cs b/BunqSdk/Model/Generated/Endpoint/WhitelistSdd.cs index d4553e8d..5cfa34f1 100644 --- a/BunqSdk/Model/Generated/Endpoint/WhitelistSdd.cs +++ b/BunqSdk/Model/Generated/Endpoint/WhitelistSdd.cs @@ -1,15 +1,17 @@ -using System.Collections.Generic; -using System.Text; +using Bunq.Sdk.Context; using Bunq.Sdk.Http; using Bunq.Sdk.Json; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Object; using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; namespace Bunq.Sdk.Model.Generated.Endpoint { /// - /// Whitelist an SDD so that when one comes in, it is automatically accepted. + /// Depreciated route, replaced with whitelist-sdd-recurring /// public class WhitelistSdd : BunqModel { @@ -21,182 +23,173 @@ public class WhitelistSdd : BunqModel protected const string ENDPOINT_URL_UPDATE = "user/{0}/whitelist-sdd/{1}"; protected const string ENDPOINT_URL_DELETE = "user/{0}/whitelist-sdd/{1}"; protected const string ENDPOINT_URL_LISTING = "user/{0}/whitelist-sdd"; - + /// /// Field constants. /// public const string FIELD_MONETARY_ACCOUNT_PAYING_ID = "monetary_account_paying_id"; public const string FIELD_REQUEST_ID = "request_id"; public const string FIELD_MAXIMUM_AMOUNT_PER_MONTH = "maximum_amount_per_month"; - + /// /// Object type. /// - private const string OBJECT_TYPE_GET = "WhitelistSdd"; - + private const string OBJECT_TYPE_GET = "Whitelist"; + /// /// The account from which payments will be deducted when a transaction is matched with this whitelist. /// [JsonProperty(PropertyName = "monetary_account_paying_id")] public int? MonetaryAccountPayingId { get; set; } - + /// /// ID of the request for which you want to whitelist the originating SDD. /// [JsonProperty(PropertyName = "request_id")] public int? RequestId { get; set; } - + /// /// The monthly maximum amount that can be deducted from the target account. /// [JsonProperty(PropertyName = "maximum_amount_per_month")] public Amount MaximumAmountPerMonth { get; set; } - + /// /// The ID of the whitelist entry. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The account to which payments will come in before possibly being 'redirected' by the whitelist. /// [JsonProperty(PropertyName = "monetary_account_incoming_id")] public int? MonetaryAccountIncomingId { get; set; } - + /// /// The type of the SDD whitelist, can be CORE or B2B. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The status of the whitelist. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The credit scheme ID provided by the counterparty. /// [JsonProperty(PropertyName = "credit_scheme_identifier")] public string CreditSchemeIdentifier { get; set; } - + /// /// The mandate ID provided by the counterparty. /// [JsonProperty(PropertyName = "mandate_identifier")] public string MandateIdentifier { get; set; } - + /// /// The account to which payments will be paid. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The user who created the whitelist entry. /// [JsonProperty(PropertyName = "user_alias_created")] public LabelUser UserAliasCreated { get; set; } - - + + /// - /// Get a specific SDD whitelist entry. + /// Get a specific recurring SDD whitelist entry. /// - public static BunqResponse Get(int whitelistSddId, - IDictionary customHeaders = null) + public static BunqResponse Get(int whitelistSddId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), whitelistSddId), - new Dictionary(), customHeaders); - - return FromJson(responseRaw, OBJECT_TYPE_GET); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), whitelistSddId), new Dictionary(), customHeaders); + + return FromJson(responseRaw); } - + /// - /// Create a new SDD whitelist entry. + /// Create a new recurring SDD whitelist entry. /// /// ID of the monetary account of which you want to pay from. /// ID of the request for which you want to whitelist the originating SDD. /// The maximum amount of money that is allowed to be deducted based on the whitelist. - public static BunqResponse Create(int? monetaryAccountPayingId, int? requestId, - Amount maximumAmountPerMonth, IDictionary customHeaders = null) + public static BunqResponse Create(int? monetaryAccountPayingId, int? requestId, Amount maximumAmountPerMonth, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_MONETARY_ACCOUNT_PAYING_ID, monetaryAccountPayingId}, - {FIELD_REQUEST_ID, requestId}, - {FIELD_MAXIMUM_AMOUNT_PER_MONTH, maximumAmountPerMonth}, - }; - + { + {FIELD_MONETARY_ACCOUNT_PAYING_ID, monetaryAccountPayingId}, + {FIELD_REQUEST_ID, requestId}, + {FIELD_MAXIMUM_AMOUNT_PER_MONTH, maximumAmountPerMonth}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, - customHeaders); - + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// /// ID of the monetary account of which you want to pay from. /// The maximum amount of money that is allowed to be deducted based on the whitelist. - public static BunqResponse Update(int whitelistSddId, int? monetaryAccountPayingId = null, - Amount maximumAmountPerMonth = null, IDictionary customHeaders = null) + public static BunqResponse Update(int whitelistSddId, int? monetaryAccountPayingId = null, Amount maximumAmountPerMonth = null, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - + var requestMap = new Dictionary - { - {FIELD_MONETARY_ACCOUNT_PAYING_ID, monetaryAccountPayingId}, - {FIELD_MAXIMUM_AMOUNT_PER_MONTH, maximumAmountPerMonth}, - }; - + { + {FIELD_MONETARY_ACCOUNT_PAYING_ID, monetaryAccountPayingId}, + {FIELD_MAXIMUM_AMOUNT_PER_MONTH, maximumAmountPerMonth}, + }; + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); - var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), whitelistSddId), - requestBytes, customHeaders); - + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), whitelistSddId), requestBytes, customHeaders); + return ProcessForId(responseRaw); } - + /// /// public static BunqResponse Delete(int whitelistSddId, IDictionary customHeaders = null) { if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), whitelistSddId), - customHeaders); - + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), whitelistSddId), customHeaders); + return new BunqResponse(null, responseRaw.Headers); } - + /// - /// Get a listing of all SDD whitelist entries for a target monetary account. + /// Get a listing of all recurring SDD whitelist entries for a target monetary account. /// - public static BunqResponse> List(IDictionary urlParams = null, - IDictionary customHeaders = null) + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) { if (urlParams == null) urlParams = new Dictionary(); if (customHeaders == null) customHeaders = new Dictionary(); - + var apiClient = new ApiClient(GetApiContext()); - var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, - customHeaders); - - return FromJsonList(responseRaw, OBJECT_TYPE_GET); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + + return FromJsonList(responseRaw); } - - + + /// /// public override bool IsAllFieldNull() @@ -205,60 +198,60 @@ public override bool IsAllFieldNull() { return false; } - + if (this.MonetaryAccountIncomingId != null) { return false; } - + if (this.MonetaryAccountPayingId != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.CreditSchemeIdentifier != null) { return false; } - + if (this.MandateIdentifier != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.MaximumAmountPerMonth != null) { return false; } - + if (this.UserAliasCreated != null) { return false; } - + return true; } - + /// /// public static WhitelistSdd CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Endpoint/WhitelistSddMonetaryAccountPaying.cs b/BunqSdk/Model/Generated/Endpoint/WhitelistSddMonetaryAccountPaying.cs new file mode 100644 index 00000000..4fd38485 --- /dev/null +++ b/BunqSdk/Model/Generated/Endpoint/WhitelistSddMonetaryAccountPaying.cs @@ -0,0 +1,182 @@ +using Bunq.Sdk.Context; +using Bunq.Sdk.Http; +using Bunq.Sdk.Json; +using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; + +namespace Bunq.Sdk.Model.Generated.Endpoint +{ + /// + /// Whitelist an SDD so that when one comes in, it is automatically accepted. + /// + public class WhitelistSddMonetaryAccountPaying : BunqModel + { + /// + /// Endpoint constants. + /// + protected const string ENDPOINT_URL_READ = "user/{0}/monetary-account/{1}/whitelist-sdd/{2}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/monetary-account/{1}/whitelist-sdd"; + + /// + /// Object type. + /// + private const string OBJECT_TYPE_GET = "WhitelistSdd"; + + /// + /// The ID of the whitelist entry. + /// + [JsonProperty(PropertyName = "id")] + public int? Id { get; set; } + + /// + /// The account to which payments will come in before possibly being 'redirected' by the whitelist. + /// + [JsonProperty(PropertyName = "monetary_account_incoming_id")] + public int? MonetaryAccountIncomingId { get; set; } + + /// + /// The account from which payments will be deducted when a transaction is matched with this whitelist. + /// + [JsonProperty(PropertyName = "monetary_account_paying_id")] + public int? MonetaryAccountPayingId { get; set; } + + /// + /// The type of the SDD whitelist, can be CORE or B2B. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// The status of the whitelist. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// The credit scheme ID provided by the counterparty. + /// + [JsonProperty(PropertyName = "credit_scheme_identifier")] + public string CreditSchemeIdentifier { get; set; } + + /// + /// The mandate ID provided by the counterparty. + /// + [JsonProperty(PropertyName = "mandate_identifier")] + public string MandateIdentifier { get; set; } + + /// + /// The account to which payments will be paid. + /// + [JsonProperty(PropertyName = "counterparty_alias")] + public MonetaryAccountReference CounterpartyAlias { get; set; } + + /// + /// The monthly maximum amount that can be deducted from the target account. + /// + [JsonProperty(PropertyName = "maximum_amount_per_month")] + public Amount MaximumAmountPerMonth { get; set; } + + /// + /// The user who created the whitelist entry. + /// + [JsonProperty(PropertyName = "user_alias_created")] + public LabelUser UserAliasCreated { get; set; } + + + /// + /// Get a specific SDD whitelist entry. + /// + public static BunqResponse Get(int whitelistSddMonetaryAccountPayingId, int? monetaryAccountId= null, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId), whitelistSddMonetaryAccountPayingId), new Dictionary(), customHeaders); + + return FromJson(responseRaw, OBJECT_TYPE_GET); + } + + /// + /// Get a listing of all SDD whitelist entries for a target monetary account. + /// + public static BunqResponse> List(int? monetaryAccountId= null, IDictionary urlParams = null, IDictionary customHeaders = null) + { + if (urlParams == null) urlParams = new Dictionary(); + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId(), DetermineMonetaryAccountId(monetaryAccountId)), urlParams, customHeaders); + + return FromJsonList(responseRaw, OBJECT_TYPE_GET); + } + + + /// + /// + public override bool IsAllFieldNull() + { + if (this.Id != null) + { + return false; + } + + if (this.MonetaryAccountIncomingId != null) + { + return false; + } + + if (this.MonetaryAccountPayingId != null) + { + return false; + } + + if (this.Type != null) + { + return false; + } + + if (this.Status != null) + { + return false; + } + + if (this.CreditSchemeIdentifier != null) + { + return false; + } + + if (this.MandateIdentifier != null) + { + return false; + } + + if (this.CounterpartyAlias != null) + { + return false; + } + + if (this.MaximumAmountPerMonth != null) + { + return false; + } + + if (this.UserAliasCreated != null) + { + return false; + } + + return true; + } + + /// + /// + public static WhitelistSddMonetaryAccountPaying CreateFromJsonString(string json) + { + return BunqModel.CreateFromJsonString(json); + } + } +} diff --git a/BunqSdk/Model/Generated/Endpoint/WhitelistSddOneOff.cs b/BunqSdk/Model/Generated/Endpoint/WhitelistSddOneOff.cs new file mode 100644 index 00000000..72999dbd --- /dev/null +++ b/BunqSdk/Model/Generated/Endpoint/WhitelistSddOneOff.cs @@ -0,0 +1,247 @@ +using Bunq.Sdk.Context; +using Bunq.Sdk.Http; +using Bunq.Sdk.Json; +using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; + +namespace Bunq.Sdk.Model.Generated.Endpoint +{ + /// + /// Whitelist an one off SDD so that when another one off SDD from the creditor comes in, it is automatically + /// accepted. + /// + public class WhitelistSddOneOff : BunqModel + { + /// + /// Endpoint constants. + /// + protected const string ENDPOINT_URL_READ = "user/{0}/whitelist-sdd-one-off/{1}"; + protected const string ENDPOINT_URL_CREATE = "user/{0}/whitelist-sdd-one-off"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/whitelist-sdd-one-off/{1}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/whitelist-sdd-one-off/{1}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/whitelist-sdd-one-off"; + + /// + /// Field constants. + /// + public const string FIELD_MONETARY_ACCOUNT_PAYING_ID = "monetary_account_paying_id"; + public const string FIELD_REQUEST_ID = "request_id"; + public const string FIELD_MAXIMUM_AMOUNT_PER_MONTH = "maximum_amount_per_month"; + + /// + /// Object type. + /// + private const string OBJECT_TYPE_GET = "WhitelistSddOneOff"; + + /// + /// The account from which payments will be deducted when a transaction is matched with this whitelist. + /// + [JsonProperty(PropertyName = "monetary_account_paying_id")] + public int? MonetaryAccountPayingId { get; set; } + + /// + /// ID of the request for which you want to whitelist the originating SDD. + /// + [JsonProperty(PropertyName = "request_id")] + public int? RequestId { get; set; } + + /// + /// The monthly maximum amount that can be deducted from the target account. + /// + [JsonProperty(PropertyName = "maximum_amount_per_month")] + public Amount MaximumAmountPerMonth { get; set; } + + /// + /// The ID of the whitelist entry. + /// + [JsonProperty(PropertyName = "id")] + public int? Id { get; set; } + + /// + /// The account to which payments will come in before possibly being 'redirected' by the whitelist. + /// + [JsonProperty(PropertyName = "monetary_account_incoming_id")] + public int? MonetaryAccountIncomingId { get; set; } + + /// + /// The type of the SDD whitelist, can be CORE or B2B. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// The status of the whitelist. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// The credit scheme ID provided by the counterparty. + /// + [JsonProperty(PropertyName = "credit_scheme_identifier")] + public string CreditSchemeIdentifier { get; set; } + + /// + /// The account to which payments will be paid. + /// + [JsonProperty(PropertyName = "counterparty_alias")] + public MonetaryAccountReference CounterpartyAlias { get; set; } + + /// + /// The user who created the whitelist entry. + /// + [JsonProperty(PropertyName = "user_alias_created")] + public LabelUser UserAliasCreated { get; set; } + + + /// + /// Get a specific one off SDD whitelist entry. + /// + public static BunqResponse Get(int whitelistSddOneOffId, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), whitelistSddOneOffId), new Dictionary(), customHeaders); + + return FromJson(responseRaw, OBJECT_TYPE_GET); + } + + /// + /// Create a new one off SDD whitelist entry. + /// + /// ID of the monetary account of which you want to pay from. + /// ID of the request for which you want to whitelist the originating SDD. + /// The maximum amount of money that is allowed to be deducted based on the whitelist. + public static BunqResponse Create(int? monetaryAccountPayingId, int? requestId, Amount maximumAmountPerMonth = null, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + + var requestMap = new Dictionary + { + {FIELD_MONETARY_ACCOUNT_PAYING_ID, monetaryAccountPayingId}, + {FIELD_REQUEST_ID, requestId}, + {FIELD_MAXIMUM_AMOUNT_PER_MONTH, maximumAmountPerMonth}, + }; + + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + + return ProcessForId(responseRaw); + } + + /// + /// + /// ID of the monetary account of which you want to pay from. + /// The maximum amount of money that is allowed to be deducted based on the whitelist. + public static BunqResponse Update(int whitelistSddOneOffId, int? monetaryAccountPayingId = null, Amount maximumAmountPerMonth = null, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + + var requestMap = new Dictionary + { + {FIELD_MONETARY_ACCOUNT_PAYING_ID, monetaryAccountPayingId}, + {FIELD_MAXIMUM_AMOUNT_PER_MONTH, maximumAmountPerMonth}, + }; + + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), whitelistSddOneOffId), requestBytes, customHeaders); + + return ProcessForId(responseRaw); + } + + /// + /// + public static BunqResponse Delete(int whitelistSddOneOffId, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), whitelistSddOneOffId), customHeaders); + + return new BunqResponse(null, responseRaw.Headers); + } + + /// + /// Get a listing of all one off SDD whitelist entries for a target monetary account. + /// + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) + { + if (urlParams == null) urlParams = new Dictionary(); + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + + return FromJsonList(responseRaw, OBJECT_TYPE_GET); + } + + + /// + /// + public override bool IsAllFieldNull() + { + if (this.Id != null) + { + return false; + } + + if (this.MonetaryAccountIncomingId != null) + { + return false; + } + + if (this.MonetaryAccountPayingId != null) + { + return false; + } + + if (this.Type != null) + { + return false; + } + + if (this.Status != null) + { + return false; + } + + if (this.CreditSchemeIdentifier != null) + { + return false; + } + + if (this.CounterpartyAlias != null) + { + return false; + } + + if (this.MaximumAmountPerMonth != null) + { + return false; + } + + if (this.UserAliasCreated != null) + { + return false; + } + + return true; + } + + /// + /// + public static WhitelistSddOneOff CreateFromJsonString(string json) + { + return BunqModel.CreateFromJsonString(json); + } + } +} diff --git a/BunqSdk/Model/Generated/Endpoint/WhitelistSddRecurring.cs b/BunqSdk/Model/Generated/Endpoint/WhitelistSddRecurring.cs new file mode 100644 index 00000000..ccfef38a --- /dev/null +++ b/BunqSdk/Model/Generated/Endpoint/WhitelistSddRecurring.cs @@ -0,0 +1,257 @@ +using Bunq.Sdk.Context; +using Bunq.Sdk.Http; +using Bunq.Sdk.Json; +using Bunq.Sdk.Model.Core; +using Bunq.Sdk.Model.Generated.Object; +using Newtonsoft.Json; +using System.Collections.Generic; +using System.Text; +using System; + +namespace Bunq.Sdk.Model.Generated.Endpoint +{ + /// + /// Whitelist a recurring SDD so that when another recurrence comes in, it is automatically accepted. + /// + public class WhitelistSddRecurring : BunqModel + { + /// + /// Endpoint constants. + /// + protected const string ENDPOINT_URL_READ = "user/{0}/whitelist-sdd-recurring/{1}"; + protected const string ENDPOINT_URL_CREATE = "user/{0}/whitelist-sdd-recurring"; + protected const string ENDPOINT_URL_UPDATE = "user/{0}/whitelist-sdd-recurring/{1}"; + protected const string ENDPOINT_URL_DELETE = "user/{0}/whitelist-sdd-recurring/{1}"; + protected const string ENDPOINT_URL_LISTING = "user/{0}/whitelist-sdd-recurring"; + + /// + /// Field constants. + /// + public const string FIELD_MONETARY_ACCOUNT_PAYING_ID = "monetary_account_paying_id"; + public const string FIELD_REQUEST_ID = "request_id"; + public const string FIELD_MAXIMUM_AMOUNT_PER_MONTH = "maximum_amount_per_month"; + + /// + /// Object type. + /// + private const string OBJECT_TYPE_GET = "WhitelistSddRecurring"; + + /// + /// The account from which payments will be deducted when a transaction is matched with this whitelist. + /// + [JsonProperty(PropertyName = "monetary_account_paying_id")] + public int? MonetaryAccountPayingId { get; set; } + + /// + /// ID of the request for which you want to whitelist the originating SDD. + /// + [JsonProperty(PropertyName = "request_id")] + public int? RequestId { get; set; } + + /// + /// The monthly maximum amount that can be deducted from the target account. + /// + [JsonProperty(PropertyName = "maximum_amount_per_month")] + public Amount MaximumAmountPerMonth { get; set; } + + /// + /// The ID of the whitelist entry. + /// + [JsonProperty(PropertyName = "id")] + public int? Id { get; set; } + + /// + /// The account to which payments will come in before possibly being 'redirected' by the whitelist. + /// + [JsonProperty(PropertyName = "monetary_account_incoming_id")] + public int? MonetaryAccountIncomingId { get; set; } + + /// + /// The type of the SDD whitelist, can be CORE or B2B. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// The status of the whitelist. + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// The credit scheme ID provided by the counterparty. + /// + [JsonProperty(PropertyName = "credit_scheme_identifier")] + public string CreditSchemeIdentifier { get; set; } + + /// + /// The mandate ID provided by the counterparty. + /// + [JsonProperty(PropertyName = "mandate_identifier")] + public string MandateIdentifier { get; set; } + + /// + /// The account to which payments will be paid. + /// + [JsonProperty(PropertyName = "counterparty_alias")] + public MonetaryAccountReference CounterpartyAlias { get; set; } + + /// + /// The user who created the whitelist entry. + /// + [JsonProperty(PropertyName = "user_alias_created")] + public LabelUser UserAliasCreated { get; set; } + + + /// + /// Get a specific recurring SDD whitelist entry. + /// + public static BunqResponse Get(int whitelistSddRecurringId, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_READ, DetermineUserId(), whitelistSddRecurringId), new Dictionary(), customHeaders); + + return FromJson(responseRaw, OBJECT_TYPE_GET); + } + + /// + /// Create a new recurring SDD whitelist entry. + /// + /// ID of the monetary account of which you want to pay from. + /// ID of the request for which you want to whitelist the originating SDD. + /// The maximum amount of money that is allowed to be deducted based on the whitelist. + public static BunqResponse Create(int? monetaryAccountPayingId, int? requestId, Amount maximumAmountPerMonth = null, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + + var requestMap = new Dictionary + { + {FIELD_MONETARY_ACCOUNT_PAYING_ID, monetaryAccountPayingId}, + {FIELD_REQUEST_ID, requestId}, + {FIELD_MAXIMUM_AMOUNT_PER_MONTH, maximumAmountPerMonth}, + }; + + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); + var responseRaw = apiClient.Post(string.Format(ENDPOINT_URL_CREATE, DetermineUserId()), requestBytes, customHeaders); + + return ProcessForId(responseRaw); + } + + /// + /// + /// ID of the monetary account of which you want to pay from. + /// The maximum amount of money that is allowed to be deducted based on the whitelist. + public static BunqResponse Update(int whitelistSddRecurringId, int? monetaryAccountPayingId = null, Amount maximumAmountPerMonth = null, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + + var requestMap = new Dictionary + { + {FIELD_MONETARY_ACCOUNT_PAYING_ID, monetaryAccountPayingId}, + {FIELD_MAXIMUM_AMOUNT_PER_MONTH, maximumAmountPerMonth}, + }; + + var requestBytes = Encoding.UTF8.GetBytes(BunqJsonConvert.SerializeObject(requestMap)); + var responseRaw = apiClient.Put(string.Format(ENDPOINT_URL_UPDATE, DetermineUserId(), whitelistSddRecurringId), requestBytes, customHeaders); + + return ProcessForId(responseRaw); + } + + /// + /// + public static BunqResponse Delete(int whitelistSddRecurringId, IDictionary customHeaders = null) + { + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Delete(string.Format(ENDPOINT_URL_DELETE, DetermineUserId(), whitelistSddRecurringId), customHeaders); + + return new BunqResponse(null, responseRaw.Headers); + } + + /// + /// Get a listing of all recurring SDD whitelist entries for a target monetary account. + /// + public static BunqResponse> List( IDictionary urlParams = null, IDictionary customHeaders = null) + { + if (urlParams == null) urlParams = new Dictionary(); + if (customHeaders == null) customHeaders = new Dictionary(); + + var apiClient = new ApiClient(GetApiContext()); + var responseRaw = apiClient.Get(string.Format(ENDPOINT_URL_LISTING, DetermineUserId()), urlParams, customHeaders); + + return FromJsonList(responseRaw, OBJECT_TYPE_GET); + } + + + /// + /// + public override bool IsAllFieldNull() + { + if (this.Id != null) + { + return false; + } + + if (this.MonetaryAccountIncomingId != null) + { + return false; + } + + if (this.MonetaryAccountPayingId != null) + { + return false; + } + + if (this.Type != null) + { + return false; + } + + if (this.Status != null) + { + return false; + } + + if (this.CreditSchemeIdentifier != null) + { + return false; + } + + if (this.MandateIdentifier != null) + { + return false; + } + + if (this.CounterpartyAlias != null) + { + return false; + } + + if (this.MaximumAmountPerMonth != null) + { + return false; + } + + if (this.UserAliasCreated != null) + { + return false; + } + + return true; + } + + /// + /// + public static WhitelistSddRecurring CreateFromJsonString(string json) + { + return BunqModel.CreateFromJsonString(json); + } + } +} diff --git a/BunqSdk/Model/Generated/Object/Address.cs b/BunqSdk/Model/Generated/Object/Address.cs index 08cec9d8..000cbd80 100644 --- a/BunqSdk/Model/Generated/Object/Address.cs +++ b/BunqSdk/Model/Generated/Object/Address.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,56 +13,56 @@ public class Address : BunqModel /// [JsonProperty(PropertyName = "street")] public string Street { get; set; } - + /// /// The house number. /// [JsonProperty(PropertyName = "house_number")] public string HouseNumber { get; set; } - + /// /// The PO box. /// [JsonProperty(PropertyName = "po_box")] public string PoBox { get; set; } - + /// /// The postal code. /// [JsonProperty(PropertyName = "postal_code")] public string PostalCode { get; set; } - + /// /// The city. /// [JsonProperty(PropertyName = "city")] public string City { get; set; } - + /// /// The country as an ISO 3166-1 alpha-2 country code. /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// The apartment, building or other extra information for addresses. /// [JsonProperty(PropertyName = "extra")] public string Extra { get; set; } - + /// /// The name on the mailbox (only used for Postal addresses). /// [JsonProperty(PropertyName = "mailbox_name")] public string MailboxName { get; set; } - + /// /// The province according to local standard. /// [JsonProperty(PropertyName = "province")] public string Province { get; set; } - - + + public Address(string street, string houseNumber, string postalCode, string city, string country) { Street = street; @@ -70,8 +71,8 @@ public Address(string street, string houseNumber, string postalCode, string city City = city; Country = country; } - - + + /// /// public override bool IsAllFieldNull() @@ -80,55 +81,55 @@ public override bool IsAllFieldNull() { return false; } - + if (this.HouseNumber != null) { return false; } - + if (this.PoBox != null) { return false; } - + if (this.PostalCode != null) { return false; } - + if (this.City != null) { return false; } - + if (this.Country != null) { return false; } - + if (this.Province != null) { return false; } - + if (this.Extra != null) { return false; } - + if (this.MailboxName != null) { return false; } - + return true; } - + /// /// public static Address CreateFromJsonString(string json) { - return CreateFromJsonString
(json); + return BunqModel.CreateFromJsonString
(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/AllocationItem.cs b/BunqSdk/Model/Generated/Object/AllocationItem.cs deleted file mode 100644 index 7aedd51a..00000000 --- a/BunqSdk/Model/Generated/Object/AllocationItem.cs +++ /dev/null @@ -1,84 +0,0 @@ -using Bunq.Sdk.Model.Core; -using Bunq.Sdk.Model.Generated.Endpoint; -using Newtonsoft.Json; - -namespace Bunq.Sdk.Model.Generated.Object -{ - /// - /// - public class AllocationItem : BunqModel - { - /// - /// The Alias of the party we are allocating money for. - /// - [JsonProperty(PropertyName = "alias")] - public MonetaryAccountReference Alias { get; set; } - - /// - /// The type of the AllocationItem. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// The Amount of the AllocationItem. - /// - [JsonProperty(PropertyName = "amount")] - public Amount Amount { get; set; } - - /// - /// The share ratio of the AllocationItem. - /// - [JsonProperty(PropertyName = "share_ratio")] - public int? ShareRatio { get; set; } - - /// - /// The membership. - /// - [JsonProperty(PropertyName = "membership")] - public RegistryMembership Membership { get; set; } - - - public AllocationItem(MonetaryAccountReference alias, string type, Amount amount) - { - Alias = alias; - Type = type; - Amount = amount; - } - - - /// - /// - public override bool IsAllFieldNull() - { - if (this.Type != null) - { - return false; - } - - if (this.Membership != null) - { - return false; - } - - if (this.Amount != null) - { - return false; - } - - if (this.ShareRatio != null) - { - return false; - } - - return true; - } - - /// - /// - public static AllocationItem CreateFromJsonString(string json) - { - return CreateFromJsonString(json); - } - } -} \ No newline at end of file diff --git a/BunqSdk/Model/Generated/Object/Amount.cs b/BunqSdk/Model/Generated/Object/Amount.cs index 9de9ab32..e341231a 100644 --- a/BunqSdk/Model/Generated/Object/Amount.cs +++ b/BunqSdk/Model/Generated/Object/Amount.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,21 +13,21 @@ public class Amount : BunqModel /// [JsonProperty(PropertyName = "value")] public string Value { get; set; } - + /// /// The currency of the amount. It is an ISO 4217 formatted currency code. /// [JsonProperty(PropertyName = "currency")] public string Currency { get; set; } - - + + public Amount(string value, string currency) { Value = value; Currency = currency; } - - + + /// /// public override bool IsAllFieldNull() @@ -35,20 +36,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Currency != null) { return false; } - + return true; } - + /// /// public static Amount CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/Attachment.cs b/BunqSdk/Model/Generated/Object/Attachment.cs index 6b27be1f..99c32c46 100644 --- a/BunqSdk/Model/Generated/Object/Attachment.cs +++ b/BunqSdk/Model/Generated/Object/Attachment.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,14 +13,15 @@ public class Attachment : BunqModel /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The content type of the attachment's file. /// [JsonProperty(PropertyName = "content_type")] public string ContentType { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -28,20 +30,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.ContentType != null) { return false; } - + return true; } - + /// /// public static Attachment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/AttachmentMonetaryAccountPayment.cs b/BunqSdk/Model/Generated/Object/AttachmentMonetaryAccountPayment.cs index 60f566d5..f5404885 100644 --- a/BunqSdk/Model/Generated/Object/AttachmentMonetaryAccountPayment.cs +++ b/BunqSdk/Model/Generated/Object/AttachmentMonetaryAccountPayment.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,20 +13,20 @@ public class AttachmentMonetaryAccountPayment : BunqModel /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The id of the MonetaryAccount this Attachment is attached from. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - - + + public AttachmentMonetaryAccountPayment(int? id) { Id = id; } - - + + /// /// public override bool IsAllFieldNull() @@ -34,20 +35,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + return true; } - + /// /// public static AttachmentMonetaryAccountPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/AttachmentPublic.cs b/BunqSdk/Model/Generated/Object/AttachmentPublic.cs index d59b66d2..d61290df 100644 --- a/BunqSdk/Model/Generated/Object/AttachmentPublic.cs +++ b/BunqSdk/Model/Generated/Object/AttachmentPublic.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,20 +13,21 @@ public class AttachmentPublic : BunqModel /// [JsonProperty(PropertyName = "uuid")] public string Uuid { get; set; } - + /// /// The description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The content type of the attachment's file. /// [JsonProperty(PropertyName = "content_type")] public string ContentType { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -34,25 +36,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Description != null) { return false; } - + if (this.ContentType != null) { return false; } - + return true; } - + /// /// public static AttachmentPublic CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/AttachmentTab.cs b/BunqSdk/Model/Generated/Object/AttachmentTab.cs index e164af2d..b3965d3b 100644 --- a/BunqSdk/Model/Generated/Object/AttachmentTab.cs +++ b/BunqSdk/Model/Generated/Object/AttachmentTab.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,20 +13,21 @@ public class AttachmentTab : BunqModel /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The description of the attachment. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The content type of the attachment's file. /// [JsonProperty(PropertyName = "content_type")] public string ContentType { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -34,25 +36,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Description != null) { return false; } - + if (this.ContentType != null) { return false; } - + return true; } - + /// /// public static AttachmentTab CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/Avatar.cs b/BunqSdk/Model/Generated/Object/Avatar.cs index 6886d2a3..b31d8950 100644 --- a/BunqSdk/Model/Generated/Object/Avatar.cs +++ b/BunqSdk/Model/Generated/Object/Avatar.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,26 +13,32 @@ public class Avatar : BunqModel /// [JsonProperty(PropertyName = "uuid")] public string Uuid { get; set; } - + /// /// The public UUID of object this avatar is anchored to. /// [JsonProperty(PropertyName = "anchor_uuid")] public string AnchorUuid { get; set; } - + /// /// The actual image information of this avatar. /// [JsonProperty(PropertyName = "image")] public List Image { get; set; } - - + + /// + /// The style (if applicable) for this Avatar. + /// + [JsonProperty(PropertyName = "style")] + public string Style { get; set; } + + public Avatar(string uuid) { Uuid = uuid; } - - + + /// /// public override bool IsAllFieldNull() @@ -41,25 +47,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.AnchorUuid != null) { return false; } - + if (this.Image != null) { return false; } - + + if (this.Style != null) + { + return false; + } + return true; } - + /// /// public static Avatar CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/BudgetRestriction.cs b/BunqSdk/Model/Generated/Object/BudgetRestriction.cs index b59497f9..92347c3d 100644 --- a/BunqSdk/Model/Generated/Object/BudgetRestriction.cs +++ b/BunqSdk/Model/Generated/Object/BudgetRestriction.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,14 +13,15 @@ public class BudgetRestriction : BunqModel /// [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } - + /// /// The duration for a budget restriction. Valid values are DAILY, WEEKLY, MONTHLY, YEARLY. /// [JsonProperty(PropertyName = "frequency")] public string Frequency { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -28,20 +30,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Frequency != null) { return false; } - + return true; } - + /// /// public static BudgetRestriction CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/BunqId.cs b/BunqSdk/Model/Generated/Object/BunqId.cs index bf77121c..2e6cf9c8 100644 --- a/BunqSdk/Model/Generated/Object/BunqId.cs +++ b/BunqSdk/Model/Generated/Object/BunqId.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,13 +13,13 @@ public class BunqId : BunqModel /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + public BunqId(int? id) { Id = id; } - - + + /// /// public override bool IsAllFieldNull() @@ -27,15 +28,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static BunqId CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/BunqMeMerchantAvailable.cs b/BunqSdk/Model/Generated/Object/BunqMeMerchantAvailable.cs index e410ee75..be475b56 100644 --- a/BunqSdk/Model/Generated/Object/BunqMeMerchantAvailable.cs +++ b/BunqSdk/Model/Generated/Object/BunqMeMerchantAvailable.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,14 +13,15 @@ public class BunqMeMerchantAvailable : BunqModel /// [JsonProperty(PropertyName = "merchant_type")] public string MerchantType { get; set; } - + /// /// Whether or not the merchant is available for the user. /// [JsonProperty(PropertyName = "available")] public bool? Available { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -28,20 +30,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Available != null) { return false; } - + return true; } - + /// /// public static BunqMeMerchantAvailable CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/CardBatchEntry.cs b/BunqSdk/Model/Generated/Object/CardBatchEntry.cs index a35c2741..649a7f3f 100644 --- a/BunqSdk/Model/Generated/Object/CardBatchEntry.cs +++ b/BunqSdk/Model/Generated/Object/CardBatchEntry.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,7 +13,7 @@ public class CardBatchEntry : BunqModel /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The status to set for the card. Can be ACTIVE, DEACTIVATED, LOST, STOLEN or CANCELLED, and can only be set /// to LOST/STOLEN/CANCELLED when order status is @@ -24,51 +24,51 @@ public class CardBatchEntry : BunqModel /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The spending limit for the card. /// [JsonProperty(PropertyName = "card_limit")] public Amount CardLimit { get; set; } - + /// /// The ATM spending limit for the card. /// [JsonProperty(PropertyName = "card_limit_atm")] public Amount CardLimitAtm { get; set; } - + /// /// The countries for which to grant (temporary) permissions to use the card. /// [JsonProperty(PropertyName = "country_permission")] public List CountryPermission { get; set; } - + /// /// ID of the MA to be used as fallback for this card if insufficient balance. Fallback account is removed if /// not supplied. /// [JsonProperty(PropertyName = "monetary_account_id_fallback")] public int? MonetaryAccountIdFallback { get; set; } - - + + public CardBatchEntry(int? id) { Id = id; } - - + + /// /// public override bool IsAllFieldNull() { return true; } - + /// /// public static CardBatchEntry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/CardBatchReplaceEntry.cs b/BunqSdk/Model/Generated/Object/CardBatchReplaceEntry.cs new file mode 100644 index 00000000..34858b52 --- /dev/null +++ b/BunqSdk/Model/Generated/Object/CardBatchReplaceEntry.cs @@ -0,0 +1,56 @@ +using Bunq.Sdk.Model.Core; +using Newtonsoft.Json; +using System.Collections.Generic; + +namespace Bunq.Sdk.Model.Generated.Object +{ + /// + /// + public class CardBatchReplaceEntry : BunqModel + { + /// + /// The ID of the card that needs to be replaced. + /// + [JsonProperty(PropertyName = "id")] + public int? Id { get; set; } + + /// + /// The user's name as it will be on the card. Check 'card-name' for the available card names for a user. + /// + [JsonProperty(PropertyName = "name_on_card")] + public string NameOnCard { get; set; } + + /// + /// Array of Types, PINs, account IDs assigned to the card. + /// + [JsonProperty(PropertyName = "pin_code_assignment")] + public List PinCodeAssignment { get; set; } + + /// + /// The second line on the card. + /// + [JsonProperty(PropertyName = "second_line")] + public string SecondLine { get; set; } + + + public CardBatchReplaceEntry(int? id) + { + Id = id; + } + + + /// + /// + public override bool IsAllFieldNull() + { + return true; + } + + /// + /// + public static CardBatchReplaceEntry CreateFromJsonString(string json) + { + return BunqModel.CreateFromJsonString(json); + } + } +} diff --git a/BunqSdk/Model/Generated/Object/CardCountryPermission.cs b/BunqSdk/Model/Generated/Object/CardCountryPermission.cs index 4f3a10f8..ca1ee978 100644 --- a/BunqSdk/Model/Generated/Object/CardCountryPermission.cs +++ b/BunqSdk/Model/Generated/Object/CardCountryPermission.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,26 +13,26 @@ public class CardCountryPermission : BunqModel /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// Expiry time of this rule. /// [JsonProperty(PropertyName = "expiry_time")] public string ExpiryTime { get; set; } - + /// /// The id of the card country permission entry. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - - + + public CardCountryPermission(string country) { Country = country; } - - + + /// /// public override bool IsAllFieldNull() @@ -40,25 +41,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Country != null) { return false; } - + if (this.ExpiryTime != null) { return false; } - + return true; } - + /// /// public static CardCountryPermission CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/CardPinAssignment.cs b/BunqSdk/Model/Generated/Object/CardPinAssignment.cs index 9c681212..19beb03c 100644 --- a/BunqSdk/Model/Generated/Object/CardPinAssignment.cs +++ b/BunqSdk/Model/Generated/Object/CardPinAssignment.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,26 +13,26 @@ public class CardPinAssignment : BunqModel /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The 4 digit PIN to be assigned to this account. /// [JsonProperty(PropertyName = "pin_code")] public string PinCode { get; set; } - + /// /// The ID of the monetary account to assign to this pin for the card. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - - + + public CardPinAssignment(string type) { Type = type; } - - + + /// /// public override bool IsAllFieldNull() @@ -40,20 +41,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + return true; } - + /// /// public static CardPinAssignment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/CardPrimaryAccountNumber.cs b/BunqSdk/Model/Generated/Object/CardPrimaryAccountNumber.cs index 05a3fd1e..437d2e68 100644 --- a/BunqSdk/Model/Generated/Object/CardPrimaryAccountNumber.cs +++ b/BunqSdk/Model/Generated/Object/CardPrimaryAccountNumber.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,44 +13,44 @@ public class CardPrimaryAccountNumber : BunqModel /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The description for this PAN. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The status for this PAN, only for Online Cards. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The ID of the monetary account to assign to this PAN, only for Online Cards. /// [JsonProperty(PropertyName = "monetary_account_id")] public int? MonetaryAccountId { get; set; } - + /// /// The UUID for this Virtual PAN. /// [JsonProperty(PropertyName = "uuid")] public string Uuid { get; set; } - + /// /// The last four digits of the PAN. /// [JsonProperty(PropertyName = "four_digit")] public string FourDigit { get; set; } - - + + public CardPrimaryAccountNumber(int? id) { Id = id; } - - + + /// /// public override bool IsAllFieldNull() @@ -58,40 +59,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Uuid != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.MonetaryAccountId != null) { return false; } - + if (this.FourDigit != null) { return false; } - + return true; } - + /// /// public static CardPrimaryAccountNumber CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/Certificate.cs b/BunqSdk/Model/Generated/Object/Certificate.cs index daaf26af..84cc32eb 100644 --- a/BunqSdk/Model/Generated/Object/Certificate.cs +++ b/BunqSdk/Model/Generated/Object/Certificate.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,13 +13,13 @@ public class Certificate : BunqModel /// [JsonProperty(PropertyName = "certificate")] public string CertificateString { get; set; } - + public Certificate(string certificateString) { CertificateString = certificateString; } - - + + /// /// public override bool IsAllFieldNull() @@ -27,15 +28,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static Certificate CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/CoOwner.cs b/BunqSdk/Model/Generated/Object/CoOwner.cs index 23caa449..de3c499d 100644 --- a/BunqSdk/Model/Generated/Object/CoOwner.cs +++ b/BunqSdk/Model/Generated/Object/CoOwner.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,13 +13,20 @@ public class CoOwner : BunqModel /// [JsonProperty(PropertyName = "alias")] public LabelUser Alias { get; set; } - + /// /// Can be: ACCEPTED, REJECTED, PENDING or REVOKED /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + + + public CoOwner(MonetaryAccountReference alias) + { + Alias = alias; + } + + /// /// public override bool IsAllFieldNull() @@ -27,20 +35,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Status != null) { return false; } - + return true; } - + /// /// public static CoOwner CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/DraftPaymentAnchorObject.cs b/BunqSdk/Model/Generated/Object/DraftPaymentAnchorObject.cs index 80e82365..a34b0a09 100644 --- a/BunqSdk/Model/Generated/Object/DraftPaymentAnchorObject.cs +++ b/BunqSdk/Model/Generated/Object/DraftPaymentAnchorObject.cs @@ -2,6 +2,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Endpoint; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,19 +14,20 @@ public class DraftPaymentAnchorObject : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - - + + /// /// [JsonProperty(PropertyName = "Payment")] public Payment Payment { get; set; } - + /// /// [JsonProperty(PropertyName = "PaymentBatch")] public PaymentBatch PaymentBatch { get; set; } - - + + + /// /// public BunqModel GetReferencedObject() @@ -34,15 +36,15 @@ public BunqModel GetReferencedObject() { return this.Payment; } - + if (this.PaymentBatch != null) { return this.PaymentBatch; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -51,20 +53,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.PaymentBatch != null) { return false; } - + return true; } - + /// /// public static DraftPaymentAnchorObject CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/DraftPaymentEntry.cs b/BunqSdk/Model/Generated/Object/DraftPaymentEntry.cs index dbb85376..af4ed6c7 100644 --- a/BunqSdk/Model/Generated/Object/DraftPaymentEntry.cs +++ b/BunqSdk/Model/Generated/Object/DraftPaymentEntry.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,60 +13,60 @@ public class DraftPaymentEntry : BunqModel /// [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } - + /// /// The LabelMonetaryAccount containing the public information of the other (counterparty) side of the /// DraftPayment. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The description for the DraftPayment. Maximum 140 characters for DraftPayments to external IBANs, 9000 /// characters for DraftPayments to only other bunq MonetaryAccounts. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// Optional data to be included with the Payment specific to the merchant. /// [JsonProperty(PropertyName = "merchant_reference")] public string MerchantReference { get; set; } - + /// /// The Attachments attached to the DraftPayment. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - + /// /// The id of the draft payment entry. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The LabelMonetaryAccount containing the public information of 'this' (party) side of the DraftPayment. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - + /// /// The type of the draft payment entry. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - - + + public DraftPaymentEntry(Amount amount, MonetaryAccountReference counterpartyAlias, string description) { Amount = amount; CounterpartyAlias = counterpartyAlias; Description = description; } - - + + /// /// public override bool IsAllFieldNull() @@ -75,50 +75,50 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Amount != null) { return false; } - + if (this.Alias != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.MerchantReference != null) { return false; } - + if (this.Type != null) { return false; } - + if (this.Attachment != null) { return false; } - + return true; } - + /// /// public static DraftPaymentEntry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/DraftPaymentResponse.cs b/BunqSdk/Model/Generated/Object/DraftPaymentResponse.cs index a280cc74..a0dca29f 100644 --- a/BunqSdk/Model/Generated/Object/DraftPaymentResponse.cs +++ b/BunqSdk/Model/Generated/Object/DraftPaymentResponse.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,14 +13,15 @@ public class DraftPaymentResponse : BunqModel /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The user that responded to the DraftPayment. /// [JsonProperty(PropertyName = "user_alias_created")] public LabelUser UserAliasCreated { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -28,20 +30,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.UserAliasCreated != null) { return false; } - + return true; } - + /// /// public static DraftPaymentResponse CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/DraftShareInviteEntry.cs b/BunqSdk/Model/Generated/Object/DraftShareInviteEntry.cs index aaf8173d..0a6cf723 100644 --- a/BunqSdk/Model/Generated/Object/DraftShareInviteEntry.cs +++ b/BunqSdk/Model/Generated/Object/DraftShareInviteEntry.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,26 +13,26 @@ public class DraftShareInviteEntry : BunqModel /// [JsonProperty(PropertyName = "share_detail")] public ShareDetail ShareDetail { get; set; } - + /// /// The start date of this share. /// [JsonProperty(PropertyName = "start_date")] public string StartDate { get; set; } - + /// /// The expiration date of this share. /// [JsonProperty(PropertyName = "end_date")] public string EndDate { get; set; } - - + + public DraftShareInviteEntry(ShareDetail shareDetail) { ShareDetail = shareDetail; } - - + + /// /// public override bool IsAllFieldNull() @@ -40,25 +41,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.StartDate != null) { return false; } - + if (this.EndDate != null) { return false; } - + return true; } - + /// /// public static DraftShareInviteEntry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/Error.cs b/BunqSdk/Model/Generated/Object/Error.cs index 32a90f44..10708acf 100644 --- a/BunqSdk/Model/Generated/Object/Error.cs +++ b/BunqSdk/Model/Generated/Object/Error.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,14 +13,15 @@ public class Error : BunqModel /// [JsonProperty(PropertyName = "error_description")] public string ErrorDescription { get; set; } - + /// /// The error description (in the user language). /// [JsonProperty(PropertyName = "error_description_translated")] public string ErrorDescriptionTranslated { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -28,20 +30,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.ErrorDescriptionTranslated != null) { return false; } - + return true; } - + /// /// public static Error CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/EventObject.cs b/BunqSdk/Model/Generated/Object/EventObject.cs index 14390977..bc9a1ad3 100644 --- a/BunqSdk/Model/Generated/Object/EventObject.cs +++ b/BunqSdk/Model/Generated/Object/EventObject.cs @@ -2,6 +2,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Endpoint; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,149 +14,150 @@ public class EventObject : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - - + + /// /// [JsonProperty(PropertyName = "BunqMeTab")] public BunqMeTab BunqMeTab { get; set; } - + /// /// [JsonProperty(PropertyName = "BunqMeTabResultResponse")] public BunqMeTabResultResponse BunqMeTabResultResponse { get; set; } - + /// /// [JsonProperty(PropertyName = "BunqMeFundraiserResult")] public BunqMeFundraiserResult BunqMeFundraiserResult { get; set; } - + /// /// [JsonProperty(PropertyName = "Card")] public Card Card { get; set; } - + /// /// [JsonProperty(PropertyName = "CardDebit")] public CardDebit CardDebit { get; set; } - + /// /// [JsonProperty(PropertyName = "DraftPayment")] public DraftPayment DraftPayment { get; set; } - + /// /// [JsonProperty(PropertyName = "FeatureAnnouncement")] public FeatureAnnouncement FeatureAnnouncement { get; set; } - + /// /// [JsonProperty(PropertyName = "IdealMerchantTransaction")] public IdealMerchantTransaction IdealMerchantTransaction { get; set; } - + /// /// [JsonProperty(PropertyName = "Invoice")] public Invoice Invoice { get; set; } - + /// /// [JsonProperty(PropertyName = "ScheduledPayment")] public SchedulePayment ScheduledPayment { get; set; } - + /// /// [JsonProperty(PropertyName = "ScheduledPaymentBatch")] public SchedulePaymentBatch ScheduledPaymentBatch { get; set; } - + /// /// [JsonProperty(PropertyName = "ScheduledInstance")] public ScheduleInstance ScheduledInstance { get; set; } - + /// /// [JsonProperty(PropertyName = "MasterCardAction")] public MasterCardAction MasterCardAction { get; set; } - + /// /// [JsonProperty(PropertyName = "BankSwitchServiceNetherlandsIncomingPayment")] public BankSwitchServiceNetherlandsIncomingPayment BankSwitchServiceNetherlandsIncomingPayment { get; set; } - + /// /// [JsonProperty(PropertyName = "Payment")] public Payment Payment { get; set; } - + /// /// [JsonProperty(PropertyName = "PaymentBatch")] public PaymentBatch PaymentBatch { get; set; } - + /// /// [JsonProperty(PropertyName = "RequestInquiryBatch")] public RequestInquiryBatch RequestInquiryBatch { get; set; } - + /// /// [JsonProperty(PropertyName = "RequestInquiry")] public RequestInquiry RequestInquiry { get; set; } - + /// /// [JsonProperty(PropertyName = "RequestResponse")] public RequestResponse RequestResponse { get; set; } - + /// /// [JsonProperty(PropertyName = "RewardRecipient")] public RewardRecipient RewardRecipient { get; set; } - + /// /// [JsonProperty(PropertyName = "RewardSender")] public RewardSender RewardSender { get; set; } - + /// /// [JsonProperty(PropertyName = "ShareInviteBankInquiryBatch")] public ShareInviteBankInquiryBatch ShareInviteBankInquiryBatch { get; set; } - + /// /// [JsonProperty(PropertyName = "ShareInviteBankInquiry")] public ShareInviteMonetaryAccountInquiry ShareInviteBankInquiry { get; set; } - + /// /// [JsonProperty(PropertyName = "ShareInviteBankResponse")] public ShareInviteMonetaryAccountResponse ShareInviteBankResponse { get; set; } - + /// /// [JsonProperty(PropertyName = "SofortMerchantTransaction")] public SofortMerchantTransaction SofortMerchantTransaction { get; set; } - + /// /// [JsonProperty(PropertyName = "TabResultInquiry")] public TabResultInquiry TabResultInquiry { get; set; } - + /// /// [JsonProperty(PropertyName = "TabResultResponse")] public TabResultResponse TabResultResponse { get; set; } - + /// /// [JsonProperty(PropertyName = "TransferwisePayment")] public TransferwiseTransfer TransferwisePayment { get; set; } - - + + + /// /// public BunqModel GetReferencedObject() @@ -164,145 +166,145 @@ public BunqModel GetReferencedObject() { return this.BunqMeTab; } - + if (this.BunqMeTabResultResponse != null) { return this.BunqMeTabResultResponse; } - + if (this.BunqMeFundraiserResult != null) { return this.BunqMeFundraiserResult; } - + if (this.Card != null) { return this.Card; } - + if (this.CardDebit != null) { return this.CardDebit; } - + if (this.DraftPayment != null) { return this.DraftPayment; } - + if (this.FeatureAnnouncement != null) { return this.FeatureAnnouncement; } - + if (this.IdealMerchantTransaction != null) { return this.IdealMerchantTransaction; } - + if (this.Invoice != null) { return this.Invoice; } - + if (this.ScheduledPayment != null) { return this.ScheduledPayment; } - + if (this.ScheduledPaymentBatch != null) { return this.ScheduledPaymentBatch; } - + if (this.ScheduledInstance != null) { return this.ScheduledInstance; } - + if (this.MasterCardAction != null) { return this.MasterCardAction; } - + if (this.BankSwitchServiceNetherlandsIncomingPayment != null) { return this.BankSwitchServiceNetherlandsIncomingPayment; } - + if (this.Payment != null) { return this.Payment; } - + if (this.PaymentBatch != null) { return this.PaymentBatch; } - + if (this.RequestInquiryBatch != null) { return this.RequestInquiryBatch; } - + if (this.RequestInquiry != null) { return this.RequestInquiry; } - + if (this.RequestResponse != null) { return this.RequestResponse; } - + if (this.RewardRecipient != null) { return this.RewardRecipient; } - + if (this.RewardSender != null) { return this.RewardSender; } - + if (this.ShareInviteBankInquiryBatch != null) { return this.ShareInviteBankInquiryBatch; } - + if (this.ShareInviteBankInquiry != null) { return this.ShareInviteBankInquiry; } - + if (this.ShareInviteBankResponse != null) { return this.ShareInviteBankResponse; } - + if (this.SofortMerchantTransaction != null) { return this.SofortMerchantTransaction; } - + if (this.TabResultInquiry != null) { return this.TabResultInquiry; } - + if (this.TabResultResponse != null) { return this.TabResultResponse; } - + if (this.TransferwisePayment != null) { return this.TransferwisePayment; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -311,150 +313,150 @@ public override bool IsAllFieldNull() { return false; } - + if (this.BunqMeTabResultResponse != null) { return false; } - + if (this.BunqMeFundraiserResult != null) { return false; } - + if (this.Card != null) { return false; } - + if (this.CardDebit != null) { return false; } - + if (this.DraftPayment != null) { return false; } - + if (this.FeatureAnnouncement != null) { return false; } - + if (this.IdealMerchantTransaction != null) { return false; } - + if (this.Invoice != null) { return false; } - + if (this.ScheduledPayment != null) { return false; } - + if (this.ScheduledPaymentBatch != null) { return false; } - + if (this.ScheduledInstance != null) { return false; } - + if (this.MasterCardAction != null) { return false; } - + if (this.BankSwitchServiceNetherlandsIncomingPayment != null) { return false; } - + if (this.Payment != null) { return false; } - + if (this.PaymentBatch != null) { return false; } - + if (this.RequestInquiryBatch != null) { return false; } - + if (this.RequestInquiry != null) { return false; } - + if (this.RequestResponse != null) { return false; } - + if (this.RewardRecipient != null) { return false; } - + if (this.RewardSender != null) { return false; } - + if (this.ShareInviteBankInquiryBatch != null) { return false; } - + if (this.ShareInviteBankInquiry != null) { return false; } - + if (this.ShareInviteBankResponse != null) { return false; } - + if (this.SofortMerchantTransaction != null) { return false; } - + if (this.TabResultInquiry != null) { return false; } - + if (this.TabResultResponse != null) { return false; } - + if (this.TransferwisePayment != null) { return false; } - + return true; } - + /// /// public static EventObject CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/Geolocation.cs b/BunqSdk/Model/Generated/Object/Geolocation.cs index 57b40ed2..b952910c 100644 --- a/BunqSdk/Model/Generated/Object/Geolocation.cs +++ b/BunqSdk/Model/Generated/Object/Geolocation.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,26 +13,27 @@ public class Geolocation : BunqModel /// [JsonProperty(PropertyName = "latitude")] public double? Latitude { get; set; } - + /// /// The longitude for a geolocation restriction. /// [JsonProperty(PropertyName = "longitude")] public double? Longitude { get; set; } - + /// /// The altitude for a geolocation restriction. /// [JsonProperty(PropertyName = "altitude")] public double? Altitude { get; set; } - + /// /// The radius for a geolocation restriction. /// [JsonProperty(PropertyName = "radius")] public double? Radius { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -40,30 +42,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Longitude != null) { return false; } - + if (this.Altitude != null) { return false; } - + if (this.Radius != null) { return false; } - + return true; } - + /// /// public static Geolocation CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/Image.cs b/BunqSdk/Model/Generated/Object/Image.cs index fe80a03d..90406a64 100644 --- a/BunqSdk/Model/Generated/Object/Image.cs +++ b/BunqSdk/Model/Generated/Object/Image.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,26 +13,27 @@ public class Image : BunqModel /// [JsonProperty(PropertyName = "attachment_public_uuid")] public string AttachmentPublicUuid { get; set; } - + /// /// The content-type as a MIME filetype. /// [JsonProperty(PropertyName = "content_type")] public string ContentType { get; set; } - + /// /// The image height in pixels. /// [JsonProperty(PropertyName = "height")] public int? Height { get; set; } - + /// /// The image width in pixels. /// [JsonProperty(PropertyName = "width")] public int? Width { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -40,30 +42,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.ContentType != null) { return false; } - + if (this.Height != null) { return false; } - + if (this.Width != null) { return false; } - + return true; } - + /// /// public static Image CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/InvoiceItem.cs b/BunqSdk/Model/Generated/Object/InvoiceItem.cs index 37a2e1e9..4513d7d2 100644 --- a/BunqSdk/Model/Generated/Object/InvoiceItem.cs +++ b/BunqSdk/Model/Generated/Object/InvoiceItem.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,56 +13,57 @@ public class InvoiceItem : BunqModel /// [JsonProperty(PropertyName = "billing_date")] public string BillingDate { get; set; } - + /// /// The price description. /// [JsonProperty(PropertyName = "type_description")] public string TypeDescription { get; set; } - + /// /// The translated price description. /// [JsonProperty(PropertyName = "type_description_translated")] public string TypeDescriptionTranslated { get; set; } - + /// /// The unit item price excluding VAT. /// [JsonProperty(PropertyName = "unit_vat_exclusive")] public Amount UnitVatExclusive { get; set; } - + /// /// The unit item price including VAT. /// [JsonProperty(PropertyName = "unit_vat_inclusive")] public Amount UnitVatInclusive { get; set; } - + /// /// The VAT tax fraction. /// [JsonProperty(PropertyName = "vat")] public double? Vat { get; set; } - + /// /// The number of items priced. /// [JsonProperty(PropertyName = "quantity")] public double? Quantity { get; set; } - + /// /// The item price excluding VAT. /// [JsonProperty(PropertyName = "total_vat_exclusive")] public Amount TotalVatExclusive { get; set; } - + /// /// The item price including VAT. /// [JsonProperty(PropertyName = "total_vat_inclusive")] public Amount TotalVatInclusive { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -70,55 +72,55 @@ public override bool IsAllFieldNull() { return false; } - + if (this.TypeDescription != null) { return false; } - + if (this.TypeDescriptionTranslated != null) { return false; } - + if (this.UnitVatExclusive != null) { return false; } - + if (this.UnitVatInclusive != null) { return false; } - + if (this.Vat != null) { return false; } - + if (this.Quantity != null) { return false; } - + if (this.TotalVatExclusive != null) { return false; } - + if (this.TotalVatInclusive != null) { return false; } - + return true; } - + /// /// public static InvoiceItem CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/InvoiceItemGroup.cs b/BunqSdk/Model/Generated/Object/InvoiceItemGroup.cs index 1ef5af42..33aa6150 100644 --- a/BunqSdk/Model/Generated/Object/InvoiceItemGroup.cs +++ b/BunqSdk/Model/Generated/Object/InvoiceItemGroup.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,44 +13,45 @@ public class InvoiceItemGroup : BunqModel /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The description of the type of the invoice item group. /// [JsonProperty(PropertyName = "type_description")] public string TypeDescription { get; set; } - + /// /// The translated description of the type of the invoice item group. /// [JsonProperty(PropertyName = "type_description_translated")] public string TypeDescriptionTranslated { get; set; } - + /// /// The identifier of the invoice item group. /// [JsonProperty(PropertyName = "instance_description")] public string InstanceDescription { get; set; } - + /// /// The unit item price excluding VAT. /// [JsonProperty(PropertyName = "product_vat_exclusive")] public Amount ProductVatExclusive { get; set; } - + /// /// The unit item price including VAT. /// [JsonProperty(PropertyName = "product_vat_inclusive")] public Amount ProductVatInclusive { get; set; } - + /// /// The invoice items in the group. /// [JsonProperty(PropertyName = "item")] public List Item { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -59,45 +60,45 @@ public override bool IsAllFieldNull() { return false; } - + if (this.TypeDescription != null) { return false; } - + if (this.TypeDescriptionTranslated != null) { return false; } - + if (this.InstanceDescription != null) { return false; } - + if (this.ProductVatExclusive != null) { return false; } - + if (this.ProductVatInclusive != null) { return false; } - + if (this.Item != null) { return false; } - + return true; } - + /// /// public static InvoiceItemGroup CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/Issuer.cs b/BunqSdk/Model/Generated/Object/Issuer.cs index c3c7408f..3986243b 100644 --- a/BunqSdk/Model/Generated/Object/Issuer.cs +++ b/BunqSdk/Model/Generated/Object/Issuer.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,20 +13,20 @@ public class Issuer : BunqModel /// [JsonProperty(PropertyName = "bic")] public string Bic { get; set; } - + /// /// The name of the bank. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - - + + public Issuer(string bic) { Bic = bic; } - - + + /// /// public override bool IsAllFieldNull() @@ -34,20 +35,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Name != null) { return false; } - + return true; } - + /// /// public static Issuer CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/LabelCard.cs b/BunqSdk/Model/Generated/Object/LabelCard.cs index fdf02b1f..a65b9af4 100644 --- a/BunqSdk/Model/Generated/Object/LabelCard.cs +++ b/BunqSdk/Model/Generated/Object/LabelCard.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,38 +13,39 @@ public class LabelCard : BunqModel /// [JsonProperty(PropertyName = "uuid")] public string Uuid { get; set; } - + /// /// The type of the card. /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The second line on the card. /// [JsonProperty(PropertyName = "second_line")] public string SecondLine { get; set; } - + /// /// The date this card will expire. /// [JsonProperty(PropertyName = "expiry_date")] public string ExpiryDate { get; set; } - + /// /// The status of the card. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The owner of this card. /// [JsonProperty(PropertyName = "label_user")] public LabelUser LabelUser { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -52,40 +54,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Type != null) { return false; } - + if (this.SecondLine != null) { return false; } - + if (this.ExpiryDate != null) { return false; } - + if (this.Status != null) { return false; } - + if (this.LabelUser != null) { return false; } - + return true; } - + /// /// public static LabelCard CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/LabelMonetaryAccount.cs b/BunqSdk/Model/Generated/Object/LabelMonetaryAccount.cs index 388fb332..e5ecce90 100644 --- a/BunqSdk/Model/Generated/Object/LabelMonetaryAccount.cs +++ b/BunqSdk/Model/Generated/Object/LabelMonetaryAccount.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,74 +13,75 @@ public class LabelMonetaryAccount : BunqModel /// [JsonProperty(PropertyName = "iban")] public string Iban { get; set; } - + /// /// The name to display with this monetary account. /// [JsonProperty(PropertyName = "display_name")] public string DisplayName { get; set; } - + /// /// The avatar of the monetary account. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - + /// /// The user this monetary account belongs to. /// [JsonProperty(PropertyName = "label_user")] public LabelUser LabelUser { get; set; } - + /// /// The country of the user. Formatted as a ISO 3166-1 alpha-2 country code. /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// Bunq.me pointer with type and value. /// [JsonProperty(PropertyName = "bunq_me")] public MonetaryAccountReference BunqMe { get; set; } - + /// /// Whether or not the monetary account is light. /// [JsonProperty(PropertyName = "is_light")] public bool? IsLight { get; set; } - + /// /// The BIC used for a SWIFT payment. /// [JsonProperty(PropertyName = "swift_bic")] public string SwiftBic { get; set; } - + /// /// The account number used for a SWIFT payment. May or may not be an IBAN. /// [JsonProperty(PropertyName = "swift_account_number")] public string SwiftAccountNumber { get; set; } - + /// /// The account number used for a Transferwise payment. May or may not be an IBAN. /// [JsonProperty(PropertyName = "transferwise_account_number")] public string TransferwiseAccountNumber { get; set; } - + /// /// The bank code used for a Transferwise payment. May or may not be a BIC. /// [JsonProperty(PropertyName = "transferwise_bank_code")] public string TransferwiseBankCode { get; set; } - + /// /// The merchant category code. /// [JsonProperty(PropertyName = "merchant_category_code")] public string MerchantCategoryCode { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -88,70 +90,70 @@ public override bool IsAllFieldNull() { return false; } - + if (this.DisplayName != null) { return false; } - + if (this.Avatar != null) { return false; } - + if (this.LabelUser != null) { return false; } - + if (this.Country != null) { return false; } - + if (this.BunqMe != null) { return false; } - + if (this.IsLight != null) { return false; } - + if (this.SwiftBic != null) { return false; } - + if (this.SwiftAccountNumber != null) { return false; } - + if (this.TransferwiseAccountNumber != null) { return false; } - + if (this.TransferwiseBankCode != null) { return false; } - + if (this.MerchantCategoryCode != null) { return false; } - + return true; } - + /// /// public static LabelMonetaryAccount CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/LabelUser.cs b/BunqSdk/Model/Generated/Object/LabelUser.cs index 26ef5d6c..3b9a049a 100644 --- a/BunqSdk/Model/Generated/Object/LabelUser.cs +++ b/BunqSdk/Model/Generated/Object/LabelUser.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,40 +13,40 @@ public class LabelUser : BunqModel /// [JsonProperty(PropertyName = "uuid")] public string Uuid { get; set; } - + /// /// The name to be displayed for this user, as it was given on the request. /// [JsonProperty(PropertyName = "display_name")] public string DisplayName { get; set; } - + /// /// The country of the user. 000 stands for "unknown" /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// The current avatar of the user. /// [JsonProperty(PropertyName = "avatar")] public Avatar Avatar { get; set; } - + /// /// The current nickname of the user. /// [JsonProperty(PropertyName = "public_nick_name")] public string PublicNickName { get; set; } - - + + public LabelUser(string uuid, string displayName, string country) { Uuid = uuid; DisplayName = displayName; Country = country; } - - + + /// /// public override bool IsAllFieldNull() @@ -54,35 +55,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Avatar != null) { return false; } - + if (this.PublicNickName != null) { return false; } - + if (this.DisplayName != null) { return false; } - + if (this.Country != null) { return false; } - + return true; } - + /// /// public static LabelUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/MonetaryAccountProfileDrain.cs b/BunqSdk/Model/Generated/Object/MonetaryAccountProfileDrain.cs index 3c305ade..075d7a69 100644 --- a/BunqSdk/Model/Generated/Object/MonetaryAccountProfileDrain.cs +++ b/BunqSdk/Model/Generated/Object/MonetaryAccountProfileDrain.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,36 +13,35 @@ public class MonetaryAccountProfileDrain : BunqModel /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The goal balance. /// [JsonProperty(PropertyName = "balance_preferred")] public Amount BalancePreferred { get; set; } - + /// /// The high threshold balance. /// [JsonProperty(PropertyName = "balance_threshold_high")] public Amount BalanceThresholdHigh { get; set; } - + /// /// The savings monetary account. /// [JsonProperty(PropertyName = "savings_account_alias")] public MonetaryAccountReference SavingsAccountAlias { get; set; } - - - public MonetaryAccountProfileDrain(string status, Amount balancePreferred, Amount balanceThresholdHigh, - MonetaryAccountReference savingsAccountAlias) + + + public MonetaryAccountProfileDrain(string status, Amount balancePreferred, Amount balanceThresholdHigh, MonetaryAccountReference savingsAccountAlias) { Status = status; BalancePreferred = balancePreferred; BalanceThresholdHigh = balanceThresholdHigh; SavingsAccountAlias = savingsAccountAlias; } - - + + /// /// public override bool IsAllFieldNull() @@ -50,30 +50,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.BalancePreferred != null) { return false; } - + if (this.BalanceThresholdHigh != null) { return false; } - + if (this.SavingsAccountAlias != null) { return false; } - + return true; } - + /// /// public static MonetaryAccountProfileDrain CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/MonetaryAccountProfileFill.cs b/BunqSdk/Model/Generated/Object/MonetaryAccountProfileFill.cs index e703f6be..16168adf 100644 --- a/BunqSdk/Model/Generated/Object/MonetaryAccountProfileFill.cs +++ b/BunqSdk/Model/Generated/Object/MonetaryAccountProfileFill.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,42 +13,40 @@ public class MonetaryAccountProfileFill : BunqModel /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - + /// /// The goal balance. /// [JsonProperty(PropertyName = "balance_preferred")] public Amount BalancePreferred { get; set; } - + /// /// The low threshold balance. /// [JsonProperty(PropertyName = "balance_threshold_low")] public Amount BalanceThresholdLow { get; set; } - + /// /// The method used to fill the monetary account. Currently only iDEAL is supported, and it is the default one. /// [JsonProperty(PropertyName = "method_fill")] public string MethodFill { get; set; } - + /// /// The bank the fill is supposed to happen from, with BIC and bank name. /// [JsonProperty(PropertyName = "issuer")] public Issuer Issuer { get; set; } - - - public MonetaryAccountProfileFill(string status, Amount balancePreferred, Amount balanceThresholdLow, - string methodFill) + + + public MonetaryAccountProfileFill(string status, Amount balancePreferred, Amount balanceThresholdLow) { Status = status; BalancePreferred = balancePreferred; BalanceThresholdLow = balanceThresholdLow; - MethodFill = methodFill; } - - + + /// /// public override bool IsAllFieldNull() @@ -56,35 +55,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.BalancePreferred != null) { return false; } - + if (this.BalanceThresholdLow != null) { return false; } - + if (this.MethodFill != null) { return false; } - + if (this.Issuer != null) { return false; } - + return true; } - + /// /// public static MonetaryAccountProfileFill CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/MonetaryAccountSetting.cs b/BunqSdk/Model/Generated/Object/MonetaryAccountSetting.cs index 6eb6c1ea..85542cf5 100644 --- a/BunqSdk/Model/Generated/Object/MonetaryAccountSetting.cs +++ b/BunqSdk/Model/Generated/Object/MonetaryAccountSetting.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,26 +13,33 @@ public class MonetaryAccountSetting : BunqModel /// [JsonProperty(PropertyName = "color")] public string Color { get; set; } - + /// /// The icon chosen for the MonetaryAccount. /// [JsonProperty(PropertyName = "icon")] public string Icon { get; set; } - + /// /// The status of the avatar. Can be either AVATAR_DEFAULT, AVATAR_CUSTOM or AVATAR_UNDETERMINED. /// [JsonProperty(PropertyName = "default_avatar_status")] public string DefaultAvatarStatus { get; set; } - + /// /// The chat restriction. Possible values are ALLOW_INCOMING or BLOCK_INCOMING /// [JsonProperty(PropertyName = "restriction_chat")] public string RestrictionChat { get; set; } - - + + /// + /// The preference for this monetary account on whether to automatically accept or reject expiring SDDs. + /// + [JsonProperty(PropertyName = "sdd_expiration_action")] + public string SddExpirationAction { get; set; } + + + /// /// public override bool IsAllFieldNull() @@ -40,30 +48,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Icon != null) { return false; } - + if (this.DefaultAvatarStatus != null) { return false; } - + if (this.RestrictionChat != null) { return false; } - + + if (this.SddExpirationAction != null) + { + return false; + } + return true; } - + /// /// public static MonetaryAccountSetting CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/NotificationAnchorObject.cs b/BunqSdk/Model/Generated/Object/NotificationAnchorObject.cs index de367cb0..047f0671 100644 --- a/BunqSdk/Model/Generated/Object/NotificationAnchorObject.cs +++ b/BunqSdk/Model/Generated/Object/NotificationAnchorObject.cs @@ -2,6 +2,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Endpoint; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,119 +14,120 @@ public class NotificationAnchorObject : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - - + + /// /// [JsonProperty(PropertyName = "BunqMeFundraiserResult")] public BunqMeFundraiserResult BunqMeFundraiserResult { get; set; } - + /// /// [JsonProperty(PropertyName = "BunqMeTab")] public BunqMeTab BunqMeTab { get; set; } - + /// /// [JsonProperty(PropertyName = "BunqMeTabResultInquiry")] public BunqMeTabResultInquiry BunqMeTabResultInquiry { get; set; } - + /// /// [JsonProperty(PropertyName = "BunqMeTabResultResponse")] public BunqMeTabResultResponse BunqMeTabResultResponse { get; set; } - + /// /// [JsonProperty(PropertyName = "ChatMessage")] public ChatMessage ChatMessage { get; set; } - + /// /// [JsonProperty(PropertyName = "DraftPayment")] public DraftPayment DraftPayment { get; set; } - + /// /// [JsonProperty(PropertyName = "IdealMerchantTransaction")] public IdealMerchantTransaction IdealMerchantTransaction { get; set; } - + /// /// [JsonProperty(PropertyName = "Invoice")] public Invoice Invoice { get; set; } - + /// /// [JsonProperty(PropertyName = "MasterCardAction")] public MasterCardAction MasterCardAction { get; set; } - + /// /// [JsonProperty(PropertyName = "MonetaryAccount")] public MonetaryAccount MonetaryAccount { get; set; } - + /// /// [JsonProperty(PropertyName = "Payment")] public Payment Payment { get; set; } - + /// /// [JsonProperty(PropertyName = "PaymentBatch")] public PaymentBatch PaymentBatch { get; set; } - + /// /// [JsonProperty(PropertyName = "RequestInquiry")] public RequestInquiry RequestInquiry { get; set; } - + /// /// [JsonProperty(PropertyName = "RequestInquiryBatch")] public RequestInquiryBatch RequestInquiryBatch { get; set; } - + /// /// [JsonProperty(PropertyName = "RequestResponse")] public RequestResponse RequestResponse { get; set; } - + /// /// [JsonProperty(PropertyName = "ShareInviteBankInquiry")] public ShareInviteMonetaryAccountInquiry ShareInviteBankInquiry { get; set; } - + /// /// [JsonProperty(PropertyName = "ShareInviteBankResponse")] public ShareInviteMonetaryAccountResponse ShareInviteBankResponse { get; set; } - + /// /// [JsonProperty(PropertyName = "ScheduledPayment")] public SchedulePayment ScheduledPayment { get; set; } - + /// /// [JsonProperty(PropertyName = "ScheduledInstance")] public ScheduleInstance ScheduledInstance { get; set; } - + /// /// [JsonProperty(PropertyName = "TabResultInquiry")] public TabResultInquiry TabResultInquiry { get; set; } - + /// /// [JsonProperty(PropertyName = "TabResultResponse")] public TabResultResponse TabResultResponse { get; set; } - + /// /// [JsonProperty(PropertyName = "User")] public User User { get; set; } - - + + + /// /// public BunqModel GetReferencedObject() @@ -134,115 +136,115 @@ public BunqModel GetReferencedObject() { return this.BunqMeFundraiserResult; } - + if (this.BunqMeTab != null) { return this.BunqMeTab; } - + if (this.BunqMeTabResultInquiry != null) { return this.BunqMeTabResultInquiry; } - + if (this.BunqMeTabResultResponse != null) { return this.BunqMeTabResultResponse; } - + if (this.ChatMessage != null) { return this.ChatMessage; } - + if (this.DraftPayment != null) { return this.DraftPayment; } - + if (this.IdealMerchantTransaction != null) { return this.IdealMerchantTransaction; } - + if (this.Invoice != null) { return this.Invoice; } - + if (this.MasterCardAction != null) { return this.MasterCardAction; } - + if (this.MonetaryAccount != null) { return this.MonetaryAccount; } - + if (this.Payment != null) { return this.Payment; } - + if (this.PaymentBatch != null) { return this.PaymentBatch; } - + if (this.RequestInquiry != null) { return this.RequestInquiry; } - + if (this.RequestInquiryBatch != null) { return this.RequestInquiryBatch; } - + if (this.RequestResponse != null) { return this.RequestResponse; } - + if (this.ShareInviteBankInquiry != null) { return this.ShareInviteBankInquiry; } - + if (this.ShareInviteBankResponse != null) { return this.ShareInviteBankResponse; } - + if (this.ScheduledPayment != null) { return this.ScheduledPayment; } - + if (this.ScheduledInstance != null) { return this.ScheduledInstance; } - + if (this.TabResultInquiry != null) { return this.TabResultInquiry; } - + if (this.TabResultResponse != null) { return this.TabResultResponse; } - + if (this.User != null) { return this.User; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -251,120 +253,120 @@ public override bool IsAllFieldNull() { return false; } - + if (this.BunqMeTab != null) { return false; } - + if (this.BunqMeTabResultInquiry != null) { return false; } - + if (this.BunqMeTabResultResponse != null) { return false; } - + if (this.ChatMessage != null) { return false; } - + if (this.DraftPayment != null) { return false; } - + if (this.IdealMerchantTransaction != null) { return false; } - + if (this.Invoice != null) { return false; } - + if (this.MasterCardAction != null) { return false; } - + if (this.MonetaryAccount != null) { return false; } - + if (this.Payment != null) { return false; } - + if (this.PaymentBatch != null) { return false; } - + if (this.RequestInquiry != null) { return false; } - + if (this.RequestInquiryBatch != null) { return false; } - + if (this.RequestResponse != null) { return false; } - + if (this.ShareInviteBankInquiry != null) { return false; } - + if (this.ShareInviteBankResponse != null) { return false; } - + if (this.ScheduledPayment != null) { return false; } - + if (this.ScheduledInstance != null) { return false; } - + if (this.TabResultInquiry != null) { return false; } - + if (this.TabResultResponse != null) { return false; } - + if (this.User != null) { return false; } - + return true; } - + /// /// public static NotificationAnchorObject CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/NotificationFilter.cs b/BunqSdk/Model/Generated/Object/NotificationFilter.cs index 9e7fd76d..29f65fe2 100644 --- a/BunqSdk/Model/Generated/Object/NotificationFilter.cs +++ b/BunqSdk/Model/Generated/Object/NotificationFilter.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,14 +14,14 @@ public class NotificationFilter : BunqModel /// [JsonProperty(PropertyName = "notification_delivery_method")] public string NotificationDeliveryMethod { get; set; } - + /// /// The target of notifications that match this notification filter. For URL notification filters this is the /// URL to which the callback will be made. For PUSH notifications filters this should always be null. /// [JsonProperty(PropertyName = "notification_target")] public string NotificationTarget { get; set; } - + /// /// The notification category that will match this notification filter. Possible choices are BILLING, /// CARD_TRANSACTION_FAILED, CARD_TRANSACTION_SUCCESSFUL, CHAT, DRAFT_PAYMENT, IDEAL, SOFORT, @@ -29,16 +30,16 @@ public class NotificationFilter : BunqModel /// [JsonProperty(PropertyName = "category")] public string Category { get; set; } - - + + public NotificationFilter(string notificationDeliveryMethod, string notificationTarget, string category) { NotificationDeliveryMethod = notificationDeliveryMethod; NotificationTarget = notificationTarget; Category = category; } - - + + /// /// public override bool IsAllFieldNull() @@ -47,25 +48,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.NotificationTarget != null) { return false; } - + if (this.Category != null) { return false; } - + return true; } - + /// /// public static NotificationFilter CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/NotificationFilterPush.cs b/BunqSdk/Model/Generated/Object/NotificationFilterPush.cs index deaf4e5b..06b3e916 100644 --- a/BunqSdk/Model/Generated/Object/NotificationFilterPush.cs +++ b/BunqSdk/Model/Generated/Object/NotificationFilterPush.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,13 +13,13 @@ public class NotificationFilterPush : BunqModel /// [JsonProperty(PropertyName = "category")] public string Category { get; set; } - + public NotificationFilterPush(string category) { Category = category; } - - + + /// /// public override bool IsAllFieldNull() @@ -27,15 +28,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static NotificationFilterPush CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/NotificationFilterUrl.cs b/BunqSdk/Model/Generated/Object/NotificationFilterUrl.cs index 9e5ab1d0..af490e88 100644 --- a/BunqSdk/Model/Generated/Object/NotificationFilterUrl.cs +++ b/BunqSdk/Model/Generated/Object/NotificationFilterUrl.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,39 +13,39 @@ public class NotificationFilterUrl : BunqModel /// [JsonProperty(PropertyName = "category")] public string Category { get; set; } - + /// /// The URL to which the callback should be made. /// [JsonProperty(PropertyName = "notification_target")] public string NotificationTarget { get; set; } - + /// /// The id of the NotificationFilterUrl. /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the NotificationFilterUrl's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the NotificationFilterUrl's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - - + + public NotificationFilterUrl(string category, string notificationTarget) { Category = category; NotificationTarget = notificationTarget; } - - + + /// /// public override bool IsAllFieldNull() @@ -53,35 +54,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Category != null) { return false; } - + if (this.NotificationTarget != null) { return false; } - + return true; } - + /// /// public static NotificationFilterUrl CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/NotificationUrl.cs b/BunqSdk/Model/Generated/Object/NotificationUrl.cs index 1b3bab9b..96ba2644 100644 --- a/BunqSdk/Model/Generated/Object/NotificationUrl.cs +++ b/BunqSdk/Model/Generated/Object/NotificationUrl.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -11,23 +12,24 @@ public class NotificationUrl : BunqModel /// [JsonProperty(PropertyName = "target_url")] public string TargetUrl { get; set; } - + /// /// [JsonProperty(PropertyName = "category")] public string Category { get; set; } - + /// /// [JsonProperty(PropertyName = "event_type")] public string EventType { get; set; } - + /// /// [JsonProperty(PropertyName = "object")] public NotificationAnchorObject Object { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -36,30 +38,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Category != null) { return false; } - + if (this.EventType != null) { return false; } - + if (this.Object != null) { return false; } - + return true; } - + /// /// public static NotificationUrl CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/OauthCallbackUrl.cs b/BunqSdk/Model/Generated/Object/OauthCallbackUrl.cs index d8c347bd..d6173992 100644 --- a/BunqSdk/Model/Generated/Object/OauthCallbackUrl.cs +++ b/BunqSdk/Model/Generated/Object/OauthCallbackUrl.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,26 +13,27 @@ public class OauthCallbackUrl : BunqModel /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The timestamp of the callback URL's creation. /// [JsonProperty(PropertyName = "created")] public string Created { get; set; } - + /// /// The timestamp of the callback URL's last update. /// [JsonProperty(PropertyName = "updated")] public string Updated { get; set; } - + /// /// The Callback URL. /// [JsonProperty(PropertyName = "url")] public string Url { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -40,30 +42,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Created != null) { return false; } - + if (this.Updated != null) { return false; } - + if (this.Url != null) { return false; } - + return true; } - + /// /// public static OauthCallbackUrl CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/PaymentBatchAnchoredPayment.cs b/BunqSdk/Model/Generated/Object/PaymentBatchAnchoredPayment.cs index 5326a9e3..2358ca81 100644 --- a/BunqSdk/Model/Generated/Object/PaymentBatchAnchoredPayment.cs +++ b/BunqSdk/Model/Generated/Object/PaymentBatchAnchoredPayment.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Endpoint; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,8 +13,8 @@ public class PaymentBatchAnchoredPayment : BunqModel /// [JsonProperty(PropertyName = "Payment")] public List Payment { get; set; } - - + + /// /// public override bool IsAllFieldNull() @@ -23,15 +23,15 @@ public override bool IsAllFieldNull() { return false; } - + return true; } - + /// /// public static PaymentBatchAnchoredPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/PermittedDevice.cs b/BunqSdk/Model/Generated/Object/PermittedDevice.cs index 91a78acc..a890884e 100644 --- a/BunqSdk/Model/Generated/Object/PermittedDevice.cs +++ b/BunqSdk/Model/Generated/Object/PermittedDevice.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,14 +13,15 @@ public class PermittedDevice : BunqModel /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The IP address of the device that may use the credential. /// [JsonProperty(PropertyName = "ip")] public string Ip { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -28,20 +30,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Ip != null) { return false; } - + return true; } - + /// /// public static PermittedDevice CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/Pointer.cs b/BunqSdk/Model/Generated/Object/Pointer.cs index 2530a180..3e57f4c8 100644 --- a/BunqSdk/Model/Generated/Object/Pointer.cs +++ b/BunqSdk/Model/Generated/Object/Pointer.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,27 +13,33 @@ public class Pointer : BunqModel /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The alias value. /// [JsonProperty(PropertyName = "value")] public string Value { get; set; } - + /// /// The alias name. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - - + + /// + /// The pointer service. Only required for external counterparties. + /// + [JsonProperty(PropertyName = "service")] + public string Service { get; set; } + + public Pointer(string type, string value) { Type = type; Value = value; } - - + + /// /// public override bool IsAllFieldNull() @@ -41,25 +48,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Value != null) { return false; } - + if (this.Name != null) { return false; } - + return true; } - + /// /// public static Pointer CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/RegistryEntryAttachment.cs b/BunqSdk/Model/Generated/Object/RegistryEntryAttachment.cs deleted file mode 100644 index f9328b6a..00000000 --- a/BunqSdk/Model/Generated/Object/RegistryEntryAttachment.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Bunq.Sdk.Model.Core; -using Newtonsoft.Json; - -namespace Bunq.Sdk.Model.Generated.Object -{ - /// - /// - public class RegistryEntryAttachment : BunqModel - { - /// - /// The id of the attachment. - /// - [JsonProperty(PropertyName = "id")] - public int? Id { get; set; } - - /// - /// The id of the monetary account to which the attachment belongs. - /// - [JsonProperty(PropertyName = "monetary_account_id")] - public int? MonetaryAccountId { get; set; } - - - public RegistryEntryAttachment(int? id) - { - Id = id; - } - - - /// - /// - public override bool IsAllFieldNull() - { - if (this.Id != null) - { - return false; - } - - if (this.MonetaryAccountId != null) - { - return false; - } - - return true; - } - - /// - /// - public static RegistryEntryAttachment CreateFromJsonString(string json) - { - return CreateFromJsonString(json); - } - } -} \ No newline at end of file diff --git a/BunqSdk/Model/Generated/Object/RegistryEntryReference.cs b/BunqSdk/Model/Generated/Object/RegistryEntryReference.cs deleted file mode 100644 index 283f2ebf..00000000 --- a/BunqSdk/Model/Generated/Object/RegistryEntryReference.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Bunq.Sdk.Model.Core; -using Newtonsoft.Json; - -namespace Bunq.Sdk.Model.Generated.Object -{ - /// - /// - public class RegistryEntryReference : BunqModel - { - /// - /// The object type that will be linked to the RegistryEntry. - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// The ID of the object that will be used for the RegistryEntry. - /// - [JsonProperty(PropertyName = "id")] - public int? Id { get; set; } - - - /// - /// - public override bool IsAllFieldNull() - { - return true; - } - - /// - /// - public static RegistryEntryReference CreateFromJsonString(string json) - { - return CreateFromJsonString(json); - } - } -} \ No newline at end of file diff --git a/BunqSdk/Model/Generated/Object/RegistrySettlementItem.cs b/BunqSdk/Model/Generated/Object/RegistrySettlementItem.cs index 6f5370a0..d6d9b994 100644 --- a/BunqSdk/Model/Generated/Object/RegistrySettlementItem.cs +++ b/BunqSdk/Model/Generated/Object/RegistrySettlementItem.cs @@ -1,6 +1,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Endpoint; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,32 +14,33 @@ public class RegistrySettlementItem : BunqModel /// [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } - + /// /// The membership of the user that has to pay. /// [JsonProperty(PropertyName = "membership_paying")] public RegistryMembership MembershipPaying { get; set; } - + /// /// The membership of the user that will receive money. /// [JsonProperty(PropertyName = "membership_receiving")] public RegistryMembership MembershipReceiving { get; set; } - + /// /// The LabelMonetaryAccount of the user that has to pay the request. /// [JsonProperty(PropertyName = "paying_user_alias")] public MonetaryAccountReference PayingUserAlias { get; set; } - + /// /// The LabelMonetaryAccount of the user that will receive the amount. /// [JsonProperty(PropertyName = "receiving_user_alias")] public MonetaryAccountReference ReceivingUserAlias { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -47,35 +49,35 @@ public override bool IsAllFieldNull() { return false; } - + if (this.MembershipPaying != null) { return false; } - + if (this.MembershipReceiving != null) { return false; } - + if (this.PayingUserAlias != null) { return false; } - + if (this.ReceivingUserAlias != null) { return false; } - + return true; } - + /// /// public static RegistrySettlementItem CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/RequestInquiryReference.cs b/BunqSdk/Model/Generated/Object/RequestInquiryReference.cs index 2acb9b7f..64fe654e 100644 --- a/BunqSdk/Model/Generated/Object/RequestInquiryReference.cs +++ b/BunqSdk/Model/Generated/Object/RequestInquiryReference.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,14 +13,15 @@ public class RequestInquiryReference : BunqModel /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The id of the request inquiry (batch). /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -28,20 +30,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Id != null) { return false; } - + return true; } - + /// /// public static RequestInquiryReference CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/RequestReferenceSplitTheBillAnchorObject.cs b/BunqSdk/Model/Generated/Object/RequestReferenceSplitTheBillAnchorObject.cs index 73ee6340..af505c6f 100644 --- a/BunqSdk/Model/Generated/Object/RequestReferenceSplitTheBillAnchorObject.cs +++ b/BunqSdk/Model/Generated/Object/RequestReferenceSplitTheBillAnchorObject.cs @@ -2,6 +2,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Endpoint; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,59 +14,60 @@ public class RequestReferenceSplitTheBillAnchorObject : BunqModel, IAnchorObject /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - - + + /// /// [JsonProperty(PropertyName = "BillingInvoice")] public Invoice BillingInvoice { get; set; } - + /// /// [JsonProperty(PropertyName = "DraftPayment")] public DraftPayment DraftPayment { get; set; } - + /// /// [JsonProperty(PropertyName = "MasterCardAction")] public MasterCardAction MasterCardAction { get; set; } - + /// /// [JsonProperty(PropertyName = "Payment")] public Payment Payment { get; set; } - + /// /// [JsonProperty(PropertyName = "PaymentBatch")] public PaymentBatch PaymentBatch { get; set; } - + /// /// [JsonProperty(PropertyName = "RequestResponse")] public RequestResponse RequestResponse { get; set; } - + /// /// [JsonProperty(PropertyName = "ScheduleInstance")] public ScheduleInstance ScheduleInstance { get; set; } - + /// /// [JsonProperty(PropertyName = "TabResultResponse")] public TabResultResponse TabResultResponse { get; set; } - + /// /// [JsonProperty(PropertyName = "WhitelistResult")] public WhitelistResult WhitelistResult { get; set; } - + /// /// [JsonProperty(PropertyName = "TransferwisePayment")] public TransferwiseTransfer TransferwisePayment { get; set; } - - + + + /// /// public BunqModel GetReferencedObject() @@ -74,55 +76,55 @@ public BunqModel GetReferencedObject() { return this.BillingInvoice; } - + if (this.DraftPayment != null) { return this.DraftPayment; } - + if (this.MasterCardAction != null) { return this.MasterCardAction; } - + if (this.Payment != null) { return this.Payment; } - + if (this.PaymentBatch != null) { return this.PaymentBatch; } - + if (this.RequestResponse != null) { return this.RequestResponse; } - + if (this.ScheduleInstance != null) { return this.ScheduleInstance; } - + if (this.TabResultResponse != null) { return this.TabResultResponse; } - + if (this.WhitelistResult != null) { return this.WhitelistResult; } - + if (this.TransferwisePayment != null) { return this.TransferwisePayment; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -131,60 +133,60 @@ public override bool IsAllFieldNull() { return false; } - + if (this.DraftPayment != null) { return false; } - + if (this.MasterCardAction != null) { return false; } - + if (this.Payment != null) { return false; } - + if (this.PaymentBatch != null) { return false; } - + if (this.RequestResponse != null) { return false; } - + if (this.ScheduleInstance != null) { return false; } - + if (this.TabResultResponse != null) { return false; } - + if (this.WhitelistResult != null) { return false; } - + if (this.TransferwisePayment != null) { return false; } - + return true; } - + /// /// public static RequestReferenceSplitTheBillAnchorObject CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/ScheduleAnchorObject.cs b/BunqSdk/Model/Generated/Object/ScheduleAnchorObject.cs index 4584d90b..d31e8c60 100644 --- a/BunqSdk/Model/Generated/Object/ScheduleAnchorObject.cs +++ b/BunqSdk/Model/Generated/Object/ScheduleAnchorObject.cs @@ -2,6 +2,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Endpoint; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,19 +14,20 @@ public class ScheduleAnchorObject : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - - + + /// /// [JsonProperty(PropertyName = "Payment")] public Payment Payment { get; set; } - + /// /// [JsonProperty(PropertyName = "PaymentBatch")] public PaymentBatch PaymentBatch { get; set; } - - + + + /// /// public BunqModel GetReferencedObject() @@ -34,15 +36,15 @@ public BunqModel GetReferencedObject() { return this.Payment; } - + if (this.PaymentBatch != null) { return this.PaymentBatch; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -51,20 +53,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.PaymentBatch != null) { return false; } - + return true; } - + /// /// public static ScheduleAnchorObject CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/ScheduleInstanceAnchorObject.cs b/BunqSdk/Model/Generated/Object/ScheduleInstanceAnchorObject.cs index 8f07c400..777b574c 100644 --- a/BunqSdk/Model/Generated/Object/ScheduleInstanceAnchorObject.cs +++ b/BunqSdk/Model/Generated/Object/ScheduleInstanceAnchorObject.cs @@ -2,6 +2,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Endpoint; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,19 +14,20 @@ public class ScheduleInstanceAnchorObject : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - - + + /// /// [JsonProperty(PropertyName = "Payment")] public Payment Payment { get; set; } - + /// /// [JsonProperty(PropertyName = "PaymentBatch")] public PaymentBatch PaymentBatch { get; set; } - - + + + /// /// public BunqModel GetReferencedObject() @@ -34,15 +36,15 @@ public BunqModel GetReferencedObject() { return this.Payment; } - + if (this.PaymentBatch != null) { return this.PaymentBatch; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -51,20 +53,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.PaymentBatch != null) { return false; } - + return true; } - + /// /// public static ScheduleInstanceAnchorObject CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/SchedulePaymentEntry.cs b/BunqSdk/Model/Generated/Object/SchedulePaymentEntry.cs index b6d03d03..ef57b901 100644 --- a/BunqSdk/Model/Generated/Object/SchedulePaymentEntry.cs +++ b/BunqSdk/Model/Generated/Object/SchedulePaymentEntry.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -14,53 +14,53 @@ public class SchedulePaymentEntry : BunqModel /// [JsonProperty(PropertyName = "amount")] public Amount Amount { get; set; } - + /// /// The LabelMonetaryAccount containing the public information of the other (counterparty) side of the Payment. /// [JsonProperty(PropertyName = "counterparty_alias")] public MonetaryAccountReference CounterpartyAlias { get; set; } - + /// /// The description for the Payment. Maximum 140 characters for Payments to external IBANs, 9000 characters for /// Payments to only other bunq MonetaryAccounts. /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - + /// /// The Attachments attached to the Payment. /// [JsonProperty(PropertyName = "attachment")] public List Attachment { get; set; } - + /// /// Optional data included with the Payment specific to the merchant. /// [JsonProperty(PropertyName = "merchant_reference")] public string MerchantReference { get; set; } - + /// /// Whether or not sending a bunq.to payment is allowed. /// [JsonProperty(PropertyName = "allow_bunqto")] public bool? AllowBunqto { get; set; } - + /// /// The LabelMonetaryAccount containing the public information of 'this' (party) side of the Payment. /// [JsonProperty(PropertyName = "alias")] public MonetaryAccountReference Alias { get; set; } - - + + public SchedulePaymentEntry(Amount amount, MonetaryAccountReference counterpartyAlias, string description) { Amount = amount; CounterpartyAlias = counterpartyAlias; Description = description; } - - + + /// /// public override bool IsAllFieldNull() @@ -69,40 +69,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Alias != null) { return false; } - + if (this.CounterpartyAlias != null) { return false; } - + if (this.Description != null) { return false; } - + if (this.Attachment != null) { return false; } - + if (this.MerchantReference != null) { return false; } - + return true; } - + /// /// public static SchedulePaymentEntry CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/ShareDetail.cs b/BunqSdk/Model/Generated/Object/ShareDetail.cs index 944eeaa0..e48cab49 100644 --- a/BunqSdk/Model/Generated/Object/ShareDetail.cs +++ b/BunqSdk/Model/Generated/Object/ShareDetail.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,21 +13,22 @@ public class ShareDetail : BunqModel /// [JsonProperty(PropertyName = "ShareDetailPayment")] public ShareDetailPayment Payment { get; set; } - + /// /// The share details for viewing a share. In the response 'read_only' is replaced by 'ShareDetailReadOnly'. /// [JsonProperty(PropertyName = "ShareDetailReadOnly")] public ShareDetailReadOnly ReadOnly { get; set; } - + /// /// The share details for a draft payment share. In the response 'draft_payment' is replaced by /// 'ShareDetailDraftPayment'. /// [JsonProperty(PropertyName = "ShareDetailDraftPayment")] public ShareDetailDraftPayment DraftPayment { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -35,25 +37,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.ReadOnly != null) { return false; } - + if (this.DraftPayment != null) { return false; } - + return true; } - + /// /// public static ShareDetail CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/ShareDetailDraftPayment.cs b/BunqSdk/Model/Generated/Object/ShareDetailDraftPayment.cs index 8af6fe03..7ad05e54 100644 --- a/BunqSdk/Model/Generated/Object/ShareDetailDraftPayment.cs +++ b/BunqSdk/Model/Generated/Object/ShareDetailDraftPayment.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,36 +13,35 @@ public class ShareDetailDraftPayment : BunqModel /// [JsonProperty(PropertyName = "make_draft_payments")] public bool? MakeDraftPayments { get; set; } - + /// /// If set to true, the invited user will be able to view the account balance. /// [JsonProperty(PropertyName = "view_balance")] public bool? ViewBalance { get; set; } - + /// /// If set to true, the invited user will be able to view events from before the share was active. /// [JsonProperty(PropertyName = "view_old_events")] public bool? ViewOldEvents { get; set; } - + /// /// If set to true, the invited user will be able to view events starting from the time the share became active. /// [JsonProperty(PropertyName = "view_new_events")] public bool? ViewNewEvents { get; set; } - - - public ShareDetailDraftPayment(bool? makeDraftPayments, bool? viewBalance, bool? viewOldEvents, - bool? viewNewEvents) + + + public ShareDetailDraftPayment(bool? makeDraftPayments, bool? viewBalance, bool? viewOldEvents, bool? viewNewEvents) { MakeDraftPayments = makeDraftPayments; ViewBalance = viewBalance; ViewOldEvents = viewOldEvents; ViewNewEvents = viewNewEvents; } - - + + /// /// public override bool IsAllFieldNull() @@ -50,30 +50,30 @@ public override bool IsAllFieldNull() { return false; } - + if (this.ViewBalance != null) { return false; } - + if (this.ViewOldEvents != null) { return false; } - + if (this.ViewNewEvents != null) { return false; } - + return true; } - + /// /// public static ShareDetailDraftPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/ShareDetailPayment.cs b/BunqSdk/Model/Generated/Object/ShareDetailPayment.cs index f589146c..e2ca99ca 100644 --- a/BunqSdk/Model/Generated/Object/ShareDetailPayment.cs +++ b/BunqSdk/Model/Generated/Object/ShareDetailPayment.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,38 +13,38 @@ public class ShareDetailPayment : BunqModel /// [JsonProperty(PropertyName = "make_payments")] public bool? MakePayments { get; set; } - + /// /// If set to true, the invited user will be able to make draft payments from the shared account. /// [JsonProperty(PropertyName = "make_draft_payments")] public bool? MakeDraftPayments { get; set; } - + /// /// If set to true, the invited user will be able to view the account balance. /// [JsonProperty(PropertyName = "view_balance")] public bool? ViewBalance { get; set; } - + /// /// If set to true, the invited user will be able to view events from before the share was active. /// [JsonProperty(PropertyName = "view_old_events")] public bool? ViewOldEvents { get; set; } - + /// /// If set to true, the invited user will be able to view events starting from the time the share became active. /// [JsonProperty(PropertyName = "view_new_events")] public bool? ViewNewEvents { get; set; } - + /// /// The budget restriction. /// [JsonProperty(PropertyName = "budget")] public BudgetRestriction Budget { get; set; } - - + + public ShareDetailPayment(bool? makePayments, bool? viewBalance, bool? viewOldEvents, bool? viewNewEvents) { MakePayments = makePayments; @@ -51,8 +52,8 @@ public ShareDetailPayment(bool? makePayments, bool? viewBalance, bool? viewOldEv ViewOldEvents = viewOldEvents; ViewNewEvents = viewNewEvents; } - - + + /// /// public override bool IsAllFieldNull() @@ -61,40 +62,40 @@ public override bool IsAllFieldNull() { return false; } - + if (this.MakeDraftPayments != null) { return false; } - + if (this.ViewBalance != null) { return false; } - + if (this.ViewOldEvents != null) { return false; } - + if (this.ViewNewEvents != null) { return false; } - + if (this.Budget != null) { return false; } - + return true; } - + /// /// public static ShareDetailPayment CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/ShareDetailReadOnly.cs b/BunqSdk/Model/Generated/Object/ShareDetailReadOnly.cs index cd0e9095..5d1d5c39 100644 --- a/BunqSdk/Model/Generated/Object/ShareDetailReadOnly.cs +++ b/BunqSdk/Model/Generated/Object/ShareDetailReadOnly.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,28 +13,28 @@ public class ShareDetailReadOnly : BunqModel /// [JsonProperty(PropertyName = "view_balance")] public bool? ViewBalance { get; set; } - + /// /// If set to true, the invited user will be able to view events from before the share was active. /// [JsonProperty(PropertyName = "view_old_events")] public bool? ViewOldEvents { get; set; } - + /// /// If set to true, the invited user will be able to view events starting from the time the share became active. /// [JsonProperty(PropertyName = "view_new_events")] public bool? ViewNewEvents { get; set; } - - + + public ShareDetailReadOnly(bool? viewBalance, bool? viewOldEvents, bool? viewNewEvents) { ViewBalance = viewBalance; ViewOldEvents = viewOldEvents; ViewNewEvents = viewNewEvents; } - - + + /// /// public override bool IsAllFieldNull() @@ -42,25 +43,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.ViewOldEvents != null) { return false; } - + if (this.ViewNewEvents != null) { return false; } - + return true; } - + /// /// public static ShareDetailReadOnly CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/TabTextWaitingScreen.cs b/BunqSdk/Model/Generated/Object/TabTextWaitingScreen.cs index 5ee381ca..8b4b8992 100644 --- a/BunqSdk/Model/Generated/Object/TabTextWaitingScreen.cs +++ b/BunqSdk/Model/Generated/Object/TabTextWaitingScreen.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,21 +13,21 @@ public class TabTextWaitingScreen : BunqModel /// [JsonProperty(PropertyName = "language")] public string Language { get; set; } - + /// /// Tab text /// [JsonProperty(PropertyName = "description")] public string Description { get; set; } - - + + public TabTextWaitingScreen(string language, string description) { Language = language; Description = description; } - - + + /// /// public override bool IsAllFieldNull() @@ -35,20 +36,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Description != null) { return false; } - + return true; } - + /// /// public static TabTextWaitingScreen CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/TabVisibility.cs b/BunqSdk/Model/Generated/Object/TabVisibility.cs index 4edc7619..553a33bd 100644 --- a/BunqSdk/Model/Generated/Object/TabVisibility.cs +++ b/BunqSdk/Model/Generated/Object/TabVisibility.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,28 +13,28 @@ public class TabVisibility : BunqModel /// [JsonProperty(PropertyName = "cash_register_qr_code")] public bool? CashRegisterQrCode { get; set; } - + /// /// When true the tab will be visible through its own QR code. Use ../tab/{tab-id}/qr-code-content to get the /// raw content of this QR code /// [JsonProperty(PropertyName = "tab_qr_code")] public bool? TabQrCode { get; set; } - + /// /// The location of the Tab in NearPay. /// [JsonProperty(PropertyName = "location")] public Geolocation Location { get; set; } - - + + public TabVisibility(bool? cashRegisterQrCode, bool? tabQrCode) { CashRegisterQrCode = cashRegisterQrCode; TabQrCode = tabQrCode; } - - + + /// /// public override bool IsAllFieldNull() @@ -42,25 +43,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.TabQrCode != null) { return false; } - + if (this.Location != null) { return false; } - + return true; } - + /// /// public static TabVisibility CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/TaxResident.cs b/BunqSdk/Model/Generated/Object/TaxResident.cs index 1762d489..58e750e2 100644 --- a/BunqSdk/Model/Generated/Object/TaxResident.cs +++ b/BunqSdk/Model/Generated/Object/TaxResident.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,27 +13,27 @@ public class TaxResident : BunqModel /// [JsonProperty(PropertyName = "country")] public string Country { get; set; } - + /// /// The tax number. /// [JsonProperty(PropertyName = "tax_number")] public string TaxNumber { get; set; } - + /// /// The status of the tax number. Either CONFIRMED or UNCONFIRMED. /// [JsonProperty(PropertyName = "status")] public string Status { get; set; } - - + + public TaxResident(string country, string taxNumber) { Country = country; TaxNumber = taxNumber; } - - + + /// /// public override bool IsAllFieldNull() @@ -41,25 +42,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.TaxNumber != null) { return false; } - + if (this.Status != null) { return false; } - + return true; } - + /// /// public static TaxResident CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/TransferwiseRequirementField.cs b/BunqSdk/Model/Generated/Object/TransferwiseRequirementField.cs index 5fa3fbc6..bb3fa97d 100644 --- a/BunqSdk/Model/Generated/Object/TransferwiseRequirementField.cs +++ b/BunqSdk/Model/Generated/Object/TransferwiseRequirementField.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,33 +13,33 @@ public class TransferwiseRequirementField : BunqModel /// [JsonProperty(PropertyName = "key")] public string Key { get; set; } - + /// /// The value of the required field. /// [JsonProperty(PropertyName = "value")] public string Value { get; set; } - + /// /// The descriptive label of the field. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - + /// /// The field group. /// [JsonProperty(PropertyName = "group")] public TransferwiseRequirementFieldGroup Group { get; set; } - - + + public TransferwiseRequirementField(string key, string value) { Key = key; Value = value; } - - + + /// /// public override bool IsAllFieldNull() @@ -47,20 +48,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Group != null) { return false; } - + return true; } - + /// /// public static TransferwiseRequirementField CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroup.cs b/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroup.cs index 7295f18a..f289f3cb 100644 --- a/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroup.cs +++ b/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroup.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,75 +13,76 @@ public class TransferwiseRequirementFieldGroup : BunqModel /// [JsonProperty(PropertyName = "key")] public string Key { get; set; } - + /// /// The field's input type: "text", "select" or "radio". /// [JsonProperty(PropertyName = "type")] public string Type { get; set; } - + /// /// The field name. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - + /// /// Indicates that any changes in this field affect the requirements, if this field is changed, the requirements /// endpoint must be called again to recheck if there are any additional requirements. /// [JsonProperty(PropertyName = "refresh_requirements_on_change")] public bool? RefreshRequirementsOnChange { get; set; } - + /// /// Whether or not the field is required. /// [JsonProperty(PropertyName = "required")] public bool? Required { get; set; } - + /// /// Formatting mask to guide user input. /// [JsonProperty(PropertyName = "display_format")] public string DisplayFormat { get; set; } - + /// /// An example value for this field. /// [JsonProperty(PropertyName = "example")] public string Example { get; set; } - + /// /// The minimum length of the field's value. /// [JsonProperty(PropertyName = "min_length")] public string MinLength { get; set; } - + /// /// The maximum length of the field's value. /// [JsonProperty(PropertyName = "max_length")] public string MaxLength { get; set; } - + /// /// A regular expression which may be used to validate the user input. /// [JsonProperty(PropertyName = "validation_regexp")] public string ValidationRegexp { get; set; } - + /// /// Details of an endpoint which may be used to validate the user input. /// [JsonProperty(PropertyName = "validation_async")] public TransferwiseRequirementFieldGroupValidationAsync ValidationAsync { get; set; } - + /// /// Shows which values are allowed for fields of type "select" or "radio". /// [JsonProperty(PropertyName = "values_allowed")] public TransferwiseRequirementFieldGroupValuesAllowed ValuesAllowed { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -89,70 +91,70 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Type != null) { return false; } - + if (this.Name != null) { return false; } - + if (this.RefreshRequirementsOnChange != null) { return false; } - + if (this.Required != null) { return false; } - + if (this.DisplayFormat != null) { return false; } - + if (this.Example != null) { return false; } - + if (this.MinLength != null) { return false; } - + if (this.MaxLength != null) { return false; } - + if (this.ValidationRegexp != null) { return false; } - + if (this.ValidationAsync != null) { return false; } - + if (this.ValuesAllowed != null) { return false; } - + return true; } - + /// /// public static TransferwiseRequirementFieldGroup CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsync.cs b/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsync.cs index 523d45af..2e952a1a 100644 --- a/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsync.cs +++ b/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsync.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,14 +13,15 @@ public class TransferwiseRequirementFieldGroupValidationAsync : BunqModel /// [JsonProperty(PropertyName = "url")] public string Url { get; set; } - + /// /// The parameters to send when validating user input. /// [JsonProperty(PropertyName = "params")] public TransferwiseRequirementFieldGroupValidationAsyncParams Params { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -28,20 +30,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Params != null) { return false; } - + return true; } - + /// /// public static TransferwiseRequirementFieldGroupValidationAsync CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsyncParams.cs b/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsyncParams.cs index 1cd4e0ca..69990983 100644 --- a/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsyncParams.cs +++ b/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValidationAsyncParams.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,20 +13,21 @@ public class TransferwiseRequirementFieldGroupValidationAsyncParams : BunqModel /// [JsonProperty(PropertyName = "key")] public string Key { get; set; } - + /// /// The parameter label. /// [JsonProperty(PropertyName = "parameter_name")] public string ParameterName { get; set; } - + /// /// Shows whether the parameter is required or not. /// [JsonProperty(PropertyName = "required")] public bool? Required { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -34,25 +36,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.ParameterName != null) { return false; } - + if (this.Required != null) { return false; } - + return true; } - + /// /// public static TransferwiseRequirementFieldGroupValidationAsyncParams CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValuesAllowed.cs b/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValuesAllowed.cs index 7ea08194..3c598eb1 100644 --- a/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValuesAllowed.cs +++ b/BunqSdk/Model/Generated/Object/TransferwiseRequirementFieldGroupValuesAllowed.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,14 +13,15 @@ public class TransferwiseRequirementFieldGroupValuesAllowed : BunqModel /// [JsonProperty(PropertyName = "key")] public string Key { get; set; } - + /// /// The label. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -28,20 +30,20 @@ public override bool IsAllFieldNull() { return false; } - + if (this.Name != null) { return false; } - + return true; } - + /// /// public static TransferwiseRequirementFieldGroupValuesAllowed CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/Ubo.cs b/BunqSdk/Model/Generated/Object/Ubo.cs index 8eeee1fc..cbb9a53e 100644 --- a/BunqSdk/Model/Generated/Object/Ubo.cs +++ b/BunqSdk/Model/Generated/Object/Ubo.cs @@ -1,5 +1,6 @@ using Bunq.Sdk.Model.Core; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -12,20 +13,21 @@ public class Ubo : BunqModel /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } - + /// /// The date of birth of the ultimate beneficiary owner. /// [JsonProperty(PropertyName = "date_of_birth")] public string DateOfBirth { get; set; } - + /// /// The nationality of the ultimate beneficiary owner. /// [JsonProperty(PropertyName = "nationality")] public string Nationality { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -34,25 +36,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.DateOfBirth != null) { return false; } - + if (this.Nationality != null) { return false; } - + return true; } - + /// /// public static Ubo CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/UserApiKeyAnchoredUser.cs b/BunqSdk/Model/Generated/Object/UserApiKeyAnchoredUser.cs index 880e4a98..bb026869 100644 --- a/BunqSdk/Model/Generated/Object/UserApiKeyAnchoredUser.cs +++ b/BunqSdk/Model/Generated/Object/UserApiKeyAnchoredUser.cs @@ -2,6 +2,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Endpoint; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,24 +14,25 @@ public class UserApiKeyAnchoredUser : BunqModel, IAnchorObjectInterface /// Error constants. /// private const string ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; - - + + /// /// [JsonProperty(PropertyName = "UserPerson")] public UserPerson UserPerson { get; set; } - + /// /// [JsonProperty(PropertyName = "UserCompany")] public UserCompany UserCompany { get; set; } - + /// /// [JsonProperty(PropertyName = "UserPaymentServiceProvider")] public UserPaymentServiceProvider UserPaymentServiceProvider { get; set; } - - + + + /// /// public BunqModel GetReferencedObject() @@ -39,20 +41,20 @@ public BunqModel GetReferencedObject() { return this.UserPerson; } - + if (this.UserCompany != null) { return this.UserCompany; } - + if (this.UserPaymentServiceProvider != null) { return this.UserPaymentServiceProvider; } - + throw new BunqException(ERROR_NULL_FIELDS); } - + /// /// public override bool IsAllFieldNull() @@ -61,25 +63,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.UserCompany != null) { return false; } - + if (this.UserPaymentServiceProvider != null) { return false; } - + return true; } - + /// /// public static UserApiKeyAnchoredUser CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +} diff --git a/BunqSdk/Model/Generated/Object/WhitelistResultViewAnchoredObject.cs b/BunqSdk/Model/Generated/Object/WhitelistResultViewAnchoredObject.cs index d3bc885d..86822acb 100644 --- a/BunqSdk/Model/Generated/Object/WhitelistResultViewAnchoredObject.cs +++ b/BunqSdk/Model/Generated/Object/WhitelistResultViewAnchoredObject.cs @@ -1,6 +1,7 @@ using Bunq.Sdk.Model.Core; using Bunq.Sdk.Model.Generated.Endpoint; using Newtonsoft.Json; +using System.Collections.Generic; namespace Bunq.Sdk.Model.Generated.Object { @@ -13,20 +14,21 @@ public class WhitelistResultViewAnchoredObject : BunqModel /// [JsonProperty(PropertyName = "id")] public int? Id { get; set; } - + /// /// The RequestResponse object /// [JsonProperty(PropertyName = "requestResponse")] public RequestResponse RequestResponse { get; set; } - + /// /// The DraftPayment object /// [JsonProperty(PropertyName = "draftPayment")] public DraftPayment DraftPayment { get; set; } - - + + + /// /// public override bool IsAllFieldNull() @@ -35,25 +37,25 @@ public override bool IsAllFieldNull() { return false; } - + if (this.RequestResponse != null) { return false; } - + if (this.DraftPayment != null) { return false; } - + return true; } - + /// /// public static WhitelistResultViewAnchoredObject CreateFromJsonString(string json) { - return CreateFromJsonString(json); + return BunqModel.CreateFromJsonString(json); } } -} \ No newline at end of file +}