diff --git a/src/main/java/com/bunq/sdk/json/AnchorObjectAdapter.java b/src/main/java/com/bunq/sdk/json/AnchorObjectAdapter.java new file mode 100644 index 00000000..8ddde901 --- /dev/null +++ b/src/main/java/com/bunq/sdk/json/AnchorObjectAdapter.java @@ -0,0 +1,48 @@ +package com.bunq.sdk.json; + +import com.bunq.sdk.exception.BunqException; +import com.bunq.sdk.model.core.AnchorObjectInterface; +import com.bunq.sdk.model.core.BunqModel; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; +import com.google.gson.Gson; + +import java.lang.reflect.Field; +import java.lang.reflect.Type; + +public class AnchorObjectAdapter implements JsonDeserializer { + @Override + public AnchorObjectInterface deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) + throws JsonParseException { + AnchorObjectInterface model = new Gson().fromJson(json, typeOfT); + + if (model.isAllFieldNull()) { + Field[] allFields = model.getClass().getDeclaredFields(); + + for(Field field : allFields) { + if (!BunqModel.class.isAssignableFrom(field.getType())) { + continue; + } + + BunqModel content = new Gson().fromJson(json, (Type) field.getType()); + field.setAccessible(true); + + try { + if (content.isAllFieldNull()) { + field.set(model, null); + } else { + field.set(model, content); + } + } catch (IllegalAccessException e) { + throw new BunqException(e.getMessage()); + } + + field.setAccessible(false); + } + } + + return model; + } +} diff --git a/src/main/java/com/bunq/sdk/json/BunqGsonBuilder.java b/src/main/java/com/bunq/sdk/json/BunqGsonBuilder.java index 85d9667e..39b39e8b 100644 --- a/src/main/java/com/bunq/sdk/json/BunqGsonBuilder.java +++ b/src/main/java/com/bunq/sdk/json/BunqGsonBuilder.java @@ -2,6 +2,7 @@ import com.bunq.sdk.context.InstallationContext; import com.bunq.sdk.http.Pagination; +import com.bunq.sdk.model.core.AnchorObjectInterface; import com.bunq.sdk.model.core.Installation; import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.core.SessionServer; @@ -33,7 +34,8 @@ public static GsonBuilder buildDefault() { new MonetaryAccountReferenceTypeAdapter() ) .registerTypeAdapter(InstallationContext.class, new InstallationContextAdapter()) - .registerTypeAdapter(Pagination.class, new PaginationAdapter()); + .registerTypeAdapter(Pagination.class, new PaginationAdapter()) + .registerTypeHierarchyAdapter(AnchorObjectInterface.class, new AnchorObjectAdapter()); } } diff --git a/src/main/java/com/bunq/sdk/model/core/AnchorObjectInterface.java b/src/main/java/com/bunq/sdk/model/core/AnchorObjectInterface.java new file mode 100644 index 00000000..521fb8ec --- /dev/null +++ b/src/main/java/com/bunq/sdk/model/core/AnchorObjectInterface.java @@ -0,0 +1,11 @@ +package com.bunq.sdk.model.core; + +public interface AnchorObjectInterface { + /** + */ + boolean isAllFieldNull(); + + /** + */ + BunqModel getReferencedObject(); +} 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 5152de53..bd1c875a 100644 --- a/src/main/java/com/bunq/sdk/model/core/BunqModel.java +++ b/src/main/java/com/bunq/sdk/model/core/BunqModel.java @@ -8,6 +8,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.google.gson.stream.JsonReader; import java.util.ArrayList; import java.util.List; @@ -34,6 +35,15 @@ abstract public class BunqModel { protected BunqModel() { } + /** + */ + public static T fromJsonReader(Class tClass, JsonReader reader) { + return gson.fromJson( + reader, + tClass + ); + } + /** * De-serializes an object from a JSON format specific to Installation and SessionServer. */ @@ -147,4 +157,8 @@ public String toString() { return gson.toJson(this); } + /** + */ + abstract public boolean isAllFieldNull(); + } diff --git a/src/main/java/com/bunq/sdk/model/core/Installation.java b/src/main/java/com/bunq/sdk/model/core/Installation.java index 9b1aa149..7e4a9534 100644 --- a/src/main/java/com/bunq/sdk/model/core/Installation.java +++ b/src/main/java/com/bunq/sdk/model/core/Installation.java @@ -66,4 +66,20 @@ public String getPublicKeyServer() { return publicKeyServer.getPublicKeyServer(); } + @Override + public boolean isAllFieldNull() { + if (this.id == null) { + return false; + } + + if (this.sessionToken == null) { + return false; + } + + if (this.publicKeyServer == null) { + return false; + } + + return true; + } } diff --git a/src/main/java/com/bunq/sdk/model/core/MonetaryAccountReference.java b/src/main/java/com/bunq/sdk/model/core/MonetaryAccountReference.java index 6926ea71..ee172f26 100644 --- a/src/main/java/com/bunq/sdk/model/core/MonetaryAccountReference.java +++ b/src/main/java/com/bunq/sdk/model/core/MonetaryAccountReference.java @@ -28,4 +28,16 @@ public LabelMonetaryAccount getLabelMonetaryAccount() { return labelMonetaryAccount; } + @Override + public boolean isAllFieldNull() { + if (this.pointer == null) { + return false; + } + + if (this.labelMonetaryAccount == null) { + return false; + } + + return true; + } } diff --git a/src/main/java/com/bunq/sdk/model/core/SessionServer.java b/src/main/java/com/bunq/sdk/model/core/SessionServer.java index 77be3bec..0b5f76a5 100644 --- a/src/main/java/com/bunq/sdk/model/core/SessionServer.java +++ b/src/main/java/com/bunq/sdk/model/core/SessionServer.java @@ -76,4 +76,24 @@ public UserPerson getUserPerson() { return userPerson; } + @Override + public boolean isAllFieldNull() { + if (this.id == null) { + return false; + } + + if (this.sessionToken == null) { + return false; + } + + if (this.userCompany == null) { + return false; + } + + if (this.userPerson == null) { + return false; + } + + return true; + } } diff --git a/src/main/java/com/bunq/sdk/model/core/SessionToken.java b/src/main/java/com/bunq/sdk/model/core/SessionToken.java index 21718e99..3f891b10 100644 --- a/src/main/java/com/bunq/sdk/model/core/SessionToken.java +++ b/src/main/java/com/bunq/sdk/model/core/SessionToken.java @@ -7,6 +7,15 @@ public class SessionToken extends BunqModel { protected SessionToken() { } + @Override + public boolean isAllFieldNull() { + if (this.token == null) { + return false; + } + + return true; + } + public SessionToken(String token) { this.token = token; } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentConversationContent.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentConversationContent.java index ac5be8ed..f0610e82 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentConversationContent.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentConversationContent.java @@ -8,6 +8,7 @@ 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; @@ -45,4 +46,16 @@ public static BunqResponse list(ApiContext apiContext, Integer userId, I return new BunqResponse<>(responseRaw.getBodyBytes(), responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static AttachmentConversationContent fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentConversationContent.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentMonetaryAccount.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentMonetaryAccount.java index 95a9afa4..24cc9f11 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentMonetaryAccount.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentMonetaryAccount.java @@ -9,6 +9,7 @@ import com.bunq.sdk.model.generated.object.Attachment; 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; @@ -85,4 +86,24 @@ public void setId(Integer id) { this.id = id; } + /** + */ + public boolean isAllFieldNull() { + if (this.attachment != null) { + return false; + } + + if (this.id != null) { + return false; + } + + return true; + } + + /** + */ + public static AttachmentMonetaryAccount fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentMonetaryAccount.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentPublic.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentPublic.java index c97ea0c3..4e6711e3 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentPublic.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentPublic.java @@ -9,6 +9,7 @@ import com.bunq.sdk.model.generated.object.Attachment; 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; @@ -137,4 +138,32 @@ public void setAttachment(Attachment attachment) { this.attachment = attachment; } + /** + */ + public boolean isAllFieldNull() { + if (this.uuid != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.attachment != null) { + return false; + } + + return true; + } + + /** + */ + public static AttachmentPublic fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentPublic.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentPublicContent.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentPublicContent.java index a8a3f9c1..84787b68 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentPublicContent.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentPublicContent.java @@ -8,6 +8,7 @@ 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; @@ -45,4 +46,16 @@ public static BunqResponse list(ApiContext apiContext, String attachment return new BunqResponse<>(responseRaw.getBodyBytes(), responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static AttachmentPublicContent fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentPublicContent.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentTab.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentTab.java index 16be2a6b..60fcf7ad 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentTab.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentTab.java @@ -9,6 +9,7 @@ import com.bunq.sdk.model.generated.object.Attachment; 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; @@ -139,4 +140,32 @@ public void setAttachment(Attachment attachment) { this.attachment = attachment; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.attachment != null) { + return false; + } + + return true; + } + + /** + */ + public static AttachmentTab fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentTab.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentTabContent.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentTabContent.java index 21bcb8ab..0cb41c3c 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentTabContent.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/AttachmentTabContent.java @@ -8,6 +8,7 @@ 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; @@ -45,4 +46,16 @@ public static BunqResponse list(ApiContext apiContext, Integer userId, I return new BunqResponse<>(responseRaw.getBodyBytes(), responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static AttachmentTabContent fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentTabContent.class, reader); + } + } 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 e1818eb9..fc74d22b 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 @@ -9,6 +9,7 @@ import com.bunq.sdk.model.generated.object.Image; 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; @@ -104,4 +105,24 @@ public void setImage(List image) { this.image = image; } + /** + */ + public boolean isAllFieldNull() { + if (this.uuid != null) { + return false; + } + + if (this.image != null) { + return false; + } + + return true; + } + + /** + */ + public static Avatar fromJsonReader(JsonReader reader) { + return fromJsonReader(Avatar.class, reader); + } + } 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 5297b24a..059eb783 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 @@ -8,6 +8,7 @@ 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; @@ -196,4 +197,44 @@ public void setSubscriptionType(String subscriptionType) { this.subscriptionType = subscriptionType; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.contractDateStart != null) { + return false; + } + + if (this.contractDateEnd != null) { + return false; + } + + if (this.contractVersion != null) { + return false; + } + + if (this.subscriptionType != null) { + return false; + } + + return true; + } + + /** + */ + public static BillingContractSubscription fromJsonReader(JsonReader reader) { + return fromJsonReader(BillingContractSubscription.class, reader); + } + } 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 new file mode 100644 index 00000000..cfbb1bf1 --- /dev/null +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeFundraiserProfile.java @@ -0,0 +1,200 @@ +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. + */ +public class BunqMeFundraiserProfile extends BunqModel { + + /** + * Field constants. + */ + public static final String FIELD_POINTER = "pointer"; + + /** + * Object type. + */ + private static final String OBJECT_TYPE = "BunqMeFundraiserProfileModel"; + + /** + * The color chosen for the bunq.me fundraiser profile in hexadecimal format. + */ + @Expose + @SerializedName("color") + private String color; + + /** + * The LabelMonetaryAccount with the public information of the User and the MonetaryAccount that + * created the bunq.me fundraiser profile. + */ + @Expose + @SerializedName("alias") + private MonetaryAccountReference alias; + + /** + * The description of the bunq.me fundraiser profile. + */ + @Expose + @SerializedName("description") + private String description; + + /** + * The attachments attached to the fundraiser profile. + */ + @Expose + @SerializedName("attachment") + private List attachment; + + /** + * The pointer (url) which will be used to access the bunq.me fundraiser profile. + */ + @Expose + @SerializedName("pointer") + private MonetaryAccountReference pointer; + + /** + * The status of the bunq.me fundraiser profile, can be ACTIVE or DEACTIVATED. + */ + @Expose + @SerializedName("status") + private String status; + + /** + * The URL which the user is sent to when a payment is completed. + */ + @Expose + @SerializedName("redirect_url") + private String redirectUrl; + + /** + * The color chosen for the bunq.me fundraiser profile in hexadecimal format. + */ + public String getColor() { + return this.color; + } + + public void setColor(String color) { + this.color = color; + } + + /** + * The LabelMonetaryAccount with the public information of the User and the MonetaryAccount that + * created the bunq.me fundraiser profile. + */ + public MonetaryAccountReference getAlias() { + return this.alias; + } + + public void setAlias(MonetaryAccountReference alias) { + this.alias = alias; + } + + /** + * The description of the bunq.me fundraiser profile. + */ + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + /** + * The attachments attached to the fundraiser profile. + */ + public List getAttachment() { + return this.attachment; + } + + public void setAttachment(List attachment) { + this.attachment = attachment; + } + + /** + * The pointer (url) which will be used to access the bunq.me fundraiser profile. + */ + public MonetaryAccountReference getPointer() { + return this.pointer; + } + + public void setPointer(MonetaryAccountReference pointer) { + this.pointer = pointer; + } + + /** + * The status of the bunq.me fundraiser profile, can be ACTIVE or DEACTIVATED. + */ + public String getStatus() { + return this.status; + } + + public void setStatus(String status) { + this.status = status; + } + + /** + * The URL which the user is sent to when a payment is completed. + */ + public String getRedirectUrl() { + return this.redirectUrl; + } + + public void setRedirectUrl(String redirectUrl) { + this.redirectUrl = redirectUrl; + } + + /** + */ + public boolean isAllFieldNull() { + if (this.color != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.attachment != null) { + return false; + } + + if (this.pointer != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.redirectUrl != null) { + return false; + } + + return true; + } + + /** + */ + public static BunqMeFundraiserProfile fromJsonReader(JsonReader reader) { + return fromJsonReader(BunqMeFundraiserProfile.class, reader); + } + +} diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeFundraiserResult.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeFundraiserResult.java new file mode 100644 index 00000000..62495a44 --- /dev/null +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeFundraiserResult.java @@ -0,0 +1,146 @@ +package com.bunq.sdk.model.generated.endpoint; + +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; + +/** + * bunq.me fundraiser result containing all payments. + */ +public class BunqMeFundraiserResult extends BunqModel { + + /** + * Object type. + */ + private static final String OBJECT_TYPE = "BunqMeFundraiserResult"; + + /** + * The id of the bunq.me. + */ + @Expose + @SerializedName("id") + private Integer id; + + /** + * The timestamp when the bunq.me was created. + */ + @Expose + @SerializedName("created") + private String created; + + /** + * The timestamp when the bunq.me was last updated. + */ + @Expose + @SerializedName("updated") + private String updated; + + /** + * The bunq.me fundraiser profile. + */ + @Expose + @SerializedName("bunqme_fundraiser_profile") + private BunqMeFundraiserProfile bunqmeFundraiserProfile; + + /** + * The list of payments, paid to the bunq.me fundraiser profile. + */ + @Expose + @SerializedName("payments") + private List payments; + + /** + * The id of the bunq.me. + */ + public Integer getId() { + return this.id; + } + + public void setId(Integer id) { + this.id = id; + } + + /** + * The timestamp when the bunq.me was created. + */ + public String getCreated() { + return this.created; + } + + public void setCreated(String created) { + this.created = created; + } + + /** + * The timestamp when the bunq.me was last updated. + */ + public String getUpdated() { + return this.updated; + } + + public void setUpdated(String updated) { + this.updated = updated; + } + + /** + * The bunq.me fundraiser profile. + */ + public BunqMeFundraiserProfile getBunqmeFundraiserProfile() { + return this.bunqmeFundraiserProfile; + } + + public void setBunqmeFundraiserProfile(BunqMeFundraiserProfile bunqmeFundraiserProfile) { + this.bunqmeFundraiserProfile = bunqmeFundraiserProfile; + } + + /** + * The list of payments, paid to the bunq.me fundraiser profile. + */ + public List getPayments() { + return this.payments; + } + + public void setPayments(List payments) { + this.payments = payments; + } + + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.bunqmeFundraiserProfile != null) { + return false; + } + + if (this.payments != null) { + return false; + } + + return true; + } + + /** + */ + public static BunqMeFundraiserResult fromJsonReader(JsonReader reader) { + return fromJsonReader(BunqMeFundraiserResult.class, reader); + } + +} 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 86d16a98..2ce95c98 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 @@ -8,6 +8,7 @@ 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; @@ -261,4 +262,52 @@ public void setResultInquiries(List resultInquiries) { this.resultInquiries = resultInquiries; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.timeExpiry != null) { + return false; + } + + if (this.monetaryAccountId != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.bunqmeTabShareUrl != null) { + return false; + } + + if (this.bunqmeTabEntry != null) { + return false; + } + + if (this.resultInquiries != null) { + return false; + } + + return true; + } + + /** + */ + public static BunqMeTab fromJsonReader(JsonReader reader) { + return fromJsonReader(BunqMeTab.class, reader); + } + } 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 fbe26948..3bff3db4 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 @@ -7,6 +7,7 @@ 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; @@ -160,4 +161,44 @@ public void setMerchantAvailable(List merchantAvailable this.merchantAvailable = merchantAvailable; } + /** + */ + public boolean isAllFieldNull() { + if (this.uuid != null) { + return false; + } + + if (this.amountInquired != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.redirectUrl != null) { + return false; + } + + if (this.merchantAvailable != null) { + return false; + } + + return true; + } + + /** + */ + public static BunqMeTabEntry fromJsonReader(JsonReader reader) { + return fromJsonReader(BunqMeTabEntry.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabResultInquiry.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabResultInquiry.java index b37bd7ea..7ccfa9fd 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabResultInquiry.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabResultInquiry.java @@ -4,6 +4,7 @@ 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; @@ -39,4 +40,20 @@ public void setPayment(Payment payment) { this.payment = payment; } + /** + */ + public boolean isAllFieldNull() { + if (this.payment != null) { + return false; + } + + return true; + } + + /** + */ + public static BunqMeTabResultInquiry fromJsonReader(JsonReader reader) { + return fromJsonReader(BunqMeTabResultInquiry.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabResultResponse.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabResultResponse.java index fb9fe651..fa7b339e 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabResultResponse.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/BunqMeTabResultResponse.java @@ -4,6 +4,7 @@ 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; @@ -39,4 +40,20 @@ public void setPayment(Payment payment) { this.payment = payment; } + /** + */ + public boolean isAllFieldNull() { + if (this.payment != null) { + return false; + } + + return true; + } + + /** + */ + public static BunqMeTabResultResponse fromJsonReader(JsonReader reader) { + return fromJsonReader(BunqMeTabResultResponse.class, reader); + } + } 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 7dca9b22..4552a71b 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 @@ -14,6 +14,7 @@ import com.bunq.sdk.security.SecurityUtils; 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; @@ -487,4 +488,100 @@ public void setCountry(String country) { this.country = country; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.publicUuid != null) { + return false; + } + + if (this.type != null) { + return false; + } + + if (this.subType != null) { + return false; + } + + if (this.secondLine != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.subStatus != null) { + return false; + } + + if (this.orderStatus != null) { + return false; + } + + if (this.expiryDate != null) { + return false; + } + + if (this.nameOnCard != null) { + return false; + } + + if (this.primaryAccountNumberFourDigit != null) { + return false; + } + + if (this.limit != null) { + return false; + } + + if (this.magStripePermission != null) { + return false; + } + + if (this.countryPermission != null) { + return false; + } + + if (this.labelMonetaryAccountOrdered != null) { + return false; + } + + if (this.labelMonetaryAccountCurrent != null) { + return false; + } + + if (this.pinCodeAssignment != null) { + return false; + } + + if (this.monetaryAccountIdFallback != null) { + return false; + } + + if (this.country != null) { + return false; + } + + return true; + } + + /** + */ + public static Card fromJsonReader(JsonReader reader) { + return fromJsonReader(Card.class, reader); + } + } 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 896a0115..e78d632d 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 @@ -14,6 +14,7 @@ import com.bunq.sdk.security.SecurityUtils; 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; @@ -427,4 +428,96 @@ public void setCountry(String country) { this.country = country; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.publicUuid != null) { + return false; + } + + if (this.type != null) { + return false; + } + + if (this.subType != null) { + return false; + } + + if (this.secondLine != null) { + return false; + } + + if (this.nameOnCard != null) { + return false; + } + + if (this.primaryAccountNumberFourDigit != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.orderStatus != null) { + return false; + } + + if (this.expiryDate != null) { + return false; + } + + if (this.limit != null) { + return false; + } + + if (this.countryPermission != null) { + return false; + } + + if (this.labelMonetaryAccountOrdered != null) { + return false; + } + + if (this.labelMonetaryAccountCurrent != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.pinCodeAssignment != null) { + return false; + } + + if (this.monetaryAccountIdFallback != null) { + return false; + } + + if (this.country != null) { + return false; + } + + return true; + } + + /** + */ + public static CardDebit fromJsonReader(JsonReader reader) { + return fromJsonReader(CardDebit.class, reader); + } + } 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 a98b91fe..fed756f4 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 @@ -9,6 +9,7 @@ import com.bunq.sdk.security.SecurityUtils; 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; @@ -189,4 +190,40 @@ public void setExpiryTime(String expiryTime) { this.expiryTime = expiryTime; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.cvc2 != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.expiryTime != null) { + return false; + } + + return true; + } + + /** + */ + public static CardGeneratedCvc2 fromJsonReader(JsonReader reader) { + return fromJsonReader(CardGeneratedCvc2.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardName.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardName.java index eac78c77..a478836b 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CardName.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CardName.java @@ -8,6 +8,7 @@ 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; @@ -68,4 +69,20 @@ public void setPossibleCardNameArray(List possibleCardNameArray) { this.possibleCardNameArray = possibleCardNameArray; } + /** + */ + public boolean isAllFieldNull() { + if (this.possibleCardNameArray != null) { + return false; + } + + return true; + } + + /** + */ + public static CardName fromJsonReader(JsonReader reader) { + return fromJsonReader(CardName.class, reader); + } + } 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 e8cf9381..873af2c7 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 @@ -10,6 +10,7 @@ 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; @@ -171,4 +172,40 @@ public void setStatus(String status) { this.status = status; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.labelCard != null) { + return false; + } + + if (this.labelMonetaryAccountCurrent != null) { + return false; + } + + if (this.timeRequest != null) { + return false; + } + + if (this.timeAccept != null) { + return false; + } + + if (this.status != null) { + return false; + } + + return true; + } + + /** + */ + public static CardPinChange fromJsonReader(JsonReader reader) { + return fromJsonReader(CardPinChange.class, reader); + } + } 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 18018e8b..99a3ccbf 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 @@ -9,6 +9,7 @@ import com.bunq.sdk.security.SecurityUtils; 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; @@ -75,4 +76,20 @@ public void setId(Integer id) { this.id = id; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + return true; + } + + /** + */ + public static CardReplace fromJsonReader(JsonReader reader) { + return fromJsonReader(CardReplace.class, reader); + } + } 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 da7c159b..c13c707c 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 @@ -11,6 +11,7 @@ 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; @@ -352,4 +353,80 @@ public void setReservationExpiryTime(String reservationExpiryTime) { this.reservationExpiryTime = reservationExpiryTime; } + /** + */ + public boolean isAllFieldNull() { + if (this.monetaryAccountId != null) { + return false; + } + + if (this.cardId != null) { + return false; + } + + if (this.amountOriginal != null) { + return false; + } + + if (this.amountFinal != null) { + return false; + } + + if (this.decision != null) { + return false; + } + + if (this.decisionDescription != null) { + return false; + } + + if (this.decisionDescriptionTranslated != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.messageType != null) { + return false; + } + + if (this.authorisationType != null) { + return false; + } + + if (this.city != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.labelCard != null) { + return false; + } + + if (this.reservationStatus != null) { + return false; + } + + if (this.reservationExpiryTime != null) { + return false; + } + + return true; + } + + /** + */ + public static CardResult fromJsonReader(JsonReader reader) { + return fromJsonReader(CardResult.class, reader); + } + } 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 ac5f0cd1..3bbbf40f 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 @@ -12,6 +12,7 @@ import com.bunq.sdk.model.generated.object.TabTextWaitingScreen; 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; @@ -283,4 +284,52 @@ public void setTabTextWaitingScreen(List tabTextWaitingScr this.tabTextWaitingScreen = tabTextWaitingScreen; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.name != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.avatar != null) { + return false; + } + + if (this.location != null) { + return false; + } + + if (this.notificationFilters != null) { + return false; + } + + if (this.tabTextWaitingScreen != null) { + return false; + } + + return true; + } + + /** + */ + public static CashRegister fromJsonReader(JsonReader reader) { + return fromJsonReader(CashRegister.class, reader); + } + } 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 d439c749..62b8572c 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 @@ -8,6 +8,7 @@ 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; @@ -219,4 +220,40 @@ public void setTabObject(Tab tabObject) { this.tabObject = tabObject; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.cashRegister != null) { + return false; + } + + if (this.tabObject != null) { + return false; + } + + return true; + } + + /** + */ + public static CashRegisterQrCode fromJsonReader(JsonReader reader) { + return fromJsonReader(CashRegisterQrCode.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegisterQrCodeContent.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegisterQrCodeContent.java index 132ae9c6..a6fb5dc9 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegisterQrCodeContent.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CashRegisterQrCodeContent.java @@ -8,6 +8,7 @@ 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; @@ -45,4 +46,16 @@ public static BunqResponse list(ApiContext apiContext, Integer userId, I return new BunqResponse<>(responseRaw.getBodyBytes(), responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static CashRegisterQrCodeContent fromJsonReader(JsonReader reader) { + return fromJsonReader(CashRegisterQrCodeContent.class, reader); + } + } 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 23765784..b513334d 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 @@ -8,6 +8,7 @@ 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; @@ -137,4 +138,24 @@ public void setId(Integer id) { this.id = id; } + /** + */ + public boolean isAllFieldNull() { + if (this.certificateChain != null) { + return false; + } + + if (this.id != null) { + return false; + } + + return true; + } + + /** + */ + public static CertificatePinned fromJsonReader(JsonReader reader) { + return fromJsonReader(CertificatePinned.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversation.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversation.java index 49daed2d..701b1b02 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversation.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversation.java @@ -5,10 +5,12 @@ import com.bunq.sdk.http.ApiClient; import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; +import com.bunq.sdk.model.core.AnchorObjectInterface; 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; @@ -19,7 +21,7 @@ /** * Manages user's conversations. */ -public class ChatConversation extends BunqModel { +public class ChatConversation extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -113,4 +115,24 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.supportConversationExternal != null) { + return false; + } + + if (this.chatConversationReference != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatConversation fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatConversation.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversationReference.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversationReference.java index fed655bc..17fea384 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversationReference.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversationReference.java @@ -4,6 +4,7 @@ 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; @@ -74,4 +75,28 @@ public void setUpdated(String updated) { this.updated = updated; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatConversationReference fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatConversationReference.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversationSupportExternal.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversationSupportExternal.java index 429b06fd..c2398c76 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversationSupportExternal.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatConversationSupportExternal.java @@ -4,6 +4,7 @@ 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; @@ -92,4 +93,32 @@ public void setLastMessage(ChatMessage lastMessage) { this.lastMessage = lastMessage; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.lastMessage != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatConversationSupportExternal fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatConversationSupportExternal.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessage.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessage.java index a02a7476..096c18f4 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessage.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessage.java @@ -5,10 +5,12 @@ import com.bunq.sdk.http.ApiClient; import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; +import com.bunq.sdk.model.core.AnchorObjectInterface; 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; @@ -19,7 +21,7 @@ /** * Endpoint for retrieving the messages that are part of a conversation. */ -public class ChatMessage extends BunqModel { +public class ChatMessage extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -120,4 +122,28 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.chatMessageAnnouncement != null) { + return false; + } + + if (this.chatMessageStatus != null) { + return false; + } + + if (this.chatMessageUser != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessage fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessage.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageAnnouncement.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageAnnouncement.java index 72a3edc2..ae7ad2ae 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageAnnouncement.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageAnnouncement.java @@ -6,6 +6,7 @@ import com.bunq.sdk.model.generated.object.LabelUser; 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; @@ -130,4 +131,40 @@ public void setContent(ChatMessageContent content) { this.content = content; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.conversationId != null) { + return false; + } + + if (this.creator != null) { + return false; + } + + if (this.content != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageAnnouncement fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageAnnouncement.class, reader); + } + } 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 b25a6fe2..9caf34d8 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 @@ -8,6 +8,7 @@ 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; @@ -69,4 +70,20 @@ public void setId(Integer id) { this.id = id; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageAttachment fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageAttachment.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageStatus.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageStatus.java index 99930f16..baed807d 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageStatus.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageStatus.java @@ -6,6 +6,7 @@ import com.bunq.sdk.model.generated.object.LabelUser; 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; @@ -130,4 +131,40 @@ public void setContent(ChatMessageContent content) { this.content = content; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.conversationId != null) { + return false; + } + + if (this.creator != null) { + return false; + } + + if (this.content != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageStatus fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageStatus.class, reader); + } + } 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 ee532a2a..7b5d5abe 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 @@ -8,6 +8,7 @@ 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; @@ -69,4 +70,20 @@ public void setId(Integer id) { this.id = id; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageText fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageText.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageUser.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageUser.java index e3543ad2..a4381677 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageUser.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ChatMessageUser.java @@ -6,6 +6,7 @@ import com.bunq.sdk.model.generated.object.LabelUser; 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; @@ -148,4 +149,44 @@ public void setContent(ChatMessageContent content) { this.content = content; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.conversationId != null) { + return false; + } + + if (this.creator != null) { + return false; + } + + if (this.displayedSender != null) { + return false; + } + + if (this.content != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageUser fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageUser.class, reader); + } + } 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 ec19d723..ad8f7cdc 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 @@ -8,6 +8,7 @@ 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; @@ -153,4 +154,32 @@ public void setBillingAccountId(String billingAccountId) { this.billingAccountId = billingAccountId; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.billingAccountId != null) { + return false; + } + + return true; + } + + /** + */ + public static Customer fromJsonReader(JsonReader reader) { + return fromJsonReader(Customer.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerLimit.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerLimit.java index 05ac4377..984156c2 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerLimit.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerLimit.java @@ -8,6 +8,7 @@ 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; @@ -138,4 +139,36 @@ public void setLimitCardDebitReplacement(Integer limitCardDebitReplacement) { this.limitCardDebitReplacement = limitCardDebitReplacement; } + /** + */ + public boolean isAllFieldNull() { + if (this.limitMonetaryAccount != null) { + return false; + } + + if (this.limitCardDebitMaestro != null) { + return false; + } + + if (this.limitCardDebitMastercard != null) { + return false; + } + + if (this.limitCardDebitWildcard != null) { + return false; + } + + if (this.limitCardDebitReplacement != null) { + return false; + } + + return true; + } + + /** + */ + public static CustomerLimit fromJsonReader(JsonReader reader) { + return fromJsonReader(CustomerLimit.class, reader); + } + } 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 2ce2c884..0dc2b228 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 @@ -9,6 +9,7 @@ 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; @@ -280,4 +281,56 @@ public void setAliasMonetaryAccount(MonetaryAccountReference aliasMonetaryAccoun this.aliasMonetaryAccount = aliasMonetaryAccount; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.dateStart != null) { + return false; + } + + if (this.dateEnd != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.statementNumber != null) { + return false; + } + + if (this.statementFormat != null) { + return false; + } + + if (this.regionalFormat != null) { + return false; + } + + if (this.aliasMonetaryAccount != null) { + return false; + } + + return true; + } + + /** + */ + public static CustomerStatementExport fromJsonReader(JsonReader reader) { + return fromJsonReader(CustomerStatementExport.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerStatementExportContent.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerStatementExportContent.java index 3f7d012c..110c702a 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerStatementExportContent.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/CustomerStatementExportContent.java @@ -8,6 +8,7 @@ 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; @@ -45,4 +46,16 @@ public static BunqResponse list(ApiContext apiContext, Integer userId, I return new BunqResponse<>(responseRaw.getBodyBytes(), responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static CustomerStatementExportContent fromJsonReader(JsonReader reader) { + return fromJsonReader(CustomerStatementExportContent.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/Device.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/Device.java index fc40a035..bf1ac8f2 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/Device.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/Device.java @@ -5,10 +5,12 @@ import com.bunq.sdk.http.ApiClient; import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; +import com.bunq.sdk.model.core.AnchorObjectInterface; 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; @@ -20,7 +22,7 @@ * Used to get a Device or a listing of Devices. Creating a DeviceServer should happen via * /device-server */ -public class Device extends BunqModel { +public class Device extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -96,4 +98,20 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.deviceServer != null) { + return false; + } + + return true; + } + + /** + */ + public static Device fromJsonReader(JsonReader reader) { + return fromJsonReader(Device.class, reader); + } + } 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 120839e2..0ab60b71 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 @@ -8,6 +8,7 @@ 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; @@ -201,4 +202,40 @@ public void setStatus(String status) { this.status = status; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.ip != null) { + return false; + } + + if (this.status != null) { + return false; + } + + return true; + } + + /** + */ + public static DeviceServer fromJsonReader(JsonReader reader) { + return fromJsonReader(DeviceServer.class, reader); + } + } 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 a0f434d5..0dadaaac 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 @@ -12,6 +12,7 @@ import com.bunq.sdk.model.generated.object.LabelUser; 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; @@ -254,4 +255,48 @@ public void setObject(DraftPaymentAnchorObject object) { this.object = object; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.monetaryAccountId != null) { + return false; + } + + if (this.userAliasCreated != null) { + return false; + } + + if (this.responses != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.type != null) { + return false; + } + + if (this.entries != null) { + return false; + } + + if (this.object != null) { + return false; + } + + return true; + } + + /** + */ + public static DraftPayment fromJsonReader(JsonReader reader) { + return fromJsonReader(DraftPayment.class, reader); + } + } 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 f4c30f49..a4229bb8 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 @@ -10,6 +10,7 @@ import com.bunq.sdk.model.generated.object.LabelUser; 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; @@ -231,4 +232,44 @@ public void setId(Integer id) { this.id = id; } + /** + */ + public boolean isAllFieldNull() { + if (this.userAliasCreated != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.expiration != null) { + return false; + } + + if (this.shareInviteBankResponseId != null) { + return false; + } + + if (this.draftShareUrl != null) { + return false; + } + + if (this.draftShareSettings != null) { + return false; + } + + if (this.id != null) { + return false; + } + + return true; + } + + /** + */ + public static DraftShareInviteBank fromJsonReader(JsonReader reader) { + return fromJsonReader(DraftShareInviteBank.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteBankQrCodeContent.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteBankQrCodeContent.java index 98a31d9c..07b252cc 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteBankQrCodeContent.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/DraftShareInviteBankQrCodeContent.java @@ -8,6 +8,7 @@ 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; @@ -47,4 +48,16 @@ public static BunqResponse list(ApiContext apiContext, Integer userId, I return new BunqResponse<>(responseRaw.getBodyBytes(), responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static DraftShareInviteBankQrCodeContent fromJsonReader(JsonReader reader) { + return fromJsonReader(DraftShareInviteBankQrCodeContent.class, reader); + } + } 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 ece11fee..a4b791c2 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 @@ -9,6 +9,7 @@ import com.bunq.sdk.model.generated.object.LabelUser; 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; @@ -178,4 +179,36 @@ public void setAliasUser(LabelUser aliasUser) { this.aliasUser = aliasUser; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.year != null) { + return false; + } + + if (this.aliasUser != null) { + return false; + } + + return true; + } + + /** + */ + public static ExportAnnualOverview fromJsonReader(JsonReader reader) { + return fromJsonReader(ExportAnnualOverview.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ExportAnnualOverviewContent.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ExportAnnualOverviewContent.java index 92ec1efe..704b1b41 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ExportAnnualOverviewContent.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ExportAnnualOverviewContent.java @@ -8,6 +8,7 @@ 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; @@ -45,4 +46,16 @@ public static BunqResponse list(ApiContext apiContext, Integer userId, I return new BunqResponse<>(responseRaw.getBodyBytes(), responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static ExportAnnualOverviewContent fromJsonReader(JsonReader reader) { + return fromJsonReader(ExportAnnualOverviewContent.class, reader); + } + } 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 8b15df4b..2fd91256 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 @@ -10,6 +10,7 @@ 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; @@ -336,4 +337,72 @@ public void setAllowChat(Boolean allowChat) { this.allowChat = allowChat; } + /** + */ + public boolean isAllFieldNull() { + if (this.monetaryAccountId != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.amountGuaranteed != null) { + return false; + } + + if (this.amountRequested != null) { + return false; + } + + if (this.expiration != null) { + return false; + } + + if (this.issuer != null) { + return false; + } + + if (this.issuerName != null) { + return false; + } + + if (this.issuerAuthenticationUrl != null) { + return false; + } + + if (this.purchaseIdentifier != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.statusTimestamp != null) { + return false; + } + + if (this.transactionIdentifier != null) { + return false; + } + + if (this.allowChat != null) { + return false; + } + + return true; + } + + /** + */ + public static IdealMerchantTransaction fromJsonReader(JsonReader reader) { + return fromJsonReader(IdealMerchantTransaction.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/InstallationServerPublicKey.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/InstallationServerPublicKey.java index 5eec479b..0075d987 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/InstallationServerPublicKey.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/InstallationServerPublicKey.java @@ -8,6 +8,7 @@ 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; @@ -67,4 +68,20 @@ public void setServerPublicKey(String serverPublicKey) { this.serverPublicKey = serverPublicKey; } + /** + */ + public boolean isAllFieldNull() { + if (this.serverPublicKey != null) { + return false; + } + + return true; + } + + /** + */ + public static InstallationServerPublicKey fromJsonReader(JsonReader reader) { + return fromJsonReader(InstallationServerPublicKey.class, reader); + } + } 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 ed800e7b..74226077 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 @@ -12,6 +12,7 @@ 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; @@ -360,4 +361,80 @@ public void setVatNumber(String vatNumber) { this.vatNumber = vatNumber; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.invoiceDate != null) { + return false; + } + + if (this.invoiceNumber != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.group != null) { + return false; + } + + if (this.totalVatInclusive != null) { + return false; + } + + if (this.totalVatExclusive != null) { + return false; + } + + if (this.totalVat != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.address != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.counterpartyAddress != null) { + return false; + } + + if (this.chamberOfCommerceNumber != null) { + return false; + } + + if (this.vatNumber != null) { + return false; + } + + return true; + } + + /** + */ + public static Invoice fromJsonReader(JsonReader reader) { + return fromJsonReader(Invoice.class, reader); + } + } 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 4982eefd..01623160 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 @@ -12,6 +12,7 @@ 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; @@ -353,4 +354,80 @@ public void setVatNumber(String vatNumber) { this.vatNumber = vatNumber; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.invoiceDate != null) { + return false; + } + + if (this.invoiceNumber != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.group != null) { + return false; + } + + if (this.totalVatInclusive != null) { + return false; + } + + if (this.totalVatExclusive != null) { + return false; + } + + if (this.totalVat != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.address != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.counterpartyAddress != null) { + return false; + } + + if (this.chamberOfCommerceNumber != null) { + return false; + } + + if (this.vatNumber != null) { + return false; + } + + return true; + } + + /** + */ + public static InvoiceByUser fromJsonReader(JsonReader reader) { + return fromJsonReader(InvoiceByUser.class, reader); + } + } 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 36d11f89..df3bc15e 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 @@ -11,6 +11,7 @@ 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; @@ -480,4 +481,108 @@ public void setEligibleWhitelistId(Integer eligibleWhitelistId) { this.eligibleWhitelistId = eligibleWhitelistId; } + /** + */ + public boolean isAllFieldNull() { + if (this.monetaryAccountId != null) { + return false; + } + + if (this.cardId != null) { + return false; + } + + if (this.amountLocal != null) { + return false; + } + + if (this.amountBilling != null) { + return false; + } + + if (this.amountOriginalLocal != null) { + return false; + } + + if (this.amountOriginalBilling != null) { + return false; + } + + if (this.amountFee != null) { + return false; + } + + if (this.decision != null) { + return false; + } + + if (this.decisionDescription != null) { + return false; + } + + if (this.decisionDescriptionTranslated != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.authorisationStatus != null) { + return false; + } + + if (this.authorisationType != null) { + return false; + } + + if (this.panEntryModeUser != null) { + return false; + } + + if (this.city != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.labelCard != null) { + return false; + } + + if (this.tokenStatus != null) { + return false; + } + + if (this.reservationExpiryTime != null) { + return false; + } + + if (this.appliedLimit != null) { + return false; + } + + if (this.allowChat != null) { + return false; + } + + if (this.eligibleWhitelistId != null) { + return false; + } + + return true; + } + + /** + */ + public static MasterCardAction fromJsonReader(JsonReader reader) { + return fromJsonReader(MasterCardAction.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccount.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccount.java index 91e8516b..a4d4b17a 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccount.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/MonetaryAccount.java @@ -5,10 +5,12 @@ import com.bunq.sdk.http.ApiClient; import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; +import com.bunq.sdk.model.core.AnchorObjectInterface; 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; @@ -22,7 +24,7 @@ * can be set on a monetary account level to receive callbacks. For more information check the * dedicated callbacks page. */ -public class MonetaryAccount extends BunqModel { +public class MonetaryAccount extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -98,4 +100,20 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.monetaryAccountBank != null) { + return false; + } + + return true; + } + + /** + */ + public static MonetaryAccount fromJsonReader(JsonReader reader) { + return fromJsonReader(MonetaryAccount.class, reader); + } + } 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 a2995ecc..c29c0b89 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 @@ -13,6 +13,7 @@ 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; @@ -492,4 +493,96 @@ public void setSetting(MonetaryAccountSetting setting) { this.setting = setting; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.avatar != null) { + return false; + } + + if (this.currency != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.dailyLimit != null) { + return false; + } + + if (this.dailySpent != null) { + return false; + } + + if (this.overdraftLimit != null) { + return false; + } + + if (this.balance != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.publicUuid != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.subStatus != null) { + return false; + } + + if (this.reason != null) { + return false; + } + + if (this.reasonDescription != null) { + return false; + } + + if (this.userId != null) { + return false; + } + + if (this.monetaryAccountProfile != null) { + return false; + } + + if (this.notificationFilters != null) { + return false; + } + + if (this.setting != null) { + return false; + } + + return true; + } + + /** + */ + public static MonetaryAccountBank fromJsonReader(JsonReader reader) { + return fromJsonReader(MonetaryAccountBank.class, reader); + } + } 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 4a3ad657..f704e068 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 @@ -6,6 +6,7 @@ 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; @@ -65,4 +66,24 @@ public void setProfileDrain(MonetaryAccountProfileDrain profileDrain) { this.profileDrain = profileDrain; } + /** + */ + public boolean isAllFieldNull() { + if (this.profileFill != null) { + return false; + } + + if (this.profileDrain != null) { + return false; + } + + return true; + } + + /** + */ + public static MonetaryAccountProfile fromJsonReader(JsonReader reader) { + return fromJsonReader(MonetaryAccountProfile.class, reader); + } + } 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 2313b2b7..b2c1e62e 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 @@ -13,6 +13,7 @@ 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; @@ -527,4 +528,108 @@ public void setAllowChat(Boolean allowChat) { this.allowChat = allowChat; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.monetaryAccountId != null) { + return false; + } + + if (this.amount != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.type != null) { + return false; + } + + if (this.subType != null) { + return false; + } + + if (this.bunqtoStatus != null) { + return false; + } + + if (this.bunqtoSubStatus != null) { + return false; + } + + if (this.bunqtoShareUrl != null) { + return false; + } + + if (this.bunqtoExpiry != null) { + return false; + } + + if (this.bunqtoTimeResponded != null) { + return false; + } + + if (this.attachment != null) { + return false; + } + + if (this.merchantReference != null) { + return false; + } + + if (this.batchId != null) { + return false; + } + + if (this.scheduledId != null) { + return false; + } + + if (this.addressShipping != null) { + return false; + } + + if (this.addressBilling != null) { + return false; + } + + if (this.geolocation != null) { + return false; + } + + if (this.allowChat != null) { + return false; + } + + return true; + } + + /** + */ + public static Payment fromJsonReader(JsonReader reader) { + return fromJsonReader(Payment.class, reader); + } + } 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 eaed7463..fff981ca 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 @@ -8,6 +8,7 @@ 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; @@ -120,4 +121,20 @@ public void setPayments(List payments) { this.payments = payments; } + /** + */ + public boolean isAllFieldNull() { + if (this.payments != null) { + return false; + } + + return true; + } + + /** + */ + public static PaymentBatch fromJsonReader(JsonReader reader) { + return fromJsonReader(PaymentBatch.class, reader); + } + } 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 00c82991..3f1aa879 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 @@ -8,6 +8,7 @@ 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; @@ -157,4 +158,32 @@ public void setUnreadMessageCount(Integer unreadMessageCount) { this.unreadMessageCount = unreadMessageCount; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.unreadMessageCount != null) { + return false; + } + + return true; + } + + /** + */ + public static PaymentChat fromJsonReader(JsonReader reader) { + return fromJsonReader(PaymentChat.class, reader); + } + } 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 e0712685..fe131082 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 @@ -8,6 +8,7 @@ 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; @@ -135,4 +136,24 @@ public void setStatus(String status) { this.status = status; } + /** + */ + public boolean isAllFieldNull() { + if (this.ip != null) { + return false; + } + + if (this.status != null) { + return false; + } + + return true; + } + + /** + */ + public static PermittedIp fromJsonReader(JsonReader reader) { + return fromJsonReader(PermittedIp.class, reader); + } + } 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 0ea47ac8..daa02bb3 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 @@ -9,6 +9,7 @@ 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; @@ -136,4 +137,32 @@ public void setStatus(String status) { this.status = status; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.eventDescription != null) { + return false; + } + + if (this.status != null) { + return false; + } + + return true; + } + + /** + */ + public static PromotionDisplay fromJsonReader(JsonReader reader) { + return fromJsonReader(PromotionDisplay.class, reader); + } + } 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 f804d575..16b70811 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 @@ -14,6 +14,7 @@ import com.bunq.sdk.model.generated.object.LabelUser; 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; @@ -574,4 +575,116 @@ public void setAllowChat(Boolean allowChat) { this.allowChat = allowChat; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.timeResponded != null) { + return false; + } + + if (this.timeExpiry != null) { + return false; + } + + if (this.monetaryAccountId != null) { + return false; + } + + if (this.amountInquired != null) { + return false; + } + + if (this.amountResponded != null) { + return false; + } + + if (this.userAliasCreated != null) { + return false; + } + + if (this.userAliasRevoked != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.merchantReference != null) { + return false; + } + + if (this.attachment != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.batchId != null) { + return false; + } + + if (this.scheduledId != null) { + return false; + } + + if (this.minimumAge != null) { + return false; + } + + if (this.requireAddress != null) { + return false; + } + + if (this.bunqmeShareUrl != null) { + return false; + } + + if (this.redirectUrl != null) { + return false; + } + + if (this.addressShipping != null) { + return false; + } + + if (this.addressBilling != null) { + return false; + } + + if (this.geolocation != null) { + return false; + } + + if (this.allowChat != null) { + return false; + } + + return true; + } + + /** + */ + public static RequestInquiry fromJsonReader(JsonReader reader) { + return fromJsonReader(RequestInquiry.class, reader); + } + } 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 1414852e..87b53bfe 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 @@ -9,6 +9,7 @@ import com.bunq.sdk.model.generated.object.Amount; 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; @@ -140,4 +141,24 @@ public void setTotalAmountInquired(Amount totalAmountInquired) { this.totalAmountInquired = totalAmountInquired; } + /** + */ + public boolean isAllFieldNull() { + if (this.requestInquiries != null) { + return false; + } + + if (this.totalAmountInquired != null) { + return false; + } + + return true; + } + + /** + */ + public static RequestInquiryBatch fromJsonReader(JsonReader reader) { + return fromJsonReader(RequestInquiryBatch.class, reader); + } + } 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 8a70330f..3961c0a1 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 @@ -8,6 +8,7 @@ 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; @@ -160,4 +161,32 @@ public void setUnreadMessageCount(Integer unreadMessageCount) { this.unreadMessageCount = unreadMessageCount; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.unreadMessageCount != null) { + return false; + } + + return true; + } + + /** + */ + public static RequestInquiryChat fromJsonReader(JsonReader reader) { + return fromJsonReader(RequestInquiryChat.class, reader); + } + } 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 1b907432..ed8bbbd2 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 @@ -13,6 +13,7 @@ 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; @@ -555,4 +556,116 @@ public void setEligibleWhitelistId(Integer eligibleWhitelistId) { this.eligibleWhitelistId = eligibleWhitelistId; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.timeResponded != null) { + return false; + } + + if (this.timeExpiry != null) { + return false; + } + + if (this.monetaryAccountId != null) { + return false; + } + + if (this.amountInquired != null) { + return false; + } + + if (this.amountResponded != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.attachment != null) { + return false; + } + + if (this.minimumAge != null) { + return false; + } + + if (this.requireAddress != null) { + return false; + } + + if (this.geolocation != null) { + return false; + } + + if (this.type != null) { + return false; + } + + if (this.subType != null) { + return false; + } + + if (this.redirectUrl != null) { + return false; + } + + if (this.addressBilling != null) { + return false; + } + + if (this.addressShipping != null) { + return false; + } + + if (this.allowChat != null) { + return false; + } + + if (this.creditSchemeIdentifier != null) { + return false; + } + + if (this.mandateIdentifier != null) { + return false; + } + + if (this.eligibleWhitelistId != null) { + return false; + } + + return true; + } + + /** + */ + public static RequestResponse fromJsonReader(JsonReader reader) { + return fromJsonReader(RequestResponse.class, reader); + } + } 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 e3486295..f5b9d640 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 @@ -8,6 +8,7 @@ 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; @@ -160,4 +161,32 @@ public void setUnreadMessageCount(Integer unreadMessageCount) { this.unreadMessageCount = unreadMessageCount; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.unreadMessageCount != null) { + return false; + } + + return true; + } + + /** + */ + public static RequestResponseChat fromJsonReader(JsonReader reader) { + return fromJsonReader(RequestResponseChat.class, reader); + } + } 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 b2bad0ac..170d8e5f 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 @@ -9,6 +9,7 @@ import com.bunq.sdk.model.generated.object.ScheduleAnchorObject; 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; @@ -185,4 +186,40 @@ public void setObject(ScheduleAnchorObject object) { this.object = object; } + /** + */ + public boolean isAllFieldNull() { + if (this.timeStart != null) { + return false; + } + + if (this.timeEnd != null) { + return false; + } + + if (this.recurrenceUnit != null) { + return false; + } + + if (this.recurrenceSize != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.object != null) { + return false; + } + + return true; + } + + /** + */ + public static Schedule fromJsonReader(JsonReader reader) { + return fromJsonReader(Schedule.class, reader); + } + } 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 11b043bd..75b99027 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 @@ -11,6 +11,7 @@ import com.bunq.sdk.model.generated.object.ScheduleInstanceAnchorObject; 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; @@ -192,4 +193,40 @@ public void setResultObject(ScheduleInstanceAnchorObject resultObject) { this.resultObject = resultObject; } + /** + */ + public boolean isAllFieldNull() { + if (this.state != null) { + return false; + } + + if (this.timeStart != null) { + return false; + } + + if (this.timeEnd != null) { + return false; + } + + if (this.errorMessage != null) { + return false; + } + + if (this.scheduledObject != null) { + return false; + } + + if (this.resultObject != null) { + return false; + } + + return true; + } + + /** + */ + public static ScheduleInstance fromJsonReader(JsonReader reader) { + return fromJsonReader(ScheduleInstance.class, reader); + } + } 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 35d3e023..62f0f3d4 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 @@ -9,6 +9,7 @@ import com.bunq.sdk.model.generated.object.SchedulePaymentEntry; 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; @@ -148,4 +149,24 @@ public void setSchedule(Schedule schedule) { this.schedule = schedule; } + /** + */ + public boolean isAllFieldNull() { + if (this.payment != null) { + return false; + } + + if (this.schedule != null) { + return false; + } + + return true; + } + + /** + */ + public static SchedulePayment fromJsonReader(JsonReader reader) { + return fromJsonReader(SchedulePayment.class, reader); + } + } 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 f391cfc2..c5412319 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 @@ -9,6 +9,7 @@ import com.bunq.sdk.model.generated.object.SchedulePaymentEntry; 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; @@ -116,4 +117,24 @@ public void setSchedule(Schedule schedule) { this.schedule = schedule; } + /** + */ + public boolean isAllFieldNull() { + if (this.payments != null) { + return false; + } + + if (this.schedule != null) { + return false; + } + + return true; + } + + /** + */ + public static SchedulePaymentBatch fromJsonReader(JsonReader reader) { + return fromJsonReader(SchedulePaymentBatch.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ScheduleUser.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ScheduleUser.java index 569689a7..203154b3 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ScheduleUser.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ScheduleUser.java @@ -8,6 +8,7 @@ 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; @@ -51,4 +52,16 @@ public static BunqResponse> list(ApiContext apiContext, Integ return fromJsonList(ScheduleUser.class, responseRaw, OBJECT_TYPE); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static ScheduleUser fromJsonReader(JsonReader reader) { + return fromJsonReader(ScheduleUser.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/Session.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/Session.java index c515ed90..900c4871 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/Session.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/Session.java @@ -8,6 +8,7 @@ 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; @@ -44,4 +45,16 @@ public static BunqResponse delete(ApiContext apiContext, Integer sessi return new BunqResponse<>(null, responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static Session fromJsonReader(JsonReader reader) { + return fromJsonReader(Session.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankAmountUsed.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankAmountUsed.java index 83b08912..8e1d909c 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankAmountUsed.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/ShareInviteBankAmountUsed.java @@ -8,6 +8,7 @@ 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; @@ -48,4 +49,16 @@ public static BunqResponse delete(ApiContext apiContext, Integer userI return new BunqResponse<>(null, responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static ShareInviteBankAmountUsed fromJsonReader(JsonReader reader) { + return fromJsonReader(ShareInviteBankAmountUsed.class, reader); + } + } 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 f5490de7..02a445f2 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 @@ -11,6 +11,7 @@ import com.bunq.sdk.model.generated.object.ShareDetail; 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; @@ -336,4 +337,64 @@ public void setId(Integer id) { this.id = id; } + /** + */ + public boolean isAllFieldNull() { + if (this.alias != null) { + return false; + } + + if (this.userAliasCreated != null) { + return false; + } + + if (this.userAliasRevoked != null) { + return false; + } + + if (this.counterUserAlias != null) { + return false; + } + + if (this.monetaryAccountId != null) { + return false; + } + + if (this.draftShareInviteBankId != null) { + return false; + } + + if (this.shareDetail != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.shareType != null) { + return false; + } + + if (this.startDate != null) { + return false; + } + + if (this.endDate != null) { + return false; + } + + if (this.id != null) { + return false; + } + + return true; + } + + /** + */ + public static ShareInviteBankInquiry fromJsonReader(JsonReader reader) { + return fromJsonReader(ShareInviteBankInquiry.class, reader); + } + } 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 25544ba7..1aa7bb45 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 @@ -11,6 +11,7 @@ import com.bunq.sdk.model.generated.object.ShareDetail; 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; @@ -274,4 +275,56 @@ public void setDescription(String description) { this.description = description; } + /** + */ + public boolean isAllFieldNull() { + if (this.counterAlias != null) { + return false; + } + + if (this.userAliasCancelled != null) { + return false; + } + + if (this.monetaryAccountId != null) { + return false; + } + + if (this.draftShareInviteBankId != null) { + return false; + } + + if (this.shareDetail != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.shareType != null) { + return false; + } + + if (this.startDate != null) { + return false; + } + + if (this.endDate != null) { + return false; + } + + if (this.description != null) { + return false; + } + + return true; + } + + /** + */ + public static ShareInviteBankResponse fromJsonReader(JsonReader reader) { + return fromJsonReader(ShareInviteBankResponse.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/Tab.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/Tab.java index 930ba911..8486f6a1 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/Tab.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/Tab.java @@ -5,10 +5,12 @@ import com.bunq.sdk.http.ApiClient; import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; +import com.bunq.sdk.model.core.AnchorObjectInterface; 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; @@ -23,7 +25,7 @@ * /tab-usage-single or /tab-usage-multiple. A TabUsageSingle is a Tab that can be paid once. A * TabUsageMultiple is a Tab that can be paid multiple times by different users. */ -public class Tab extends BunqModel { +public class Tab extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -119,4 +121,24 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.tabUsageSingle != null) { + return false; + } + + if (this.tabUsageMultiple != null) { + return false; + } + + return true; + } + + /** + */ + public static Tab fromJsonReader(JsonReader reader) { + return fromJsonReader(Tab.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabAttachmentTab.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabAttachmentTab.java index c6e1dd8f..c0724f30 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabAttachmentTab.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabAttachmentTab.java @@ -9,6 +9,7 @@ import com.bunq.sdk.model.generated.object.Attachment; 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; @@ -118,4 +119,32 @@ public void setAttachment(Attachment attachment) { this.attachment = attachment; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.attachment != null) { + return false; + } + + return true; + } + + /** + */ + public static TabAttachmentTab fromJsonReader(JsonReader reader) { + return fromJsonReader(TabAttachmentTab.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabAttachmentTabContent.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabAttachmentTabContent.java index 90f7152f..5c46056b 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabAttachmentTabContent.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabAttachmentTabContent.java @@ -8,6 +8,7 @@ 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; @@ -45,4 +46,16 @@ public static BunqResponse list(ApiContext apiContext, String tabUuid, I return new BunqResponse<>(responseRaw.getBodyBytes(), responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static TabAttachmentTabContent fromJsonReader(JsonReader reader) { + return fromJsonReader(TabAttachmentTabContent.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItem.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItem.java index c8430410..2ec326b6 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItem.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItem.java @@ -7,6 +7,7 @@ import com.bunq.sdk.model.generated.object.AttachmentTab; 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; @@ -151,4 +152,44 @@ public void setAmount(Amount amount) { this.amount = amount; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.eanCode != null) { + return false; + } + + if (this.avatarAttachment != null) { + return false; + } + + if (this.tabAttachment != null) { + return false; + } + + if (this.quantity != null) { + return false; + } + + if (this.amount != null) { + return false; + } + + return true; + } + + /** + */ + public static TabItem fromJsonReader(JsonReader reader) { + return fromJsonReader(TabItem.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItemShop.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItemShop.java index aacdf6bf..7fd97724 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItemShop.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabItemShop.java @@ -11,6 +11,7 @@ import com.bunq.sdk.model.generated.object.AttachmentTab; 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; @@ -254,4 +255,44 @@ public void setAmount(Amount amount) { this.amount = amount; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.eanCode != null) { + return false; + } + + if (this.avatarAttachment != null) { + return false; + } + + if (this.tabAttachment != null) { + return false; + } + + if (this.quantity != null) { + return false; + } + + if (this.amount != null) { + return false; + } + + return true; + } + + /** + */ + public static TabItemShop fromJsonReader(JsonReader reader) { + return fromJsonReader(TabItemShop.class, reader); + } + } 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 343f855c..097fcce4 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 @@ -8,6 +8,7 @@ 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; @@ -68,4 +69,20 @@ public void setTabItems(List tabItems) { this.tabItems = tabItems; } + /** + */ + public boolean isAllFieldNull() { + if (this.tabItems != null) { + return false; + } + + return true; + } + + /** + */ + public static TabItemShopBatch fromJsonReader(JsonReader reader) { + return fromJsonReader(TabItemShopBatch.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabQrCodeContent.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabQrCodeContent.java index 22e7d93f..c17823a1 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabQrCodeContent.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabQrCodeContent.java @@ -8,6 +8,7 @@ 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; @@ -46,4 +47,16 @@ public static BunqResponse list(ApiContext apiContext, Integer userId, I return new BunqResponse<>(responseRaw.getBodyBytes(), responseRaw.getHeaders()); } + /** + */ + public boolean isAllFieldNull() { + return true; + } + + /** + */ + public static TabQrCodeContent fromJsonReader(JsonReader reader) { + return fromJsonReader(TabQrCodeContent.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabResultInquiry.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabResultInquiry.java index 9caf00dd..83e4eebb 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabResultInquiry.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabResultInquiry.java @@ -8,6 +8,7 @@ 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; @@ -100,4 +101,24 @@ public void setPayment(Payment payment) { this.payment = payment; } + /** + */ + public boolean isAllFieldNull() { + if (this.tab != null) { + return false; + } + + if (this.payment != null) { + return false; + } + + return true; + } + + /** + */ + public static TabResultInquiry fromJsonReader(JsonReader reader) { + return fromJsonReader(TabResultInquiry.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabResultResponse.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabResultResponse.java index a4a2a518..da04c2e1 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/TabResultResponse.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/TabResultResponse.java @@ -8,6 +8,7 @@ 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; @@ -100,4 +101,24 @@ public void setPayment(Payment payment) { this.payment = payment; } + /** + */ + public boolean isAllFieldNull() { + if (this.tab != null) { + return false; + } + + if (this.payment != null) { + return false; + } + + return true; + } + + /** + */ + public static TabResultResponse fromJsonReader(JsonReader reader) { + return fromJsonReader(TabResultResponse.class, reader); + } + } 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 18416d2e..557f828f 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 @@ -13,6 +13,7 @@ import com.bunq.sdk.model.generated.object.TabVisibility; 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; @@ -452,4 +453,84 @@ public void setTabAttachment(List tabAttachment) { this.tabAttachment = tabAttachment; } + /** + */ + public boolean isAllFieldNull() { + if (this.uuid != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.amountTotal != null) { + return false; + } + + if (this.qrCodeToken != null) { + return false; + } + + if (this.tabUrl != null) { + return false; + } + + if (this.visibility != null) { + return false; + } + + if (this.minimumAge != null) { + return false; + } + + if (this.requireAddress != null) { + return false; + } + + if (this.redirectUrl != null) { + return false; + } + + if (this.expiration != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.cashRegisterLocation != null) { + return false; + } + + if (this.tabItem != null) { + return false; + } + + if (this.tabAttachment != null) { + return false; + } + + return true; + } + + /** + */ + public static TabUsageMultiple fromJsonReader(JsonReader reader) { + return fromJsonReader(TabUsageMultiple.class, reader); + } + } 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 a25d941d..4f098c14 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 @@ -13,6 +13,7 @@ import com.bunq.sdk.model.generated.object.TabVisibility; 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; @@ -488,4 +489,92 @@ public void setTabAttachment(List tabAttachment) { this.tabAttachment = tabAttachment; } + /** + */ + public boolean isAllFieldNull() { + if (this.uuid != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.merchantReference != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.amountTotal != null) { + return false; + } + + if (this.amountPaid != null) { + return false; + } + + if (this.qrCodeToken != null) { + return false; + } + + if (this.tabUrl != null) { + return false; + } + + if (this.visibility != null) { + return false; + } + + if (this.minimumAge != null) { + return false; + } + + if (this.requireAddress != null) { + return false; + } + + if (this.redirectUrl != null) { + return false; + } + + if (this.expiration != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.cashRegisterLocation != null) { + return false; + } + + if (this.tabItem != null) { + return false; + } + + if (this.tabAttachment != null) { + return false; + } + + return true; + } + + /** + */ + public static TabUsageSingle fromJsonReader(JsonReader reader) { + return fromJsonReader(TabUsageSingle.class, reader); + } + } 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 36ac1a07..c8234f4b 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 @@ -13,6 +13,7 @@ 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; @@ -426,4 +427,96 @@ public void setEligibleWhitelistId(Integer eligibleWhitelistId) { this.eligibleWhitelistId = eligibleWhitelistId; } + /** + */ + public boolean isAllFieldNull() { + if (this.timeResponded != null) { + return false; + } + + if (this.timeExpiry != null) { + return false; + } + + if (this.monetaryAccountId != null) { + return false; + } + + if (this.amountInquired != null) { + return false; + } + + if (this.amountResponded != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.attachment != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.minimumAge != null) { + return false; + } + + if (this.requireAddress != null) { + return false; + } + + if (this.addressShipping != null) { + return false; + } + + if (this.addressBilling != null) { + return false; + } + + if (this.geolocation != null) { + return false; + } + + if (this.redirectUrl != null) { + return false; + } + + if (this.type != null) { + return false; + } + + if (this.subType != null) { + return false; + } + + if (this.allowChat != null) { + return false; + } + + if (this.eligibleWhitelistId != null) { + return false; + } + + return true; + } + + /** + */ + public static TokenQrRequestIdeal fromJsonReader(JsonReader reader) { + return fromJsonReader(TokenQrRequestIdeal.class, reader); + } + } 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 4a7967ae..e768f520 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 @@ -5,10 +5,12 @@ import com.bunq.sdk.http.ApiClient; import com.bunq.sdk.http.BunqResponse; import com.bunq.sdk.http.BunqResponseRaw; +import com.bunq.sdk.model.core.AnchorObjectInterface; 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; @@ -20,7 +22,7 @@ * Using this call you can retrieve information of the user you are logged in as. This includes * your user id, which is referred to in endpoints. */ -public class User extends BunqModel { +public class User extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -136,4 +138,28 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.userLight != null) { + return false; + } + + if (this.userPerson != null) { + return false; + } + + if (this.userCompany != null) { + return false; + } + + return true; + } + + /** + */ + public static User fromJsonReader(JsonReader reader) { + return fromJsonReader(User.class, reader); + } + } 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 c529b4fd..46687431 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 @@ -15,6 +15,7 @@ import com.bunq.sdk.model.generated.object.Ubo; 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; @@ -620,4 +621,132 @@ public void setBillingContract(List billingContract this.billingContract = billingContract; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.publicUuid != null) { + return false; + } + + if (this.name != null) { + return false; + } + + if (this.displayName != null) { + return false; + } + + if (this.publicNickName != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.chamberOfCommerceNumber != null) { + return false; + } + + if (this.typeOfBusinessEntity != null) { + return false; + } + + if (this.sectorOfIndustry != null) { + return false; + } + + if (this.counterBankIban != null) { + return false; + } + + if (this.avatar != null) { + return false; + } + + if (this.addressMain != null) { + return false; + } + + if (this.addressPostal != null) { + return false; + } + + if (this.versionTermsOfService != null) { + return false; + } + + if (this.directorAlias != null) { + return false; + } + + if (this.language != null) { + return false; + } + + if (this.country != null) { + return false; + } + + if (this.region != null) { + return false; + } + + if (this.ubo != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.subStatus != null) { + return false; + } + + if (this.sessionTimeout != null) { + return false; + } + + if (this.dailyLimitWithoutConfirmationLogin != null) { + return false; + } + + if (this.notificationFilters != null) { + return false; + } + + if (this.customer != null) { + return false; + } + + if (this.customerLimit != null) { + return false; + } + + if (this.billingContract != null) { + return false; + } + + return true; + } + + /** + */ + public static UserCompany fromJsonReader(JsonReader reader) { + return fromJsonReader(UserCompany.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/endpoint/UserCredentialPasswordIp.java b/src/main/java/com/bunq/sdk/model/generated/endpoint/UserCredentialPasswordIp.java index 82b6794f..da4fe937 100644 --- a/src/main/java/com/bunq/sdk/model/generated/endpoint/UserCredentialPasswordIp.java +++ b/src/main/java/com/bunq/sdk/model/generated/endpoint/UserCredentialPasswordIp.java @@ -10,6 +10,7 @@ import com.bunq.sdk.security.SecurityUtils; 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; @@ -190,4 +191,44 @@ public void setPermittedDevice(PermittedDevice permittedDevice) { this.permittedDevice = permittedDevice; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.expiryTime != null) { + return false; + } + + if (this.tokenValue != null) { + return false; + } + + if (this.permittedDevice != null) { + return false; + } + + return true; + } + + /** + */ + public static UserCredentialPasswordIp fromJsonReader(JsonReader reader) { + return fromJsonReader(UserCredentialPasswordIp.class, reader); + } + } 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 101282d1..6809a7ba 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 @@ -14,6 +14,7 @@ import com.bunq.sdk.model.generated.object.TaxResident; 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; @@ -666,4 +667,144 @@ public void setNotificationFilters(List notificationFilters) this.notificationFilters = notificationFilters; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.publicUuid != null) { + return false; + } + + if (this.firstName != null) { + return false; + } + + if (this.middleName != null) { + return false; + } + + if (this.lastName != null) { + return false; + } + + if (this.legalName != null) { + return false; + } + + if (this.displayName != null) { + return false; + } + + if (this.publicNickName != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.socialSecurityNumber != null) { + return false; + } + + if (this.taxResident != null) { + return false; + } + + if (this.documentType != null) { + return false; + } + + if (this.documentNumber != null) { + return false; + } + + if (this.documentCountryOfIssuance != null) { + return false; + } + + if (this.addressMain != null) { + return false; + } + + if (this.addressPostal != null) { + return false; + } + + if (this.dateOfBirth != null) { + return false; + } + + if (this.placeOfBirth != null) { + return false; + } + + if (this.countryOfBirth != null) { + return false; + } + + if (this.nationality != null) { + return false; + } + + if (this.language != null) { + return false; + } + + if (this.region != null) { + return false; + } + + if (this.gender != null) { + return false; + } + + if (this.avatar != null) { + return false; + } + + if (this.versionTermsOfService != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.subStatus != null) { + return false; + } + + if (this.sessionTimeout != null) { + return false; + } + + if (this.dailyLimitWithoutConfirmationLogin != null) { + return false; + } + + if (this.notificationFilters != null) { + return false; + } + + return true; + } + + /** + */ + public static UserLight fromJsonReader(JsonReader reader) { + return fromJsonReader(UserLight.class, reader); + } + } 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 74abd018..2aeb864d 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 @@ -14,6 +14,7 @@ import com.bunq.sdk.model.generated.object.TaxResident; 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; @@ -668,4 +669,140 @@ public void setNotificationFilters(List notificationFilters) this.notificationFilters = notificationFilters; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.created != null) { + return false; + } + + if (this.updated != null) { + return false; + } + + if (this.publicUuid != null) { + return false; + } + + if (this.firstName != null) { + return false; + } + + if (this.middleName != null) { + return false; + } + + if (this.lastName != null) { + return false; + } + + if (this.legalName != null) { + return false; + } + + if (this.displayName != null) { + return false; + } + + if (this.publicNickName != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.taxResident != null) { + return false; + } + + if (this.documentType != null) { + return false; + } + + if (this.documentNumber != null) { + return false; + } + + if (this.documentCountryOfIssuance != null) { + return false; + } + + if (this.addressMain != null) { + return false; + } + + if (this.addressPostal != null) { + return false; + } + + if (this.dateOfBirth != null) { + return false; + } + + if (this.placeOfBirth != null) { + return false; + } + + if (this.countryOfBirth != null) { + return false; + } + + if (this.nationality != null) { + return false; + } + + if (this.language != null) { + return false; + } + + if (this.region != null) { + return false; + } + + if (this.gender != null) { + return false; + } + + if (this.avatar != null) { + return false; + } + + if (this.versionTermsOfService != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.subStatus != null) { + return false; + } + + if (this.sessionTimeout != null) { + return false; + } + + if (this.dailyLimitWithoutConfirmationLogin != null) { + return false; + } + + if (this.notificationFilters != null) { + return false; + } + + return true; + } + + /** + */ + public static UserPerson fromJsonReader(JsonReader reader) { + return fromJsonReader(UserPerson.class, reader); + } + } 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 942b47d6..2b1990cb 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 @@ -4,6 +4,7 @@ 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; @@ -148,4 +149,44 @@ public void setProvince(String province) { this.province = province; } + /** + */ + public boolean isAllFieldNull() { + if (this.street != null) { + return false; + } + + if (this.houseNumber != null) { + return false; + } + + if (this.poBox != null) { + return false; + } + + if (this.postalCode != null) { + return false; + } + + if (this.city != null) { + return false; + } + + if (this.country != null) { + return false; + } + + if (this.province != null) { + return false; + } + + return true; + } + + /** + */ + public static Address fromJsonReader(JsonReader reader) { + return fromJsonReader(Address.class, reader); + } + } 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 a965b3a8..3ab52608 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 @@ -4,6 +4,7 @@ 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; @@ -55,4 +56,24 @@ public void setCurrency(String currency) { this.currency = currency; } + /** + */ + public boolean isAllFieldNull() { + if (this.value != null) { + return false; + } + + if (this.currency != null) { + return false; + } + + return true; + } + + /** + */ + public static Amount fromJsonReader(JsonReader reader) { + return fromJsonReader(Amount.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/AnchoredObject.java b/src/main/java/com/bunq/sdk/model/generated/object/AnchoredObject.java index d9ce590c..724d6822 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/AnchoredObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/AnchoredObject.java @@ -1,6 +1,7 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.exception.BunqException; +import com.bunq.sdk.model.core.AnchorObjectInterface; import com.bunq.sdk.model.core.BunqModel; import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.endpoint.CardDebit; @@ -23,6 +24,7 @@ import com.bunq.sdk.model.generated.endpoint.UserCredentialPasswordIp; 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; @@ -31,7 +33,7 @@ /** */ -public class AnchoredObject extends BunqModel { +public class AnchoredObject extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -404,4 +406,88 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.cardDebit != null) { + return false; + } + + if (this.cardPinChange != null) { + return false; + } + + if (this.cardResult != null) { + return false; + } + + if (this.draftPayment != null) { + return false; + } + + if (this.idealMerchantTransaction != null) { + return false; + } + + if (this.invoice != null) { + return false; + } + + if (this.payment != null) { + return false; + } + + if (this.paymentBatch != null) { + return false; + } + + if (this.promotionDisplay != null) { + return false; + } + + if (this.requestInquiryBatch != null) { + return false; + } + + if (this.requestInquiry != null) { + return false; + } + + if (this.requestResponse != null) { + return false; + } + + if (this.scheduledPaymentBatch != null) { + return false; + } + + if (this.scheduledPayment != null) { + return false; + } + + if (this.scheduledInstance != null) { + return false; + } + + if (this.shareInviteBankInquiry != null) { + return false; + } + + if (this.shareInviteBankResponse != null) { + return false; + } + + if (this.userCredentialPasswordIp != null) { + return false; + } + + return true; + } + + /** + */ + public static AnchoredObject fromJsonReader(JsonReader reader) { + return fromJsonReader(AnchoredObject.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Attachment.java b/src/main/java/com/bunq/sdk/model/generated/object/Attachment.java index 3e1a757b..05237d33 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Attachment.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Attachment.java @@ -4,6 +4,7 @@ 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; @@ -50,4 +51,24 @@ public void setContentType(String contentType) { this.contentType = contentType; } + /** + */ + public boolean isAllFieldNull() { + if (this.description != null) { + return false; + } + + if (this.contentType != null) { + return false; + } + + return true; + } + + /** + */ + public static Attachment fromJsonReader(JsonReader reader) { + return fromJsonReader(Attachment.class, reader); + } + } 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 1fdb5306..f00942b6 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 @@ -4,6 +4,7 @@ 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; @@ -54,4 +55,24 @@ public void setMonetaryAccountId(Integer monetaryAccountId) { this.monetaryAccountId = monetaryAccountId; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.monetaryAccountId != null) { + return false; + } + + return true; + } + + /** + */ + public static AttachmentMonetaryAccountPayment fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentMonetaryAccountPayment.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/AttachmentPublic.java b/src/main/java/com/bunq/sdk/model/generated/object/AttachmentPublic.java index 1b670b98..48e7cca8 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/AttachmentPublic.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/AttachmentPublic.java @@ -4,6 +4,7 @@ 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; @@ -68,4 +69,28 @@ public void setContentType(String contentType) { this.contentType = contentType; } + /** + */ + public boolean isAllFieldNull() { + if (this.uuid != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.contentType != null) { + return false; + } + + return true; + } + + /** + */ + public static AttachmentPublic fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentPublic.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/AttachmentTab.java b/src/main/java/com/bunq/sdk/model/generated/object/AttachmentTab.java index 2cd7222a..6248788a 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/AttachmentTab.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/AttachmentTab.java @@ -4,6 +4,7 @@ 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; @@ -68,4 +69,28 @@ public void setContentType(String contentType) { this.contentType = contentType; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.contentType != null) { + return false; + } + + return true; + } + + /** + */ + public static AttachmentTab fromJsonReader(JsonReader reader) { + return fromJsonReader(AttachmentTab.class, reader); + } + } 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 bf98a7ca..5c13250c 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 @@ -4,6 +4,7 @@ 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; @@ -72,4 +73,28 @@ public void setImage(List image) { this.image = image; } + /** + */ + public boolean isAllFieldNull() { + if (this.uuid != null) { + return false; + } + + if (this.anchorUuid != null) { + return false; + } + + if (this.image != null) { + return false; + } + + return true; + } + + /** + */ + public static Avatar fromJsonReader(JsonReader reader) { + return fromJsonReader(Avatar.class, reader); + } + } 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 f30fbb08..8478a907 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 @@ -4,6 +4,7 @@ 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; @@ -50,4 +51,24 @@ public void setFrequency(String frequency) { this.frequency = frequency; } + /** + */ + public boolean isAllFieldNull() { + if (this.amount != null) { + return false; + } + + if (this.frequency != null) { + return false; + } + + return true; + } + + /** + */ + public static BudgetRestriction fromJsonReader(JsonReader reader) { + return fromJsonReader(BudgetRestriction.class, reader); + } + } 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 8630baa0..d83592bf 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 @@ -4,6 +4,7 @@ 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; @@ -36,4 +37,20 @@ public void setId(Integer id) { this.id = id; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + return true; + } + + /** + */ + public static BunqId fromJsonReader(JsonReader reader) { + return fromJsonReader(BunqId.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/BunqMeMerchantAvailable.java b/src/main/java/com/bunq/sdk/model/generated/object/BunqMeMerchantAvailable.java index 493cd39b..91c31b62 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/BunqMeMerchantAvailable.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/BunqMeMerchantAvailable.java @@ -4,6 +4,7 @@ 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; @@ -50,4 +51,24 @@ public void setAvailable(Boolean available) { this.available = available; } + /** + */ + public boolean isAllFieldNull() { + if (this.merchantType != null) { + return false; + } + + if (this.available != null) { + return false; + } + + return true; + } + + /** + */ + public static BunqMeMerchantAvailable fromJsonReader(JsonReader reader) { + return fromJsonReader(BunqMeMerchantAvailable.class, reader); + } + } 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 52970908..9041f599 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 @@ -4,6 +4,7 @@ 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; @@ -72,4 +73,28 @@ public void setExpiryTime(String expiryTime) { this.expiryTime = expiryTime; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.country != null) { + return false; + } + + if (this.expiryTime != null) { + return false; + } + + return true; + } + + /** + */ + public static CardCountryPermission fromJsonReader(JsonReader reader) { + return fromJsonReader(CardCountryPermission.class, reader); + } + } 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 5b7c581e..216ba21b 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 @@ -4,6 +4,7 @@ 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; @@ -94,4 +95,32 @@ public void setType(String type) { this.type = type; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.dailyLimit != null) { + return false; + } + + if (this.currency != null) { + return false; + } + + if (this.type != null) { + return false; + } + + return true; + } + + /** + */ + public static CardLimit fromJsonReader(JsonReader reader) { + return fromJsonReader(CardLimit.class, reader); + } + } 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 5bcb71c9..e5e90d61 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 @@ -4,6 +4,7 @@ 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; @@ -32,4 +33,20 @@ public void setExpiryTime(String expiryTime) { this.expiryTime = expiryTime; } + /** + */ + public boolean isAllFieldNull() { + if (this.expiryTime != null) { + return false; + } + + return true; + } + + /** + */ + public static CardMagStripePermission fromJsonReader(JsonReader reader) { + return fromJsonReader(CardMagStripePermission.class, reader); + } + } 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 83503358..c6172fdb 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 @@ -4,6 +4,7 @@ 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; @@ -61,4 +62,24 @@ public void setMonetaryAccountId(String monetaryAccountId) { this.monetaryAccountId = monetaryAccountId; } + /** + */ + public boolean isAllFieldNull() { + if (this.type != null) { + return false; + } + + if (this.monetaryAccountId != null) { + return false; + } + + return true; + } + + /** + */ + public static CardPinAssignment fromJsonReader(JsonReader reader) { + return fromJsonReader(CardPinAssignment.class, reader); + } + } 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 06b768a6..e359c4c3 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 @@ -4,6 +4,7 @@ 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; @@ -36,4 +37,20 @@ public void setCertificate(String certificate) { this.certificate = certificate; } + /** + */ + public boolean isAllFieldNull() { + if (this.certificate != null) { + return false; + } + + return true; + } + + /** + */ + public static Certificate fromJsonReader(JsonReader reader) { + return fromJsonReader(Certificate.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContent.java b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContent.java index bbb0ef89..56ec210a 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContent.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContent.java @@ -1,10 +1,12 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.exception.BunqException; +import com.bunq.sdk.model.core.AnchorObjectInterface; 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; @@ -13,7 +15,7 @@ /** */ -public class ChatMessageContent extends BunqModel { +public class ChatMessageContent extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -166,4 +168,44 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.chatMessageContentAnchorEvent != null) { + return false; + } + + if (this.chatMessageContentAttachment != null) { + return false; + } + + if (this.chatMessageContentGeolocation != null) { + return false; + } + + if (this.chatMessageContentStatusConversationTitle != null) { + return false; + } + + if (this.chatMessageContentStatusConversation != null) { + return false; + } + + if (this.chatMessageContentStatusMembership != null) { + return false; + } + + if (this.chatMessageContentText != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageContent fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageContent.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentAnchorEvent.java b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentAnchorEvent.java index e8e34d5d..b6c99019 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentAnchorEvent.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentAnchorEvent.java @@ -4,6 +4,7 @@ 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; @@ -40,4 +41,20 @@ public void setAnchoredObject(AnchoredObject anchoredObject) { this.anchoredObject = anchoredObject; } + /** + */ + public boolean isAllFieldNull() { + if (this.anchoredObject != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageContentAnchorEvent fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageContentAnchorEvent.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentAttachment.java b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentAttachment.java index b5ac7f08..1819a2fc 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentAttachment.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentAttachment.java @@ -4,6 +4,7 @@ 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; @@ -32,4 +33,20 @@ public void setAttachment(Attachment attachment) { this.attachment = attachment; } + /** + */ + public boolean isAllFieldNull() { + if (this.attachment != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageContentAttachment fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageContentAttachment.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentGeolocation.java b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentGeolocation.java index fd6a1271..3dcc3610 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentGeolocation.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentGeolocation.java @@ -4,6 +4,7 @@ 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; @@ -32,4 +33,20 @@ public void setGeolocation(Geolocation geolocation) { this.geolocation = geolocation; } + /** + */ + public boolean isAllFieldNull() { + if (this.geolocation != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageContentGeolocation fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageContentGeolocation.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusConversation.java b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusConversation.java index c4c90d9e..0b93c405 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusConversation.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusConversation.java @@ -4,6 +4,7 @@ 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; @@ -32,4 +33,20 @@ public void setAction(String action) { this.action = action; } + /** + */ + public boolean isAllFieldNull() { + if (this.action != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageContentStatusConversation fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageContentStatusConversation.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusConversationTitle.java b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusConversationTitle.java index 1ec7b47f..d12f1d41 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusConversationTitle.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusConversationTitle.java @@ -4,6 +4,7 @@ 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; @@ -32,4 +33,20 @@ public void setTitle(String title) { this.title = title; } + /** + */ + public boolean isAllFieldNull() { + if (this.title != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageContentStatusConversationTitle fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageContentStatusConversationTitle.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusMembership.java b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusMembership.java index d0f64f3d..ad3bf2db 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusMembership.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentStatusMembership.java @@ -4,6 +4,7 @@ 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; @@ -50,4 +51,24 @@ public void setMember(LabelUser member) { this.member = member; } + /** + */ + public boolean isAllFieldNull() { + if (this.action != null) { + return false; + } + + if (this.member != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageContentStatusMembership fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageContentStatusMembership.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentText.java b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentText.java index 0a77ae15..1c6bd258 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentText.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ChatMessageContentText.java @@ -4,6 +4,7 @@ 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; @@ -32,4 +33,20 @@ public void setText(String text) { this.text = text; } + /** + */ + public boolean isAllFieldNull() { + if (this.text != null) { + return false; + } + + return true; + } + + /** + */ + public static ChatMessageContentText fromJsonReader(JsonReader reader) { + return fromJsonReader(ChatMessageContentText.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentAnchorObject.java b/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentAnchorObject.java index 07c6ec1b..59673e53 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentAnchorObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentAnchorObject.java @@ -1,12 +1,14 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.exception.BunqException; +import com.bunq.sdk.model.core.AnchorObjectInterface; import com.bunq.sdk.model.core.BunqModel; import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.endpoint.Payment; import com.bunq.sdk.model.generated.endpoint.PaymentBatch; 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; @@ -15,7 +17,7 @@ /** */ -public class DraftPaymentAnchorObject extends BunqModel { +public class DraftPaymentAnchorObject extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -68,4 +70,24 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.payment != null) { + return false; + } + + if (this.paymentBatch != null) { + return false; + } + + return true; + } + + /** + */ + public static DraftPaymentAnchorObject fromJsonReader(JsonReader reader) { + return fromJsonReader(DraftPaymentAnchorObject.class, reader); + } + } 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 59f4f666..eb710e89 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 @@ -4,6 +4,7 @@ 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; @@ -177,4 +178,48 @@ public void setAttachment(List attachment) { this.attachment = attachment; } + /** + */ + public boolean isAllFieldNull() { + if (this.id != null) { + return false; + } + + if (this.amount != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.merchantReference != null) { + return false; + } + + if (this.type != null) { + return false; + } + + if (this.attachment != null) { + return false; + } + + return true; + } + + /** + */ + public static DraftPaymentEntry fromJsonReader(JsonReader reader) { + return fromJsonReader(DraftPaymentEntry.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentResponse.java b/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentResponse.java index a894ff58..59793f2d 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentResponse.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/DraftPaymentResponse.java @@ -4,6 +4,7 @@ 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; @@ -50,4 +51,24 @@ public void setUserAliasCreated(LabelUser userAliasCreated) { this.userAliasCreated = userAliasCreated; } + /** + */ + public boolean isAllFieldNull() { + if (this.status != null) { + return false; + } + + if (this.userAliasCreated != null) { + return false; + } + + return true; + } + + /** + */ + public static DraftPaymentResponse fromJsonReader(JsonReader reader) { + return fromJsonReader(DraftPaymentResponse.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/DraftShareInviteBankEntry.java b/src/main/java/com/bunq/sdk/model/generated/object/DraftShareInviteBankEntry.java index 671f91bd..bb24abf4 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/DraftShareInviteBankEntry.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/DraftShareInviteBankEntry.java @@ -4,6 +4,7 @@ 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; @@ -72,4 +73,28 @@ public void setEndDate(String endDate) { this.endDate = endDate; } + /** + */ + public boolean isAllFieldNull() { + if (this.shareDetail != null) { + return false; + } + + if (this.startDate != null) { + return false; + } + + if (this.endDate != null) { + return false; + } + + return true; + } + + /** + */ + public static DraftShareInviteBankEntry fromJsonReader(JsonReader reader) { + return fromJsonReader(DraftShareInviteBankEntry.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Error.java b/src/main/java/com/bunq/sdk/model/generated/object/Error.java index c7a4f223..8d556517 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Error.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Error.java @@ -4,6 +4,7 @@ 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; @@ -50,4 +51,24 @@ public void setErrorDescriptionTranslated(String errorDescriptionTranslated) { this.errorDescriptionTranslated = errorDescriptionTranslated; } + /** + */ + public boolean isAllFieldNull() { + if (this.errorDescription != null) { + return false; + } + + if (this.errorDescriptionTranslated != null) { + return false; + } + + return true; + } + + /** + */ + public static Error fromJsonReader(JsonReader reader) { + return fromJsonReader(Error.class, reader); + } + } 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 83e783e5..f8872e67 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 @@ -4,6 +4,7 @@ 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; @@ -86,4 +87,32 @@ public void setRadius(BigDecimal radius) { this.radius = radius; } + /** + */ + public boolean isAllFieldNull() { + if (this.latitude != null) { + return false; + } + + if (this.longitude != null) { + return false; + } + + if (this.altitude != null) { + return false; + } + + if (this.radius != null) { + return false; + } + + return true; + } + + /** + */ + public static Geolocation fromJsonReader(JsonReader reader) { + return fromJsonReader(Geolocation.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/Image.java b/src/main/java/com/bunq/sdk/model/generated/object/Image.java index 8320cf9c..ec648621 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/Image.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/Image.java @@ -4,6 +4,7 @@ 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; @@ -86,4 +87,32 @@ public void setWidth(Integer width) { this.width = width; } + /** + */ + public boolean isAllFieldNull() { + if (this.attachmentPublicUuid != null) { + return false; + } + + if (this.contentType != null) { + return false; + } + + if (this.height != null) { + return false; + } + + if (this.width != null) { + return false; + } + + return true; + } + + /** + */ + public static Image fromJsonReader(JsonReader reader) { + return fromJsonReader(Image.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/InvoiceItem.java b/src/main/java/com/bunq/sdk/model/generated/object/InvoiceItem.java index 6a6142d2..0d3a856a 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/InvoiceItem.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/InvoiceItem.java @@ -4,6 +4,7 @@ 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; @@ -176,4 +177,52 @@ public void setTotalVatInclusive(Amount totalVatInclusive) { this.totalVatInclusive = totalVatInclusive; } + /** + */ + public boolean isAllFieldNull() { + if (this.billingDate != null) { + return false; + } + + if (this.typeDescription != null) { + return false; + } + + if (this.typeDescriptionTranslated != null) { + return false; + } + + if (this.unitVatExclusive != null) { + return false; + } + + if (this.unitVatInclusive != null) { + return false; + } + + if (this.vat != null) { + return false; + } + + if (this.quantity != null) { + return false; + } + + if (this.totalVatExclusive != null) { + return false; + } + + if (this.totalVatInclusive != null) { + return false; + } + + return true; + } + + /** + */ + public static InvoiceItem fromJsonReader(JsonReader reader) { + return fromJsonReader(InvoiceItem.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/InvoiceItemGroup.java b/src/main/java/com/bunq/sdk/model/generated/object/InvoiceItemGroup.java index d408f53d..b0064f91 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/InvoiceItemGroup.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/InvoiceItemGroup.java @@ -4,6 +4,7 @@ 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; @@ -140,4 +141,44 @@ public void setItem(InvoiceItem item) { this.item = item; } + /** + */ + public boolean isAllFieldNull() { + if (this.type != null) { + return false; + } + + if (this.typeDescription != null) { + return false; + } + + if (this.typeDescriptionTranslated != null) { + return false; + } + + if (this.instanceDescription != null) { + return false; + } + + if (this.productVatExclusive != null) { + return false; + } + + if (this.productVatInclusive != null) { + return false; + } + + if (this.item != null) { + return false; + } + + return true; + } + + /** + */ + public static InvoiceItemGroup fromJsonReader(JsonReader reader) { + return fromJsonReader(InvoiceItemGroup.class, reader); + } + } 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 bb120add..1e3d09a4 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 @@ -4,6 +4,7 @@ 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; @@ -54,4 +55,24 @@ public void setName(String name) { this.name = name; } + /** + */ + public boolean isAllFieldNull() { + if (this.bic != null) { + return false; + } + + if (this.name != null) { + return false; + } + + return true; + } + + /** + */ + public static Issuer fromJsonReader(JsonReader reader) { + return fromJsonReader(Issuer.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/LabelCard.java b/src/main/java/com/bunq/sdk/model/generated/object/LabelCard.java index e48b4749..69c3f767 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/LabelCard.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/LabelCard.java @@ -4,6 +4,7 @@ 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; @@ -122,4 +123,40 @@ public void setLabelUser(LabelUser labelUser) { this.labelUser = labelUser; } + /** + */ + public boolean isAllFieldNull() { + if (this.uuid != null) { + return false; + } + + if (this.type != null) { + return false; + } + + if (this.secondLine != null) { + return false; + } + + if (this.expiryDate != null) { + return false; + } + + if (this.status != null) { + return false; + } + + if (this.labelUser != null) { + return false; + } + + return true; + } + + /** + */ + public static LabelCard fromJsonReader(JsonReader reader) { + return fromJsonReader(LabelCard.class, reader); + } + } 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 b8d9df0c..6f9527b3 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 @@ -4,6 +4,7 @@ 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; @@ -176,4 +177,52 @@ public void setSwiftAccountNumber(String swiftAccountNumber) { this.swiftAccountNumber = swiftAccountNumber; } + /** + */ + public boolean isAllFieldNull() { + if (this.iban != null) { + return false; + } + + if (this.displayName != null) { + return false; + } + + if (this.avatar != null) { + return false; + } + + if (this.labelUser != null) { + return false; + } + + if (this.country != null) { + return false; + } + + if (this.bunqMe != null) { + return false; + } + + if (this.isLight != null) { + return false; + } + + if (this.swiftBic != null) { + return false; + } + + if (this.swiftAccountNumber != null) { + return false; + } + + return true; + } + + /** + */ + public static LabelMonetaryAccount fromJsonReader(JsonReader reader) { + return fromJsonReader(LabelMonetaryAccount.class, reader); + } + } 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 349fbf70..05919cfc 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 @@ -4,6 +4,7 @@ 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; @@ -110,4 +111,36 @@ public void setCountry(String country) { this.country = country; } + /** + */ + public boolean isAllFieldNull() { + if (this.uuid != null) { + return false; + } + + if (this.avatar != null) { + return false; + } + + if (this.publicNickName != null) { + return false; + } + + if (this.displayName != null) { + return false; + } + + if (this.country != null) { + return false; + } + + return true; + } + + /** + */ + public static LabelUser fromJsonReader(JsonReader reader) { + return fromJsonReader(LabelUser.class, reader); + } + } 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 a154e0d9..1d80b4aa 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 @@ -4,6 +4,7 @@ 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; @@ -93,4 +94,32 @@ public void setSavingsAccountAlias(MonetaryAccountReference savingsAccountAlias) this.savingsAccountAlias = savingsAccountAlias; } + /** + */ + public boolean isAllFieldNull() { + if (this.status != null) { + return false; + } + + if (this.balancePreferred != null) { + return false; + } + + if (this.balanceThresholdHigh != null) { + return false; + } + + if (this.savingsAccountAlias != null) { + return false; + } + + return true; + } + + /** + */ + public static MonetaryAccountProfileDrain fromJsonReader(JsonReader reader) { + return fromJsonReader(MonetaryAccountProfileDrain.class, reader); + } + } 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 0b17c6b3..73a8b7e0 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 @@ -4,6 +4,7 @@ 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; @@ -113,4 +114,36 @@ public void setIssuer(Issuer issuer) { this.issuer = issuer; } + /** + */ + public boolean isAllFieldNull() { + if (this.status != null) { + return false; + } + + if (this.balancePreferred != null) { + return false; + } + + if (this.balanceThresholdLow != null) { + return false; + } + + if (this.methodFill != null) { + return false; + } + + if (this.issuer != null) { + return false; + } + + return true; + } + + /** + */ + public static MonetaryAccountProfileFill fromJsonReader(JsonReader reader) { + return fromJsonReader(MonetaryAccountProfileFill.class, reader); + } + } 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 49bd1e45..cfcc9cf5 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 @@ -4,6 +4,7 @@ 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; @@ -68,4 +69,28 @@ public void setRestrictionChat(String restrictionChat) { this.restrictionChat = restrictionChat; } + /** + */ + public boolean isAllFieldNull() { + if (this.color != null) { + return false; + } + + if (this.defaultAvatarStatus != null) { + return false; + } + + if (this.restrictionChat != null) { + return false; + } + + return true; + } + + /** + */ + public static MonetaryAccountSetting fromJsonReader(JsonReader reader) { + return fromJsonReader(MonetaryAccountSetting.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/NotificationAnchorObject.java b/src/main/java/com/bunq/sdk/model/generated/object/NotificationAnchorObject.java index c527e1a4..3e661517 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/NotificationAnchorObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/NotificationAnchorObject.java @@ -1,19 +1,19 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.exception.BunqException; +import com.bunq.sdk.model.core.AnchorObjectInterface; import com.bunq.sdk.model.core.BunqModel; import com.bunq.sdk.model.core.MonetaryAccountReference; +import com.bunq.sdk.model.generated.endpoint.BunqMeFundraiserResult; import com.bunq.sdk.model.generated.endpoint.BunqMeTab; import com.bunq.sdk.model.generated.endpoint.BunqMeTabResultInquiry; import com.bunq.sdk.model.generated.endpoint.BunqMeTabResultResponse; -import com.bunq.sdk.model.generated.endpoint.ChatMessageAnnouncement; -import com.bunq.sdk.model.generated.endpoint.ChatMessageStatus; -import com.bunq.sdk.model.generated.endpoint.ChatMessageUser; +import com.bunq.sdk.model.generated.endpoint.ChatMessage; import com.bunq.sdk.model.generated.endpoint.DraftPayment; import com.bunq.sdk.model.generated.endpoint.IdealMerchantTransaction; import com.bunq.sdk.model.generated.endpoint.Invoice; import com.bunq.sdk.model.generated.endpoint.MasterCardAction; -import com.bunq.sdk.model.generated.endpoint.MonetaryAccountBank; +import com.bunq.sdk.model.generated.endpoint.MonetaryAccount; import com.bunq.sdk.model.generated.endpoint.Payment; import com.bunq.sdk.model.generated.endpoint.PaymentBatch; import com.bunq.sdk.model.generated.endpoint.RequestInquiry; @@ -25,10 +25,10 @@ import com.bunq.sdk.model.generated.endpoint.ShareInviteBankResponse; import com.bunq.sdk.model.generated.endpoint.TabResultInquiry; import com.bunq.sdk.model.generated.endpoint.TabResultResponse; -import com.bunq.sdk.model.generated.endpoint.UserCompany; -import com.bunq.sdk.model.generated.endpoint.UserPerson; +import com.bunq.sdk.model.generated.endpoint.User; 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; @@ -37,13 +37,19 @@ /** */ -public class NotificationAnchorObject extends BunqModel { +public class NotificationAnchorObject extends BunqModel implements AnchorObjectInterface { /** * Error constants. */ private static final String ERROR_NULL_FIELDS = "All fields of an extended model or object are null."; + /** + */ + @Expose + @SerializedName("BunqMeFundraiserResult") + private BunqMeFundraiserResult bunqMeFundraiserResult; + /** */ @Expose @@ -65,20 +71,8 @@ public class NotificationAnchorObject extends BunqModel { /** */ @Expose - @SerializedName("ChatMessageStatus") - private ChatMessageStatus chatMessageStatus; - - /** - */ - @Expose - @SerializedName("ChatMessageUser") - private ChatMessageUser chatMessageUser; - - /** - */ - @Expose - @SerializedName("ChatMessageAnnouncement") - private ChatMessageAnnouncement chatMessageAnnouncement; + @SerializedName("ChatMessage") + private ChatMessage chatMessage; /** */ @@ -107,8 +101,8 @@ public class NotificationAnchorObject extends BunqModel { /** */ @Expose - @SerializedName("MonetaryAccountBank") - private MonetaryAccountBank monetaryAccountBank; + @SerializedName("MonetaryAccount") + private MonetaryAccount monetaryAccount; /** */ @@ -179,14 +173,18 @@ public class NotificationAnchorObject extends BunqModel { /** */ @Expose - @SerializedName("UserPerson") - private UserPerson userPerson; + @SerializedName("User") + private User user; /** */ - @Expose - @SerializedName("UserCompany") - private UserCompany userCompany; + public BunqMeFundraiserResult getBunqMeFundraiserResult() { + return this.bunqMeFundraiserResult; + } + + public void setBunqMeFundraiserResult(BunqMeFundraiserResult bunqMeFundraiserResult) { + this.bunqMeFundraiserResult = bunqMeFundraiserResult; + } /** */ @@ -220,32 +218,12 @@ public void setBunqMeTabResultResponse(BunqMeTabResultResponse bunqMeTabResultRe /** */ - public ChatMessageStatus getChatMessageStatus() { - return this.chatMessageStatus; - } - - public void setChatMessageStatus(ChatMessageStatus chatMessageStatus) { - this.chatMessageStatus = chatMessageStatus; - } - - /** - */ - public ChatMessageUser getChatMessageUser() { - return this.chatMessageUser; - } - - public void setChatMessageUser(ChatMessageUser chatMessageUser) { - this.chatMessageUser = chatMessageUser; - } - - /** - */ - public ChatMessageAnnouncement getChatMessageAnnouncement() { - return this.chatMessageAnnouncement; + public ChatMessage getChatMessage() { + return this.chatMessage; } - public void setChatMessageAnnouncement(ChatMessageAnnouncement chatMessageAnnouncement) { - this.chatMessageAnnouncement = chatMessageAnnouncement; + public void setChatMessage(ChatMessage chatMessage) { + this.chatMessage = chatMessage; } /** @@ -290,12 +268,12 @@ public void setMasterCardAction(MasterCardAction masterCardAction) { /** */ - public MonetaryAccountBank getMonetaryAccountBank() { - return this.monetaryAccountBank; + public MonetaryAccount getMonetaryAccount() { + return this.monetaryAccount; } - public void setMonetaryAccountBank(MonetaryAccountBank monetaryAccountBank) { - this.monetaryAccountBank = monetaryAccountBank; + public void setMonetaryAccount(MonetaryAccount monetaryAccount) { + this.monetaryAccount = monetaryAccount; } /** @@ -410,27 +388,21 @@ public void setTabResultResponse(TabResultResponse tabResultResponse) { /** */ - public UserPerson getUserPerson() { - return this.userPerson; + public User getUser() { + return this.user; } - public void setUserPerson(UserPerson userPerson) { - this.userPerson = userPerson; - } - - /** - */ - public UserCompany getUserCompany() { - return this.userCompany; - } - - public void setUserCompany(UserCompany userCompany) { - this.userCompany = userCompany; + public void setUser(User user) { + this.user = user; } /** */ public BunqModel getReferencedObject() { + if (this.bunqMeFundraiserResult != null) { + return this.bunqMeFundraiserResult; + } + if (this.bunqMeTab != null) { return this.bunqMeTab; } @@ -443,16 +415,8 @@ public BunqModel getReferencedObject() { return this.bunqMeTabResultResponse; } - if (this.chatMessageStatus != null) { - return this.chatMessageStatus; - } - - if (this.chatMessageUser != null) { - return this.chatMessageUser; - } - - if (this.chatMessageAnnouncement != null) { - return this.chatMessageAnnouncement; + if (this.chatMessage != null) { + return this.chatMessage; } if (this.draftPayment != null) { @@ -471,8 +435,8 @@ public BunqModel getReferencedObject() { return this.masterCardAction; } - if (this.monetaryAccountBank != null) { - return this.monetaryAccountBank; + if (this.monetaryAccount != null) { + return this.monetaryAccount; } if (this.payment != null) { @@ -519,15 +483,111 @@ public BunqModel getReferencedObject() { return this.tabResultResponse; } - if (this.userPerson != null) { - return this.userPerson; + if (this.user != null) { + return this.user; } - if (this.userCompany != null) { - return this.userCompany; + throw new BunqException(ERROR_NULL_FIELDS); + } + + /** + */ + public boolean isAllFieldNull() { + if (this.bunqMeFundraiserResult != null) { + return false; } - throw new BunqException(ERROR_NULL_FIELDS); + if (this.bunqMeTab != null) { + return false; + } + + if (this.bunqMeTabResultInquiry != null) { + return false; + } + + if (this.bunqMeTabResultResponse != null) { + return false; + } + + if (this.chatMessage != null) { + return false; + } + + if (this.draftPayment != null) { + return false; + } + + if (this.idealMerchantTransaction != null) { + return false; + } + + if (this.invoice != null) { + return false; + } + + if (this.masterCardAction != null) { + return false; + } + + if (this.monetaryAccount != null) { + return false; + } + + if (this.payment != null) { + return false; + } + + if (this.paymentBatch != null) { + return false; + } + + if (this.requestInquiry != null) { + return false; + } + + if (this.requestInquiryBatch != null) { + return false; + } + + if (this.requestResponse != null) { + return false; + } + + if (this.shareInviteBankInquiry != null) { + return false; + } + + if (this.shareInviteBankResponse != null) { + return false; + } + + if (this.scheduledPayment != null) { + return false; + } + + if (this.scheduledInstance != null) { + return false; + } + + if (this.tabResultInquiry != null) { + return false; + } + + if (this.tabResultResponse != null) { + return false; + } + + if (this.user != null) { + return false; + } + + return true; + } + + /** + */ + public static NotificationAnchorObject fromJsonReader(JsonReader reader) { + return fromJsonReader(NotificationAnchorObject.class, reader); } } 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 4eebff08..205cb3ac 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 @@ -4,6 +4,7 @@ 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; @@ -88,4 +89,28 @@ public void setCategory(String category) { this.category = category; } + /** + */ + public boolean isAllFieldNull() { + if (this.notificationDeliveryMethod != null) { + return false; + } + + if (this.notificationTarget != null) { + return false; + } + + if (this.category != null) { + return false; + } + + return true; + } + + /** + */ + public static NotificationFilter fromJsonReader(JsonReader reader) { + return fromJsonReader(NotificationFilter.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/NotificationUrl.java b/src/main/java/com/bunq/sdk/model/generated/object/NotificationUrl.java index 8fefcd7c..cd48437c 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/NotificationUrl.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/NotificationUrl.java @@ -4,6 +4,7 @@ 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; @@ -78,4 +79,32 @@ public void setObject(NotificationAnchorObject object) { this.object = object; } + /** + */ + public boolean isAllFieldNull() { + if (this.targetUrl != null) { + return false; + } + + if (this.category != null) { + return false; + } + + if (this.eventType != null) { + return false; + } + + if (this.object != null) { + return false; + } + + return true; + } + + /** + */ + public static NotificationUrl fromJsonReader(JsonReader reader) { + return fromJsonReader(NotificationUrl.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/PermittedDevice.java b/src/main/java/com/bunq/sdk/model/generated/object/PermittedDevice.java index f3bf1084..ddecb302 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/PermittedDevice.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/PermittedDevice.java @@ -4,6 +4,7 @@ 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; @@ -50,4 +51,24 @@ public void setIp(String ip) { this.ip = ip; } + /** + */ + public boolean isAllFieldNull() { + if (this.description != null) { + return false; + } + + if (this.ip != null) { + return false; + } + + return true; + } + + /** + */ + public static PermittedDevice fromJsonReader(JsonReader reader) { + return fromJsonReader(PermittedDevice.class, reader); + } + } 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 9affb6b3..fa2a6512 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 @@ -4,6 +4,7 @@ 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; @@ -73,4 +74,28 @@ public void setName(String name) { this.name = name; } + /** + */ + public boolean isAllFieldNull() { + if (this.type != null) { + return false; + } + + if (this.value != null) { + return false; + } + + if (this.name != null) { + return false; + } + + return true; + } + + /** + */ + public static Pointer fromJsonReader(JsonReader reader) { + return fromJsonReader(Pointer.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ScheduleAnchorObject.java b/src/main/java/com/bunq/sdk/model/generated/object/ScheduleAnchorObject.java index 18d166fe..6bca7733 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ScheduleAnchorObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ScheduleAnchorObject.java @@ -1,12 +1,14 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.exception.BunqException; +import com.bunq.sdk.model.core.AnchorObjectInterface; import com.bunq.sdk.model.core.BunqModel; import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.endpoint.Payment; import com.bunq.sdk.model.generated.endpoint.PaymentBatch; 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; @@ -15,7 +17,7 @@ /** */ -public class ScheduleAnchorObject extends BunqModel { +public class ScheduleAnchorObject extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -68,4 +70,24 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.payment != null) { + return false; + } + + if (this.paymentBatch != null) { + return false; + } + + return true; + } + + /** + */ + public static ScheduleAnchorObject fromJsonReader(JsonReader reader) { + return fromJsonReader(ScheduleAnchorObject.class, reader); + } + } diff --git a/src/main/java/com/bunq/sdk/model/generated/object/ScheduleInstanceAnchorObject.java b/src/main/java/com/bunq/sdk/model/generated/object/ScheduleInstanceAnchorObject.java index e261b541..10d7f708 100644 --- a/src/main/java/com/bunq/sdk/model/generated/object/ScheduleInstanceAnchorObject.java +++ b/src/main/java/com/bunq/sdk/model/generated/object/ScheduleInstanceAnchorObject.java @@ -1,12 +1,14 @@ package com.bunq.sdk.model.generated.object; import com.bunq.sdk.exception.BunqException; +import com.bunq.sdk.model.core.AnchorObjectInterface; import com.bunq.sdk.model.core.BunqModel; import com.bunq.sdk.model.core.MonetaryAccountReference; import com.bunq.sdk.model.generated.endpoint.Payment; import com.bunq.sdk.model.generated.endpoint.PaymentBatch; 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; @@ -15,7 +17,7 @@ /** */ -public class ScheduleInstanceAnchorObject extends BunqModel { +public class ScheduleInstanceAnchorObject extends BunqModel implements AnchorObjectInterface { /** * Error constants. @@ -68,4 +70,24 @@ public BunqModel getReferencedObject() { throw new BunqException(ERROR_NULL_FIELDS); } + /** + */ + public boolean isAllFieldNull() { + if (this.payment != null) { + return false; + } + + if (this.paymentBatch != null) { + return false; + } + + return true; + } + + /** + */ + public static ScheduleInstanceAnchorObject fromJsonReader(JsonReader reader) { + return fromJsonReader(ScheduleInstanceAnchorObject.class, reader); + } + } 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 f569c9a3..234a61d7 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 @@ -4,6 +4,7 @@ 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; @@ -143,4 +144,40 @@ public void setMerchantReference(String merchantReference) { this.merchantReference = merchantReference; } + /** + */ + public boolean isAllFieldNull() { + if (this.amount != null) { + return false; + } + + if (this.alias != null) { + return false; + } + + if (this.counterpartyAlias != null) { + return false; + } + + if (this.description != null) { + return false; + } + + if (this.attachment != null) { + return false; + } + + if (this.merchantReference != null) { + return false; + } + + return true; + } + + /** + */ + public static SchedulePaymentEntry fromJsonReader(JsonReader reader) { + return fromJsonReader(SchedulePaymentEntry.class, reader); + } + } 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 ab653d40..d27ef0ed 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 @@ -4,6 +4,7 @@ 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; @@ -74,4 +75,28 @@ public void setDraftPayment(ShareDetailDraftPayment draftPayment) { this.draftPayment = draftPayment; } + /** + */ + public boolean isAllFieldNull() { + if (this.payment != null) { + return false; + } + + if (this.readOnly != null) { + return false; + } + + if (this.draftPayment != null) { + return false; + } + + return true; + } + + /** + */ + public static ShareDetail fromJsonReader(JsonReader reader) { + return fromJsonReader(ShareDetail.class, reader); + } + } 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 4c289eb4..6ace0f40 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 @@ -4,6 +4,7 @@ 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; @@ -97,4 +98,32 @@ public void setViewNewEvents(Boolean viewNewEvents) { this.viewNewEvents = viewNewEvents; } + /** + */ + public boolean isAllFieldNull() { + if (this.makeDraftPayments != null) { + return false; + } + + if (this.viewBalance != null) { + return false; + } + + if (this.viewOldEvents != null) { + return false; + } + + if (this.viewNewEvents != null) { + return false; + } + + return true; + } + + /** + */ + public static ShareDetailDraftPayment fromJsonReader(JsonReader reader) { + return fromJsonReader(ShareDetailDraftPayment.class, reader); + } + } 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 4512df12..e468a909 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 @@ -4,6 +4,7 @@ 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; @@ -133,4 +134,40 @@ public void setBudget(BudgetRestriction budget) { this.budget = budget; } + /** + */ + public boolean isAllFieldNull() { + if (this.makePayments != null) { + return false; + } + + if (this.makeDraftPayments != null) { + return false; + } + + if (this.viewBalance != null) { + return false; + } + + if (this.viewOldEvents != null) { + return false; + } + + if (this.viewNewEvents != null) { + return false; + } + + if (this.budget != null) { + return false; + } + + return true; + } + + /** + */ + public static ShareDetailPayment fromJsonReader(JsonReader reader) { + return fromJsonReader(ShareDetailPayment.class, reader); + } + } 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 f3c286ac..c70c77fd 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 @@ -4,6 +4,7 @@ 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; @@ -78,4 +79,28 @@ public void setViewNewEvents(Boolean viewNewEvents) { this.viewNewEvents = viewNewEvents; } + /** + */ + public boolean isAllFieldNull() { + if (this.viewBalance != null) { + return false; + } + + if (this.viewOldEvents != null) { + return false; + } + + if (this.viewNewEvents != null) { + return false; + } + + return true; + } + + /** + */ + public static ShareDetailReadOnly fromJsonReader(JsonReader reader) { + return fromJsonReader(ShareDetailReadOnly.class, reader); + } + } 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 9c101fcd..59102a6f 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 @@ -4,6 +4,7 @@ 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; @@ -55,4 +56,24 @@ public void setDescription(String description) { this.description = description; } + /** + */ + public boolean isAllFieldNull() { + if (this.language != null) { + return false; + } + + if (this.description != null) { + return false; + } + + return true; + } + + /** + */ + public static TabTextWaitingScreen fromJsonReader(JsonReader reader) { + return fromJsonReader(TabTextWaitingScreen.class, reader); + } + } 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 ad75c269..59dd5757 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 @@ -4,6 +4,7 @@ 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; @@ -75,4 +76,28 @@ public void setLocation(Geolocation location) { this.location = location; } + /** + */ + public boolean isAllFieldNull() { + if (this.cashRegisterQrCode != null) { + return false; + } + + if (this.tabQrCode != null) { + return false; + } + + if (this.location != null) { + return false; + } + + return true; + } + + /** + */ + public static TabVisibility fromJsonReader(JsonReader reader) { + return fromJsonReader(TabVisibility.class, reader); + } + } 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 decf0cbf..61287d08 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 @@ -4,6 +4,7 @@ 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; @@ -55,4 +56,24 @@ public void setTaxNumber(String taxNumber) { this.taxNumber = taxNumber; } + /** + */ + public boolean isAllFieldNull() { + if (this.country != null) { + return false; + } + + if (this.taxNumber != null) { + return false; + } + + return true; + } + + /** + */ + public static TaxResident fromJsonReader(JsonReader reader) { + return fromJsonReader(TaxResident.class, reader); + } + } 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 dbb04d96..b70a82ee 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 @@ -4,6 +4,7 @@ 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; @@ -68,4 +69,28 @@ public void setNationality(String nationality) { this.nationality = nationality; } + /** + */ + public boolean isAllFieldNull() { + if (this.name != null) { + return false; + } + + if (this.dateOfBirth != null) { + return false; + } + + if (this.nationality != null) { + return false; + } + + return true; + } + + /** + */ + public static Ubo fromJsonReader(JsonReader reader) { + return fromJsonReader(Ubo.class, reader); + } + } diff --git a/src/test/java/com/bunq/sdk/model/generated/object/NotificationUrlTest.java b/src/test/java/com/bunq/sdk/model/generated/object/NotificationUrlTest.java index d31ed9ef..3c25e383 100644 --- a/src/test/java/com/bunq/sdk/model/generated/object/NotificationUrlTest.java +++ b/src/test/java/com/bunq/sdk/model/generated/object/NotificationUrlTest.java @@ -24,9 +24,11 @@ public class NotificationUrlTest extends BunqSdkTestBase { private static final String GETTER_PAYMENT = "getPayment"; private static final String GETTER_BUNQ_ME_TAB = "getBunqMeTab"; private static final String GETTER_CHAT_MESSAGE_ANNOUNCEMENT = "getChatMessageAnnouncement"; + private static final String GETTER_CHAT_MESSAGE = "getChatMessage"; private static final String GETTER_DRAFT_PAYMENT = "getDraftPayment"; private static final String GETTER_MASTER_CARD_ACTION = "getMasterCardAction"; private static final String GETTER_MONETARY_ACCOUNT_BANK = "getMonetaryAccountBank"; + private static final String GETTER_MONETARY_ACCOUNT = "getMonetaryAccount"; private static final String GETTER_PAYMENT_BATCH = "getPaymentBatch"; private static final String GETTER_REQUEST_INQUIRY = "getRequestInquiry"; private static final String GETTER_REQUEST_RESPONSE = "getRequestResponse"; @@ -62,14 +64,16 @@ public class NotificationUrlTest extends BunqSdkTestBase { private void executeNotificationUrlTest( String expectedJsonFileName, String classNameExpected, - String referencedObjectGetterName + String referencedObjectGetterName, + String subClassExpectedName, + String subClassGetterName ) throws FileNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException, ClassNotFoundException { JsonReader jsonReader = new JsonReader(new FileReader(expectedJsonFileName)); - NotificationUrl notificationUrl = new Gson().fromJson(jsonReader, TYPE_NOTIFICATION_URL); + NotificationUrl notificationUrl = BunqModel.fromJsonReader(NotificationUrl.class, jsonReader); assertNotNull(notificationUrl); assertNotNull(notificationUrl.getObject()); @@ -82,6 +86,33 @@ private void executeNotificationUrlTest( assertNotNull(model); assertNotNull(referencedModel); assertTrue(Class.forName(classNameExpected).isInstance(referencedModel)); + + if (subClassExpectedName != null && subClassGetterName != null) { + Object subClass = referencedModel.getClass().getDeclaredMethod(subClassGetterName).invoke( + referencedModel + ); + + assertNotNull(subClass); + assertTrue(Class.forName(subClassExpectedName).isInstance(subClass)); + } + } + + private void executeNotificationUrlTest( + String expectedJsonFileName, + String classNameExpected, + String referencedObjectGetterName + ) throws InvocationTargetException, + FileNotFoundException, + ClassNotFoundException, + IllegalAccessException, + NoSuchMethodException { + this.executeNotificationUrlTest( + expectedJsonFileName, + classNameExpected, + referencedObjectGetterName, + null, + null + ); } @Test @@ -115,6 +146,8 @@ public void chatMessageAnnouncementModelTest() throws InvocationTargetException, NoSuchMethodException { executeNotificationUrlTest( JSON_PATH_CHAT_MESSAGE_ANNOUNCEMENT_MODEL, + ChatMessage.class.getName(), + GETTER_CHAT_MESSAGE, ChatMessageAnnouncement.class.getName(), GETTER_CHAT_MESSAGE_ANNOUNCEMENT ); @@ -151,6 +184,8 @@ public void monetaryAccountModelTest() throws InvocationTargetException, FileNot NoSuchMethodException { executeNotificationUrlTest( JSON_PATH_MONETARY_ACCOUNT_BANK_MODEL, + MonetaryAccount.class.getName(), + GETTER_MONETARY_ACCOUNT, MonetaryAccountBank.class.getName(), GETTER_MONETARY_ACCOUNT_BANK );