diff --git a/src/main/java/com/bunq/sdk/model/core/BunqModel.java b/src/main/java/com/bunq/sdk/model/core/BunqModel.java index 8e5d830b..f00bc529 100644 --- a/src/main/java/com/bunq/sdk/model/core/BunqModel.java +++ b/src/main/java/com/bunq/sdk/model/core/BunqModel.java @@ -13,6 +13,7 @@ import com.google.gson.stream.JsonReader; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; abstract public class BunqModel { @@ -30,6 +31,16 @@ abstract public class BunqModel { */ private static final int INDEX_FIRST = 0; + /** + * String format constants. + */ + private static final String STRING_EMPTY = ""; + + /** + * Regex constants. + */ + private static final String REGEX_FIELD_FOR_REQUEST = "(_field_for_request)"; + /** * Gson builder for serialization. */ @@ -179,4 +190,11 @@ protected static Integer determineMonetaryAccountId(Integer id) { return id; } } + + protected static byte[] determineAllRequestByte(HashMap requestMap) { + String requestString = gson.toJson(requestMap).toString(); + + return requestString.replaceAll(REGEX_FIELD_FOR_REQUEST, STRING_EMPTY).getBytes(); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/Avatar.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/Avatar.java index ef352903..0b38c631 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/Avatar.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/Avatar.java @@ -53,6 +53,21 @@ public class Avatar extends BunqModel { @SerializedName("image") private List image; + /** + * The public UUID of the public attachment from which an avatar image must be created. + */ + @Expose + @SerializedName("attachment_public_uuid_field_for_request") + private String attachmentPublicUuidFieldForRequest; + + public Avatar() { + this(null); + } + + public Avatar(String attachmentPublicUuid) { + this.attachmentPublicUuidFieldForRequest = attachmentPublicUuid; + } + /** * @param attachmentPublicUuid The public UUID of the public attachment from which an avatar * image must be created. @@ -67,7 +82,7 @@ public static BunqResponse create(String attachmentPublicUuid, Map requestMap = new HashMap<>(); requestMap.put(FIELD_ATTACHMENT_PUBLIC_UUID, attachmentPublicUuid); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(ENDPOINT_URL_CREATE, requestBytes, customHeaders); return processForUuid(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/BillingContractSubscription.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/BillingContractSubscription.java index 9de22954..606ac026 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/BillingContractSubscription.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/BillingContractSubscription.java @@ -97,6 +97,22 @@ public class BillingContractSubscription extends BunqModel { @SerializedName("sub_status") private String subStatus; + /** + * The subscription type of the user. Can be one of PERSON_LIGHT_V1, PERSON_MORE_V1, + * PERSON_FREE_V1, PERSON_PREMIUM_V1, COMPANY_V1, or COMPANY_V2. + */ + @Expose + @SerializedName("subscription_type_field_for_request") + private String subscriptionTypeFieldForRequest; + + public BillingContractSubscription() { + this(null); + } + + public BillingContractSubscription(String subscriptionType) { + this.subscriptionTypeFieldForRequest = subscriptionType; + } + /** * @param subscriptionType The subscription type of the user. Can be one of PERSON_LIGHT_V1, * PERSON_MORE_V1, PERSON_FREE_V1, PERSON_PREMIUM_V1, COMPANY_V1, or COMPANY_V2. @@ -111,7 +127,7 @@ public static BunqResponse create(String subscriptionType, Map requestMap = new HashMap<>(); requestMap.put(FIELD_SUBSCRIPTION_TYPE, subscriptionType); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeFundraiserProfile.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeFundraiserProfile.java index 82e8aba0..771b6174 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeFundraiserProfile.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeFundraiserProfile.java @@ -1,18 +1,14 @@ package com.bunq.sdk.model.generated.endpoint; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.AttachmentPublic; import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.Pointer; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; + import java.util.List; -import java.util.Map; /** * bunq.me public profile of the user. @@ -37,7 +33,7 @@ public class BunqMeFundraiserProfile extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The description of the bunq.me fundraiser profile. @@ -58,7 +54,7 @@ public class BunqMeFundraiserProfile extends BunqModel { */ @Expose @SerializedName("pointer") - private MonetaryAccountReference pointer; + private Pointer pointer; /** * The status of the bunq.me fundraiser profile, can be ACTIVE or DEACTIVATED. @@ -74,6 +70,21 @@ public class BunqMeFundraiserProfile extends BunqModel { @SerializedName("redirect_url") private String redirectUrl; + /** + * The pointer (url) which will be used to access the bunq.me fundraiser profile. + */ + @Expose + @SerializedName("pointer_field_for_request") + private Pointer pointerFieldForRequest; + + public BunqMeFundraiserProfile() { + this(null); + } + + public BunqMeFundraiserProfile(Pointer pointer) { + this.pointerFieldForRequest = pointer; + } + /** * The color chosen for the bunq.me fundraiser profile in hexadecimal format. */ @@ -89,11 +100,11 @@ public void setColor(String color) { * The LabelMonetaryAccount with the public information of the User and the MonetaryAccount that * created the bunq.me fundraiser profile. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } @@ -122,11 +133,11 @@ public void setAttachment(List attachment) { /** * The pointer (url) which will be used to access the bunq.me fundraiser profile. */ - public MonetaryAccountReference getPointer() { + public Pointer getPointer() { return this.pointer; } - public void setPointer(MonetaryAccountReference pointer) { + public void setPointer(Pointer pointer) { this.pointer = pointer; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTab.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTab.java index d2f1d4a8..352f8d85 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTab.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTab.java @@ -101,6 +101,34 @@ public class BunqMeTab extends BunqModel { @SerializedName("result_inquiries") private List resultInquiries; + /** + * The bunq.me entry containing the payment information. + */ + @Expose + @SerializedName("bunqme_tab_entry_field_for_request") + private BunqMeTabEntry bunqmeTabEntryFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + public BunqMeTab() { + this(null, null); + } + + public BunqMeTab(BunqMeTabEntry bunqmeTabEntry) { + this(bunqmeTabEntry, null); + } + + public BunqMeTab(BunqMeTabEntry bunqmeTabEntry, String status) { + this.bunqmeTabEntryFieldForRequest = bunqmeTabEntry; + this.statusFieldForRequest = status; + } + /** * @param bunqmeTabEntry The bunq.me entry containing the payment information. * @param status The status of the bunq.me. Ignored in POST requests but can be used for @@ -117,7 +145,7 @@ public static BunqResponse create(BunqMeTabEntry bunqmeTabEntry, Intege requestMap.put(FIELD_BUNQME_TAB_ENTRY, bunqmeTabEntry); requestMap.put(FIELD_STATUS, status); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -153,7 +181,7 @@ public static BunqResponse update(Integer bunqMeTabId, Integer monetary HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_STATUS, status); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), bunqMeTabId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabEntry.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabEntry.java index 27aa6c5e..e0226eb6 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabEntry.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabEntry.java @@ -1,18 +1,14 @@ package com.bunq.sdk.model.generated.endpoint; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.BunqMeMerchantAvailable; import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; + import java.util.List; -import java.util.Map; /** * bunq.me tabs allows you to create a payment request and share the link through e-mail, chat, @@ -48,7 +44,7 @@ public class BunqMeTabEntry extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The description for the bunq.me. Maximum 9000 characters. @@ -78,6 +74,46 @@ public class BunqMeTabEntry extends BunqModel { @SerializedName("merchant_available") private List merchantAvailable; + /** + * The Amount requested to be paid. Can be optional. + */ + @Expose + @SerializedName("amount_inquired_field_for_request") + private Amount amountInquiredFieldForRequest; + + /** + * The description for the bunq.me. Maximum 9000 characters. Field is required but can be an + * empty string. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The URL which the user is sent to after making a payment. + */ + @Expose + @SerializedName("redirect_url_field_for_request") + private String redirectUrlFieldForRequest; + + public BunqMeTabEntry() { + this(null, null, null); + } + + public BunqMeTabEntry(String description) { + this(description, null, null); + } + + public BunqMeTabEntry(String description, Amount amountInquired) { + this(description, amountInquired, null); + } + + public BunqMeTabEntry(String description, Amount amountInquired, String redirectUrl) { + this.amountInquiredFieldForRequest = amountInquired; + this.descriptionFieldForRequest = description; + this.redirectUrlFieldForRequest = redirectUrl; + } + /** * The uuid of the bunq.me. */ @@ -104,11 +140,11 @@ public void setAmountInquired(Amount amountInquired) { * The LabelMonetaryAccount with the public information of the User and the MonetaryAccount that * created the bunq.me link. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/Card.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/Card.java index 7f3f6ca2..95f7db34 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/Card.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/Card.java @@ -4,11 +4,11 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.CardCountryPermission; import com.bunq.sdk.model.generated.object.CardLimit; import com.bunq.sdk.model.generated.object.CardMagStripePermission; import com.bunq.sdk.model.generated.object.CardPinAssignment; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.security.SecurityUtils; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -169,14 +169,14 @@ public class Card extends BunqModel { */ @Expose @SerializedName("label_monetary_account_ordered") - private MonetaryAccountReference labelMonetaryAccountOrdered; + private LabelMonetaryAccount labelMonetaryAccountOrdered; /** * The monetary account that this card is currently linked to and the label user viewing it. */ @Expose @SerializedName("label_monetary_account_current") - private MonetaryAccountReference labelMonetaryAccountCurrent; + private LabelMonetaryAccount labelMonetaryAccountCurrent; /** * Array of Types, PINs, account IDs assigned to the card. @@ -200,6 +200,127 @@ public class Card extends BunqModel { @SerializedName("country") private String country; + /** + * The plaintext pin code. Requests require encryption to be enabled. + */ + @Expose + @SerializedName("pin_code_field_for_request") + private String pinCodeFieldForRequest; + + /** + * The activation code required to set status to ACTIVE initially. Can only set status to ACTIVE + * using activation code when order_status is ACCEPTED_FOR_PRODUCTION and status is DEACTIVATED. + */ + @Expose + @SerializedName("activation_code_field_for_request") + private String activationCodeFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The limits to define for the card, among CARD_LIMIT_CONTACTLESS, CARD_LIMIT_ATM, + * CARD_LIMIT_DIPPING and CARD_LIMIT_POS_ICC (e.g. 25 EUR for CARD_LIMIT_CONTACTLESS). All the + * limits must be provided on update. + */ + @Expose + @SerializedName("limit_field_for_request") + private List limitFieldForRequest; + + /** + * Whether or not it is allowed to use the mag stripe for the card. + */ + @Expose + @SerializedName("mag_stripe_permission_field_for_request") + private CardMagStripePermission magStripePermissionFieldForRequest; + + /** + * The countries for which to grant (temporary) permissions to use the card. + */ + @Expose + @SerializedName("country_permission_field_for_request") + private List countryPermissionFieldForRequest; + + /** + * The ID of the monetary account that card transactions will use. + */ + @Expose + @SerializedName("monetary_account_current_id_field_for_request") + private Integer monetaryAccountCurrentIdFieldForRequest; + + /** + * Array of Types, PINs, account IDs assigned to the card. + */ + @Expose + @SerializedName("pin_code_assignment_field_for_request") + private List pinCodeAssignmentFieldForRequest; + + /** + * ID of the MA to be used as fallback for this card if insufficient balance. Fallback account + * is removed if not supplied. + */ + @Expose + @SerializedName("monetary_account_id_fallback_field_for_request") + private Integer monetaryAccountIdFallbackFieldForRequest; + + public Card() { + this(null, null, null, null, null, null, null, null, null); + } + + public Card(String pinCode) { + this(pinCode, null, null, null, null, null, null, null, null); + } + + public Card(String pinCode, String activationCode) { + this(pinCode, activationCode, null, null, null, null, null, null, null); + } + + public Card(String pinCode, String activationCode, String status) { + this(pinCode, activationCode, status, null, null, null, null, null, null); + } + + public Card(String pinCode, String activationCode, String status, List limit) { + this(pinCode, activationCode, status, limit, null, null, null, null, null); + } + + public Card(String pinCode, String activationCode, String status, List limit, CardMagStripePermission magStripePermission) { + this(pinCode, activationCode, status, limit, magStripePermission, null, null, null, null); + } + + public Card(String pinCode, String activationCode, String status, List limit, CardMagStripePermission magStripePermission, List countryPermission) { + this(pinCode, activationCode, status, limit, magStripePermission, countryPermission, null, null, null); + } + + public Card(String pinCode, String activationCode, String status, List limit, CardMagStripePermission magStripePermission, List countryPermission, Integer monetaryAccountCurrentId) { + this(pinCode, activationCode, status, limit, magStripePermission, countryPermission, monetaryAccountCurrentId, null, null); + } + + public Card(String pinCode, String activationCode, String status, List limit, CardMagStripePermission magStripePermission, List countryPermission, Integer monetaryAccountCurrentId, List pinCodeAssignment) { + this(pinCode, activationCode, status, limit, magStripePermission, countryPermission, monetaryAccountCurrentId, pinCodeAssignment, null); + } + + public Card(String pinCode, String activationCode, String status, List limit, CardMagStripePermission magStripePermission, List countryPermission, Integer monetaryAccountCurrentId, List pinCodeAssignment, Integer monetaryAccountIdFallback) { + this.pinCodeFieldForRequest = pinCode; + this.activationCodeFieldForRequest = activationCode; + this.statusFieldForRequest = status; + this.limitFieldForRequest = limit; + this.magStripePermissionFieldForRequest = magStripePermission; + this.countryPermissionFieldForRequest = countryPermission; + this.monetaryAccountCurrentIdFieldForRequest = monetaryAccountCurrentId; + this.pinCodeAssignmentFieldForRequest = pinCodeAssignment; + this.monetaryAccountIdFallbackFieldForRequest = monetaryAccountIdFallback; + } + /** * 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 @@ -245,7 +366,7 @@ public static BunqResponse update(Integer cardId, String pinCode, String a requestMap.put(FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment); requestMap.put(FIELD_MONETARY_ACCOUNT_ID_FALLBACK, monetaryAccountIdFallback); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); requestBytes = SecurityUtils.encrypt(getApiContext(), requestBytes, customHeaders); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), cardId), requestBytes, customHeaders); @@ -514,22 +635,22 @@ public void setCountryPermission(List countryPermission) /** * The monetary account this card was ordered on and the label user that owns the card. */ - public MonetaryAccountReference getLabelMonetaryAccountOrdered() { + public LabelMonetaryAccount getLabelMonetaryAccountOrdered() { return this.labelMonetaryAccountOrdered; } - public void setLabelMonetaryAccountOrdered(MonetaryAccountReference labelMonetaryAccountOrdered) { + public void setLabelMonetaryAccountOrdered(LabelMonetaryAccount labelMonetaryAccountOrdered) { this.labelMonetaryAccountOrdered = labelMonetaryAccountOrdered; } /** * The monetary account that this card is currently linked to and the label user viewing it. */ - public MonetaryAccountReference getLabelMonetaryAccountCurrent() { + public LabelMonetaryAccount getLabelMonetaryAccountCurrent() { return this.labelMonetaryAccountCurrent; } - public void setLabelMonetaryAccountCurrent(MonetaryAccountReference labelMonetaryAccountCurrent) { + public void setLabelMonetaryAccountCurrent(LabelMonetaryAccount labelMonetaryAccountCurrent) { this.labelMonetaryAccountCurrent = labelMonetaryAccountCurrent; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardDebit.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardDebit.java index b03dea57..7b0132b7 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardDebit.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardDebit.java @@ -4,10 +4,10 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.CardCountryPermission; import com.bunq.sdk.model.generated.object.CardLimit; import com.bunq.sdk.model.generated.object.CardPinAssignment; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.LabelUser; import com.bunq.sdk.model.generated.object.Pointer; import com.bunq.sdk.security.SecurityUtils; @@ -148,14 +148,14 @@ public class CardDebit extends BunqModel { */ @Expose @SerializedName("label_monetary_account_ordered") - private MonetaryAccountReference labelMonetaryAccountOrdered; + private LabelMonetaryAccount labelMonetaryAccountOrdered; /** * The monetary account that this card is currently linked to and the label user viewing it. */ @Expose @SerializedName("label_monetary_account_current") - private MonetaryAccountReference labelMonetaryAccountCurrent; + private LabelMonetaryAccount labelMonetaryAccountCurrent; /** * The label for the user who requested the card. @@ -186,6 +186,86 @@ public class CardDebit extends BunqModel { @SerializedName("country") private String country; + /** + * 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. + */ + @Expose + @SerializedName("second_line_field_for_request") + private String secondLineFieldForRequest; + + /** + * The user's name as it will be on the card. Check 'card-name' for the available card names for + * a user. + */ + @Expose + @SerializedName("name_on_card_field_for_request") + private String nameOnCardFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("alias_field_for_request") + private Pointer aliasFieldForRequest; + + /** + * The type of card to order. Can be MAESTRO or MASTERCARD. + */ + @Expose + @SerializedName("type_field_for_request") + private String typeFieldForRequest; + + /** + * Array of Types, PINs, account IDs assigned to the card. + */ + @Expose + @SerializedName("pin_code_assignment_field_for_request") + private List pinCodeAssignmentFieldForRequest; + + /** + * ID of the MA to be used as fallback for this card if insufficient balance. Fallback account + * is removed if not supplied. + */ + @Expose + @SerializedName("monetary_account_id_fallback_field_for_request") + private Integer monetaryAccountIdFallbackFieldForRequest; + + public CardDebit() { + this(null, null, null, null, null, null); + } + + public CardDebit(String secondLine) { + this(secondLine, null, null, null, null, null); + } + + public CardDebit(String secondLine, String nameOnCard) { + this(secondLine, nameOnCard, null, null, null, null); + } + + public CardDebit(String secondLine, String nameOnCard, Pointer alias) { + this(secondLine, nameOnCard, alias, null, null, null); + } + + public CardDebit(String secondLine, String nameOnCard, Pointer alias, String type) { + this(secondLine, nameOnCard, alias, type, null, null); + } + + public CardDebit(String secondLine, String nameOnCard, Pointer alias, String type, List pinCodeAssignment) { + this(secondLine, nameOnCard, alias, type, pinCodeAssignment, null); + } + + public CardDebit(String secondLine, String nameOnCard, Pointer alias, String type, List pinCodeAssignment, Integer monetaryAccountIdFallback) { + this.secondLineFieldForRequest = secondLine; + this.nameOnCardFieldForRequest = nameOnCard; + this.aliasFieldForRequest = alias; + this.typeFieldForRequest = type; + this.pinCodeAssignmentFieldForRequest = pinCodeAssignment; + this.monetaryAccountIdFallbackFieldForRequest = monetaryAccountIdFallback; + } + /** * Create a new debit card request. * @param secondLine The second line of text on the card, used as name/description for it. It @@ -215,7 +295,7 @@ public static BunqResponse create(String secondLine, String nameOnCar requestMap.put(FIELD_PIN_CODE_ASSIGNMENT, pinCodeAssignment); requestMap.put(FIELD_MONETARY_ACCOUNT_ID_FALLBACK, monetaryAccountIdFallback); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); requestBytes = SecurityUtils.encrypt(getApiContext(), requestBytes, customHeaders); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); @@ -407,22 +487,22 @@ public void setCountryPermission(List countryPermission) /** * The monetary account this card was ordered on and the label user that owns the card. */ - public MonetaryAccountReference getLabelMonetaryAccountOrdered() { + public LabelMonetaryAccount getLabelMonetaryAccountOrdered() { return this.labelMonetaryAccountOrdered; } - public void setLabelMonetaryAccountOrdered(MonetaryAccountReference labelMonetaryAccountOrdered) { + public void setLabelMonetaryAccountOrdered(LabelMonetaryAccount labelMonetaryAccountOrdered) { this.labelMonetaryAccountOrdered = labelMonetaryAccountOrdered; } /** * The monetary account that this card is currently linked to and the label user viewing it. */ - public MonetaryAccountReference getLabelMonetaryAccountCurrent() { + public LabelMonetaryAccount getLabelMonetaryAccountCurrent() { return this.labelMonetaryAccountCurrent; } - public void setLabelMonetaryAccountCurrent(MonetaryAccountReference labelMonetaryAccountCurrent) { + public void setLabelMonetaryAccountCurrent(LabelMonetaryAccount labelMonetaryAccountCurrent) { this.labelMonetaryAccountCurrent = labelMonetaryAccountCurrent; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardGeneratedCvc2.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardGeneratedCvc2.java index a8518113..d1bd671d 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardGeneratedCvc2.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardGeneratedCvc2.java @@ -84,7 +84,7 @@ public static BunqResponse create(Integer cardId, Map c HashMap requestMap = new HashMap<>(); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); requestBytes = SecurityUtils.encrypt(getApiContext(), requestBytes, customHeaders); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), cardId), requestBytes, customHeaders); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardPinChange.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardPinChange.java index 78e032d9..091d1394 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardPinChange.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardPinChange.java @@ -4,8 +4,8 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.LabelCard; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; @@ -48,7 +48,7 @@ public class CardPinChange extends BunqModel { */ @Expose @SerializedName("label_monetary_account_current") - private MonetaryAccountReference labelMonetaryAccountCurrent; + private LabelMonetaryAccount labelMonetaryAccountCurrent; /** * The request date of the pin change. @@ -142,11 +142,11 @@ public void setLabelCard(LabelCard labelCard) { /** * The monetary account this card was ordered on and the label user that owns the card. */ - public MonetaryAccountReference getLabelMonetaryAccountCurrent() { + public LabelMonetaryAccount getLabelMonetaryAccountCurrent() { return this.labelMonetaryAccountCurrent; } - public void setLabelMonetaryAccountCurrent(MonetaryAccountReference labelMonetaryAccountCurrent) { + public void setLabelMonetaryAccountCurrent(LabelMonetaryAccount labelMonetaryAccountCurrent) { this.labelMonetaryAccountCurrent = labelMonetaryAccountCurrent; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardReplace.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardReplace.java index cae3cc6b..ca400d59 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardReplace.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardReplace.java @@ -40,6 +40,46 @@ public class CardReplace extends BunqModel { @SerializedName("id") private Integer id; + /** + * The user's name as it will be on the card. Check 'card-name' for the available card names for + * a user. + */ + @Expose + @SerializedName("name_on_card_field_for_request") + private String nameOnCardFieldForRequest; + + /** + * The plaintext pin code. Requests require encryption to be enabled. + */ + @Expose + @SerializedName("pin_code_field_for_request") + private String pinCodeFieldForRequest; + + /** + * The second line on the card. + */ + @Expose + @SerializedName("second_line_field_for_request") + private String secondLineFieldForRequest; + + public CardReplace() { + this(null, null, null); + } + + public CardReplace(String nameOnCard) { + this(nameOnCard, null, null); + } + + public CardReplace(String nameOnCard, String pinCode) { + this(nameOnCard, pinCode, null); + } + + public CardReplace(String nameOnCard, String pinCode, String secondLine) { + this.nameOnCardFieldForRequest = nameOnCard; + this.pinCodeFieldForRequest = pinCode; + this.secondLineFieldForRequest = secondLine; + } + /** * Request a card replacement. * @param nameOnCard The user's name as it will be on the card. Check 'card-name' for the @@ -59,7 +99,7 @@ public static BunqResponse create(Integer cardId, String nameOnCard, St requestMap.put(FIELD_PIN_CODE, pinCode); requestMap.put(FIELD_SECOND_LINE, secondLine); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); requestBytes = SecurityUtils.encrypt(getApiContext(), requestBytes, customHeaders); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), cardId), requestBytes, customHeaders); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardResult.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardResult.java index 23c183e0..55182285 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardResult.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardResult.java @@ -4,9 +4,9 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.LabelCard; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; @@ -112,14 +112,14 @@ public class CardResult extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The monetary account label of the counterparty. */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The label of the card. @@ -312,22 +312,22 @@ public void setCity(String city) { /** * The monetary account label of the account that this result is created for. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } /** * The monetary account label of the counterparty. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegister.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegister.java index 89270022..ea5c81c3 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegister.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegister.java @@ -113,6 +113,84 @@ public class CashRegister extends BunqModel { @SerializedName("tab_text_waiting_screen") private List tabTextWaitingScreen; + /** + * The name of the CashRegister. Must be unique for this MonetaryAccount. + */ + @Expose + @SerializedName("name_field_for_request") + private String nameFieldForRequest; + + /** + * The status of the CashRegister. Can only be created or updated with PENDING_APPROVAL or + * CLOSED. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The UUID of the avatar of the CashRegister. Use the calls /attachment-public and /avatar to + * create a new Avatar and get its UUID. + */ + @Expose + @SerializedName("avatar_uuid_field_for_request") + private String avatarUuidFieldForRequest; + + /** + * The geolocation of the CashRegister. + */ + @Expose + @SerializedName("location_field_for_request") + private Geolocation locationFieldForRequest; + + /** + * The types of notifications that will result in a push notification or URL callback for this + * CashRegister. + */ + @Expose + @SerializedName("notification_filters_field_for_request") + private List notificationFiltersFieldForRequest; + + /** + * The tab text for waiting screen of CashRegister. + */ + @Expose + @SerializedName("tab_text_waiting_screen_field_for_request") + private List tabTextWaitingScreenFieldForRequest; + + public CashRegister() { + this(null, null, null, null, null, null); + } + + public CashRegister(String name) { + this(name, null, null, null, null, null); + } + + public CashRegister(String name, String status) { + this(name, status, null, null, null, null); + } + + public CashRegister(String name, String status, String avatarUuid) { + this(name, status, avatarUuid, null, null, null); + } + + public CashRegister(String name, String status, String avatarUuid, Geolocation location) { + this(name, status, avatarUuid, location, null, null); + } + + public CashRegister(String name, String status, String avatarUuid, Geolocation location, List notificationFilters) { + this(name, status, avatarUuid, location, notificationFilters, null); + } + + public CashRegister(String name, String status, String avatarUuid, Geolocation location, List notificationFilters, List tabTextWaitingScreen) { + this.nameFieldForRequest = name; + this.statusFieldForRequest = status; + this.avatarUuidFieldForRequest = avatarUuid; + this.locationFieldForRequest = location; + this.notificationFiltersFieldForRequest = notificationFilters; + this.tabTextWaitingScreenFieldForRequest = tabTextWaitingScreen; + } + /** * 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 @@ -143,7 +221,7 @@ public static BunqResponse create(String name, String status, String av requestMap.put(FIELD_NOTIFICATION_FILTERS, notificationFilters); requestMap.put(FIELD_TAB_TEXT_WAITING_SCREEN, tabTextWaitingScreen); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -236,7 +314,7 @@ public static BunqResponse update(Integer cashRegisterId, Integer monet requestMap.put(FIELD_NOTIFICATION_FILTERS, notificationFilters); requestMap.put(FIELD_TAB_TEXT_WAITING_SCREEN, tabTextWaitingScreen); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), cashRegisterId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegisterQrCode.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegisterQrCode.java index ae7949de..7051da48 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegisterQrCode.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegisterQrCode.java @@ -82,6 +82,23 @@ public class CashRegisterQrCode extends BunqModel { @SerializedName("tab_object") private Tab tabObject; + /** + * 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. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + public CashRegisterQrCode() { + this(null); + } + + public CashRegisterQrCode(String status) { + this.statusFieldForRequest = status; + } + /** * Create a new QR code for this CashRegister. You can only have one ACTIVE CashRegister QR code * at the time. @@ -99,7 +116,7 @@ public static BunqResponse create(Integer cashRegisterId, String status HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_STATUS, status); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), cashRegisterId), requestBytes, customHeaders); return processForId(responseRaw); @@ -138,7 +155,7 @@ public static BunqResponse update(Integer cashRegisterId, Integer cashR HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_STATUS, status); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), cashRegisterId, cashRegisterQrCodeId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CertificatePinned.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CertificatePinned.java index de3e1609..debb5804 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CertificatePinned.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CertificatePinned.java @@ -52,6 +52,21 @@ public class CertificatePinned extends BunqModel { @SerializedName("id") private Integer id; + /** + * The certificate chain in .PEM format. + */ + @Expose + @SerializedName("certificate_chain_field_for_request") + private List certificateChainFieldForRequest; + + public CertificatePinned() { + this(null); + } + + public CertificatePinned(List certificateChain) { + this.certificateChainFieldForRequest = certificateChain; + } + /** * Pin the certificate chain. * @param certificateChain The certificate chain in .PEM format. @@ -66,7 +81,7 @@ public static BunqResponse create(List certificateChain, M HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_CERTIFICATE_CHAIN, certificateChain); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageAttachment.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageAttachment.java index b010db1b..b7a1468e 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageAttachment.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageAttachment.java @@ -34,6 +34,21 @@ public class ChatMessageAttachment extends BunqModel { @SerializedName("id") private Integer id; + /** + * The attachment contained in this message. + */ + @Expose + @SerializedName("attachment_field_for_request") + private BunqId attachmentFieldForRequest; + + public ChatMessageAttachment() { + this(null); + } + + public ChatMessageAttachment(BunqId attachment) { + this.attachmentFieldForRequest = attachment; + } + /** * Create a new message holding a file attachment to a specific conversation. * @param attachment The attachment contained in this message. @@ -48,7 +63,7 @@ public static BunqResponse create(Integer chatConversationId, BunqId at HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_ATTACHMENT, attachment); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), chatConversationId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageText.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageText.java index fad46f57..8174683c 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageText.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageText.java @@ -33,6 +33,21 @@ public class ChatMessageText extends BunqModel { @SerializedName("id") private Integer id; + /** + * The textual content of this message. Cannot be empty. + */ + @Expose + @SerializedName("text_field_for_request") + private String textFieldForRequest; + + public ChatMessageText() { + this(null); + } + + public ChatMessageText(String text) { + this.textFieldForRequest = text; + } + /** * Add a new text message to a specific conversation. * @param text The textual content of this message. Cannot be empty. @@ -47,7 +62,7 @@ public static BunqResponse create(Integer chatConversationId, String te HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_TEXT, text); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), chatConversationId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/Customer.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/Customer.java index 8e47ec25..47eaf7d8 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/Customer.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/Customer.java @@ -62,6 +62,21 @@ public class Customer extends BunqModel { @SerializedName("billing_account_id") private String billingAccountId; + /** + * The primary billing account account's id. + */ + @Expose + @SerializedName("billing_account_id_field_for_request") + private String billingAccountIdFieldForRequest; + + public Customer() { + this(null); + } + + public Customer(String billingAccountId) { + this.billingAccountIdFieldForRequest = billingAccountId; + } + /** */ public static BunqResponse> list(Map params, Map customHeaders) { @@ -113,7 +128,7 @@ public static BunqResponse update(Integer customerId, String billingAcc HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_BILLING_ACCOUNT_ID, billingAccountId); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), customerId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerStatementExport.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerStatementExport.java index bce7442b..20488d10 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerStatementExport.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerStatementExport.java @@ -4,7 +4,7 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; @@ -108,7 +108,59 @@ public class CustomerStatementExport extends BunqModel { */ @Expose @SerializedName("alias_monetary_account") - private MonetaryAccountReference aliasMonetaryAccount; + private LabelMonetaryAccount aliasMonetaryAccount; + + /** + * The format type of statement. Allowed values: MT940, CSV, PDF. + */ + @Expose + @SerializedName("statement_format_field_for_request") + private String statementFormatFieldForRequest; + + /** + * The start date for making statements. + */ + @Expose + @SerializedName("date_start_field_for_request") + private String dateStartFieldForRequest; + + /** + * The end date for making statements. + */ + @Expose + @SerializedName("date_end_field_for_request") + private String dateEndFieldForRequest; + + /** + * Required for CSV exports. The regional format of the statement, can be UK_US + * (comma-separated) or EUROPEAN (semicolon-separated). + */ + @Expose + @SerializedName("regional_format_field_for_request") + private String regionalFormatFieldForRequest; + + public CustomerStatementExport() { + this(null, null, null, null); + } + + public CustomerStatementExport(String statementFormat) { + this(statementFormat, null, null, null); + } + + public CustomerStatementExport(String statementFormat, String dateStart) { + this(statementFormat, dateStart, null, null); + } + + public CustomerStatementExport(String statementFormat, String dateStart, String dateEnd) { + this(statementFormat, dateStart, dateEnd, null); + } + + public CustomerStatementExport(String statementFormat, String dateStart, String dateEnd, String regionalFormat) { + this.statementFormatFieldForRequest = statementFormat; + this.dateStartFieldForRequest = dateStart; + this.dateEndFieldForRequest = dateEnd; + this.regionalFormatFieldForRequest = regionalFormat; + } /** * @param statementFormat The format type of statement. Allowed values: MT940, CSV, PDF. @@ -130,7 +182,7 @@ public static BunqResponse create(String statementFormat, String dateSt requestMap.put(FIELD_DATE_END, dateEnd); requestMap.put(FIELD_REGIONAL_FORMAT, regionalFormat); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -325,11 +377,11 @@ public void setRegionalFormat(String regionalFormat) { /** * The monetary account for which this statement was created. */ - public MonetaryAccountReference getAliasMonetaryAccount() { + public LabelMonetaryAccount getAliasMonetaryAccount() { return this.aliasMonetaryAccount; } - public void setAliasMonetaryAccount(MonetaryAccountReference aliasMonetaryAccount) { + public void setAliasMonetaryAccount(LabelMonetaryAccount aliasMonetaryAccount) { this.aliasMonetaryAccount = aliasMonetaryAccount; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/DeviceServer.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/DeviceServer.java index a5734e14..c9315e59 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/DeviceServer.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/DeviceServer.java @@ -79,6 +79,47 @@ public class DeviceServer extends BunqModel { @SerializedName("status") private String status; + /** + * The description of the DeviceServer. This is only for your own reference when reading the + * DeviceServer again. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The API key. You can request an API key in the bunq app. + */ + @Expose + @SerializedName("secret_field_for_request") + private String secretFieldForRequest; + + /** + * An array of IPs (v4 or v6) this DeviceServer will be able to do calls from. These will be + * linked to the API key. + */ + @Expose + @SerializedName("permitted_ips_field_for_request") + private List permittedIpsFieldForRequest; + + public DeviceServer() { + this(null, null, null); + } + + public DeviceServer(String description) { + this(description, null, null); + } + + public DeviceServer(String description, String secret) { + this(description, secret, null); + } + + public DeviceServer(String description, String secret, List permittedIps) { + this.descriptionFieldForRequest = description; + this.secretFieldForRequest = secret; + this.permittedIpsFieldForRequest = permittedIps; + } + /** * 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 @@ -105,7 +146,7 @@ public static BunqResponse create(String description, String secret, Li requestMap.put(FIELD_SECRET, secret); requestMap.put(FIELD_PERMITTED_IPS, permittedIps); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(ENDPOINT_URL_CREATE, requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftPayment.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftPayment.java index abf898c5..dd6b958b 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftPayment.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftPayment.java @@ -109,6 +109,60 @@ public class DraftPayment extends BunqModel { @SerializedName("request_reference_split_the_bill") private List requestReferenceSplitTheBill; + /** + * The status of the DraftPayment. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The list of entries in the DraftPayment. Each entry will result in a payment when the + * DraftPayment is accepted. + */ + @Expose + @SerializedName("entries_field_for_request") + private List entriesFieldForRequest; + + /** + * The last updated_timestamp that you received for this DraftPayment. This needs to be provided + * to prevent race conditions. + */ + @Expose + @SerializedName("previous_updated_timestamp_field_for_request") + private String previousUpdatedTimestampFieldForRequest; + + /** + * The number of accepts that are required for the draft payment to receive status ACCEPTED. + * Currently only 1 is valid. + */ + @Expose + @SerializedName("number_of_required_accepts_field_for_request") + private Integer numberOfRequiredAcceptsFieldForRequest; + + public DraftPayment() { + this(null, null, null, null); + } + + public DraftPayment(List entries) { + this(entries, null, null, null); + } + + public DraftPayment(List entries, Integer numberOfRequiredAccepts) { + this(entries, numberOfRequiredAccepts, null, null); + } + + public DraftPayment(List entries, Integer numberOfRequiredAccepts, String status) { + this(entries, numberOfRequiredAccepts, status, null); + } + + public DraftPayment(List entries, Integer numberOfRequiredAccepts, String status, String previousUpdatedTimestamp) { + this.statusFieldForRequest = status; + this.entriesFieldForRequest = entries; + this.previousUpdatedTimestampFieldForRequest = previousUpdatedTimestamp; + this.numberOfRequiredAcceptsFieldForRequest = numberOfRequiredAccepts; + } + /** * Create a new DraftPayment. * @param entries The list of entries in the DraftPayment. Each entry will result in a payment @@ -132,7 +186,7 @@ public static BunqResponse create(List entries, Inte requestMap.put(FIELD_PREVIOUS_UPDATED_TIMESTAMP, previousUpdatedTimestamp); requestMap.put(FIELD_NUMBER_OF_REQUIRED_ACCEPTS, numberOfRequiredAccepts); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -182,7 +236,7 @@ public static BunqResponse update(Integer draftPaymentId, Integer monet requestMap.put(FIELD_ENTRIES, entries); requestMap.put(FIELD_PREVIOUS_UPDATED_TIMESTAMP, previousUpdatedTimestamp); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), draftPaymentId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteApiKey.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteApiKey.java index 24e3e086..c66f0235 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteApiKey.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteApiKey.java @@ -89,6 +89,46 @@ public class DraftShareInviteApiKey extends BunqModel { @SerializedName("id") private Integer id; + /** + * The status of the draft share invite. Can be CANCELLED (the user cancels the draft share + * before it's used). + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The sub-status of the draft share invite. Can be NONE, ACCEPTED or REJECTED. + */ + @Expose + @SerializedName("sub_status_field_for_request") + private String subStatusFieldForRequest; + + /** + * The moment when this draft share invite expires. + */ + @Expose + @SerializedName("expiration_field_for_request") + private String expirationFieldForRequest; + + public DraftShareInviteApiKey() { + this(null, null, null); + } + + public DraftShareInviteApiKey(String expiration) { + this(expiration, null, null); + } + + public DraftShareInviteApiKey(String expiration, String status) { + this(expiration, status, null); + } + + public DraftShareInviteApiKey(String expiration, String status, String subStatus) { + this.statusFieldForRequest = status; + this.subStatusFieldForRequest = subStatus; + this.expirationFieldForRequest = expiration; + } + /** * @param expiration The moment when this draft share invite expires. * @param status The status of the draft share invite. Can be CANCELLED (the user cancels the @@ -102,12 +142,12 @@ public static BunqResponse create(String expiration, String status, Str customHeaders = new HashMap<>(); } - HashMap requestMap = new HashMap<>(); + HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_STATUS, status); requestMap.put(FIELD_SUB_STATUS, subStatus); requestMap.put(FIELD_EXPIRATION, expiration); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); return processForId(responseRaw); @@ -171,7 +211,7 @@ public static BunqResponse update(Integer draftShareInvi requestMap.put(FIELD_SUB_STATUS, subStatus); requestMap.put(FIELD_EXPIRATION, expiration); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), draftShareInviteApiKeyId), requestBytes, customHeaders); return fromJson(DraftShareInviteApiKey.class, responseRaw, OBJECT_TYPE_PUT); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteBank.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteBank.java index 255c1d02..57ff9e1a 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteBank.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteBank.java @@ -90,6 +90,46 @@ public class DraftShareInviteBank extends BunqModel { @SerializedName("id") private Integer id; + /** + * The status of the draft share invite. Can be CANCELLED (the user cancels the draft share + * before it's used). + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The moment when this draft share invite expires. + */ + @Expose + @SerializedName("expiration_field_for_request") + private String expirationFieldForRequest; + + /** + * The draft share invite details. + */ + @Expose + @SerializedName("draft_share_settings_field_for_request") + private DraftShareInviteEntry draftShareSettingsFieldForRequest; + + public DraftShareInviteBank() { + this(null, null, null); + } + + public DraftShareInviteBank(String expiration) { + this(expiration, null, null); + } + + public DraftShareInviteBank(String expiration, DraftShareInviteEntry draftShareSettings) { + this(expiration, draftShareSettings, null); + } + + public DraftShareInviteBank(String expiration, DraftShareInviteEntry draftShareSettings, String status) { + this.statusFieldForRequest = status; + this.expirationFieldForRequest = expiration; + this.draftShareSettingsFieldForRequest = draftShareSettings; + } + /** * @param expiration The moment when this draft share invite expires. * @param draftShareSettings The draft share invite details. @@ -108,7 +148,7 @@ public static BunqResponse create(String expiration, DraftShareInviteEn requestMap.put(FIELD_EXPIRATION, expiration); requestMap.put(FIELD_DRAFT_SHARE_SETTINGS, draftShareSettings); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); return processForId(responseRaw); @@ -172,7 +212,7 @@ public static BunqResponse update(Integer draftShareInviteBankId, Strin requestMap.put(FIELD_EXPIRATION, expiration); requestMap.put(FIELD_DRAFT_SHARE_SETTINGS, draftShareSettings); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), draftShareInviteBankId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ExportAnnualOverview.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ExportAnnualOverview.java index 289bc8d2..dc1869c0 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ExportAnnualOverview.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ExportAnnualOverview.java @@ -73,6 +73,21 @@ public class ExportAnnualOverview extends BunqModel { @SerializedName("alias_user") private LabelUser aliasUser; + /** + * The year for which the overview is. + */ + @Expose + @SerializedName("year_field_for_request") + private Integer yearFieldForRequest; + + public ExportAnnualOverview() { + this(null); + } + + public ExportAnnualOverview(Integer year) { + this.yearFieldForRequest = year; + } + /** * Create a new annual overview for a specific year. An overview can be generated only for a * past year. @@ -88,7 +103,7 @@ public static BunqResponse create(Integer year, Map cus HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_YEAR, year); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/IdealMerchantTransaction.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/IdealMerchantTransaction.java index a0797891..0bc5602d 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/IdealMerchantTransaction.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/IdealMerchantTransaction.java @@ -4,8 +4,8 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Amount; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; @@ -49,14 +49,14 @@ public class IdealMerchantTransaction extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The alias of the monetary account the money comes from. */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * In case of a successful transaction, the amount of money that will be transferred. @@ -135,6 +135,33 @@ public class IdealMerchantTransaction extends BunqModel { @SerializedName("allow_chat") private Boolean allowChat; + /** + * The requested amount of money to add. + */ + @Expose + @SerializedName("amount_requested_field_for_request") + private Amount amountRequestedFieldForRequest; + + /** + * The BIC of the issuing bank to ask for money. + */ + @Expose + @SerializedName("issuer_field_for_request") + private String issuerFieldForRequest; + + public IdealMerchantTransaction() { + this(null, null); + } + + public IdealMerchantTransaction(Amount amountRequested) { + this(amountRequested, null); + } + + public IdealMerchantTransaction(Amount amountRequested, String issuer) { + this.amountRequestedFieldForRequest = amountRequested; + this.issuerFieldForRequest = issuer; + } + /** * @param amountRequested The requested amount of money to add. * @param issuer The BIC of the issuing bank to ask for money. @@ -150,7 +177,7 @@ public static BunqResponse create(Amount amountRequested, String issuer requestMap.put(FIELD_AMOUNT_REQUESTED, amountRequested); requestMap.put(FIELD_ISSUER, issuer); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -232,22 +259,22 @@ public void setMonetaryAccountId(Integer monetaryAccountId) { /** * The alias of the monetary account to add money to. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } /** * The alias of the monetary account the money comes from. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/Invoice.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/Invoice.java index 770d0a0b..d6adc827 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/Invoice.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/Invoice.java @@ -4,10 +4,10 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Address; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.InvoiceItemGroup; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.RequestInquiryReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -114,7 +114,7 @@ public class Invoice extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The customer's address. @@ -128,7 +128,7 @@ public class Invoice extends BunqModel { */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The company's address. @@ -159,6 +159,45 @@ public class Invoice extends BunqModel { @SerializedName("request_reference_split_the_bill") private List requestReferenceSplitTheBill; + /** + * The status of the invoice. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The description provided by the admin. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The external url provided by the admin. + */ + @Expose + @SerializedName("external_url_field_for_request") + private String externalUrlFieldForRequest; + + public Invoice() { + this(null, null, null); + } + + public Invoice(String status) { + this(status, null, null); + } + + public Invoice(String status, String description) { + this(status, description, null); + } + + public Invoice(String status, String description, String externalUrl) { + this.statusFieldForRequest = status; + this.descriptionFieldForRequest = description; + this.externalUrlFieldForRequest = externalUrl; + } + /** */ public static BunqResponse> list(Integer monetaryAccountId, Map params, Map customHeaders) { @@ -318,11 +357,11 @@ public void setTotalVat(Amount totalVat) { /** * The label that's displayed to the counterparty with the invoice. Includes user. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } @@ -340,11 +379,11 @@ public void setAddress(Address address) { /** * The label of the counterparty of the invoice. Includes user. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/InvoiceByUser.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/InvoiceByUser.java index 342b6ef7..4b954c0b 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/InvoiceByUser.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/InvoiceByUser.java @@ -4,10 +4,10 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Address; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.InvoiceItemGroup; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; @@ -106,7 +106,7 @@ public class InvoiceByUser extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The customer's address. @@ -120,7 +120,7 @@ public class InvoiceByUser extends BunqModel { */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The company's address. @@ -294,11 +294,11 @@ public void setTotalVat(Amount totalVat) { /** * The label that's displayed to the counterparty with the invoice. Includes user. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } @@ -316,11 +316,11 @@ public void setAddress(Address address) { /** * The label of the counterparty of the invoice. Includes user. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MasterCardAction.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MasterCardAction.java index 71482727..866c0bbb 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MasterCardAction.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MasterCardAction.java @@ -4,9 +4,9 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.LabelCard; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.RequestInquiryReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -148,14 +148,14 @@ public class MasterCardAction extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The monetary account label of the counterparty. */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The label of the card. @@ -448,22 +448,22 @@ public void setCity(String city) { /** * The monetary account label of the account that this action is created for. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } /** * The monetary account label of the counterparty. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountBank.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountBank.java index f8fefe35..88a96f9e 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountBank.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountBank.java @@ -199,6 +199,141 @@ public class MonetaryAccountBank extends BunqModel { @SerializedName("setting") private MonetaryAccountSetting setting; + /** + * The currency of the MonetaryAccountBank as an ISO 4217 formatted currency code. + */ + @Expose + @SerializedName("currency_field_for_request") + private String currencyFieldForRequest; + + /** + * The description of the MonetaryAccountBank. Defaults to 'bunq account'. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The daily spending limit Amount of the MonetaryAccountBank. Defaults to 1000 EUR. Currency + * must match the MonetaryAccountBank's currency. Limited to 10000 EUR. + */ + @Expose + @SerializedName("daily_limit_field_for_request") + private Amount dailyLimitFieldForRequest; + + /** + * The UUID of the Avatar of the MonetaryAccountBank. + */ + @Expose + @SerializedName("avatar_uuid_field_for_request") + private String avatarUuidFieldForRequest; + + /** + * The status of the MonetaryAccountBank. Ignored in POST requests (always set to ACTIVE) can be + * CANCELLED or PENDING_REOPEN in PUT requests to cancel (close) or reopen the + * MonetaryAccountBank. When updating the status and/or sub_status no other fields can be + * updated in the same request (and vice versa). + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The sub-status of the MonetaryAccountBank providing extra information regarding the status. + * Should be ignored for POST requests. In case of PUT requests with status CANCELLED it can + * only be REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be NONE. When + * updating the status and/or sub_status no other fields can be updated in the same request (and + * vice versa). + */ + @Expose + @SerializedName("sub_status_field_for_request") + private String subStatusFieldForRequest; + + /** + * The reason for voluntarily cancelling (closing) the MonetaryAccountBank, can only be OTHER. + * Should only be specified if updating the status to CANCELLED. + */ + @Expose + @SerializedName("reason_field_for_request") + private String reasonFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("reason_description_field_for_request") + private String reasonDescriptionFieldForRequest; + + /** + * The types of notifications that will result in a push notification or URL callback for this + * MonetaryAccountBank. + */ + @Expose + @SerializedName("notification_filters_field_for_request") + private List notificationFiltersFieldForRequest; + + /** + * The settings of the MonetaryAccountBank. + */ + @Expose + @SerializedName("setting_field_for_request") + private MonetaryAccountSetting settingFieldForRequest; + + public MonetaryAccountBank() { + this(null, null, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountBank(String currency) { + this(currency, null, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountBank(String currency, String description) { + this(currency, description, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountBank(String currency, String description, Amount dailyLimit) { + this(currency, description, dailyLimit, null, null, null, null, null, null, null); + } + + public MonetaryAccountBank(String currency, String description, Amount dailyLimit, String avatarUuid) { + this(currency, description, dailyLimit, avatarUuid, null, null, null, null, null, null); + } + + public MonetaryAccountBank(String currency, String description, Amount dailyLimit, String avatarUuid, String status) { + this(currency, description, dailyLimit, avatarUuid, status, null, null, null, null, null); + } + + public MonetaryAccountBank(String currency, String description, Amount dailyLimit, String avatarUuid, String status, String subStatus) { + this(currency, description, dailyLimit, avatarUuid, status, subStatus, null, null, null, null); + } + + public MonetaryAccountBank(String currency, String description, Amount dailyLimit, String avatarUuid, String status, String subStatus, String reason) { + this(currency, description, dailyLimit, avatarUuid, status, subStatus, reason, null, null, null); + } + + public MonetaryAccountBank(String currency, String description, Amount dailyLimit, String avatarUuid, String status, String subStatus, String reason, String reasonDescription) { + this(currency, description, dailyLimit, avatarUuid, status, subStatus, reason, reasonDescription, null, null); + } + + public MonetaryAccountBank(String currency, String description, Amount dailyLimit, String avatarUuid, String status, String subStatus, String reason, String reasonDescription, List notificationFilters) { + this(currency, description, dailyLimit, avatarUuid, status, subStatus, reason, reasonDescription, notificationFilters, null); + } + + public MonetaryAccountBank(String currency, String description, Amount dailyLimit, String avatarUuid, String status, String subStatus, String reason, String reasonDescription, List notificationFilters, MonetaryAccountSetting setting) { + this.currencyFieldForRequest = currency; + this.descriptionFieldForRequest = description; + this.dailyLimitFieldForRequest = dailyLimit; + this.avatarUuidFieldForRequest = avatarUuid; + this.statusFieldForRequest = status; + this.subStatusFieldForRequest = subStatus; + this.reasonFieldForRequest = reason; + this.reasonDescriptionFieldForRequest = reasonDescription; + this.notificationFiltersFieldForRequest = notificationFilters; + this.settingFieldForRequest = setting; + } + /** * Create new MonetaryAccountBank. * @param currency The currency of the MonetaryAccountBank as an ISO 4217 formatted currency @@ -244,7 +379,7 @@ public static BunqResponse create(String currency, String description, requestMap.put(FIELD_NOTIFICATION_FILTERS, notificationFilters); requestMap.put(FIELD_SETTING, setting); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); return processForId(responseRaw); @@ -358,7 +493,7 @@ public static BunqResponse update(Integer monetaryAccountBankId, String requestMap.put(FIELD_NOTIFICATION_FILTERS, notificationFilters); requestMap.put(FIELD_SETTING, setting); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), monetaryAccountBankId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountJoint.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountJoint.java index e915f6c5..78340f2f 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountJoint.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountJoint.java @@ -205,6 +205,178 @@ public class MonetaryAccountJoint extends BunqModel { @SerializedName("setting") private MonetaryAccountSetting setting; + /** + * The currency of the MonetaryAccountJoint as an ISO 4217 formatted currency code. + */ + @Expose + @SerializedName("currency_field_for_request") + private String currencyFieldForRequest; + + /** + * The description of the MonetaryAccountJoint. Defaults to 'bunq account'. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The daily spending limit Amount of the MonetaryAccountJoint. Defaults to 1000 EUR. Currency + * must match the MonetaryAccountJoint's currency. Limited to 10000 EUR. + */ + @Expose + @SerializedName("daily_limit_field_for_request") + private Amount dailyLimitFieldForRequest; + + /** + * The maximum Amount the MonetaryAccountJoint can be 'in the red'. Must be 0 EUR or omitted. + */ + @Expose + @SerializedName("overdraft_limit_field_for_request") + private Amount overdraftLimitFieldForRequest; + + /** + * The Aliases to add to MonetaryAccountJoint. Must all be confirmed first. Can mostly be + * ignored. + */ + @Expose + @SerializedName("alias_field_for_request") + private List aliasFieldForRequest; + + /** + * The UUID of the Avatar of the MonetaryAccountJoint. + */ + @Expose + @SerializedName("avatar_uuid_field_for_request") + private String avatarUuidFieldForRequest; + + /** + * The status of the MonetaryAccountJoint. Ignored in POST requests (always set to ACTIVE) can + * be CANCELLED or PENDING_REOPEN in PUT requests to cancel (close) or reopen the + * MonetaryAccountJoint. When updating the status and/or sub_status no other fields can be + * updated in the same request (and vice versa). + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The sub-status of the MonetaryAccountJoint providing extra information regarding the status. + * Should be ignored for POST requests. In case of PUT requests with status CANCELLED it can + * only be REDEMPTION_VOLUNTARY, while with status PENDING_REOPEN it can only be NONE. When + * updating the status and/or sub_status no other fields can be updated in the same request (and + * vice versa). + */ + @Expose + @SerializedName("sub_status_field_for_request") + private String subStatusFieldForRequest; + + /** + * The reason for voluntarily cancelling (closing) the MonetaryAccountJoint, can only be OTHER. + * Should only be specified if updating the status to CANCELLED. + */ + @Expose + @SerializedName("reason_field_for_request") + private String reasonFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("reason_description_field_for_request") + private String reasonDescriptionFieldForRequest; + + /** + * The users the account will be joint with. + */ + @Expose + @SerializedName("all_co_owner_field_for_request") + private List allCoOwnerFieldForRequest; + + /** + * The types of notifications that will result in a push notification or URL callback for this + * MonetaryAccountJoint. + */ + @Expose + @SerializedName("notification_filters_field_for_request") + private List notificationFiltersFieldForRequest; + + /** + * The settings of the MonetaryAccountJoint. + */ + @Expose + @SerializedName("setting_field_for_request") + private MonetaryAccountSetting settingFieldForRequest; + + public MonetaryAccountJoint() { + this(null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountJoint(String currency) { + this(currency, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner) { + this(currency, allCoOwner, null, null, null, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description) { + this(currency, allCoOwner, description, null, null, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description, Amount dailyLimit) { + this(currency, allCoOwner, description, dailyLimit, null, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description, Amount dailyLimit, Amount overdraftLimit) { + this(currency, allCoOwner, description, dailyLimit, overdraftLimit, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description, Amount dailyLimit, Amount overdraftLimit, List alias) { + this(currency, allCoOwner, description, dailyLimit, overdraftLimit, alias, null, null, null, null, null, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description, Amount dailyLimit, Amount overdraftLimit, List alias, String avatarUuid) { + this(currency, allCoOwner, description, dailyLimit, overdraftLimit, alias, avatarUuid, null, null, null, null, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description, Amount dailyLimit, Amount overdraftLimit, List alias, String avatarUuid, String status) { + this(currency, allCoOwner, description, dailyLimit, overdraftLimit, alias, avatarUuid, status, null, null, null, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description, Amount dailyLimit, Amount overdraftLimit, List alias, String avatarUuid, String status, String subStatus) { + this(currency, allCoOwner, description, dailyLimit, overdraftLimit, alias, avatarUuid, status, subStatus, null, null, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description, Amount dailyLimit, Amount overdraftLimit, List alias, String avatarUuid, String status, String subStatus, String reason) { + this(currency, allCoOwner, description, dailyLimit, overdraftLimit, alias, avatarUuid, status, subStatus, reason, null, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description, Amount dailyLimit, Amount overdraftLimit, List alias, String avatarUuid, String status, String subStatus, String reason, String reasonDescription) { + this(currency, allCoOwner, description, dailyLimit, overdraftLimit, alias, avatarUuid, status, subStatus, reason, reasonDescription, null, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description, Amount dailyLimit, Amount overdraftLimit, List alias, String avatarUuid, String status, String subStatus, String reason, String reasonDescription, List notificationFilters) { + this(currency, allCoOwner, description, dailyLimit, overdraftLimit, alias, avatarUuid, status, subStatus, reason, reasonDescription, notificationFilters, null); + } + + public MonetaryAccountJoint(String currency, List allCoOwner, String description, Amount dailyLimit, Amount overdraftLimit, List alias, String avatarUuid, String status, String subStatus, String reason, String reasonDescription, List notificationFilters, MonetaryAccountSetting setting) { + this.currencyFieldForRequest = currency; + this.descriptionFieldForRequest = description; + this.dailyLimitFieldForRequest = dailyLimit; + this.overdraftLimitFieldForRequest = overdraftLimit; + this.aliasFieldForRequest = alias; + this.avatarUuidFieldForRequest = avatarUuid; + this.statusFieldForRequest = status; + this.subStatusFieldForRequest = subStatus; + this.reasonFieldForRequest = reason; + this.reasonDescriptionFieldForRequest = reasonDescription; + this.allCoOwnerFieldForRequest = allCoOwner; + this.notificationFiltersFieldForRequest = notificationFilters; + this.settingFieldForRequest = setting; + } + /** * @param currency The currency of the MonetaryAccountJoint as an ISO 4217 formatted currency * code. @@ -257,7 +429,7 @@ public static BunqResponse create(String currency, List allCoO requestMap.put(FIELD_NOTIFICATION_FILTERS, notificationFilters); requestMap.put(FIELD_SETTING, setting); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); return processForId(responseRaw); @@ -381,7 +553,7 @@ public static BunqResponse update(Integer monetaryAccountJointId, Strin requestMap.put(FIELD_NOTIFICATION_FILTERS, notificationFilters); requestMap.put(FIELD_SETTING, setting); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), monetaryAccountJointId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountLight.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountLight.java index 8110c5f9..e32db6e5 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountLight.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountLight.java @@ -232,6 +232,140 @@ public class MonetaryAccountLight extends BunqModel { @SerializedName("setting") private MonetaryAccountSetting setting; + /** + * The currency of the MonetaryAccountLight as an ISO 4217 formatted currency code. + */ + @Expose + @SerializedName("currency_field_for_request") + private String currencyFieldForRequest; + + /** + * The description of the MonetaryAccountLight. Defaults to 'bunq account'. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The daily spending limit Amount of the MonetaryAccountLight. Defaults to 1000 EUR. Currency + * must match the MonetaryAccountLight's currency. Limited to 10000 EUR. + */ + @Expose + @SerializedName("daily_limit_field_for_request") + private Amount dailyLimitFieldForRequest; + + /** + * The UUID of the Avatar of the MonetaryAccountLight. + */ + @Expose + @SerializedName("avatar_uuid_field_for_request") + private String avatarUuidFieldForRequest; + + /** + * The status of the MonetaryAccountLight. Ignored in POST requests (always set to ACTIVE) can + * be CANCELLED or PENDING_REOPEN in PUT requests to cancel (close) or reopen the + * MonetaryAccountLight. When updating the status and/or sub_status no other fields can be + * updated in the same request (and vice versa). + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The sub-status of the MonetaryAccountLight providing extra information regarding the status. + * Should be ignored for POST requests and can only be REDEMPTION_VOLUNTARY for PUT requests + * with status CANCELLED. When updating the status and/or sub_status no other fields can be + * updated in the same request (and vice versa). + */ + @Expose + @SerializedName("sub_status_field_for_request") + private String subStatusFieldForRequest; + + /** + * The reason for voluntarily cancelling (closing) the MonetaryAccountBank, can only be OTHER. + * Should only be specified if updating the status to CANCELLED. + */ + @Expose + @SerializedName("reason_field_for_request") + private String reasonFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("reason_description_field_for_request") + private String reasonDescriptionFieldForRequest; + + /** + * The types of notifications that will result in a push notification or URL callback for this + * MonetaryAccountLight. + */ + @Expose + @SerializedName("notification_filters_field_for_request") + private List notificationFiltersFieldForRequest; + + /** + * The settings of the MonetaryAccountLight. + */ + @Expose + @SerializedName("setting_field_for_request") + private MonetaryAccountSetting settingFieldForRequest; + + public MonetaryAccountLight() { + this(null, null, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountLight(String currency) { + this(currency, null, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountLight(String currency, String description) { + this(currency, description, null, null, null, null, null, null, null, null); + } + + public MonetaryAccountLight(String currency, String description, Amount dailyLimit) { + this(currency, description, dailyLimit, null, null, null, null, null, null, null); + } + + public MonetaryAccountLight(String currency, String description, Amount dailyLimit, String avatarUuid) { + this(currency, description, dailyLimit, avatarUuid, null, null, null, null, null, null); + } + + public MonetaryAccountLight(String currency, String description, Amount dailyLimit, String avatarUuid, String status) { + this(currency, description, dailyLimit, avatarUuid, status, null, null, null, null, null); + } + + public MonetaryAccountLight(String currency, String description, Amount dailyLimit, String avatarUuid, String status, String subStatus) { + this(currency, description, dailyLimit, avatarUuid, status, subStatus, null, null, null, null); + } + + public MonetaryAccountLight(String currency, String description, Amount dailyLimit, String avatarUuid, String status, String subStatus, String reason) { + this(currency, description, dailyLimit, avatarUuid, status, subStatus, reason, null, null, null); + } + + public MonetaryAccountLight(String currency, String description, Amount dailyLimit, String avatarUuid, String status, String subStatus, String reason, String reasonDescription) { + this(currency, description, dailyLimit, avatarUuid, status, subStatus, reason, reasonDescription, null, null); + } + + public MonetaryAccountLight(String currency, String description, Amount dailyLimit, String avatarUuid, String status, String subStatus, String reason, String reasonDescription, List notificationFilters) { + this(currency, description, dailyLimit, avatarUuid, status, subStatus, reason, reasonDescription, notificationFilters, null); + } + + public MonetaryAccountLight(String currency, String description, Amount dailyLimit, String avatarUuid, String status, String subStatus, String reason, String reasonDescription, List notificationFilters, MonetaryAccountSetting setting) { + this.currencyFieldForRequest = currency; + this.descriptionFieldForRequest = description; + this.dailyLimitFieldForRequest = dailyLimit; + this.avatarUuidFieldForRequest = avatarUuid; + this.statusFieldForRequest = status; + this.subStatusFieldForRequest = subStatus; + this.reasonFieldForRequest = reason; + this.reasonDescriptionFieldForRequest = reasonDescription; + this.notificationFiltersFieldForRequest = notificationFilters; + this.settingFieldForRequest = setting; + } + /** * Create new MonetaryAccountLight. * @param currency The currency of the MonetaryAccountLight as an ISO 4217 formatted currency @@ -264,7 +398,7 @@ public static BunqResponse create(String currency, String description, customHeaders = new HashMap<>(); } - HashMap requestMap = new HashMap<>(); + HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_CURRENCY, currency); requestMap.put(FIELD_DESCRIPTION, description); requestMap.put(FIELD_DAILY_LIMIT, dailyLimit); @@ -276,7 +410,7 @@ public static BunqResponse create(String currency, String description, requestMap.put(FIELD_NOTIFICATION_FILTERS, notificationFilters); requestMap.put(FIELD_SETTING, setting); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); return processForId(responseRaw); @@ -389,7 +523,7 @@ public static BunqResponse update(Integer monetaryAccountLightId, Strin requestMap.put(FIELD_NOTIFICATION_FILTERS, notificationFilters); requestMap.put(FIELD_SETTING, setting); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), monetaryAccountLightId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountProfile.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountProfile.java index ac08f51e..fdb5db30 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountProfile.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccountProfile.java @@ -1,17 +1,11 @@ package com.bunq.sdk.model.generated.endpoint; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.MonetaryAccountProfileDrain; import com.bunq.sdk.model.generated.object.MonetaryAccountProfileFill; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** * Used to update and read up monetary account profiles, to keep the balance between specific @@ -39,6 +33,33 @@ public class MonetaryAccountProfile extends BunqModel { @SerializedName("profile_drain") private MonetaryAccountProfileDrain profileDrain; + /** + * The profile settings for triggering the fill of a monetary account. + */ + @Expose + @SerializedName("profile_fill_field_for_request") + private MonetaryAccountProfileFill profileFillFieldForRequest; + + /** + * The profile settings for moving excesses to a savings account + */ + @Expose + @SerializedName("profile_drain_field_for_request") + private MonetaryAccountProfileDrain profileDrainFieldForRequest; + + public MonetaryAccountProfile() { + this(null, null); + } + + public MonetaryAccountProfile(MonetaryAccountProfileFill profileFill) { + this(profileFill, null); + } + + public MonetaryAccountProfile(MonetaryAccountProfileFill profileFill, MonetaryAccountProfileDrain profileDrain) { + this.profileFillFieldForRequest = profileFill; + this.profileDrainFieldForRequest = profileDrain; + } + /** * The profile settings for triggering the fill of a monetary account. */ diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/Payment.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/Payment.java index 3c579c12..b1aa87bc 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/Payment.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/Payment.java @@ -4,11 +4,11 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Address; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.AttachmentMonetaryAccountPayment; import com.bunq.sdk.model.generated.object.Geolocation; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.Pointer; import com.bunq.sdk.model.generated.object.RequestInquiryReference; import com.google.gson.annotations.Expose; @@ -93,7 +93,7 @@ public class Payment extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The LabelMonetaryAccount containing the public information of the other (counterparty) side @@ -101,7 +101,7 @@ public class Payment extends BunqModel { */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The description for the Payment. Maximum 140 characters for Payments to external IBANs, 9000 @@ -225,6 +225,74 @@ public class Payment extends BunqModel { @SerializedName("request_reference_split_the_bill") private List requestReferenceSplitTheBill; + /** + * The Amount to transfer with the Payment. Must be bigger than 0 and smaller than the + * MonetaryAccount's balance. + */ + @Expose + @SerializedName("amount_field_for_request") + private Amount amountFieldForRequest; + + /** + * The Alias of the party we are transferring the money to. Can be an Alias of type EMAIL or + * PHONE_NUMBER (for bunq MonetaryAccounts or bunq.to payments) or IBAN (for external bank + * account). + */ + @Expose + @SerializedName("counterparty_alias_field_for_request") + private Pointer counterpartyAliasFieldForRequest; + + /** + * The description for the Payment. Maximum 140 characters for Payments to external IBANs, 9000 + * characters for Payments to only other bunq MonetaryAccounts. Field is required but can be an + * empty string. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The Attachments to attach to the Payment. + */ + @Expose + @SerializedName("attachment_field_for_request") + private List attachmentFieldForRequest; + + /** + * Optional data to be included with the Payment specific to the merchant. + */ + @Expose + @SerializedName("merchant_reference_field_for_request") + private String merchantReferenceFieldForRequest; + + public Payment() { + this(null, null, null, null, null); + } + + public Payment(Amount amount) { + this(amount, null, null, null, null); + } + + public Payment(Amount amount, Pointer counterpartyAlias) { + this(amount, counterpartyAlias, null, null, null); + } + + public Payment(Amount amount, Pointer counterpartyAlias, String description) { + this(amount, counterpartyAlias, description, null, null); + } + + public Payment(Amount amount, Pointer counterpartyAlias, String description, List attachment) { + this(amount, counterpartyAlias, description, attachment, null); + } + + public Payment(Amount amount, Pointer counterpartyAlias, String description, List attachment, String merchantReference) { + this.amountFieldForRequest = amount; + this.counterpartyAliasFieldForRequest = counterpartyAlias; + this.descriptionFieldForRequest = description; + this.attachmentFieldForRequest = attachment; + this.merchantReferenceFieldForRequest = merchantReference; + } + /** * Create a new Payment. * @param amount The Amount to transfer with the Payment. Must be bigger than 0 and smaller than @@ -253,7 +321,7 @@ public static BunqResponse create(Amount amount, Pointer counterpartyAl requestMap.put(FIELD_ATTACHMENT, attachment); requestMap.put(FIELD_MERCHANT_REFERENCE, merchantReference); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -397,11 +465,11 @@ public void setAmount(Amount amount) { * The LabelMonetaryAccount containing the public information of 'this' (party) side of the * Payment. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } @@ -409,11 +477,11 @@ public void setAlias(MonetaryAccountReference alias) { * The LabelMonetaryAccount containing the public information of the other (counterparty) side * of the Payment. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentBatch.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentBatch.java index f2b9a211..1e5f18b9 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentBatch.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentBatch.java @@ -42,6 +42,21 @@ public class PaymentBatch extends BunqModel { @SerializedName("payments") private List payments; + /** + * The list of payments we want to send in a single batch. + */ + @Expose + @SerializedName("payments_field_for_request") + private List paymentsFieldForRequest; + + public PaymentBatch() { + this(null); + } + + public PaymentBatch(List payments) { + this.paymentsFieldForRequest = payments; + } + /** * Create a payment batch by sending an array of single payment objects, that will become part * of the batch. @@ -57,7 +72,7 @@ public static BunqResponse create(List payments, Integer monet HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_PAYMENTS, payments); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -87,7 +102,7 @@ public static BunqResponse update(Integer paymentBatchId, Integer monet HashMap requestMap = new HashMap<>(); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), paymentBatchId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentChat.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentChat.java index 2d6fe77f..4f73e130 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentChat.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/PaymentChat.java @@ -62,6 +62,21 @@ public class PaymentChat extends BunqModel { @SerializedName("unread_message_count") private Integer unreadMessageCount; + /** + * The id of the last read message. + */ + @Expose + @SerializedName("last_read_message_id_field_for_request") + private Integer lastReadMessageIdFieldForRequest; + + public PaymentChat() { + this(null); + } + + public PaymentChat(Integer lastReadMessageId) { + this.lastReadMessageIdFieldForRequest = lastReadMessageId; + } + /** * Create a chat for a specific payment. * @param lastReadMessageId The id of the last read message. @@ -76,7 +91,7 @@ public static BunqResponse create(Integer paymentId, Integer monetaryAc HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_LAST_READ_MESSAGE_ID, lastReadMessageId); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), paymentId), requestBytes, customHeaders); return processForId(responseRaw); @@ -112,7 +127,7 @@ public static BunqResponse update(Integer paymentId, Integer paymentCha HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_LAST_READ_MESSAGE_ID, lastReadMessageId); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), paymentId, paymentChatId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/PermittedIp.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/PermittedIp.java index 4b313df1..33616c4c 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/PermittedIp.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/PermittedIp.java @@ -51,6 +51,34 @@ public class PermittedIp extends BunqModel { @SerializedName("status") private String status; + /** + * The IP address. + */ + @Expose + @SerializedName("ip_field_for_request") + private String ipFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + public PermittedIp() { + this(null, null); + } + + public PermittedIp(String ip) { + this(ip, null); + } + + public PermittedIp(String ip, String status) { + this.ipFieldForRequest = ip; + this.statusFieldForRequest = status; + } + /** */ public static BunqResponse get(Integer credentialPasswordIpId, Integer permittedIpId, Map params, Map customHeaders) { @@ -92,7 +120,7 @@ public static BunqResponse create(Integer credentialPasswordIpId, Strin requestMap.put(FIELD_IP, ip); requestMap.put(FIELD_STATUS, status); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), credentialPasswordIpId), requestBytes, customHeaders); return processForId(responseRaw); @@ -149,7 +177,7 @@ public static BunqResponse update(Integer credentialPasswordIpId, Integ HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_STATUS, status); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), credentialPasswordIpId, permittedIpId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/PromotionDisplay.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/PromotionDisplay.java index 60dd4cb4..39ef2db2 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/PromotionDisplay.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/PromotionDisplay.java @@ -4,7 +4,7 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; @@ -45,7 +45,7 @@ public class PromotionDisplay extends BunqModel { */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The event description of the promotion appearing on time line. @@ -61,6 +61,21 @@ public class PromotionDisplay extends BunqModel { @SerializedName("status") private String status; + /** + * The status of the promotion. User can set it to discarded. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + public PromotionDisplay() { + this(null); + } + + public PromotionDisplay(String status) { + this.statusFieldForRequest = status; + } + /** */ public static BunqResponse get(Integer promotionDisplayId, Map params, Map customHeaders) { @@ -95,7 +110,7 @@ public static BunqResponse update(Integer promotionDisplayId, String st HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_STATUS, status); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), promotionDisplayId), requestBytes, customHeaders); return processForId(responseRaw); @@ -123,11 +138,11 @@ public void setId(Integer id) { /** * The alias of the user you received the promotion from. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiry.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiry.java index 658dbd9a..fdc11a6c 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiry.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiry.java @@ -4,11 +4,11 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Address; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.BunqId; import com.bunq.sdk.model.generated.object.Geolocation; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.LabelUser; import com.bunq.sdk.model.generated.object.Pointer; import com.bunq.sdk.model.generated.object.RequestReferenceSplitTheBillAnchorObject; @@ -137,7 +137,7 @@ public class RequestInquiry extends BunqModel { */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The description of the inquiry. @@ -245,6 +245,189 @@ public class RequestInquiry extends BunqModel { @SerializedName("reference_split_the_bill") private RequestReferenceSplitTheBillAnchorObject referenceSplitTheBill; + /** + * The Amount requested to be paid by the person the RequestInquiry is sent to. Must be bigger + * than 0. + */ + @Expose + @SerializedName("amount_inquired_field_for_request") + private Amount amountInquiredFieldForRequest; + + /** + * The Alias of the party we are requesting the money from. Can be an Alias of type EMAIL, + * PHONE_NUMBER or IBAN. In case the EMAIL or PHONE_NUMBER Alias does not refer to a bunq + * monetary account, 'allow_bunqme' needs to be 'true' in order to trigger the creation of a + * bunq.me request. Otherwise no request inquiry will be sent. + */ + @Expose + @SerializedName("counterparty_alias_field_for_request") + private Pointer counterpartyAliasFieldForRequest; + + /** + * The description for the RequestInquiry. Maximum 9000 characters. Field is required but can be + * an empty string. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The Attachments to attach to the RequestInquiry. + */ + @Expose + @SerializedName("attachment_field_for_request") + private List attachmentFieldForRequest; + + /** + * Optional data to be included with the RequestInquiry specific to the merchant. Has to be + * unique for the same source MonetaryAccount. + */ + @Expose + @SerializedName("merchant_reference_field_for_request") + private String merchantReferenceFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The minimum age the user accepting the RequestInquiry must have. Defaults to not checking. If + * set, must be between 12 and 100 inclusive. + */ + @Expose + @SerializedName("minimum_age_field_for_request") + private Integer minimumAgeFieldForRequest; + + /** + * Whether a billing and shipping address must be provided when paying the request. Possible + * values are: BILLING, SHIPPING, BILLING_SHIPPING, NONE, OPTIONAL. Default is NONE. + */ + @Expose + @SerializedName("require_address_field_for_request") + private String requireAddressFieldForRequest; + + /** + * [DEPRECATED] Whether or not the accepting user can give an extra tip on top of the requested + * Amount. Defaults to false. + */ + @Expose + @SerializedName("want_tip_field_for_request") + private Boolean wantTipFieldForRequest; + + /** + * [DEPRECATED] Whether or not the accepting user can choose to accept with a lower amount than + * requested. Defaults to false. + */ + @Expose + @SerializedName("allow_amount_lower_field_for_request") + private Boolean allowAmountLowerFieldForRequest; + + /** + * [DEPRECATED] Whether or not the accepting user can choose to accept with a higher amount than + * requested. Defaults to false. + */ + @Expose + @SerializedName("allow_amount_higher_field_for_request") + private Boolean allowAmountHigherFieldForRequest; + + /** + * Whether or not sending a bunq.me request is allowed. + */ + @Expose + @SerializedName("allow_bunqme_field_for_request") + private Boolean allowBunqmeFieldForRequest; + + /** + * The URL which the user is sent to after accepting or rejecting the Request. + */ + @Expose + @SerializedName("redirect_url_field_for_request") + private String redirectUrlFieldForRequest; + + /** + * The ID of the associated event if the request was made using 'split the bill'. + */ + @Expose + @SerializedName("event_id_field_for_request") + private Integer eventIdFieldForRequest; + + public RequestInquiry() { + this(null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired) { + this(amountInquired, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias) { + this(amountInquired, counterpartyAlias, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description) { + this(amountInquired, counterpartyAlias, description, null, null, null, null, null, null, null, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme) { + this(amountInquired, counterpartyAlias, description, allowBunqme, null, null, null, null, null, null, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme, List attachment) { + this(amountInquired, counterpartyAlias, description, allowBunqme, attachment, null, null, null, null, null, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme, List attachment, String merchantReference) { + this(amountInquired, counterpartyAlias, description, allowBunqme, attachment, merchantReference, null, null, null, null, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme, List attachment, String merchantReference, String status) { + this(amountInquired, counterpartyAlias, description, allowBunqme, attachment, merchantReference, status, null, null, null, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme, List attachment, String merchantReference, String status, Integer minimumAge) { + this(amountInquired, counterpartyAlias, description, allowBunqme, attachment, merchantReference, status, minimumAge, null, null, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme, List attachment, String merchantReference, String status, Integer minimumAge, String requireAddress) { + this(amountInquired, counterpartyAlias, description, allowBunqme, attachment, merchantReference, status, minimumAge, requireAddress, null, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme, List attachment, String merchantReference, String status, Integer minimumAge, String requireAddress, Boolean wantTip) { + this(amountInquired, counterpartyAlias, description, allowBunqme, attachment, merchantReference, status, minimumAge, requireAddress, wantTip, null, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme, List attachment, String merchantReference, String status, Integer minimumAge, String requireAddress, Boolean wantTip, Boolean allowAmountLower) { + this(amountInquired, counterpartyAlias, description, allowBunqme, attachment, merchantReference, status, minimumAge, requireAddress, wantTip, allowAmountLower, null, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme, List attachment, String merchantReference, String status, Integer minimumAge, String requireAddress, Boolean wantTip, Boolean allowAmountLower, Boolean allowAmountHigher) { + this(amountInquired, counterpartyAlias, description, allowBunqme, attachment, merchantReference, status, minimumAge, requireAddress, wantTip, allowAmountLower, allowAmountHigher, null, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme, List attachment, String merchantReference, String status, Integer minimumAge, String requireAddress, Boolean wantTip, Boolean allowAmountLower, Boolean allowAmountHigher, String redirectUrl) { + this(amountInquired, counterpartyAlias, description, allowBunqme, attachment, merchantReference, status, minimumAge, requireAddress, wantTip, allowAmountLower, allowAmountHigher, redirectUrl, null); + } + + public RequestInquiry(Amount amountInquired, Pointer counterpartyAlias, String description, Boolean allowBunqme, List attachment, String merchantReference, String status, Integer minimumAge, String requireAddress, Boolean wantTip, Boolean allowAmountLower, Boolean allowAmountHigher, String redirectUrl, Integer eventId) { + this.amountInquiredFieldForRequest = amountInquired; + this.counterpartyAliasFieldForRequest = counterpartyAlias; + this.descriptionFieldForRequest = description; + this.attachmentFieldForRequest = attachment; + this.merchantReferenceFieldForRequest = merchantReference; + this.statusFieldForRequest = status; + this.minimumAgeFieldForRequest = minimumAge; + this.requireAddressFieldForRequest = requireAddress; + this.wantTipFieldForRequest = wantTip; + this.allowAmountLowerFieldForRequest = allowAmountLower; + this.allowAmountHigherFieldForRequest = allowAmountHigher; + this.allowBunqmeFieldForRequest = allowBunqme; + this.redirectUrlFieldForRequest = redirectUrl; + this.eventIdFieldForRequest = eventId; + } + /** * Create a new payment request. * @param amountInquired The Amount requested to be paid by the person the RequestInquiry is @@ -299,7 +482,7 @@ public static BunqResponse create(Amount amountInquired, Pointer counte requestMap.put(FIELD_REDIRECT_URL, redirectUrl); requestMap.put(FIELD_EVENT_ID, eventId); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -384,7 +567,7 @@ public static BunqResponse update(Integer requestInquiryId, Inte HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_STATUS, status); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), requestInquiryId), requestBytes, customHeaders); return fromJson(RequestInquiry.class, responseRaw, OBJECT_TYPE_PUT); @@ -564,11 +747,11 @@ public void setUserAliasRevoked(LabelUser userAliasRevoked) { * The LabelMonetaryAccount with the public information of the MonetaryAccount the money was * requested from. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiryBatch.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiryBatch.java index 8df221c0..004e57b5 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiryBatch.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiryBatch.java @@ -62,6 +62,57 @@ public class RequestInquiryBatch extends BunqModel { @SerializedName("reference_split_the_bill") private RequestReferenceSplitTheBillAnchorObject referenceSplitTheBill; + /** + * The list of request inquiries we want to send in 1 batch. + */ + @Expose + @SerializedName("request_inquiries_field_for_request") + private List requestInquiriesFieldForRequest; + + /** + * The status of the request. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The total amount originally inquired for this batch. + */ + @Expose + @SerializedName("total_amount_inquired_field_for_request") + private Amount totalAmountInquiredFieldForRequest; + + /** + * The ID of the associated event if the request batch was made using 'split the bill'. + */ + @Expose + @SerializedName("event_id_field_for_request") + private Integer eventIdFieldForRequest; + + public RequestInquiryBatch() { + this(null, null, null, null); + } + + public RequestInquiryBatch(List requestInquiries) { + this(requestInquiries, null, null, null); + } + + public RequestInquiryBatch(List requestInquiries, Amount totalAmountInquired) { + this(requestInquiries, totalAmountInquired, null, null); + } + + public RequestInquiryBatch(List requestInquiries, Amount totalAmountInquired, String status) { + this(requestInquiries, totalAmountInquired, status, null); + } + + public RequestInquiryBatch(List requestInquiries, Amount totalAmountInquired, String status, Integer eventId) { + this.requestInquiriesFieldForRequest = requestInquiries; + this.statusFieldForRequest = status; + this.totalAmountInquiredFieldForRequest = totalAmountInquired; + this.eventIdFieldForRequest = eventId; + } + /** * Create a request batch by sending an array of single request objects, that will become part * of the batch. @@ -84,7 +135,7 @@ public static BunqResponse create(List requestInquiries requestMap.put(FIELD_TOTAL_AMOUNT_INQUIRED, totalAmountInquired); requestMap.put(FIELD_EVENT_ID, eventId); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -128,7 +179,7 @@ public static BunqResponse update(Integer requestInquiryBatchId, Intege HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_STATUS, status); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), requestInquiryBatchId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiryChat.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiryChat.java index 87f181bf..75a1b426 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiryChat.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestInquiryChat.java @@ -65,6 +65,21 @@ public class RequestInquiryChat extends BunqModel { @SerializedName("unread_message_count") private Integer unreadMessageCount; + /** + * The id of the last read message. + */ + @Expose + @SerializedName("last_read_message_id_field_for_request") + private Integer lastReadMessageIdFieldForRequest; + + public RequestInquiryChat() { + this(null); + } + + public RequestInquiryChat(Integer lastReadMessageId) { + this.lastReadMessageIdFieldForRequest = lastReadMessageId; + } + /** * Create a chat for a specific request inquiry. * @param lastReadMessageId The id of the last read message. @@ -79,7 +94,7 @@ public static BunqResponse create(Integer requestInquiryId, Integer mon HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_LAST_READ_MESSAGE_ID, lastReadMessageId); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), requestInquiryId), requestBytes, customHeaders); return processForId(responseRaw); @@ -115,7 +130,7 @@ public static BunqResponse update(Integer requestInquiryId, Integer req HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_LAST_READ_MESSAGE_ID, lastReadMessageId); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), requestInquiryId, requestInquiryChatId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestResponse.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestResponse.java index 90dc693e..872fbe59 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestResponse.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestResponse.java @@ -4,11 +4,11 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Address; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.Attachment; import com.bunq.sdk.model.generated.object.Geolocation; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.RequestInquiryReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -125,7 +125,7 @@ public class RequestResponse extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The LabelMonetaryAccount with the public information of the MonetaryAccount that is @@ -133,7 +133,7 @@ public class RequestResponse extends BunqModel { */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The Attachments attached to the RequestResponse. @@ -236,6 +236,59 @@ public class RequestResponse extends BunqModel { @SerializedName("request_reference_split_the_bill") private List requestReferenceSplitTheBill; + /** + * The Amount the user decides to pay. + */ + @Expose + @SerializedName("amount_responded_field_for_request") + private Amount amountRespondedFieldForRequest; + + /** + * The responding status of the RequestResponse. Can be ACCEPTED or REJECTED. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("address_shipping_field_for_request") + private Address addressShippingFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("address_billing_field_for_request") + private Address addressBillingFieldForRequest; + + public RequestResponse() { + this(null, null, null, null); + } + + public RequestResponse(String status) { + this(status, null, null, null); + } + + public RequestResponse(String status, Amount amountResponded) { + this(status, amountResponded, null, null); + } + + public RequestResponse(String status, Amount amountResponded, Address addressShipping) { + this(status, amountResponded, addressShipping, null); + } + + public RequestResponse(String status, Amount amountResponded, Address addressShipping, Address addressBilling) { + this.amountRespondedFieldForRequest = amountResponded; + this.statusFieldForRequest = status; + this.addressShippingFieldForRequest = addressShipping; + this.addressBillingFieldForRequest = addressBilling; + } + /** * Update the status to accept or reject the RequestResponse. * @param amountResponded The Amount the user decides to pay. @@ -260,7 +313,7 @@ public static BunqResponse update(Integer requestResponseId, In requestMap.put(FIELD_ADDRESS_SHIPPING, addressShipping); requestMap.put(FIELD_ADDRESS_BILLING, addressBilling); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), requestResponseId), requestBytes, customHeaders); return fromJson(RequestResponse.class, responseRaw, OBJECT_TYPE_PUT); @@ -454,11 +507,11 @@ public void setDescription(String description) { * The LabelMonetaryAccount with the public information of the MonetaryAccount this * RequestResponse was received on. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } @@ -466,11 +519,11 @@ public void setAlias(MonetaryAccountReference alias) { * The LabelMonetaryAccount with the public information of the MonetaryAccount that is * requesting money with this RequestResponse. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestResponseChat.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestResponseChat.java index 0dd40d04..b305c0e5 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestResponseChat.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/RequestResponseChat.java @@ -65,6 +65,21 @@ public class RequestResponseChat extends BunqModel { @SerializedName("unread_message_count") private Integer unreadMessageCount; + /** + * The id of the last read message. + */ + @Expose + @SerializedName("last_read_message_id_field_for_request") + private Integer lastReadMessageIdFieldForRequest; + + public RequestResponseChat() { + this(null); + } + + public RequestResponseChat(Integer lastReadMessageId) { + this.lastReadMessageIdFieldForRequest = lastReadMessageId; + } + /** * Create a chat for a specific request response. * @param lastReadMessageId The id of the last read message. @@ -79,7 +94,7 @@ public static BunqResponse create(Integer requestResponseId, Integer mo HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_LAST_READ_MESSAGE_ID, lastReadMessageId); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), requestResponseId), requestBytes, customHeaders); return processForId(responseRaw); @@ -115,7 +130,7 @@ public static BunqResponse update(Integer requestResponseId, Integer re HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_LAST_READ_MESSAGE_ID, lastReadMessageId); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), requestResponseId, requestResponseChatId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/SandboxUser.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/SandboxUser.java index 09e33e56..79cd27b2 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/SandboxUser.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/SandboxUser.java @@ -44,7 +44,7 @@ public static BunqResponse create(Map customHeaders HashMap requestMap = new HashMap<>(); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(ENDPOINT_URL_CREATE, requestBytes, customHeaders); return fromJson(SandboxUser.class, responseRaw, OBJECT_TYPE_POST); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/Schedule.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/Schedule.java index 9f278567..3e4b98db 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/Schedule.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/Schedule.java @@ -79,6 +79,58 @@ public class Schedule extends BunqModel { @SerializedName("object") private ScheduleAnchorObject object; + /** + * The schedule start time (UTC). + */ + @Expose + @SerializedName("time_start_field_for_request") + private String timeStartFieldForRequest; + + /** + * The schedule end time (UTC). + */ + @Expose + @SerializedName("time_end_field_for_request") + private String timeEndFieldForRequest; + + /** + * The schedule recurrence unit, options: ONCE, HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY + */ + @Expose + @SerializedName("recurrence_unit_field_for_request") + private String recurrenceUnitFieldForRequest; + + /** + * The schedule recurrence size. For example size 4 and unit WEEKLY means the recurrence is + * every 4 weeks. + */ + @Expose + @SerializedName("recurrence_size_field_for_request") + private Integer recurrenceSizeFieldForRequest; + + public Schedule() { + this(null, null, null, null); + } + + public Schedule(String timeStart) { + this(timeStart, null, null, null); + } + + public Schedule(String timeStart, String recurrenceUnit) { + this(timeStart, recurrenceUnit, null, null); + } + + public Schedule(String timeStart, String recurrenceUnit, Integer recurrenceSize) { + this(timeStart, recurrenceUnit, recurrenceSize, null); + } + + public Schedule(String timeStart, String recurrenceUnit, Integer recurrenceSize, String timeEnd) { + this.timeStartFieldForRequest = timeStart; + this.timeEndFieldForRequest = timeEnd; + this.recurrenceUnitFieldForRequest = recurrenceUnit; + this.recurrenceSizeFieldForRequest = recurrenceSize; + } + /** * Get a specific schedule definition for a given monetary account. */ diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ScheduleInstance.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ScheduleInstance.java index 1bb44e13..cb32db91 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ScheduleInstance.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ScheduleInstance.java @@ -88,6 +88,21 @@ public class ScheduleInstance extends BunqModel { @SerializedName("request_reference_split_the_bill") private List requestReferenceSplitTheBill; + /** + * Change the state of the scheduleInstance from FAILED_USER_ERROR to RETRY. + */ + @Expose + @SerializedName("state_field_for_request") + private String stateFieldForRequest; + + public ScheduleInstance() { + this(null); + } + + public ScheduleInstance(String state) { + this.stateFieldForRequest = state; + } + /** */ public static BunqResponse get(Integer scheduleId, Integer scheduleInstanceId, Integer monetaryAccountId, Map params, Map customHeaders) { @@ -130,7 +145,7 @@ public static BunqResponse update(Integer scheduleId, Integer scheduleI HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_STATE, state); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), scheduleId, scheduleInstanceId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/SchedulePayment.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/SchedulePayment.java index ea583e86..42c7c0a6 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/SchedulePayment.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/SchedulePayment.java @@ -52,6 +52,33 @@ public class SchedulePayment extends BunqModel { @SerializedName("schedule") private Schedule schedule; + /** + * The payment details. + */ + @Expose + @SerializedName("payment_field_for_request") + private SchedulePaymentEntry paymentFieldForRequest; + + /** + * The schedule details when creating or updating a scheduled payment. + */ + @Expose + @SerializedName("schedule_field_for_request") + private Schedule scheduleFieldForRequest; + + public SchedulePayment() { + this(null, null); + } + + public SchedulePayment(SchedulePaymentEntry payment) { + this(payment, null); + } + + public SchedulePayment(SchedulePaymentEntry payment, Schedule schedule) { + this.paymentFieldForRequest = payment; + this.scheduleFieldForRequest = schedule; + } + /** * @param payment The payment details. * @param schedule The schedule details when creating or updating a scheduled payment. @@ -67,7 +94,7 @@ public static BunqResponse create(SchedulePaymentEntry payment, Schedul requestMap.put(FIELD_PAYMENT, payment); requestMap.put(FIELD_SCHEDULE, schedule); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -167,7 +194,7 @@ public static BunqResponse update(Integer schedulePaymentId, Integer mo requestMap.put(FIELD_PAYMENT, payment); requestMap.put(FIELD_SCHEDULE, schedule); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), schedulePaymentId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/SchedulePaymentBatch.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/SchedulePaymentBatch.java index b0b510e4..60b0cbf3 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/SchedulePaymentBatch.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/SchedulePaymentBatch.java @@ -45,6 +45,33 @@ public class SchedulePaymentBatch extends BunqModel { @SerializedName("schedule") private Schedule schedule; + /** + * The payment details. + */ + @Expose + @SerializedName("payments_field_for_request") + private List paymentsFieldForRequest; + + /** + * The schedule details when creating a scheduled payment. + */ + @Expose + @SerializedName("schedule_field_for_request") + private Schedule scheduleFieldForRequest; + + public SchedulePaymentBatch() { + this(null, null); + } + + public SchedulePaymentBatch(List payments) { + this(payments, null); + } + + public SchedulePaymentBatch(List payments, Schedule schedule) { + this.paymentsFieldForRequest = payments; + this.scheduleFieldForRequest = schedule; + } + /** * @param payments The payment details. * @param schedule The schedule details when creating a scheduled payment. @@ -60,7 +87,7 @@ public static BunqResponse create(List payments, requestMap.put(FIELD_PAYMENTS, payments); requestMap.put(FIELD_SCHEDULE, schedule); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -97,7 +124,7 @@ public static BunqResponse update(Integer schedulePaymentBatchId, Integ requestMap.put(FIELD_PAYMENTS, payments); requestMap.put(FIELD_SCHEDULE, schedule); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), schedulePaymentBatchId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankInquiry.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankInquiry.java index ecb8440e..3f5bea5f 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankInquiry.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankInquiry.java @@ -4,7 +4,7 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.LabelUser; import com.bunq.sdk.model.generated.object.Pointer; import com.bunq.sdk.model.generated.object.ShareDetail; @@ -52,7 +52,7 @@ public class ShareInviteBankInquiry extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The user who created the share. @@ -134,6 +134,96 @@ public class ShareInviteBankInquiry extends BunqModel { @SerializedName("id") private Integer id; + /** + * The pointer of the user to share with. + */ + @Expose + @SerializedName("counter_user_alias_field_for_request") + private Pointer counterUserAliasFieldForRequest; + + /** + * The id of the draft share invite bank. + */ + @Expose + @SerializedName("draft_share_invite_bank_id_field_for_request") + private Integer draftShareInviteBankIdFieldForRequest; + + /** + * The share details. Only one of these objects may be passed. + */ + @Expose + @SerializedName("share_detail_field_for_request") + private ShareDetail shareDetailFieldForRequest; + + /** + * 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). + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The share type, either STANDARD or MUTUAL. + */ + @Expose + @SerializedName("share_type_field_for_request") + private String shareTypeFieldForRequest; + + /** + * The start date of this share. + */ + @Expose + @SerializedName("start_date_field_for_request") + private String startDateFieldForRequest; + + /** + * The expiration date of this share. + */ + @Expose + @SerializedName("end_date_field_for_request") + private String endDateFieldForRequest; + + public ShareInviteBankInquiry() { + this(null, null, null, null, null, null, null); + } + + public ShareInviteBankInquiry(Pointer counterUserAlias) { + this(counterUserAlias, null, null, null, null, null, null); + } + + public ShareInviteBankInquiry(Pointer counterUserAlias, ShareDetail shareDetail) { + this(counterUserAlias, shareDetail, null, null, null, null, null); + } + + public ShareInviteBankInquiry(Pointer counterUserAlias, ShareDetail shareDetail, String status) { + this(counterUserAlias, shareDetail, status, null, null, null, null); + } + + public ShareInviteBankInquiry(Pointer counterUserAlias, ShareDetail shareDetail, String status, Integer draftShareInviteBankId) { + this(counterUserAlias, shareDetail, status, draftShareInviteBankId, null, null, null); + } + + public ShareInviteBankInquiry(Pointer counterUserAlias, ShareDetail shareDetail, String status, Integer draftShareInviteBankId, String shareType) { + this(counterUserAlias, shareDetail, status, draftShareInviteBankId, shareType, null, null); + } + + public ShareInviteBankInquiry(Pointer counterUserAlias, ShareDetail shareDetail, String status, Integer draftShareInviteBankId, String shareType, String startDate) { + this(counterUserAlias, shareDetail, status, draftShareInviteBankId, shareType, startDate, null); + } + + public ShareInviteBankInquiry(Pointer counterUserAlias, ShareDetail shareDetail, String status, Integer draftShareInviteBankId, String shareType, String startDate, String endDate) { + this.counterUserAliasFieldForRequest = counterUserAlias; + this.draftShareInviteBankIdFieldForRequest = draftShareInviteBankId; + this.shareDetailFieldForRequest = shareDetail; + this.statusFieldForRequest = status; + this.shareTypeFieldForRequest = shareType; + this.startDateFieldForRequest = startDate; + this.endDateFieldForRequest = endDate; + } + /** * Create a new share inquiry for a monetary account, specifying the permission the other bunq * user will have on it. @@ -164,7 +254,7 @@ public static BunqResponse create(Pointer counterUserAlias, ShareDetail requestMap.put(FIELD_START_DATE, startDate); requestMap.put(FIELD_END_DATE, endDate); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId)), requestBytes, customHeaders); return processForId(responseRaw); @@ -256,7 +346,7 @@ public static BunqResponse update(Integer shareInviteBankInquiryId, Int requestMap.put(FIELD_START_DATE, startDate); requestMap.put(FIELD_END_DATE, endDate); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), shareInviteBankInquiryId), requestBytes, customHeaders); return processForId(responseRaw); @@ -312,11 +402,11 @@ public static BunqResponse> list(Integer monetaryAc /** * The label of the monetary account that's being shared. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankResponse.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankResponse.java index 483f1d7f..cf8c77f1 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankResponse.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankResponse.java @@ -4,7 +4,7 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.LabelUser; import com.bunq.sdk.model.generated.object.ShareDetail; import com.google.gson.annotations.Expose; @@ -43,7 +43,7 @@ public class ShareInviteBankResponse extends BunqModel { */ @Expose @SerializedName("counter_alias") - private MonetaryAccountReference counterAlias; + private LabelMonetaryAccount counterAlias; /** * The user who cancelled the share if it has been revoked or rejected. @@ -111,6 +111,24 @@ public class ShareInviteBankResponse extends BunqModel { @SerializedName("description") private String description; + /** + * 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) + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + public ShareInviteBankResponse() { + this(null); + } + + public ShareInviteBankResponse(String status) { + this.statusFieldForRequest = status; + } + /** * Return the details of a specific share a user was invited to. */ @@ -150,7 +168,7 @@ public static BunqResponse update(Integer shareInviteBankResponseId, St HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_STATUS, status); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), shareInviteBankResponseId), requestBytes, customHeaders); return processForId(responseRaw); @@ -185,11 +203,11 @@ public static BunqResponse> list(Map tabAttachmentFieldForRequest; + + /** + * The quantity of the TabItem. Formatted as a number containing up to 15 digits, up to 15 + * decimals and using a dot. + */ + @Expose + @SerializedName("quantity_field_for_request") + private String quantityFieldForRequest; + + /** + * The money amount of the TabItem. Will not change the value of the corresponding Tab. + */ + @Expose + @SerializedName("amount_field_for_request") + private Amount amountFieldForRequest; + + public TabItemShop() { + this(null, null, null, null, null, null); + } + + public TabItemShop(String description) { + this(description, null, null, null, null, null); + } + + public TabItemShop(String description, String eanCode) { + this(description, eanCode, null, null, null, null); + } + + public TabItemShop(String description, String eanCode, String avatarAttachmentUuid) { + this(description, eanCode, avatarAttachmentUuid, null, null, null); + } + + public TabItemShop(String description, String eanCode, String avatarAttachmentUuid, List tabAttachment) { + this(description, eanCode, avatarAttachmentUuid, tabAttachment, null, null); + } + + public TabItemShop(String description, String eanCode, String avatarAttachmentUuid, List tabAttachment, String quantity) { + this(description, eanCode, avatarAttachmentUuid, tabAttachment, quantity, null); + } + + public TabItemShop(String description, String eanCode, String avatarAttachmentUuid, List tabAttachment, String quantity, Amount amount) { + this.descriptionFieldForRequest = description; + this.eanCodeFieldForRequest = eanCode; + this.avatarAttachmentUuidFieldForRequest = avatarAttachmentUuid; + this.tabAttachmentFieldForRequest = tabAttachment; + this.quantityFieldForRequest = quantity; + this.amountFieldForRequest = amount; + } + /** * Create a new TabItem for a given Tab. * @param description The TabItem's brief description. Can't be empty and must be no longer than @@ -126,7 +202,7 @@ public static BunqResponse create(Integer cashRegisterId, String tabUui requestMap.put(FIELD_QUANTITY, quantity); requestMap.put(FIELD_AMOUNT, amount); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), requestBytes, customHeaders); return processForId(responseRaw); @@ -199,7 +275,7 @@ public static BunqResponse update(Integer cashRegisterId, String tabUui requestMap.put(FIELD_QUANTITY, quantity); requestMap.put(FIELD_AMOUNT, amount); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid, tabItemShopId), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItemShopBatch.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItemShopBatch.java index 34516745..a70b5d34 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItemShopBatch.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItemShopBatch.java @@ -34,6 +34,21 @@ public class TabItemShopBatch extends BunqModel { @SerializedName("tab_items") private List tabItems; + /** + * The list of tab items we want to create in a single batch. Limited to 50 items per batch. + */ + @Expose + @SerializedName("tab_items_field_for_request") + private List tabItemsFieldForRequest; + + public TabItemShopBatch() { + this(null); + } + + public TabItemShopBatch(List tabItems) { + this.tabItemsFieldForRequest = tabItems; + } + /** * Create tab items as a batch. * @param tabItems The list of tab items we want to create in a single batch. Limited to 50 @@ -49,7 +64,7 @@ public static BunqResponse create(Integer cashRegisterId, String tabUui HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_TAB_ITEMS, tabItems); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUuid), requestBytes, customHeaders); return processForId(responseRaw); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabUsageMultiple.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabUsageMultiple.java index 0aa31913..33fe1243 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabUsageMultiple.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabUsageMultiple.java @@ -4,10 +4,10 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.BunqId; import com.bunq.sdk.model.generated.object.Geolocation; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.TabVisibility; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -158,7 +158,7 @@ public class TabUsageMultiple extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The location of the cash register that created this tab. @@ -182,6 +182,164 @@ public class TabUsageMultiple extends BunqModel { @SerializedName("tab_attachment") private List tabAttachment; + /** + * The description of the TabUsageMultiple. Maximum 9000 characters. Field is required but can + * be an empty string. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The status of the TabUsageMultiple. On creation the status must be set to OPEN. You can + * change the status from OPEN to PAYABLE. If the TabUsageMultiple gets paid the status will + * remain PAYABLE. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The total amount of the Tab. Must be a positive amount. As long as the tab has the status + * OPEN you can change the total amount. This amount is not affected by the amounts of the + * TabItems. However, if you've created any TabItems for a Tab the sum of the amounts of these + * items must be equal to the total_amount of the Tab when you change its status to PAYABLE + */ + @Expose + @SerializedName("amount_total_field_for_request") + private Amount amountTotalFieldForRequest; + + /** + * [DEPRECATED] Whether or not a higher amount can be paid. + */ + @Expose + @SerializedName("allow_amount_higher_field_for_request") + private Boolean allowAmountHigherFieldForRequest; + + /** + * [DEPRECATED] Whether or not a lower amount can be paid. + */ + @Expose + @SerializedName("allow_amount_lower_field_for_request") + private Boolean allowAmountLowerFieldForRequest; + + /** + * [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. + */ + @Expose + @SerializedName("want_tip_field_for_request") + private Boolean wantTipFieldForRequest; + + /** + * The minimum age of the user paying the Tab. + */ + @Expose + @SerializedName("minimum_age_field_for_request") + private Integer minimumAgeFieldForRequest; + + /** + * Whether a billing and shipping address must be provided when paying the Tab. Possible values + * are: BILLING, SHIPPING, BILLING_SHIPPING, NONE, OPTIONAL. Default is NONE. + */ + @Expose + @SerializedName("require_address_field_for_request") + private String requireAddressFieldForRequest; + + /** + * The URL which the user is sent to after paying the Tab. + */ + @Expose + @SerializedName("redirect_url_field_for_request") + private String redirectUrlFieldForRequest; + + /** + * The visibility of a Tab. A Tab can be visible trough NearPay, the QR code of the CashRegister + * and its own QR code. + */ + @Expose + @SerializedName("visibility_field_for_request") + private TabVisibility visibilityFieldForRequest; + + /** + * The moment when this Tab expires. Can be at most 365 days into the future. + */ + @Expose + @SerializedName("expiration_field_for_request") + private String expirationFieldForRequest; + + /** + * An array of attachments that describe the tab. Uploaded through the POST + * /user/{userid}/attachment-tab endpoint. + */ + @Expose + @SerializedName("tab_attachment_field_for_request") + private List tabAttachmentFieldForRequest; + + public TabUsageMultiple() { + this(null, null, null, null, null, null, null, null, null, null, null, null); + } + + public TabUsageMultiple(String description) { + this(description, null, null, null, null, null, null, null, null, null, null, null); + } + + public TabUsageMultiple(String description, String status) { + this(description, status, null, null, null, null, null, null, null, null, null, null); + } + + public TabUsageMultiple(String description, String status, Amount amountTotal) { + this(description, status, amountTotal, null, null, null, null, null, null, null, null, null); + } + + public TabUsageMultiple(String description, String status, Amount amountTotal, Boolean allowAmountHigher) { + this(description, status, amountTotal, allowAmountHigher, null, null, null, null, null, null, null, null); + } + + public TabUsageMultiple(String description, String status, Amount amountTotal, Boolean allowAmountHigher, Boolean allowAmountLower) { + this(description, status, amountTotal, allowAmountHigher, allowAmountLower, null, null, null, null, null, null, null); + } + + public TabUsageMultiple(String description, String status, Amount amountTotal, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip) { + this(description, status, amountTotal, allowAmountHigher, allowAmountLower, wantTip, null, null, null, null, null, null); + } + + public TabUsageMultiple(String description, String status, Amount amountTotal, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge) { + this(description, status, amountTotal, allowAmountHigher, allowAmountLower, wantTip, minimumAge, null, null, null, null, null); + } + + public TabUsageMultiple(String description, String status, Amount amountTotal, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge, String requireAddress) { + this(description, status, amountTotal, allowAmountHigher, allowAmountLower, wantTip, minimumAge, requireAddress, null, null, null, null); + } + + public TabUsageMultiple(String description, String status, Amount amountTotal, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge, String requireAddress, String redirectUrl) { + this(description, status, amountTotal, allowAmountHigher, allowAmountLower, wantTip, minimumAge, requireAddress, redirectUrl, null, null, null); + } + + public TabUsageMultiple(String description, String status, Amount amountTotal, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge, String requireAddress, String redirectUrl, TabVisibility visibility) { + this(description, status, amountTotal, allowAmountHigher, allowAmountLower, wantTip, minimumAge, requireAddress, redirectUrl, visibility, null, null); + } + + public TabUsageMultiple(String description, String status, Amount amountTotal, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge, String requireAddress, String redirectUrl, TabVisibility visibility, String expiration) { + this(description, status, amountTotal, allowAmountHigher, allowAmountLower, wantTip, minimumAge, requireAddress, redirectUrl, visibility, expiration, null); + } + + public TabUsageMultiple(String description, String status, Amount amountTotal, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge, String requireAddress, String redirectUrl, TabVisibility visibility, String expiration, List tabAttachment) { + this.descriptionFieldForRequest = description; + this.statusFieldForRequest = status; + this.amountTotalFieldForRequest = amountTotal; + this.allowAmountHigherFieldForRequest = allowAmountHigher; + this.allowAmountLowerFieldForRequest = allowAmountLower; + this.wantTipFieldForRequest = wantTip; + this.minimumAgeFieldForRequest = minimumAge; + this.requireAddressFieldForRequest = requireAddress; + this.redirectUrlFieldForRequest = redirectUrl; + this.visibilityFieldForRequest = visibility; + this.expirationFieldForRequest = expiration; + this.tabAttachmentFieldForRequest = tabAttachment; + } + /** * Create a TabUsageMultiple. On creation the status must be set to OPEN * @param description The description of the TabUsageMultiple. Maximum 9000 characters. Field is @@ -231,7 +389,7 @@ public static BunqResponse create(Integer cashRegisterId, String descrip requestMap.put(FIELD_EXPIRATION, expiration); requestMap.put(FIELD_TAB_ATTACHMENT, tabAttachment); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), cashRegisterId), requestBytes, customHeaders); return processForUuid(responseRaw); @@ -330,7 +488,7 @@ public static BunqResponse update(Integer cashRegisterId, String tabUsag requestMap.put(FIELD_EXPIRATION, expiration); requestMap.put(FIELD_TAB_ATTACHMENT, tabAttachment); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUsageMultipleUuid), requestBytes, customHeaders); return processForUuid(responseRaw); @@ -594,11 +752,11 @@ public void setExpiration(String expiration) { /** * The alias of the party that owns this tab. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabUsageSingle.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabUsageSingle.java index 0b89d916..86e26d94 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabUsageSingle.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabUsageSingle.java @@ -4,10 +4,10 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.BunqId; import com.bunq.sdk.model.generated.object.Geolocation; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.bunq.sdk.model.generated.object.TabVisibility; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; @@ -173,7 +173,7 @@ public class TabUsageSingle extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The location of the cash register that created this tab. @@ -197,6 +197,178 @@ public class TabUsageSingle extends BunqModel { @SerializedName("tab_attachment") private List tabAttachment; + /** + * The reference of the Tab, as defined by the owner. This reference will be set for any payment + * that is generated by this tab. Must be unique among all the owner's tabs for the used + * monetary account. + */ + @Expose + @SerializedName("merchant_reference_field_for_request") + private String merchantReferenceFieldForRequest; + + /** + * The description of the Tab. Maximum 9000 characters. Field is required but can be an empty + * string. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The status of the Tab. On creation the status must be set to OPEN. You can change the status + * from OPEN to WAITING_FOR_PAYMENT. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The total amount of the Tab. Must be a positive amount. As long as the tab has the status + * OPEN you can change the total amount. This amount is not affected by the amounts of the + * TabItems. However, if you've created any TabItems for a Tab the sum of the amounts of these + * items must be equal to the total_amount of the Tab when you change its status to + * WAITING_FOR_PAYMENT. + */ + @Expose + @SerializedName("amount_total_field_for_request") + private Amount amountTotalFieldForRequest; + + /** + * [DEPRECATED] Whether or not a higher amount can be paid. + */ + @Expose + @SerializedName("allow_amount_higher_field_for_request") + private Boolean allowAmountHigherFieldForRequest; + + /** + * [DEPRECATED] Whether or not a lower amount can be paid. + */ + @Expose + @SerializedName("allow_amount_lower_field_for_request") + private Boolean allowAmountLowerFieldForRequest; + + /** + * [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. + */ + @Expose + @SerializedName("want_tip_field_for_request") + private Boolean wantTipFieldForRequest; + + /** + * The minimum age of the user paying the Tab. + */ + @Expose + @SerializedName("minimum_age_field_for_request") + private Integer minimumAgeFieldForRequest; + + /** + * Whether a billing and shipping address must be provided when paying the Tab. Possible values + * are: BILLING, SHIPPING, BILLING_SHIPPING, NONE, OPTIONAL. Default is NONE. + */ + @Expose + @SerializedName("require_address_field_for_request") + private String requireAddressFieldForRequest; + + /** + * The URL which the user is sent to after paying the Tab. + */ + @Expose + @SerializedName("redirect_url_field_for_request") + private String redirectUrlFieldForRequest; + + /** + * The visibility of a Tab. A Tab can be visible trough NearPay, the QR code of the CashRegister + * and its own QR code. + */ + @Expose + @SerializedName("visibility_field_for_request") + private TabVisibility visibilityFieldForRequest; + + /** + * The moment when this Tab expires. Can be at most 1 hour into the future. + */ + @Expose + @SerializedName("expiration_field_for_request") + private String expirationFieldForRequest; + + /** + * An array of attachments that describe the tab. Uploaded through the POST + * /user/{userid}/attachment-tab endpoint. + */ + @Expose + @SerializedName("tab_attachment_field_for_request") + private List tabAttachmentFieldForRequest; + + public TabUsageSingle() { + this(null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public TabUsageSingle(String description) { + this(description, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public TabUsageSingle(String description, String status) { + this(description, status, null, null, null, null, null, null, null, null, null, null, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal) { + this(description, status, amountTotal, null, null, null, null, null, null, null, null, null, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal, String merchantReference) { + this(description, status, amountTotal, merchantReference, null, null, null, null, null, null, null, null, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal, String merchantReference, Boolean allowAmountHigher) { + this(description, status, amountTotal, merchantReference, allowAmountHigher, null, null, null, null, null, null, null, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal, String merchantReference, Boolean allowAmountHigher, Boolean allowAmountLower) { + this(description, status, amountTotal, merchantReference, allowAmountHigher, allowAmountLower, null, null, null, null, null, null, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal, String merchantReference, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip) { + this(description, status, amountTotal, merchantReference, allowAmountHigher, allowAmountLower, wantTip, null, null, null, null, null, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal, String merchantReference, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge) { + this(description, status, amountTotal, merchantReference, allowAmountHigher, allowAmountLower, wantTip, minimumAge, null, null, null, null, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal, String merchantReference, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge, String requireAddress) { + this(description, status, amountTotal, merchantReference, allowAmountHigher, allowAmountLower, wantTip, minimumAge, requireAddress, null, null, null, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal, String merchantReference, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge, String requireAddress, String redirectUrl) { + this(description, status, amountTotal, merchantReference, allowAmountHigher, allowAmountLower, wantTip, minimumAge, requireAddress, redirectUrl, null, null, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal, String merchantReference, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge, String requireAddress, String redirectUrl, TabVisibility visibility) { + this(description, status, amountTotal, merchantReference, allowAmountHigher, allowAmountLower, wantTip, minimumAge, requireAddress, redirectUrl, visibility, null, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal, String merchantReference, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge, String requireAddress, String redirectUrl, TabVisibility visibility, String expiration) { + this(description, status, amountTotal, merchantReference, allowAmountHigher, allowAmountLower, wantTip, minimumAge, requireAddress, redirectUrl, visibility, expiration, null); + } + + public TabUsageSingle(String description, String status, Amount amountTotal, String merchantReference, Boolean allowAmountHigher, Boolean allowAmountLower, Boolean wantTip, Integer minimumAge, String requireAddress, String redirectUrl, TabVisibility visibility, String expiration, List tabAttachment) { + this.merchantReferenceFieldForRequest = merchantReference; + this.descriptionFieldForRequest = description; + this.statusFieldForRequest = status; + this.amountTotalFieldForRequest = amountTotal; + this.allowAmountHigherFieldForRequest = allowAmountHigher; + this.allowAmountLowerFieldForRequest = allowAmountLower; + this.wantTipFieldForRequest = wantTip; + this.minimumAgeFieldForRequest = minimumAge; + this.requireAddressFieldForRequest = requireAddress; + this.redirectUrlFieldForRequest = redirectUrl; + this.visibilityFieldForRequest = visibility; + this.expirationFieldForRequest = expiration; + this.tabAttachmentFieldForRequest = tabAttachment; + } + /** * Create a TabUsageSingle. The initial status must be OPEN * @param description The description of the Tab. Maximum 9000 characters. Field is required but @@ -249,7 +421,7 @@ public static BunqResponse create(Integer cashRegisterId, String descrip requestMap.put(FIELD_EXPIRATION, expiration); requestMap.put(FIELD_TAB_ATTACHMENT, tabAttachment); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), cashRegisterId), requestBytes, customHeaders); return processForUuid(responseRaw); @@ -350,7 +522,7 @@ public static BunqResponse update(Integer cashRegisterId, String tabUsag requestMap.put(FIELD_EXPIRATION, expiration); requestMap.put(FIELD_TAB_ATTACHMENT, tabAttachment); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId(), determineMonetaryAccountId(monetaryAccountId), cashRegisterId, tabUsageSingleUuid), requestBytes, customHeaders); return processForUuid(responseRaw); @@ -636,11 +808,11 @@ public void setExpiration(String expiration) { /** * The alias of the party that owns this tab. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TokenQrRequestIdeal.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TokenQrRequestIdeal.java index 1552e283..f6ed553c 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TokenQrRequestIdeal.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TokenQrRequestIdeal.java @@ -4,11 +4,11 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.object.Address; import com.bunq.sdk.model.generated.object.Amount; import com.bunq.sdk.model.generated.object.Attachment; import com.bunq.sdk.model.generated.object.Geolocation; +import com.bunq.sdk.model.generated.object.LabelMonetaryAccount; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; @@ -89,7 +89,7 @@ public class TokenQrRequestIdeal extends BunqModel { */ @Expose @SerializedName("alias") - private MonetaryAccountReference alias; + private LabelMonetaryAccount alias; /** * The LabelMonetaryAccount with the public information of the MonetaryAccount that is @@ -97,7 +97,7 @@ public class TokenQrRequestIdeal extends BunqModel { */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The description for the RequestResponse provided by the requesting party. Maximum 9000 @@ -191,6 +191,21 @@ public class TokenQrRequestIdeal extends BunqModel { @SerializedName("eligible_whitelist_id") private Integer eligibleWhitelistId; + /** + * The token passed from a site or read from a QR code. + */ + @Expose + @SerializedName("token_field_for_request") + private String tokenFieldForRequest; + + public TokenQrRequestIdeal() { + this(null); + } + + public TokenQrRequestIdeal(String token) { + this.tokenFieldForRequest = token; + } + /** * Create a request from an ideal transaction. * @param token The token passed from a site or read from a QR code. @@ -205,7 +220,7 @@ public static BunqResponse create(String token, Map requestMap = new HashMap<>(); requestMap.put(FIELD_TOKEN, token); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); return fromJson(TokenQrRequestIdeal.class, responseRaw, OBJECT_TYPE_POST); @@ -289,11 +304,11 @@ public void setAmountResponded(Amount amountResponded) { * The LabelMonetaryAccount with the public information of the MonetaryAccount this * RequestResponse was received on. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } @@ -301,11 +316,11 @@ public void setAlias(MonetaryAccountReference alias) { * The LabelMonetaryAccount with the public information of the MonetaryAccount that is * requesting money with this RequestResponse. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TokenQrRequestSofort.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TokenQrRequestSofort.java index a06f72bb..3f850dd0 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TokenQrRequestSofort.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TokenQrRequestSofort.java @@ -4,6 +4,8 @@ import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; import com.bunq.sdk.model.core.BunqModel; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import java.util.HashMap; @@ -30,6 +32,21 @@ public class TokenQrRequestSofort extends BunqModel { */ protected static final String OBJECT_TYPE_POST = "RequestResponse"; + /** + * The token passed from a site or read from a QR code. + */ + @Expose + @SerializedName("token_field_for_request") + private String tokenFieldForRequest; + + public TokenQrRequestSofort() { + this(null); + } + + public TokenQrRequestSofort(String token) { + this.tokenFieldForRequest = token; + } + /** * Create a request from an SOFORT transaction. * @param token The token passed from a site or read from a QR code. @@ -41,10 +58,10 @@ public static BunqResponse create(String token, Map(); } - HashMap requestMap = new HashMap<>(); + HashMap requestMap = new HashMap<>(); requestMap.put(FIELD_TOKEN, token); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.post(String.format(ENDPOINT_URL_CREATE, determineUserId()), requestBytes, customHeaders); return fromJson(TokenQrRequestSofort.class, responseRaw, OBJECT_TYPE_POST); diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/User.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/User.java index 369e5048..888e4ced 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/User.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/User.java @@ -56,7 +56,7 @@ public class User extends BunqModel implements AnchorObjectInterface { /** * Get a specific user. */ - public static BunqResponse get(Map params, Map customHeaders) { + public static BunqResponse get(Integer userId, Map params, Map customHeaders) { ApiClient apiClient = new ApiClient(getApiContext()); BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, determineUserId()), params, customHeaders); @@ -64,11 +64,15 @@ public static BunqResponse get(Map params, Map get() { - return get(null, null); + return get(null, null, null); } - public static BunqResponse get(Map params) { - return get(params, null); + public static BunqResponse get(Integer userId) { + return get(userId, null, null); + } + + public static BunqResponse get(Integer userId, Map params) { + return get(userId, params, null); } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/UserCompany.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/UserCompany.java index 91efb906..e3a6d3ef 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/UserCompany.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/UserCompany.java @@ -280,10 +280,198 @@ public class UserCompany extends BunqModel { @SerializedName("billing_contract") private List billingContract; + /** + * The company name. + */ + @Expose + @SerializedName("name_field_for_request") + private String nameFieldForRequest; + + /** + * The company's nick name. + */ + @Expose + @SerializedName("public_nick_name_field_for_request") + private String publicNickNameFieldForRequest; + + /** + * The public UUID of the company's avatar. + */ + @Expose + @SerializedName("avatar_uuid_field_for_request") + private String avatarUuidFieldForRequest; + + /** + * The user's main address. + */ + @Expose + @SerializedName("address_main_field_for_request") + private Address addressMainFieldForRequest; + + /** + * The company's postal address. + */ + @Expose + @SerializedName("address_postal_field_for_request") + private Address addressPostalFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("language_field_for_request") + private String languageFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("region_field_for_request") + private String regionFieldForRequest; + + /** + * The country where the company is registered. + */ + @Expose + @SerializedName("country_field_for_request") + private String countryFieldForRequest; + + /** + * The names and birth dates of the company's ultimate beneficiary owners. Minimum zero, maximum + * four. + */ + @Expose + @SerializedName("ubo_field_for_request") + private List uboFieldForRequest; + + /** + * The company's chamber of commerce number. + */ + @Expose + @SerializedName("chamber_of_commerce_number_field_for_request") + private String chamberOfCommerceNumberFieldForRequest; + + /** + * The user status. Can be: ACTIVE, SIGNUP, RECOVERY. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The user sub-status. Can be: NONE, FACE_RESET, APPROVAL, APPROVAL_DIRECTOR, APPROVAL_PARENT, + * APPROVAL_SUPPORT, COUNTER_IBAN, IDEAL or SUBMIT. + */ + @Expose + @SerializedName("sub_status_field_for_request") + private String subStatusFieldForRequest; + + /** + * The setting for the session timeout of the company in seconds. + */ + @Expose + @SerializedName("session_timeout_field_for_request") + private Integer sessionTimeoutFieldForRequest; + + /** + * The amount the company can pay in the session without asking for credentials. + */ + @Expose + @SerializedName("daily_limit_without_confirmation_login_field_for_request") + private Amount dailyLimitWithoutConfirmationLoginFieldForRequest; + + /** + * The types of notifications that will result in a push notification or URL callback for this + * UserCompany. + */ + @Expose + @SerializedName("notification_filters_field_for_request") + private List notificationFiltersFieldForRequest; + + public UserCompany() { + this(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserCompany(Address addressMain) { + this(addressMain, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserCompany(Address addressMain, String language) { + this(addressMain, language, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region) { + this(addressMain, language, region, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name) { + this(addressMain, language, region, name, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName) { + this(addressMain, language, region, name, publicNickName, null, null, null, null, null, null, null, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName, String avatarUuid) { + this(addressMain, language, region, name, publicNickName, avatarUuid, null, null, null, null, null, null, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName, String avatarUuid, Address addressPostal) { + this(addressMain, language, region, name, publicNickName, avatarUuid, addressPostal, null, null, null, null, null, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName, String avatarUuid, Address addressPostal, String country) { + this(addressMain, language, region, name, publicNickName, avatarUuid, addressPostal, country, null, null, null, null, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName, String avatarUuid, Address addressPostal, String country, List ubo) { + this(addressMain, language, region, name, publicNickName, avatarUuid, addressPostal, country, ubo, null, null, null, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName, String avatarUuid, Address addressPostal, String country, List ubo, String chamberOfCommerceNumber) { + this(addressMain, language, region, name, publicNickName, avatarUuid, addressPostal, country, ubo, chamberOfCommerceNumber, null, null, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName, String avatarUuid, Address addressPostal, String country, List ubo, String chamberOfCommerceNumber, String status) { + this(addressMain, language, region, name, publicNickName, avatarUuid, addressPostal, country, ubo, chamberOfCommerceNumber, status, null, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName, String avatarUuid, Address addressPostal, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus) { + this(addressMain, language, region, name, publicNickName, avatarUuid, addressPostal, country, ubo, chamberOfCommerceNumber, status, subStatus, null, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName, String avatarUuid, Address addressPostal, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout) { + this(addressMain, language, region, name, publicNickName, avatarUuid, addressPostal, country, ubo, chamberOfCommerceNumber, status, subStatus, sessionTimeout, null, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName, String avatarUuid, Address addressPostal, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin) { + this(addressMain, language, region, name, publicNickName, avatarUuid, addressPostal, country, ubo, chamberOfCommerceNumber, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, null); + } + + public UserCompany(Address addressMain, String language, String region, String name, String publicNickName, String avatarUuid, Address addressPostal, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, List notificationFilters) { + this.nameFieldForRequest = name; + this.publicNickNameFieldForRequest = publicNickName; + this.avatarUuidFieldForRequest = avatarUuid; + this.addressMainFieldForRequest = addressMain; + this.addressPostalFieldForRequest = addressPostal; + this.languageFieldForRequest = language; + this.regionFieldForRequest = region; + this.countryFieldForRequest = country; + this.uboFieldForRequest = ubo; + this.chamberOfCommerceNumberFieldForRequest = chamberOfCommerceNumber; + this.statusFieldForRequest = status; + this.subStatusFieldForRequest = subStatus; + this.sessionTimeoutFieldForRequest = sessionTimeout; + this.dailyLimitWithoutConfirmationLoginFieldForRequest = dailyLimitWithoutConfirmationLogin; + this.notificationFiltersFieldForRequest = notificationFilters; + } + /** * Get a specific company. */ - public static BunqResponse get(Map params, Map customHeaders) { + public static BunqResponse get(Integer userCompanyId, Map params, Map customHeaders) { ApiClient apiClient = new ApiClient(getApiContext()); BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, determineUserId()), params, customHeaders); @@ -291,11 +479,15 @@ public static BunqResponse get(Map params, Map get() { - return get(null, null); + return get(null, null, null); + } + + public static BunqResponse get(Integer userCompanyId) { + return get(userCompanyId, null, null); } - public static BunqResponse get(Map params) { - return get(params, null); + public static BunqResponse get(Integer userCompanyId, Map params) { + return get(userCompanyId, params, null); } /** @@ -322,7 +514,7 @@ public static BunqResponse get(Map params) { * @param notificationFilters The types of notifications that will result in a push notification * or URL callback for this UserCompany. */ - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, List notificationFilters, Map customHeaders) { + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, List notificationFilters, Map customHeaders) { ApiClient apiClient = new ApiClient(getApiContext()); if (customHeaders == null) { @@ -346,70 +538,74 @@ public static BunqResponse update(String name, String publicNickName, S requestMap.put(FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN, dailyLimitWithoutConfirmationLogin); requestMap.put(FIELD_NOTIFICATION_FILTERS, notificationFilters); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId()), requestBytes, customHeaders); return processForId(responseRaw); } - public static BunqResponse update(String name) { - return update(name, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId) { + return update(userCompanyId, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public static BunqResponse update(Integer userCompanyId, String name) { + return update(userCompanyId, name, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName) { - return update(name, publicNickName, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName) { + return update(userCompanyId, name, publicNickName, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid) { - return update(name, publicNickName, avatarUuid, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid) { + return update(userCompanyId, name, publicNickName, avatarUuid, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain) { - return update(name, publicNickName, avatarUuid, addressMain, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, language, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, language, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, null, null, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, null, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, null, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, status, null, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, status, null, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, status, subStatus, null, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, status, subStatus, null, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, status, subStatus, sessionTimeout, null, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, status, subStatus, sessionTimeout, null, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, null, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, null, null); } - public static BunqResponse update(String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, List notificationFilters) { - return update(name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, notificationFilters, null); + public static BunqResponse update(Integer userCompanyId, String name, String publicNickName, String avatarUuid, Address addressMain, Address addressPostal, String language, String region, String country, List ubo, String chamberOfCommerceNumber, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, List notificationFilters) { + return update(userCompanyId, name, publicNickName, avatarUuid, addressMain, addressPostal, language, region, country, ubo, chamberOfCommerceNumber, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, notificationFilters, null); } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/UserLight.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/UserLight.java index de5151af..0d5639f2 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/UserLight.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/UserLight.java @@ -291,6 +291,336 @@ public class UserLight extends BunqModel { @SerializedName("notification_filters") private List notificationFilters; + /** + * The user's first name. + */ + @Expose + @SerializedName("first_name_field_for_request") + private String firstNameFieldForRequest; + + /** + * The user's middle name. + */ + @Expose + @SerializedName("middle_name_field_for_request") + private String middleNameFieldForRequest; + + /** + * The user's last name. + */ + @Expose + @SerializedName("last_name_field_for_request") + private String lastNameFieldForRequest; + + /** + * The user's public nick name. + */ + @Expose + @SerializedName("public_nick_name_field_for_request") + private String publicNickNameFieldForRequest; + + /** + * The user's main address. + */ + @Expose + @SerializedName("address_main_field_for_request") + private Address addressMainFieldForRequest; + + /** + * The user's postal address. + */ + @Expose + @SerializedName("address_postal_field_for_request") + private Address addressPostalFieldForRequest; + + /** + * The public UUID of the user's avatar. + */ + @Expose + @SerializedName("avatar_uuid_field_for_request") + private String avatarUuidFieldForRequest; + + /** + * The user's social security number. + */ + @Expose + @SerializedName("social_security_number_field_for_request") + private String socialSecurityNumberFieldForRequest; + + /** + * The user's tax residence numbers for different countries. + */ + @Expose + @SerializedName("tax_resident_field_for_request") + private List taxResidentFieldForRequest; + + /** + * The type of identification document the user registered with. + */ + @Expose + @SerializedName("document_type_field_for_request") + private String documentTypeFieldForRequest; + + /** + * The identification document number the user registered with. + */ + @Expose + @SerializedName("document_number_field_for_request") + private String documentNumberFieldForRequest; + + /** + * The country which issued the identification document the user registered with. + */ + @Expose + @SerializedName("document_country_of_issuance_field_for_request") + private String documentCountryOfIssuanceFieldForRequest; + + /** + * The reference to the uploaded picture/scan of the front side of the identification document. + */ + @Expose + @SerializedName("document_front_attachment_id_field_for_request") + private Integer documentFrontAttachmentIdFieldForRequest; + + /** + * The reference to the uploaded picture/scan of the back side of the identification document. + */ + @Expose + @SerializedName("document_back_attachment_id_field_for_request") + private Integer documentBackAttachmentIdFieldForRequest; + + /** + * The user's date of birth. Accepts ISO8601 date formats. + */ + @Expose + @SerializedName("date_of_birth_field_for_request") + private String dateOfBirthFieldForRequest; + + /** + * The user's place of birth. + */ + @Expose + @SerializedName("place_of_birth_field_for_request") + private String placeOfBirthFieldForRequest; + + /** + * The user's country of birth. Formatted as a SO 3166-1 alpha-2 country code. + */ + @Expose + @SerializedName("country_of_birth_field_for_request") + private String countryOfBirthFieldForRequest; + + /** + * The user's nationality. Formatted as a SO 3166-1 alpha-2 country code. + */ + @Expose + @SerializedName("nationality_field_for_request") + private String nationalityFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("language_field_for_request") + private String languageFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("region_field_for_request") + private String regionFieldForRequest; + + /** + * The user's gender. Can be: MALE, FEMALE and UNKNOWN. + */ + @Expose + @SerializedName("gender_field_for_request") + private String genderFieldForRequest; + + /** + * The user status. You are not allowed to update the status via PUT. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The user sub-status. Can be updated to SUBMIT to apply for a full bunq account. + */ + @Expose + @SerializedName("sub_status_field_for_request") + private String subStatusFieldForRequest; + + /** + * The legal guardian of the user. Required for minors. + */ + @Expose + @SerializedName("legal_guardian_alias_field_for_request") + private Pointer legalGuardianAliasFieldForRequest; + + /** + * The setting for the session timeout of the user in seconds. + */ + @Expose + @SerializedName("session_timeout_field_for_request") + private Integer sessionTimeoutFieldForRequest; + + /** + * The amount the user can pay in the session without asking for credentials. + */ + @Expose + @SerializedName("daily_limit_without_confirmation_login_field_for_request") + private Amount dailyLimitWithoutConfirmationLoginFieldForRequest; + + /** + * The types of notifications that will result in a push notification or URL callback for this + * UserLight. + */ + @Expose + @SerializedName("notification_filters_field_for_request") + private List notificationFiltersFieldForRequest; + + public UserLight() { + this(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName) { + this(firstName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName) { + this(firstName, lastName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName) { + this(firstName, lastName, publicNickName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain) { + this(firstName, lastName, publicNickName, addressMain, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, documentType, null, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType, String documentNumber) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, documentType, documentNumber, null, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, documentType, documentNumber, documentCountryOfIssuance, null, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, null, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, null, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String placeOfBirth) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, placeOfBirth, null, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String placeOfBirth, String countryOfBirth) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, placeOfBirth, countryOfBirth, null, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String placeOfBirth, String countryOfBirth, String nationality) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, placeOfBirth, countryOfBirth, nationality, null, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String placeOfBirth, String countryOfBirth, String nationality, String gender) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, placeOfBirth, countryOfBirth, nationality, gender, null, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String placeOfBirth, String countryOfBirth, String nationality, String gender, Pointer legalGuardianAlias) { + this(firstName, lastName, publicNickName, addressMain, avatarUuid, dateOfBirth, language, region, status, subStatus, sessionTimeout, dailyLimitWithoutConfirmationLogin, middleName, addressPostal, socialSecurityNumber, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, placeOfBirth, countryOfBirth, nationality, gender, legalGuardianAlias, null); + } + + public UserLight(String firstName, String lastName, String publicNickName, Address addressMain, String avatarUuid, String dateOfBirth, String language, String region, String status, String subStatus, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String middleName, Address addressPostal, String socialSecurityNumber, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String placeOfBirth, String countryOfBirth, String nationality, String gender, Pointer legalGuardianAlias, List notificationFilters) { + this.firstNameFieldForRequest = firstName; + this.middleNameFieldForRequest = middleName; + this.lastNameFieldForRequest = lastName; + this.publicNickNameFieldForRequest = publicNickName; + this.addressMainFieldForRequest = addressMain; + this.addressPostalFieldForRequest = addressPostal; + this.avatarUuidFieldForRequest = avatarUuid; + this.socialSecurityNumberFieldForRequest = socialSecurityNumber; + this.taxResidentFieldForRequest = taxResident; + this.documentTypeFieldForRequest = documentType; + this.documentNumberFieldForRequest = documentNumber; + this.documentCountryOfIssuanceFieldForRequest = documentCountryOfIssuance; + this.documentFrontAttachmentIdFieldForRequest = documentFrontAttachmentId; + this.documentBackAttachmentIdFieldForRequest = documentBackAttachmentId; + this.dateOfBirthFieldForRequest = dateOfBirth; + this.placeOfBirthFieldForRequest = placeOfBirth; + this.countryOfBirthFieldForRequest = countryOfBirth; + this.nationalityFieldForRequest = nationality; + this.languageFieldForRequest = language; + this.regionFieldForRequest = region; + this.genderFieldForRequest = gender; + this.statusFieldForRequest = status; + this.subStatusFieldForRequest = subStatus; + this.legalGuardianAliasFieldForRequest = legalGuardianAlias; + this.sessionTimeoutFieldForRequest = sessionTimeout; + this.dailyLimitWithoutConfirmationLoginFieldForRequest = dailyLimitWithoutConfirmationLogin; + this.notificationFiltersFieldForRequest = notificationFilters; + } + /** * Get a specific bunq light user. */ diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/UserPerson.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/UserPerson.java index 03f3401c..6f1881d6 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/UserPerson.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/UserPerson.java @@ -293,10 +293,352 @@ public class UserPerson extends BunqModel { @SerializedName("notification_filters") private List notificationFilters; + /** + * The person's first name. + */ + @Expose + @SerializedName("first_name_field_for_request") + private String firstNameFieldForRequest; + + /** + * The person's middle name. + */ + @Expose + @SerializedName("middle_name_field_for_request") + private String middleNameFieldForRequest; + + /** + * The person's last name. + */ + @Expose + @SerializedName("last_name_field_for_request") + private String lastNameFieldForRequest; + + /** + * The person's public nick name. + */ + @Expose + @SerializedName("public_nick_name_field_for_request") + private String publicNickNameFieldForRequest; + + /** + * The user's main address. + */ + @Expose + @SerializedName("address_main_field_for_request") + private Address addressMainFieldForRequest; + + /** + * The person's postal address. + */ + @Expose + @SerializedName("address_postal_field_for_request") + private Address addressPostalFieldForRequest; + + /** + * The public UUID of the user's avatar. + */ + @Expose + @SerializedName("avatar_uuid_field_for_request") + private String avatarUuidFieldForRequest; + + /** + * The user's tax residence numbers for different countries. + */ + @Expose + @SerializedName("tax_resident_field_for_request") + private List taxResidentFieldForRequest; + + /** + * The type of identification document the person registered with. + */ + @Expose + @SerializedName("document_type_field_for_request") + private String documentTypeFieldForRequest; + + /** + * The identification document number the person registered with. + */ + @Expose + @SerializedName("document_number_field_for_request") + private String documentNumberFieldForRequest; + + /** + * The country which issued the identification document the person registered with. + */ + @Expose + @SerializedName("document_country_of_issuance_field_for_request") + private String documentCountryOfIssuanceFieldForRequest; + + /** + * The reference to the uploaded picture/scan of the front side of the identification document. + */ + @Expose + @SerializedName("document_front_attachment_id_field_for_request") + private Integer documentFrontAttachmentIdFieldForRequest; + + /** + * The reference to the uploaded picture/scan of the back side of the identification document. + */ + @Expose + @SerializedName("document_back_attachment_id_field_for_request") + private Integer documentBackAttachmentIdFieldForRequest; + + /** + * The person's date of birth. Accepts ISO8601 date formats. + */ + @Expose + @SerializedName("date_of_birth_field_for_request") + private String dateOfBirthFieldForRequest; + + /** + * The person's place of birth. + */ + @Expose + @SerializedName("place_of_birth_field_for_request") + private String placeOfBirthFieldForRequest; + + /** + * The person's country of birth. Formatted as a SO 3166-1 alpha-2 country code. + */ + @Expose + @SerializedName("country_of_birth_field_for_request") + private String countryOfBirthFieldForRequest; + + /** + * The person's nationality. Formatted as a SO 3166-1 alpha-2 country code. + */ + @Expose + @SerializedName("nationality_field_for_request") + private String nationalityFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("language_field_for_request") + private String languageFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("region_field_for_request") + private String regionFieldForRequest; + + /** + * The person's gender. Can be: MALE, FEMALE and UNKNOWN. + */ + @Expose + @SerializedName("gender_field_for_request") + private String genderFieldForRequest; + + /** + * The user status. You are not allowed to update the status via PUT. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The user sub-status. Can be updated to SUBMIT if status is RECOVERY. + */ + @Expose + @SerializedName("sub_status_field_for_request") + private String subStatusFieldForRequest; + + /** + * The legal guardian of the user. Required for minors. + */ + @Expose + @SerializedName("legal_guardian_alias_field_for_request") + private Pointer legalGuardianAliasFieldForRequest; + + /** + * The setting for the session timeout of the user in seconds. + */ + @Expose + @SerializedName("session_timeout_field_for_request") + private Integer sessionTimeoutFieldForRequest; + + /** + * Card ids used for centralized card limits. + */ + @Expose + @SerializedName("card_ids_field_for_request") + private List cardIdsFieldForRequest; + + /** + * The centralized limits for user's cards. + */ + @Expose + @SerializedName("card_limits_field_for_request") + private List cardLimitsFieldForRequest; + + /** + * The amount the user can pay in the session without asking for credentials. + */ + @Expose + @SerializedName("daily_limit_without_confirmation_login_field_for_request") + private Amount dailyLimitWithoutConfirmationLoginFieldForRequest; + + /** + * The types of notifications that will result in a push notification or URL callback for this + * UserPerson. + */ + @Expose + @SerializedName("notification_filters_field_for_request") + private List notificationFiltersFieldForRequest; + + public UserPerson() { + this(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain) { + this(addressMain, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid) { + this(addressMain, avatarUuid, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType) { + this(addressMain, avatarUuid, documentType, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber) { + this(addressMain, avatarUuid, documentType, documentNumber, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, null, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, dailyLimitWithoutConfirmationLogin, null, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String firstName) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, dailyLimitWithoutConfirmationLogin, firstName, null, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String firstName, String middleName) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, dailyLimitWithoutConfirmationLogin, firstName, middleName, null, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String firstName, String middleName, String lastName) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, dailyLimitWithoutConfirmationLogin, firstName, middleName, lastName, null, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String firstName, String middleName, String lastName, String publicNickName) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, dailyLimitWithoutConfirmationLogin, firstName, middleName, lastName, publicNickName, null, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String firstName, String middleName, String lastName, String publicNickName, Address addressPostal) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, dailyLimitWithoutConfirmationLogin, firstName, middleName, lastName, publicNickName, addressPostal, null, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String firstName, String middleName, String lastName, String publicNickName, Address addressPostal, List taxResident) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, dailyLimitWithoutConfirmationLogin, firstName, middleName, lastName, publicNickName, addressPostal, taxResident, null, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String firstName, String middleName, String lastName, String publicNickName, Address addressPostal, List taxResident, Integer documentBackAttachmentId) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, dailyLimitWithoutConfirmationLogin, firstName, middleName, lastName, publicNickName, addressPostal, taxResident, documentBackAttachmentId, null, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String firstName, String middleName, String lastName, String publicNickName, Address addressPostal, List taxResident, Integer documentBackAttachmentId, List cardIds) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, dailyLimitWithoutConfirmationLogin, firstName, middleName, lastName, publicNickName, addressPostal, taxResident, documentBackAttachmentId, cardIds, null, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String firstName, String middleName, String lastName, String publicNickName, Address addressPostal, List taxResident, Integer documentBackAttachmentId, List cardIds, List cardLimits) { + this(addressMain, avatarUuid, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, dailyLimitWithoutConfirmationLogin, firstName, middleName, lastName, publicNickName, addressPostal, taxResident, documentBackAttachmentId, cardIds, cardLimits, null); + } + + public UserPerson(Address addressMain, String avatarUuid, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, Amount dailyLimitWithoutConfirmationLogin, String firstName, String middleName, String lastName, String publicNickName, Address addressPostal, List taxResident, Integer documentBackAttachmentId, List cardIds, List cardLimits, List notificationFilters) { + this.firstNameFieldForRequest = firstName; + this.middleNameFieldForRequest = middleName; + this.lastNameFieldForRequest = lastName; + this.publicNickNameFieldForRequest = publicNickName; + this.addressMainFieldForRequest = addressMain; + this.addressPostalFieldForRequest = addressPostal; + this.avatarUuidFieldForRequest = avatarUuid; + this.taxResidentFieldForRequest = taxResident; + this.documentTypeFieldForRequest = documentType; + this.documentNumberFieldForRequest = documentNumber; + this.documentCountryOfIssuanceFieldForRequest = documentCountryOfIssuance; + this.documentFrontAttachmentIdFieldForRequest = documentFrontAttachmentId; + this.documentBackAttachmentIdFieldForRequest = documentBackAttachmentId; + this.dateOfBirthFieldForRequest = dateOfBirth; + this.placeOfBirthFieldForRequest = placeOfBirth; + this.countryOfBirthFieldForRequest = countryOfBirth; + this.nationalityFieldForRequest = nationality; + this.languageFieldForRequest = language; + this.regionFieldForRequest = region; + this.genderFieldForRequest = gender; + this.statusFieldForRequest = status; + this.subStatusFieldForRequest = subStatus; + this.legalGuardianAliasFieldForRequest = legalGuardianAlias; + this.sessionTimeoutFieldForRequest = sessionTimeout; + this.cardIdsFieldForRequest = cardIds; + this.cardLimitsFieldForRequest = cardLimits; + this.dailyLimitWithoutConfirmationLoginFieldForRequest = dailyLimitWithoutConfirmationLogin; + this.notificationFiltersFieldForRequest = notificationFilters; + } + /** * Get a specific person. */ - public static BunqResponse get(Map params, Map customHeaders) { + public static BunqResponse get(Integer userPersonId, Map params, Map customHeaders) { ApiClient apiClient = new ApiClient(getApiContext()); BunqResponseRaw responseRaw = apiClient.get(String.format(ENDPOINT_URL_READ, determineUserId()), params, customHeaders); @@ -304,11 +646,15 @@ public static BunqResponse get(Map params, Map get() { - return get(null, null); + return get(null, null, null); + } + + public static BunqResponse get(Integer userPersonId) { + return get(userPersonId, null, null); } - public static BunqResponse get(Map params) { - return get(params, null); + public static BunqResponse get(Integer userPersonId, Map params) { + return get(userPersonId, params, null); } /** @@ -350,7 +696,7 @@ public static BunqResponse get(Map params) { * @param notificationFilters The types of notifications that will result in a push notification * or URL callback for this UserPerson. */ - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, List cardIds, List cardLimits, Amount dailyLimitWithoutConfirmationLogin, List notificationFilters, Map customHeaders) { + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, List cardIds, List cardLimits, Amount dailyLimitWithoutConfirmationLogin, List notificationFilters, Map customHeaders) { ApiClient apiClient = new ApiClient(getApiContext()); if (customHeaders == null) { @@ -387,122 +733,126 @@ public static BunqResponse update(String firstName, String middleName, requestMap.put(FIELD_DAILY_LIMIT_WITHOUT_CONFIRMATION_LOGIN, dailyLimitWithoutConfirmationLogin); requestMap.put(FIELD_NOTIFICATION_FILTERS, notificationFilters); - byte[] requestBytes = gson.toJson(requestMap).getBytes(); + byte[] requestBytes = determineAllRequestByte(requestMap); BunqResponseRaw responseRaw = apiClient.put(String.format(ENDPOINT_URL_UPDATE, determineUserId()), requestBytes, customHeaders); return processForId(responseRaw); } - public static BunqResponse update(String firstName) { - return update(firstName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId) { + return update(userPersonId, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + } + + public static BunqResponse update(Integer userPersonId, String firstName) { + return update(userPersonId, firstName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName) { - return update(firstName, middleName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName) { + return update(userPersonId, firstName, middleName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName) { - return update(firstName, middleName, lastName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName) { + return update(userPersonId, firstName, middleName, lastName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName) { - return update(firstName, middleName, lastName, publicNickName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain) { - return update(firstName, middleName, lastName, publicNickName, addressMain, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, null, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, null, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, null, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, null, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, null, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, null, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, null, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, null, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, null, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, null, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, null, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, null, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, null, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, null, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, null, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, null, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, null, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, null, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, null, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, List cardIds) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, cardIds, null, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, List cardIds) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, cardIds, null, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, List cardIds, List cardLimits) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, cardIds, cardLimits, null, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, List cardIds, List cardLimits) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, cardIds, cardLimits, null, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, List cardIds, List cardLimits, Amount dailyLimitWithoutConfirmationLogin) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, cardIds, cardLimits, dailyLimitWithoutConfirmationLogin, null, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, List cardIds, List cardLimits, Amount dailyLimitWithoutConfirmationLogin) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, cardIds, cardLimits, dailyLimitWithoutConfirmationLogin, null, null); } - public static BunqResponse update(String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, List cardIds, List cardLimits, Amount dailyLimitWithoutConfirmationLogin, List notificationFilters) { - return update(firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, cardIds, cardLimits, dailyLimitWithoutConfirmationLogin, notificationFilters, null); + public static BunqResponse update(Integer userPersonId, String firstName, String middleName, String lastName, String publicNickName, Address addressMain, Address addressPostal, String avatarUuid, List taxResident, String documentType, String documentNumber, String documentCountryOfIssuance, Integer documentFrontAttachmentId, Integer documentBackAttachmentId, String dateOfBirth, String placeOfBirth, String countryOfBirth, String nationality, String language, String region, String gender, String status, String subStatus, Pointer legalGuardianAlias, Integer sessionTimeout, List cardIds, List cardLimits, Amount dailyLimitWithoutConfirmationLogin, List notificationFilters) { + return update(userPersonId, firstName, middleName, lastName, publicNickName, addressMain, addressPostal, avatarUuid, taxResident, documentType, documentNumber, documentCountryOfIssuance, documentFrontAttachmentId, documentBackAttachmentId, dateOfBirth, placeOfBirth, countryOfBirth, nationality, language, region, gender, status, subStatus, legalGuardianAlias, sessionTimeout, cardIds, cardLimits, dailyLimitWithoutConfirmationLogin, notificationFilters, null); } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Address.java b/src/main/java/com/bunq/sdk/model/generated/object/Address.java index 42605440..c1c6b06e 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Address.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Address.java @@ -58,13 +58,79 @@ public class Address extends BunqModel { @SerializedName("province") private String province; + /** + * The street. + */ + @Expose + @SerializedName("street_field_for_request") + private String streetFieldForRequest; + + /** + * The house number. + */ + @Expose + @SerializedName("house_number_field_for_request") + private String houseNumberFieldForRequest; + + /** + * The PO box. + */ + @Expose + @SerializedName("po_box_field_for_request") + private String poBoxFieldForRequest; + + /** + * The postal code. + */ + @Expose + @SerializedName("postal_code_field_for_request") + private String postalCodeFieldForRequest; + + /** + * The city. + */ + @Expose + @SerializedName("city_field_for_request") + private String cityFieldForRequest; + + /** + * The country as an ISO 3166-1 alpha-2 country code. + */ + @Expose + @SerializedName("country_field_for_request") + private String countryFieldForRequest; + + public Address() { + this(null, null, null, null, null, null); + } + + public Address(String street) { + this(street, null, null, null, null, null); + } + + public Address(String street, String houseNumber) { + this(street, houseNumber, null, null, null, null); + } + + public Address(String street, String houseNumber, String postalCode) { + this(street, houseNumber, postalCode, null, null, null); + } + + public Address(String street, String houseNumber, String postalCode, String city) { + this(street, houseNumber, postalCode, city, null, null); + } + public Address(String street, String houseNumber, String postalCode, String city, String country) { - this.street = street; - this.houseNumber = houseNumber; - this.poBox = poBox; - this.postalCode = postalCode; - this.city = city; - this.country = country; + this(street, houseNumber, postalCode, city, country, null); + } + + public Address(String street, String houseNumber, String postalCode, String city, String country, String poBox) { + this.streetFieldForRequest = street; + this.houseNumberFieldForRequest = houseNumber; + this.poBoxFieldForRequest = poBox; + this.postalCodeFieldForRequest = postalCode; + this.cityFieldForRequest = city; + this.countryFieldForRequest = country; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Amount.java b/src/main/java/com/bunq/sdk/model/generated/object/Amount.java index 3ab52608..dbf66d90 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Amount.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Amount.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -29,9 +23,31 @@ public class Amount extends BunqModel { @SerializedName("currency") private String currency; + /** + * The amount formatted to two decimal places. + */ + @Expose + @SerializedName("value_field_for_request") + private String valueFieldForRequest; + + /** + * The currency of the amount. It is an ISO 4217 formatted currency code. + */ + @Expose + @SerializedName("currency_field_for_request") + private String currencyFieldForRequest; + + public Amount() { + this(null, null); + } + + public Amount(String value) { + this(value, null); + } + public Amount(String value, String currency) { - this.value = value; - this.currency = currency; + this.valueFieldForRequest = value; + this.currencyFieldForRequest = currency; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/AttachmentMonetaryAccountPayment.java b/src/main/java/com/bunq/sdk/model/generated/object/AttachmentMonetaryAccountPayment.java index f00942b6..f62fa483 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/AttachmentMonetaryAccountPayment.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/AttachmentMonetaryAccountPayment.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -29,8 +23,19 @@ public class AttachmentMonetaryAccountPayment extends BunqModel { @SerializedName("monetary_account_id") private Integer monetaryAccountId; + /** + * The id of the Attachment to attach to the MonetaryAccount. + */ + @Expose + @SerializedName("id_field_for_request") + private Integer idFieldForRequest; + + public AttachmentMonetaryAccountPayment() { + this(null); + } + public AttachmentMonetaryAccountPayment(Integer id) { - this.id = id; + this.idFieldForRequest = id; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Avatar.java b/src/main/java/com/bunq/sdk/model/generated/object/Avatar.java index 5c13250c..143dd8ed 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Avatar.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Avatar.java @@ -1,15 +1,11 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; + import java.util.List; -import java.util.Map; /** */ @@ -36,8 +32,19 @@ public class Avatar extends BunqModel { @SerializedName("image") private List image; + /** + * The public UUID of the avatar. + */ + @Expose + @SerializedName("uuid_field_for_request") + private String uuidFieldForRequest; + + public Avatar() { + this(null); + } + public Avatar(String uuid) { - this.uuid = uuid; + this.uuidFieldForRequest = uuid; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/BudgetRestriction.java b/src/main/java/com/bunq/sdk/model/generated/object/BudgetRestriction.java index 8478a907..af13678d 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/BudgetRestriction.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/BudgetRestriction.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -29,6 +23,33 @@ public class BudgetRestriction extends BunqModel { @SerializedName("frequency") private String frequency; + /** + * The amount of the budget given to the invited user. + */ + @Expose + @SerializedName("amount_field_for_request") + private Amount amountFieldForRequest; + + /** + * The duration for a budget restriction. Valid values are DAILY, WEEKLY, MONTHLY, YEARLY. + */ + @Expose + @SerializedName("frequency_field_for_request") + private String frequencyFieldForRequest; + + public BudgetRestriction() { + this(null, null); + } + + public BudgetRestriction(Amount amount) { + this(amount, null); + } + + public BudgetRestriction(Amount amount, String frequency) { + this.amountFieldForRequest = amount; + this.frequencyFieldForRequest = frequency; + } + /** * The amount of the budget given to the invited user. */ diff --git a/src/main/java/com/bunq/sdk/model/generated/object/BunqId.java b/src/main/java/com/bunq/sdk/model/generated/object/BunqId.java index d83592bf..fd92fcc6 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/BunqId.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/BunqId.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -22,8 +16,19 @@ public class BunqId extends BunqModel { @SerializedName("id") private Integer id; + /** + * An integer ID of an object. Unique per object type. + */ + @Expose + @SerializedName("id_field_for_request") + private Integer idFieldForRequest; + + public BunqId() { + this(null); + } + public BunqId(Integer id) { - this.id = id; + this.idFieldForRequest = id; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/CardCountryPermission.java b/src/main/java/com/bunq/sdk/model/generated/object/CardCountryPermission.java index 58ab0bd0..771829ad 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/CardCountryPermission.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/CardCountryPermission.java @@ -9,6 +9,13 @@ */ public class CardCountryPermission extends BunqModel { + /** + * The id of the card country permission entry. + */ + @Expose + @SerializedName("id") + private Integer id; + /** * The country to allow transactions in (e.g. NL, DE). */ @@ -24,15 +31,30 @@ public class CardCountryPermission extends BunqModel { private String expiryTime; /** - * The id of the card country permission entry. + * The country to allow transactions in (e.g. NL, DE). */ @Expose - @SerializedName("id") - private Integer id; + @SerializedName("country_field_for_request") + private String countryFieldForRequest; + + /** + * Expiry time of this rule. + */ + @Expose + @SerializedName("expiry_time_field_for_request") + private String expiryTimeFieldForRequest; + + public CardCountryPermission() { + this(null, null); + } public CardCountryPermission(String country) { - this.country = country; - this.expiryTime = expiryTime; + this(country, null); + } + + public CardCountryPermission(String country, String expiryTime) { + this.countryFieldForRequest = country; + this.expiryTimeFieldForRequest = expiryTime; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/CardLimit.java b/src/main/java/com/bunq/sdk/model/generated/object/CardLimit.java index 216ba21b..8358813c 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/CardLimit.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/CardLimit.java @@ -1,20 +1,21 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ public class CardLimit extends BunqModel { + /** + * The id of the card limit entry. + */ + @Expose + @SerializedName("id") + private Integer id; + /** * The daily limit amount. */ @@ -38,16 +39,43 @@ public class CardLimit extends BunqModel { private String type; /** - * The id of the card limit entry. + * The daily limit amount. */ @Expose - @SerializedName("id") - private Integer id; + @SerializedName("daily_limit_field_for_request") + private String dailyLimitFieldForRequest; + + /** + * Currency for the daily limit. + */ + @Expose + @SerializedName("currency_field_for_request") + private String currencyFieldForRequest; + + /** + * The type of transaction for the limit. Can be CARD_LIMIT_ATM, CARD_LIMIT_CONTACTLESS, + * CARD_LIMIT_DIPPING or CARD_LIMIT_POS_ICC. + */ + @Expose + @SerializedName("type_field_for_request") + private String typeFieldForRequest; + + public CardLimit() { + this(null, null, null); + } + + public CardLimit(String dailyLimit) { + this(dailyLimit, null, null); + } + + public CardLimit(String dailyLimit, String currency) { + this(dailyLimit, currency, null); + } public CardLimit(String dailyLimit, String currency, String type) { - this.dailyLimit = dailyLimit; - this.currency = currency; - this.type = type; + this.dailyLimitFieldForRequest = dailyLimit; + this.currencyFieldForRequest = currency; + this.typeFieldForRequest = type; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/CardMagStripePermission.java b/src/main/java/com/bunq/sdk/model/generated/object/CardMagStripePermission.java index e5e90d61..e1efc9bc 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/CardMagStripePermission.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/CardMagStripePermission.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -22,6 +16,21 @@ public class CardMagStripePermission extends BunqModel { @SerializedName("expiry_time") private String expiryTime; + /** + * Expiry time of this rule. + */ + @Expose + @SerializedName("expiry_time_field_for_request") + private String expiryTimeFieldForRequest; + + public CardMagStripePermission() { + this(null); + } + + public CardMagStripePermission(String expiryTime) { + this.expiryTimeFieldForRequest = expiryTime; + } + /** * Expiry time of this rule. */ diff --git a/src/main/java/com/bunq/sdk/model/generated/object/CardPinAssignment.java b/src/main/java/com/bunq/sdk/model/generated/object/CardPinAssignment.java index eb8daf81..91358d3e 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/CardPinAssignment.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/CardPinAssignment.java @@ -16,24 +16,50 @@ public class CardPinAssignment extends BunqModel { @SerializedName("type") private String type; + /** + * The ID of the monetary account to assign to this pin for the card. + */ + @Expose + @SerializedName("monetary_account_id") + private Integer monetaryAccountId; + + /** + * PIN type. Can be PRIMARY, SECONDARY or TERTIARY + */ + @Expose + @SerializedName("type_field_for_request") + private String typeFieldForRequest; + /** * The 4 digit PIN to be assigned to this account. */ @Expose - @SerializedName("pin_code") - private String pinCode; + @SerializedName("pin_code_field_for_request") + private String pinCodeFieldForRequest; /** * The ID of the monetary account to assign to this pin for the card. */ @Expose - @SerializedName("monetary_account_id") - private Integer monetaryAccountId; + @SerializedName("monetary_account_id_field_for_request") + private Integer monetaryAccountIdFieldForRequest; + + public CardPinAssignment() { + this(null, null, null); + } + + public CardPinAssignment(String type) { + this(type, null, null); + } + + public CardPinAssignment(String type, String pinCode) { + this(type, pinCode, null); + } public CardPinAssignment(String type, String pinCode, Integer monetaryAccountId) { - this.type = type; - this.pinCode = pinCode; - this.monetaryAccountId = monetaryAccountId; + this.typeFieldForRequest = type; + this.pinCodeFieldForRequest = pinCode; + this.monetaryAccountIdFieldForRequest = monetaryAccountId; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Certificate.java b/src/main/java/com/bunq/sdk/model/generated/object/Certificate.java index e359c4c3..37e82744 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Certificate.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Certificate.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -22,8 +16,19 @@ public class Certificate extends BunqModel { @SerializedName("certificate") private String certificate; + /** + * A single certificate in the chain in .PEM format. + */ + @Expose + @SerializedName("certificate_field_for_request") + private String certificateFieldForRequest; + + public Certificate() { + this(null); + } + public Certificate(String certificate) { - this.certificate = certificate; + this.certificateFieldForRequest = certificate; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/CoOwner.java b/src/main/java/com/bunq/sdk/model/generated/object/CoOwner.java index afc86ca4..1efe21f4 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/CoOwner.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/CoOwner.java @@ -1,7 +1,6 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; @@ -24,8 +23,19 @@ public class CoOwner extends BunqModel { @SerializedName("status") private String status; - public CoOwner(LabelUser alias) { - this.alias = alias; + /** + * The users the account will be joint with. + */ + @Expose + @SerializedName("alias_field_for_request") + private Pointer aliasFieldForRequest; + + public CoOwner() { + this(null); + } + + public CoOwner(Pointer alias) { + this.aliasFieldForRequest = alias; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentEntry.java b/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentEntry.java index c0c2c0b0..a0b6da2b 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentEntry.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentEntry.java @@ -1,7 +1,6 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; @@ -12,6 +11,13 @@ */ public class DraftPaymentEntry extends BunqModel { + /** + * The id of the draft payment entry. + */ + @Expose + @SerializedName("id") + private Integer id; + /** * The amount of the payment. */ @@ -19,13 +25,21 @@ public class DraftPaymentEntry extends BunqModel { @SerializedName("amount") private Amount amount; + /** + * The LabelMonetaryAccount containing the public information of 'this' (party) side of the + * DraftPayment. + */ + @Expose + @SerializedName("alias") + private LabelMonetaryAccount alias; + /** * The LabelMonetaryAccount containing the public information of the other (counterparty) side * of the DraftPayment. */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The description for the DraftPayment. Maximum 140 characters for DraftPayments to external @@ -42,6 +56,13 @@ public class DraftPaymentEntry extends BunqModel { @SerializedName("merchant_reference") private String merchantReference; + /** + * The type of the draft payment entry. + */ + @Expose + @SerializedName("type") + private String type; + /** * The Attachments attached to the DraftPayment. */ @@ -50,33 +71,70 @@ public class DraftPaymentEntry extends BunqModel { private List attachment; /** - * The id of the draft payment entry. + * The amount of the payment. */ @Expose - @SerializedName("id") - private Integer id; + @SerializedName("amount_field_for_request") + private Amount amountFieldForRequest; /** - * The LabelMonetaryAccount containing the public information of 'this' (party) side of the - * DraftPayment. + * The Alias of the party we are transferring the money to. Can be an Alias of type EMAIL or + * PHONE_NUMBER (for bunq MonetaryAccounts or bunq.to payments) or IBAN (for external bank + * account). */ @Expose - @SerializedName("alias") - private MonetaryAccountReference alias; + @SerializedName("counterparty_alias_field_for_request") + private Pointer counterpartyAliasFieldForRequest; /** - * The type of the draft payment entry. + * The description for the DraftPayment. Maximum 140 characters for DraftPayments to external + * IBANs, 9000 characters for DraftPayments to only other bunq MonetaryAccounts. Field is + * required but can be an empty string. */ @Expose - @SerializedName("type") - private String type; + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; - public DraftPaymentEntry(Amount amount, MonetaryAccountReference counterpartyAlias, String description) { - this.amount = amount; - this.counterpartyAlias = counterpartyAlias; - this.description = description; - this.merchantReference = merchantReference; - this.attachment = attachment; + /** + * Optional data to be included with the Payment specific to the merchant. + */ + @Expose + @SerializedName("merchant_reference_field_for_request") + private String merchantReferenceFieldForRequest; + + /** + * The Attachments to attach to the DraftPayment. + */ + @Expose + @SerializedName("attachment_field_for_request") + private List attachmentFieldForRequest; + + public DraftPaymentEntry() { + this(null, null, null, null, null); + } + + public DraftPaymentEntry(Amount amount) { + this(amount, null, null, null, null); + } + + public DraftPaymentEntry(Amount amount, Pointer counterpartyAlias) { + this(amount, counterpartyAlias, null, null, null); + } + + public DraftPaymentEntry(Amount amount, Pointer counterpartyAlias, String description) { + this(amount, counterpartyAlias, description, null, null); + } + + public DraftPaymentEntry(Amount amount, Pointer counterpartyAlias, String description, String merchantReference) { + this(amount, counterpartyAlias, description, merchantReference, null); + } + + public DraftPaymentEntry(Amount amount, Pointer counterpartyAlias, String description, String merchantReference, List attachment) { + this.amountFieldForRequest = amount; + this.counterpartyAliasFieldForRequest = counterpartyAlias; + this.descriptionFieldForRequest = description; + this.merchantReferenceFieldForRequest = merchantReference; + this.attachmentFieldForRequest = attachment; } /** @@ -105,11 +163,11 @@ public void setAmount(Amount amount) { * The LabelMonetaryAccount containing the public information of 'this' (party) side of the * DraftPayment. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } @@ -117,11 +175,11 @@ public void setAlias(MonetaryAccountReference alias) { * The LabelMonetaryAccount containing the public information of the other (counterparty) side * of the DraftPayment. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/DraftShareInviteEntry.java b/src/main/java/com/bunq/sdk/model/generated/object/DraftShareInviteEntry.java index cca1dd5b..8edf5409 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/DraftShareInviteEntry.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/DraftShareInviteEntry.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -36,10 +30,43 @@ public class DraftShareInviteEntry extends BunqModel { @SerializedName("end_date") private String endDate; + /** + * The share details. Only one of these objects may be passed. + */ + @Expose + @SerializedName("share_detail_field_for_request") + private ShareDetail shareDetailFieldForRequest; + + /** + * The start date of this share. + */ + @Expose + @SerializedName("start_date_field_for_request") + private String startDateFieldForRequest; + + /** + * The expiration date of this share. + */ + @Expose + @SerializedName("end_date_field_for_request") + private String endDateFieldForRequest; + + public DraftShareInviteEntry() { + this(null, null, null); + } + public DraftShareInviteEntry(ShareDetail shareDetail) { - this.shareDetail = shareDetail; - this.startDate = startDate; - this.endDate = endDate; + this(shareDetail, null, null); + } + + public DraftShareInviteEntry(ShareDetail shareDetail, String startDate) { + this(shareDetail, startDate, null); + } + + public DraftShareInviteEntry(ShareDetail shareDetail, String startDate, String endDate) { + this.shareDetailFieldForRequest = shareDetail; + this.startDateFieldForRequest = startDate; + this.endDateFieldForRequest = endDate; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Geolocation.java b/src/main/java/com/bunq/sdk/model/generated/object/Geolocation.java index f8872e67..5b905b25 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Geolocation.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Geolocation.java @@ -1,15 +1,11 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; + import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -43,6 +39,57 @@ public class Geolocation extends BunqModel { @SerializedName("radius") private BigDecimal radius; + /** + * The latitude for a geolocation restriction. + */ + @Expose + @SerializedName("latitude_field_for_request") + private String latitudeFieldForRequest; + + /** + * The longitude for a geolocation restriction. + */ + @Expose + @SerializedName("longitude_field_for_request") + private String longitudeFieldForRequest; + + /** + * The altitude for a geolocation restriction. + */ + @Expose + @SerializedName("altitude_field_for_request") + private String altitudeFieldForRequest; + + /** + * The radius for a geolocation restriction. + */ + @Expose + @SerializedName("radius_field_for_request") + private String radiusFieldForRequest; + + public Geolocation() { + this(null, null, null, null); + } + + public Geolocation(String latitude) { + this(latitude, null, null, null); + } + + public Geolocation(String latitude, String longitude) { + this(latitude, longitude, null, null); + } + + public Geolocation(String latitude, String longitude, String altitude) { + this(latitude, longitude, altitude, null); + } + + public Geolocation(String latitude, String longitude, String altitude, String radius) { + this.latitudeFieldForRequest = latitude; + this.longitudeFieldForRequest = longitude; + this.altitudeFieldForRequest = altitude; + this.radiusFieldForRequest = radius; + } + /** * The latitude for a geolocation restriction. */ diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Issuer.java b/src/main/java/com/bunq/sdk/model/generated/object/Issuer.java index 6a64ca10..71c073bd 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Issuer.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Issuer.java @@ -23,9 +23,31 @@ public class Issuer extends BunqModel { @SerializedName("name") private String name; + /** + * The BIC code. + */ + @Expose + @SerializedName("bic_field_for_request") + private String bicFieldForRequest; + + /** + * The name of the bank. + */ + @Expose + @SerializedName("name_field_for_request") + private String nameFieldForRequest; + + public Issuer() { + this(null, null); + } + public Issuer(String bic) { - this.bic = bic; - this.name = name; + this(bic, null); + } + + public Issuer(String bic, String name) { + this.bicFieldForRequest = bic; + this.nameFieldForRequest = name; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/LabelMonetaryAccount.java b/src/main/java/com/bunq/sdk/model/generated/object/LabelMonetaryAccount.java index 6f9527b3..06fdf679 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/LabelMonetaryAccount.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/LabelMonetaryAccount.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -55,7 +49,7 @@ public class LabelMonetaryAccount extends BunqModel { */ @Expose @SerializedName("bunq_me") - private MonetaryAccountReference bunqMe; + private Pointer bunqMe; /** * Whether or not the monetary account is light. @@ -136,11 +130,11 @@ public void setCountry(String country) { /** * Bunq.me pointer with type and value. */ - public MonetaryAccountReference getBunqMe() { + public Pointer getBunqMe() { return this.bunqMe; } - public void setBunqMe(MonetaryAccountReference bunqMe) { + public void setBunqMe(Pointer bunqMe) { this.bunqMe = bunqMe; } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/LabelUser.java b/src/main/java/com/bunq/sdk/model/generated/object/LabelUser.java index 05919cfc..3cf1b815 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/LabelUser.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/LabelUser.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -22,6 +16,20 @@ public class LabelUser extends BunqModel { @SerializedName("uuid") private String uuid; + /** + * The current avatar of the user. + */ + @Expose + @SerializedName("avatar") + private Avatar avatar; + + /** + * The current nickname of the user. + */ + @Expose + @SerializedName("public_nick_name") + private String publicNickName; + /** * The name to be displayed for this user, as it was given on the request. */ @@ -37,23 +45,42 @@ public class LabelUser extends BunqModel { private String country; /** - * The current avatar of the user. + * The public UUID of the label-user. */ @Expose - @SerializedName("avatar") - private Avatar avatar; + @SerializedName("uuid_field_for_request") + private String uuidFieldForRequest; /** - * The current nickname of the user. + * The name to be displayed for this user, as it was given on the request. */ @Expose - @SerializedName("public_nick_name") - private String publicNickName; + @SerializedName("display_name_field_for_request") + private String displayNameFieldForRequest; + + /** + * The country of the user + */ + @Expose + @SerializedName("country_field_for_request") + private String countryFieldForRequest; + + public LabelUser() { + this(null, null, null); + } + + public LabelUser(String uuid) { + this(uuid, null, null); + } + + public LabelUser(String uuid, String displayName) { + this(uuid, displayName, null); + } public LabelUser(String uuid, String displayName, String country) { - this.uuid = uuid; - this.displayName = displayName; - this.country = country; + this.uuidFieldForRequest = uuid; + this.displayNameFieldForRequest = displayName; + this.countryFieldForRequest = country; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountProfileDrain.java b/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountProfileDrain.java index 1d80b4aa..182dd471 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountProfileDrain.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountProfileDrain.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -41,13 +35,57 @@ public class MonetaryAccountProfileDrain extends BunqModel { */ @Expose @SerializedName("savings_account_alias") - private MonetaryAccountReference savingsAccountAlias; + private LabelMonetaryAccount savingsAccountAlias; - public MonetaryAccountProfileDrain(String status, Amount balancePreferred, Amount balanceThresholdHigh, MonetaryAccountReference savingsAccountAlias) { - this.status = status; - this.balancePreferred = balancePreferred; - this.balanceThresholdHigh = balanceThresholdHigh; - this.savingsAccountAlias = savingsAccountAlias; + /** + * The status of the profile. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The goal balance. + */ + @Expose + @SerializedName("balance_preferred_field_for_request") + private Amount balancePreferredFieldForRequest; + + /** + * The high threshold balance. + */ + @Expose + @SerializedName("balance_threshold_high_field_for_request") + private Amount balanceThresholdHighFieldForRequest; + + /** + * The savings monetary account. + */ + @Expose + @SerializedName("savings_account_alias_field_for_request") + private Pointer savingsAccountAliasFieldForRequest; + + public MonetaryAccountProfileDrain() { + this(null, null, null, null); + } + + public MonetaryAccountProfileDrain(String status) { + this(status, null, null, null); + } + + public MonetaryAccountProfileDrain(String status, Amount balancePreferred) { + this(status, balancePreferred, null, null); + } + + public MonetaryAccountProfileDrain(String status, Amount balancePreferred, Amount balanceThresholdHigh) { + this(status, balancePreferred, balanceThresholdHigh, null); + } + + public MonetaryAccountProfileDrain(String status, Amount balancePreferred, Amount balanceThresholdHigh, Pointer savingsAccountAlias) { + this.statusFieldForRequest = status; + this.balancePreferredFieldForRequest = balancePreferred; + this.balanceThresholdHighFieldForRequest = balanceThresholdHigh; + this.savingsAccountAliasFieldForRequest = savingsAccountAlias; } /** @@ -86,11 +124,11 @@ public void setBalanceThresholdHigh(Amount balanceThresholdHigh) { /** * The savings monetary account. */ - public MonetaryAccountReference getSavingsAccountAlias() { + public LabelMonetaryAccount getSavingsAccountAlias() { return this.savingsAccountAlias; } - public void setSavingsAccountAlias(MonetaryAccountReference savingsAccountAlias) { + public void setSavingsAccountAlias(LabelMonetaryAccount savingsAccountAlias) { this.savingsAccountAlias = savingsAccountAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountProfileFill.java b/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountProfileFill.java index bce35018..35bd19f1 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountProfileFill.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountProfileFill.java @@ -45,12 +45,67 @@ public class MonetaryAccountProfileFill extends BunqModel { @SerializedName("issuer") private Issuer issuer; + /** + * The status of the profile. + */ + @Expose + @SerializedName("status_field_for_request") + private String statusFieldForRequest; + + /** + * The goal balance. + */ + @Expose + @SerializedName("balance_preferred_field_for_request") + private Amount balancePreferredFieldForRequest; + + /** + * The low threshold balance. + */ + @Expose + @SerializedName("balance_threshold_low_field_for_request") + private Amount balanceThresholdLowFieldForRequest; + + /** + * The method used to fill the monetary account. Currently IDEAL and SOFORT is supported. + */ + @Expose + @SerializedName("method_fill_field_for_request") + private String methodFillFieldForRequest; + + /** + * The bank the fill is supposed to happen from, with BIC and bank name. + */ + @Expose + @SerializedName("issuer_field_for_request") + private Issuer issuerFieldForRequest; + + public MonetaryAccountProfileFill() { + this(null, null, null, null, null); + } + + public MonetaryAccountProfileFill(String status) { + this(status, null, null, null, null); + } + + public MonetaryAccountProfileFill(String status, Amount balancePreferred) { + this(status, balancePreferred, null, null, null); + } + + public MonetaryAccountProfileFill(String status, Amount balancePreferred, Amount balanceThresholdLow) { + this(status, balancePreferred, balanceThresholdLow, null, null); + } + public MonetaryAccountProfileFill(String status, Amount balancePreferred, Amount balanceThresholdLow, String methodFill) { - this.status = status; - this.balancePreferred = balancePreferred; - this.balanceThresholdLow = balanceThresholdLow; - this.methodFill = methodFill; - this.issuer = issuer; + this(status, balancePreferred, balanceThresholdLow, methodFill, null); + } + + public MonetaryAccountProfileFill(String status, Amount balancePreferred, Amount balanceThresholdLow, String methodFill, Issuer issuer) { + this.statusFieldForRequest = status; + this.balancePreferredFieldForRequest = balancePreferred; + this.balanceThresholdLowFieldForRequest = balanceThresholdLow; + this.methodFillFieldForRequest = methodFill; + this.issuerFieldForRequest = issuer; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountSetting.java b/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountSetting.java index cfcc9cf5..3dc5fd75 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountSetting.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/MonetaryAccountSetting.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -36,6 +30,45 @@ public class MonetaryAccountSetting extends BunqModel { @SerializedName("restriction_chat") private String restrictionChat; + /** + * The color chosen for the MonetaryAccount in hexadecimal format. + */ + @Expose + @SerializedName("color_field_for_request") + private String colorFieldForRequest; + + /** + * The status of the avatar. Cannot be updated directly. + */ + @Expose + @SerializedName("default_avatar_status_field_for_request") + private String defaultAvatarStatusFieldForRequest; + + /** + * The chat restriction. Possible values are ALLOW_INCOMING or BLOCK_INCOMING + */ + @Expose + @SerializedName("restriction_chat_field_for_request") + private String restrictionChatFieldForRequest; + + public MonetaryAccountSetting() { + this(null, null, null); + } + + public MonetaryAccountSetting(String color) { + this(color, null, null); + } + + public MonetaryAccountSetting(String color, String defaultAvatarStatus) { + this(color, defaultAvatarStatus, null); + } + + public MonetaryAccountSetting(String color, String defaultAvatarStatus, String restrictionChat) { + this.colorFieldForRequest = color; + this.defaultAvatarStatusFieldForRequest = defaultAvatarStatus; + this.restrictionChatFieldForRequest = restrictionChat; + } + /** * The color chosen for the MonetaryAccount. */ diff --git a/src/main/java/com/bunq/sdk/model/generated/object/NotificationFilter.java b/src/main/java/com/bunq/sdk/model/generated/object/NotificationFilter.java index 205cb3ac..09c48538 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/NotificationFilter.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/NotificationFilter.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -43,10 +37,50 @@ public class NotificationFilter extends BunqModel { @SerializedName("category") private String category; + /** + * The delivery method via which notifications that match this notification filter will be + * delivered. Possible choices are PUSH for delivery via push notification and URL for delivery + * via URL callback. + */ + @Expose + @SerializedName("notification_delivery_method_field_for_request") + private String notificationDeliveryMethodFieldForRequest; + + /** + * 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. + */ + @Expose + @SerializedName("notification_target_field_for_request") + private String notificationTargetFieldForRequest; + + /** + * The notification category that will match this notification filter. Possible choices are + * BILLING, CARD_TRANSACTION_FAILED, CARD_TRANSACTION_SUCCESSFUL, CHAT, DRAFT_PAYMENT, IDEAL, + * SOFORT, MONETARY_ACCOUNT_PROFILE, MUTATION, PAYMENT, PROMOTION, REQUEST, SCHEDULE_RESULT, + * SCHEDULE_STATUS, SHARE, SUPPORT, TAB_RESULT, USER_APPROVAL. + */ + @Expose + @SerializedName("category_field_for_request") + private String categoryFieldForRequest; + + public NotificationFilter() { + this(null, null, null); + } + + public NotificationFilter(String notificationDeliveryMethod) { + this(notificationDeliveryMethod, null, null); + } + + public NotificationFilter(String notificationDeliveryMethod, String notificationTarget) { + this(notificationDeliveryMethod, notificationTarget, null); + } + public NotificationFilter(String notificationDeliveryMethod, String notificationTarget, String category) { - this.notificationDeliveryMethod = notificationDeliveryMethod; - this.notificationTarget = notificationTarget; - this.category = category; + this.notificationDeliveryMethodFieldForRequest = notificationDeliveryMethod; + this.notificationTargetFieldForRequest = notificationTarget; + this.categoryFieldForRequest = category; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Pointer.java b/src/main/java/com/bunq/sdk/model/generated/object/Pointer.java index 61ba86e3..8afa9c8e 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Pointer.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Pointer.java @@ -30,10 +30,44 @@ public class Pointer extends BunqModel { @SerializedName("name") private String name; + /** + * The alias type, can be: EMAIL|PHONE_NUMBER|IBAN. + */ + @Expose + @SerializedName("type_field_for_request") + private String typeFieldForRequest; + + /** + * The alias value. Phone number are formatted conform E.123 without spaces (e.g., + * +314211234567). + */ + @Expose + @SerializedName("value_field_for_request") + private String valueFieldForRequest; + + /** + * The alias name. Only required for IBANs. + */ + @Expose + @SerializedName("name_field_for_request") + private String nameFieldForRequest; + + public Pointer() { + this(null, null, null); + } + + public Pointer(String type) { + this(type, null, null); + } + public Pointer(String type, String value) { - this.type = type; - this.value = value; - this.name = name; + this(type, value, null); + } + + public Pointer(String type, String value, String name) { + this.typeFieldForRequest = type; + this.valueFieldForRequest = value; + this.nameFieldForRequest = name; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/SchedulePaymentEntry.java b/src/main/java/com/bunq/sdk/model/generated/object/SchedulePaymentEntry.java index 5a477cc3..71df387f 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/SchedulePaymentEntry.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/SchedulePaymentEntry.java @@ -1,7 +1,6 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; @@ -20,13 +19,21 @@ public class SchedulePaymentEntry extends BunqModel { @SerializedName("amount") private Amount amount; + /** + * The LabelMonetaryAccount containing the public information of 'this' (party) side of the + * Payment. + */ + @Expose + @SerializedName("alias") + private LabelMonetaryAccount alias; + /** * The LabelMonetaryAccount containing the public information of the other (counterparty) side * of the Payment. */ @Expose @SerializedName("counterparty_alias") - private MonetaryAccountReference counterpartyAlias; + private LabelMonetaryAccount counterpartyAlias; /** * The description for the Payment. Maximum 140 characters for Payments to external IBANs, 9000 @@ -51,27 +58,82 @@ public class SchedulePaymentEntry extends BunqModel { private String merchantReference; /** - * Whether or not sending a bunq.to payment is allowed. Mandatory for publicApi. + * The Amount to transfer with the Payment. Must be bigger 0 and smaller than the + * MonetaryAccount's balance. */ @Expose - @SerializedName("allow_bunqto") - private Boolean allowBunqto; + @SerializedName("amount_field_for_request") + private Amount amountFieldForRequest; /** - * The LabelMonetaryAccount containing the public information of 'this' (party) side of the - * Payment. + * The Alias of the party we are transferring the money to. Can be an Alias of type EMAIL or + * PHONE (for bunq MonetaryAccounts) or IBAN (for external bank account). */ @Expose - @SerializedName("alias") - private MonetaryAccountReference alias; + @SerializedName("counterparty_alias_field_for_request") + private Pointer counterpartyAliasFieldForRequest; - public SchedulePaymentEntry(Amount amount, MonetaryAccountReference counterpartyAlias, String description) { - this.amount = amount; - this.counterpartyAlias = counterpartyAlias; - this.description = description; - this.attachment = attachment; - this.merchantReference = merchantReference; - this.allowBunqto = allowBunqto; + /** + * The description for the Payment. Maximum 140 characters for Payments to external IBANs, 9000 + * characters for Payments to only other bunq MonetaryAccounts. Field is required but can be an + * empty string. + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + /** + * The Attachments to attach to the Payment. + */ + @Expose + @SerializedName("attachment_field_for_request") + private List attachmentFieldForRequest; + + /** + * Optional data to be included with the Payment specific to the merchant. + */ + @Expose + @SerializedName("merchant_reference_field_for_request") + private String merchantReferenceFieldForRequest; + + /** + * Whether or not sending a bunq.to payment is allowed. Mandatory for publicApi. + */ + @Expose + @SerializedName("allow_bunqto_field_for_request") + private Boolean allowBunqtoFieldForRequest; + + public SchedulePaymentEntry() { + this(null, null, null, null, null, null); + } + + public SchedulePaymentEntry(Amount amount) { + this(amount, null, null, null, null, null); + } + + public SchedulePaymentEntry(Amount amount, Pointer counterpartyAlias) { + this(amount, counterpartyAlias, null, null, null, null); + } + + public SchedulePaymentEntry(Amount amount, Pointer counterpartyAlias, String description) { + this(amount, counterpartyAlias, description, null, null, null); + } + + public SchedulePaymentEntry(Amount amount, Pointer counterpartyAlias, String description, List attachment) { + this(amount, counterpartyAlias, description, attachment, null, null); + } + + public SchedulePaymentEntry(Amount amount, Pointer counterpartyAlias, String description, List attachment, String merchantReference) { + this(amount, counterpartyAlias, description, attachment, merchantReference, null); + } + + public SchedulePaymentEntry(Amount amount, Pointer counterpartyAlias, String description, List attachment, String merchantReference, Boolean allowBunqto) { + this.amountFieldForRequest = amount; + this.counterpartyAliasFieldForRequest = counterpartyAlias; + this.descriptionFieldForRequest = description; + this.attachmentFieldForRequest = attachment; + this.merchantReferenceFieldForRequest = merchantReference; + this.allowBunqtoFieldForRequest = allowBunqto; } /** @@ -90,11 +152,11 @@ public void setAmount(Amount amount) { * The LabelMonetaryAccount containing the public information of 'this' (party) side of the * Payment. */ - public MonetaryAccountReference getAlias() { + public LabelMonetaryAccount getAlias() { return this.alias; } - public void setAlias(MonetaryAccountReference alias) { + public void setAlias(LabelMonetaryAccount alias) { this.alias = alias; } @@ -102,11 +164,11 @@ public void setAlias(MonetaryAccountReference alias) { * The LabelMonetaryAccount containing the public information of the other (counterparty) side * of the Payment. */ - public MonetaryAccountReference getCounterpartyAlias() { + public LabelMonetaryAccount getCounterpartyAlias() { return this.counterpartyAlias; } - public void setCounterpartyAlias(MonetaryAccountReference counterpartyAlias) { + public void setCounterpartyAlias(LabelMonetaryAccount counterpartyAlias) { this.counterpartyAlias = counterpartyAlias; } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ShareDetail.java b/src/main/java/com/bunq/sdk/model/generated/object/ShareDetail.java index d27ef0ed..6941b955 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ShareDetail.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ShareDetail.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -39,6 +33,48 @@ public class ShareDetail extends BunqModel { @SerializedName("ShareDetailDraftPayment") private ShareDetailDraftPayment draftPayment; + /** + * The share details for a payment share. Remember to replace 'payment' with + * 'ShareDetailPayment' before sending a request. + */ + @Expose + @SerializedName("ShareDetailPayment_field_for_request") + private ShareDetailPayment paymentFieldForRequest; + + /** + * The share details for viewing a share. Remember to replace 'read_only' with + * 'ShareDetailReadOnly' before sending a request. + */ + @Expose + @SerializedName("ShareDetailReadOnly_field_for_request") + private ShareDetailReadOnly readOnlyFieldForRequest; + + /** + * The share details for a draft payment share. Remember to replace 'draft_payment' with + * 'ShareDetailDraftPayment' before sending a request. + */ + @Expose + @SerializedName("ShareDetailDraftPayment_field_for_request") + private ShareDetailDraftPayment draftPaymentFieldForRequest; + + public ShareDetail() { + this(null, null, null); + } + + public ShareDetail(ShareDetailPayment payment) { + this(payment, null, null); + } + + public ShareDetail(ShareDetailPayment payment, ShareDetailReadOnly readOnly) { + this(payment, readOnly, null); + } + + public ShareDetail(ShareDetailPayment payment, ShareDetailReadOnly readOnly, ShareDetailDraftPayment draftPayment) { + this.paymentFieldForRequest = payment; + this.readOnlyFieldForRequest = readOnly; + this.draftPaymentFieldForRequest = draftPayment; + } + /** * The share details for a payment share. In the response 'payment' is replaced by * 'ShareDetailPayment'. diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailDraftPayment.java b/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailDraftPayment.java index 6ace0f40..0ebfba50 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailDraftPayment.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailDraftPayment.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -45,11 +39,57 @@ public class ShareDetailDraftPayment extends BunqModel { @SerializedName("view_new_events") private Boolean viewNewEvents; + /** + * If set to true, the invited user will be able to make draft payments from the shared account. + */ + @Expose + @SerializedName("make_draft_payments_field_for_request") + private Boolean makeDraftPaymentsFieldForRequest; + + /** + * If set to true, the invited user will be able to view the account balance. + */ + @Expose + @SerializedName("view_balance_field_for_request") + private Boolean viewBalanceFieldForRequest; + + /** + * If set to true, the invited user will be able to view events from before the share was + * active. + */ + @Expose + @SerializedName("view_old_events_field_for_request") + private Boolean viewOldEventsFieldForRequest; + + /** + * If set to true, the invited user will be able to view events starting from the time the share + * became active. + */ + @Expose + @SerializedName("view_new_events_field_for_request") + private Boolean viewNewEventsFieldForRequest; + + public ShareDetailDraftPayment() { + this(null, null, null, null); + } + + public ShareDetailDraftPayment(Boolean makeDraftPayments) { + this(makeDraftPayments, null, null, null); + } + + public ShareDetailDraftPayment(Boolean makeDraftPayments, Boolean viewBalance) { + this(makeDraftPayments, viewBalance, null, null); + } + + public ShareDetailDraftPayment(Boolean makeDraftPayments, Boolean viewBalance, Boolean viewOldEvents) { + this(makeDraftPayments, viewBalance, viewOldEvents, null); + } + public ShareDetailDraftPayment(Boolean makeDraftPayments, Boolean viewBalance, Boolean viewOldEvents, Boolean viewNewEvents) { - this.makeDraftPayments = makeDraftPayments; - this.viewBalance = viewBalance; - this.viewOldEvents = viewOldEvents; - this.viewNewEvents = viewNewEvents; + this.makeDraftPaymentsFieldForRequest = makeDraftPayments; + this.viewBalanceFieldForRequest = viewBalance; + this.viewOldEventsFieldForRequest = viewOldEvents; + this.viewNewEventsFieldForRequest = viewNewEvents; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailPayment.java b/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailPayment.java index f43293a7..3969393c 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailPayment.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailPayment.java @@ -53,13 +53,81 @@ public class ShareDetailPayment extends BunqModel { @SerializedName("budget") private BudgetRestriction budget; + /** + * If set to true, the invited user will be able to make payments from the shared account. + */ + @Expose + @SerializedName("make_payments_field_for_request") + private Boolean makePaymentsFieldForRequest; + + /** + * If set to true, the invited user will be able to make draft payments from the shared account. + */ + @Expose + @SerializedName("make_draft_payments_field_for_request") + private Boolean makeDraftPaymentsFieldForRequest; + + /** + * If set to true, the invited user will be able to view the account balance. + */ + @Expose + @SerializedName("view_balance_field_for_request") + private Boolean viewBalanceFieldForRequest; + + /** + * If set to true, the invited user will be able to view events from before the share was + * active. + */ + @Expose + @SerializedName("view_old_events_field_for_request") + private Boolean viewOldEventsFieldForRequest; + + /** + * If set to true, the invited user will be able to view events starting from the time the share + * became active. + */ + @Expose + @SerializedName("view_new_events_field_for_request") + private Boolean viewNewEventsFieldForRequest; + + /** + * The budget restriction. + */ + @Expose + @SerializedName("budget_field_for_request") + private BudgetRestriction budgetFieldForRequest; + + public ShareDetailPayment() { + this(null, null, null, null, null, null); + } + + public ShareDetailPayment(Boolean makePayments) { + this(makePayments, null, null, null, null, null); + } + + public ShareDetailPayment(Boolean makePayments, Boolean viewBalance) { + this(makePayments, viewBalance, null, null, null, null); + } + + public ShareDetailPayment(Boolean makePayments, Boolean viewBalance, Boolean viewOldEvents) { + this(makePayments, viewBalance, viewOldEvents, null, null, null); + } + public ShareDetailPayment(Boolean makePayments, Boolean viewBalance, Boolean viewOldEvents, Boolean viewNewEvents) { - this.makePayments = makePayments; - this.makeDraftPayments = makeDraftPayments; - this.viewBalance = viewBalance; - this.viewOldEvents = viewOldEvents; - this.viewNewEvents = viewNewEvents; - this.budget = budget; + this(makePayments, viewBalance, viewOldEvents, viewNewEvents, null, null); + } + + public ShareDetailPayment(Boolean makePayments, Boolean viewBalance, Boolean viewOldEvents, Boolean viewNewEvents, Boolean makeDraftPayments) { + this(makePayments, viewBalance, viewOldEvents, viewNewEvents, makeDraftPayments, null); + } + + public ShareDetailPayment(Boolean makePayments, Boolean viewBalance, Boolean viewOldEvents, Boolean viewNewEvents, Boolean makeDraftPayments, BudgetRestriction budget) { + this.makePaymentsFieldForRequest = makePayments; + this.makeDraftPaymentsFieldForRequest = makeDraftPayments; + this.viewBalanceFieldForRequest = viewBalance; + this.viewOldEventsFieldForRequest = viewOldEvents; + this.viewNewEventsFieldForRequest = viewNewEvents; + this.budgetFieldForRequest = budget; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailReadOnly.java b/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailReadOnly.java index c70c77fd..2d74b844 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailReadOnly.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ShareDetailReadOnly.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -38,10 +32,45 @@ public class ShareDetailReadOnly extends BunqModel { @SerializedName("view_new_events") private Boolean viewNewEvents; + /** + * If set to true, the invited user will be able to view the account balance. + */ + @Expose + @SerializedName("view_balance_field_for_request") + private Boolean viewBalanceFieldForRequest; + + /** + * If set to true, the invited user will be able to view events from before the share was + * active. + */ + @Expose + @SerializedName("view_old_events_field_for_request") + private Boolean viewOldEventsFieldForRequest; + + /** + * If set to true, the invited user will be able to view events starting from the time the share + * became active. + */ + @Expose + @SerializedName("view_new_events_field_for_request") + private Boolean viewNewEventsFieldForRequest; + + public ShareDetailReadOnly() { + this(null, null, null); + } + + public ShareDetailReadOnly(Boolean viewBalance) { + this(viewBalance, null, null); + } + + public ShareDetailReadOnly(Boolean viewBalance, Boolean viewOldEvents) { + this(viewBalance, viewOldEvents, null); + } + public ShareDetailReadOnly(Boolean viewBalance, Boolean viewOldEvents, Boolean viewNewEvents) { - this.viewBalance = viewBalance; - this.viewOldEvents = viewOldEvents; - this.viewNewEvents = viewNewEvents; + this.viewBalanceFieldForRequest = viewBalance; + this.viewOldEventsFieldForRequest = viewOldEvents; + this.viewNewEventsFieldForRequest = viewNewEvents; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/TabTextWaitingScreen.java b/src/main/java/com/bunq/sdk/model/generated/object/TabTextWaitingScreen.java index 59102a6f..a344b1d1 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/TabTextWaitingScreen.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/TabTextWaitingScreen.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -29,9 +23,31 @@ public class TabTextWaitingScreen extends BunqModel { @SerializedName("description") private String description; + /** + * Language of tab text + */ + @Expose + @SerializedName("language_field_for_request") + private String languageFieldForRequest; + + /** + * Tab text + */ + @Expose + @SerializedName("description_field_for_request") + private String descriptionFieldForRequest; + + public TabTextWaitingScreen() { + this(null, null); + } + + public TabTextWaitingScreen(String language) { + this(language, null); + } + public TabTextWaitingScreen(String language, String description) { - this.language = language; - this.description = description; + this.languageFieldForRequest = language; + this.descriptionFieldForRequest = description; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/TabVisibility.java b/src/main/java/com/bunq/sdk/model/generated/object/TabVisibility.java index 31d1bb02..8c54b400 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/TabVisibility.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/TabVisibility.java @@ -31,10 +31,47 @@ public class TabVisibility extends BunqModel { @SerializedName("location") private Geolocation location; + /** + * When true the Tab will be linked to the ACTIVE cash registers QR code. If no cash register QR + * code exists, one will be created. + */ + @Expose + @SerializedName("cash_register_qr_code_field_for_request") + private Boolean cashRegisterQrCodeFieldForRequest; + + /** + * 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 + */ + @Expose + @SerializedName("tab_qr_code_field_for_request") + private Boolean tabQrCodeFieldForRequest; + + /** + * The location on which this tab will be made visible in NearPay. This location must overlap + * with the location of the CashRegister. If no location is provided the location of the + * CashRegister will be used. + */ + @Expose + @SerializedName("location_field_for_request") + private Geolocation locationFieldForRequest; + + public TabVisibility() { + this(null, null, null); + } + + public TabVisibility(Boolean cashRegisterQrCode) { + this(cashRegisterQrCode, null, null); + } + public TabVisibility(Boolean cashRegisterQrCode, Boolean tabQrCode) { - this.cashRegisterQrCode = cashRegisterQrCode; - this.tabQrCode = tabQrCode; - this.location = location; + this(cashRegisterQrCode, tabQrCode, null); + } + + public TabVisibility(Boolean cashRegisterQrCode, Boolean tabQrCode, Geolocation location) { + this.cashRegisterQrCodeFieldForRequest = cashRegisterQrCode; + this.tabQrCodeFieldForRequest = tabQrCode; + this.locationFieldForRequest = location; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/TaxResident.java b/src/main/java/com/bunq/sdk/model/generated/object/TaxResident.java index 61287d08..9ab6fd5d 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/TaxResident.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/TaxResident.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -29,9 +23,31 @@ public class TaxResident extends BunqModel { @SerializedName("tax_number") private String taxNumber; + /** + * The country of the tax number. + */ + @Expose + @SerializedName("country_field_for_request") + private String countryFieldForRequest; + + /** + * The tax number. + */ + @Expose + @SerializedName("tax_number_field_for_request") + private String taxNumberFieldForRequest; + + public TaxResident() { + this(null, null); + } + + public TaxResident(String country) { + this(country, null); + } + public TaxResident(String country, String taxNumber) { - this.country = country; - this.taxNumber = taxNumber; + this.countryFieldForRequest = country; + this.taxNumberFieldForRequest = taxNumber; } /** diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Ubo.java b/src/main/java/com/bunq/sdk/model/generated/object/Ubo.java index b70a82ee..bef37bbe 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Ubo.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Ubo.java @@ -1,15 +1,9 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.model.core.BunqModel; -import com.bunq.sdk.model.core.MonetaryAccountReference; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; /** */ @@ -36,6 +30,45 @@ public class Ubo extends BunqModel { @SerializedName("nationality") private String nationality; + /** + * The name of the ultimate beneficiary owner. + */ + @Expose + @SerializedName("name_field_for_request") + private String nameFieldForRequest; + + /** + * The date of birth of the ultimate beneficiary owner. Accepts ISO8601 date formats. + */ + @Expose + @SerializedName("date_of_birth_field_for_request") + private String dateOfBirthFieldForRequest; + + /** + * The nationality of the ultimate beneficiary owner. Accepts ISO8601 date formats. + */ + @Expose + @SerializedName("nationality_field_for_request") + private String nationalityFieldForRequest; + + public Ubo() { + this(null, null, null); + } + + public Ubo(String name) { + this(name, null, null); + } + + public Ubo(String name, String dateOfBirth) { + this(name, dateOfBirth, null); + } + + public Ubo(String name, String dateOfBirth, String nationality) { + this.nameFieldForRequest = name; + this.dateOfBirthFieldForRequest = dateOfBirth; + this.nationalityFieldForRequest = nationality; + } + /** * The name of the ultimate beneficiary owner. */ diff --git a/src/test/java/com/bunq/sdk/model/generated/endpoint/PaymentTest.java b/src/test/java/com/bunq/sdk/model/generated/endpoint/PaymentTest.java index 4fc6bf7b..acb45341 100644 --- a/src/test/java/com/bunq/sdk/model/generated/endpoint/PaymentTest.java +++ b/src/test/java/com/bunq/sdk/model/generated/endpoint/PaymentTest.java @@ -1,17 +1,14 @@ package com.bunq.sdk.model.generated.endpoint; + import com.bunq.sdk.BunqSdkTestBase; -import com.bunq.sdk.Config; -import com.bunq.sdk.context.ApiContext; import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.Pagination; import com.bunq.sdk.model.generated.object.Amount; -import com.bunq.sdk.model.generated.object.Pointer; import org.junit.Assert; -import org.junit.Assume; import org.junit.Test; -import java.util.HashMap; +import java.util.ArrayList; import java.util.List; /** @@ -24,25 +21,19 @@ public class PaymentTest extends BunqSdkTestBase { * Payment field value constants. */ private static final String AMOUNT_EUR = "0.01"; - private static final String CURRENCY = "EUR"; private static final String PAYMENT_DESCRIPTION = "Java test Payment"; private static final int PAGE_SIZE = 100; + private static final int MAXIMUM_AMOUNT_OF_PAYMENT = 10; /** * Number constants. */ - private static final int NUMBER_ZERO = 0; - - /** - * Comparison constants. - */ - private static final int COMPARE_EQUAL = 0; + private static final int INDEX_FIRST = 0; /** * String constants. */ private static final String STRING_NULL = "null"; - private static final int INDEX_FIRST = 0; /** * Tests making a payment to another sandbox user @@ -51,7 +42,7 @@ public class PaymentTest extends BunqSdkTestBase { */ @Test public void makePaymentToOtherUser() { - Amount amount = new Amount(AMOUNT_EUR, CURRENCY); + Amount amount = new Amount(AMOUNT_EUR, CURRENCY_EUR); BunqResponse response = Payment.create( amount, @@ -71,7 +62,7 @@ public void makePaymentToOtherUser() { */ @Test public void makePaymentToOtherAccount() { - Amount amount = new Amount(AMOUNT_EUR, CURRENCY); + Amount amount = new Amount(AMOUNT_EUR, CURRENCY_EUR); BunqResponse response = Payment.create(amount, getPointerBravo(),PAYMENT_DESCRIPTION); @@ -96,4 +87,22 @@ public void counterPartyAliasNotNullTest() { } } + @Test + public void paymentBatchTest() { + BunqResponse response = PaymentBatch.create(createPaymentForBatch()); + + Assert.assertNotNull(response); + Assert.assertNotNull(response.getValue()); + } + + private List createPaymentForBatch() { + List allPayment = new ArrayList<>(); + + while (allPayment.size() < MAXIMUM_AMOUNT_OF_PAYMENT) { + allPayment.add(new Payment(new Amount(AMOUNT_EUR, CURRENCY_EUR), getPointerBravo(), PAYMENT_DESCRIPTION)); + } + + return allPayment; + } + }