From aa20ac85e73783f4c19706c31810d8499ccb3f37 Mon Sep 17 00:00:00 2001 From: AdyenAutomationBot <38424300+AdyenAutomationBot@users.noreply.github.com> Date: Mon, 9 Mar 2026 13:31:49 +0000 Subject: [PATCH] [managementwebhooks] Automated update from Adyen/adyen-openapi@37c03ec --- .../AbstractOpenApiSchema.java | 2 +- .../AccountCapabilityData.java | 137 ++++++++++- .../AccountCreateNotificationData.java | 110 ++++++++- .../AccountNotificationResponse.java | 65 ++++- .../AccountUpdateNotificationData.java | 99 +++++++- .../CapabilityProblem.java | 73 +++++- .../CapabilityProblemEntity.java | 91 ++++++- .../CapabilityProblemEntityRecursive.java | 82 ++++++- .../MerchantCreatedNotificationRequest.java | 93 +++++++- .../MerchantUpdatedNotificationRequest.java | 93 +++++++- .../MidServiceNotificationData.java | 154 +++++++++++- ...ymentMethodCreatedNotificationRequest.java | 94 +++++++- .../PaymentMethodNotificationResponse.java | 66 +++++- ...thodRequestRemovedNotificationRequest.java | 95 +++++++- ...cheduledForRemovalNotificationRequest.java | 98 +++++++- .../RemediatingAction.java | 73 +++++- ...TerminalAssignmentNotificationRequest.java | 123 +++++++++- ...erminalAssignmentNotificationResponse.java | 66 +++++- .../TerminalBoardingData.java | 99 +++++++- .../TerminalBoardingNotificationRequest.java | 93 +++++++- .../TerminalBoardingNotificationResponse.java | 66 +++++- .../TerminalSettingsData.java | 121 +++++++++- .../TerminalSettingsNotificationRequest.java | 93 +++++++- .../TerminalSettingsNotificationResponse.java | 66 +++++- .../VerificationError.java | 110 ++++++++- .../VerificationErrorRecursive.java | 100 +++++++- .../adyen/model/managementwebhooks/JSON.java | 2 +- .../ManagementWebhooksHandler.java | 222 ------------------ 28 files changed, 2287 insertions(+), 299 deletions(-) rename src/main/java/com/adyen/model/{managementwebhooks => java}/AbstractOpenApiSchema.java (98%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/AccountCapabilityData.java (80%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/AccountCreateNotificationData.java (81%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/AccountNotificationResponse.java (66%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/AccountUpdateNotificationData.java (83%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/CapabilityProblem.java (66%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/CapabilityProblemEntity.java (74%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/CapabilityProblemEntityRecursive.java (75%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/MerchantCreatedNotificationRequest.java (73%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/MerchantUpdatedNotificationRequest.java (73%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/MidServiceNotificationData.java (79%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/PaymentMethodCreatedNotificationRequest.java (73%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/PaymentMethodNotificationResponse.java (66%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/PaymentMethodRequestRemovedNotificationRequest.java (73%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/PaymentMethodScheduledForRemovalNotificationRequest.java (73%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/RemediatingAction.java (66%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/TerminalAssignmentNotificationRequest.java (73%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/TerminalAssignmentNotificationResponse.java (67%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/TerminalBoardingData.java (68%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/TerminalBoardingNotificationRequest.java (73%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/TerminalBoardingNotificationResponse.java (67%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/TerminalSettingsData.java (73%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/TerminalSettingsNotificationRequest.java (73%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/TerminalSettingsNotificationResponse.java (67%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/VerificationError.java (74%) rename src/main/java/com/adyen/model/{managementwebhooks => java}/VerificationErrorRecursive.java (74%) delete mode 100644 src/main/java/com/adyen/model/managementwebhooks/ManagementWebhooksHandler.java diff --git a/src/main/java/com/adyen/model/managementwebhooks/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/java/AbstractOpenApiSchema.java similarity index 98% rename from src/main/java/com/adyen/model/managementwebhooks/AbstractOpenApiSchema.java rename to src/main/java/com/adyen/model/java/AbstractOpenApiSchema.java index afb8c9764..fa3588b9e 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/AbstractOpenApiSchema.java +++ b/src/main/java/com/adyen/model/java/AbstractOpenApiSchema.java @@ -9,7 +9,7 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; import com.fasterxml.jackson.annotation.JsonValue; import jakarta.ws.rs.core.GenericType; diff --git a/src/main/java/com/adyen/model/managementwebhooks/AccountCapabilityData.java b/src/main/java/com/adyen/model/java/AccountCapabilityData.java similarity index 80% rename from src/main/java/com/adyen/model/managementwebhooks/AccountCapabilityData.java rename to src/main/java/com/adyen/model/java/AccountCapabilityData.java index 861debf56..954a29b53 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/AccountCapabilityData.java +++ b/src/main/java/com/adyen/model/java/AccountCapabilityData.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,27 +37,57 @@ public class AccountCapabilityData { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + public static final String JSON_PROPERTY_ALLOWED_LEVEL = "allowedLevel"; private String allowedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedLevel = false; + public static final String JSON_PROPERTY_CAPABILITY = "capability"; private String capability; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapability = false; + public static final String JSON_PROPERTY_PROBLEMS = "problems"; private List problems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProblems = false; + public static final String JSON_PROPERTY_REQUESTED = "requested"; private Boolean requested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequested = false; + public static final String JSON_PROPERTY_REQUESTED_LEVEL = "requestedLevel"; private String requestedLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedLevel = false; + public static final String JSON_PROPERTY_VERIFICATION_DEADLINE = "verificationDeadline"; private OffsetDateTime verificationDeadline; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationDeadline = false; + public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private String verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountCapabilityData() {} /** @@ -68,6 +100,7 @@ public AccountCapabilityData() {} */ public AccountCapabilityData allowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set return this; } @@ -95,6 +128,7 @@ public Boolean getAllowed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set } /** @@ -109,6 +143,7 @@ public void setAllowed(Boolean allowed) { */ public AccountCapabilityData allowedLevel(String allowedLevel) { this.allowedLevel = allowedLevel; + isSetAllowedLevel = true; // mark as set return this; } @@ -140,6 +175,7 @@ public String getAllowedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedLevel(String allowedLevel) { this.allowedLevel = allowedLevel; + isSetAllowedLevel = true; // mark as set } /** @@ -150,6 +186,7 @@ public void setAllowedLevel(String allowedLevel) { */ public AccountCapabilityData capability(String capability) { this.capability = capability; + isSetCapability = true; // mark as set return this; } @@ -173,6 +210,7 @@ public String getCapability() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapability(String capability) { this.capability = capability; + isSetCapability = true; // mark as set } /** @@ -185,6 +223,7 @@ public void setCapability(String capability) { */ public AccountCapabilityData problems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set return this; } @@ -220,6 +259,7 @@ public List getProblems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProblems(List problems) { this.problems = problems; + isSetProblems = true; // mark as set } /** @@ -230,6 +270,7 @@ public void setProblems(List problems) { */ public AccountCapabilityData requested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set return this; } @@ -253,6 +294,7 @@ public Boolean getRequested() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequested(Boolean requested) { this.requested = requested; + isSetRequested = true; // mark as set } /** @@ -268,6 +310,7 @@ public void setRequested(Boolean requested) { */ public AccountCapabilityData requestedLevel(String requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set return this; } @@ -301,6 +344,7 @@ public String getRequestedLevel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedLevel(String requestedLevel) { this.requestedLevel = requestedLevel; + isSetRequestedLevel = true; // mark as set } /** @@ -313,6 +357,7 @@ public void setRequestedLevel(String requestedLevel) { */ public AccountCapabilityData verificationDeadline(OffsetDateTime verificationDeadline) { this.verificationDeadline = verificationDeadline; + isSetVerificationDeadline = true; // mark as set return this; } @@ -340,6 +385,7 @@ public OffsetDateTime getVerificationDeadline() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationDeadline(OffsetDateTime verificationDeadline) { this.verificationDeadline = verificationDeadline; + isSetVerificationDeadline = true; // mark as set } /** @@ -358,6 +404,7 @@ public void setVerificationDeadline(OffsetDateTime verificationDeadline) { */ public AccountCapabilityData verificationStatus(String verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set return this; } @@ -397,6 +444,27 @@ public String getVerificationStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationStatus(String verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountCapabilityData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AccountCapabilityData object is equal to o. */ @@ -410,26 +478,44 @@ public boolean equals(Object o) { } AccountCapabilityData accountCapabilityData = (AccountCapabilityData) o; return Objects.equals(this.allowed, accountCapabilityData.allowed) + && Objects.equals(this.isSetAllowed, accountCapabilityData.isSetAllowed) && Objects.equals(this.allowedLevel, accountCapabilityData.allowedLevel) + && Objects.equals(this.isSetAllowedLevel, accountCapabilityData.isSetAllowedLevel) && Objects.equals(this.capability, accountCapabilityData.capability) + && Objects.equals(this.isSetCapability, accountCapabilityData.isSetCapability) && Objects.equals(this.problems, accountCapabilityData.problems) + && Objects.equals(this.isSetProblems, accountCapabilityData.isSetProblems) && Objects.equals(this.requested, accountCapabilityData.requested) + && Objects.equals(this.isSetRequested, accountCapabilityData.isSetRequested) && Objects.equals(this.requestedLevel, accountCapabilityData.requestedLevel) + && Objects.equals(this.isSetRequestedLevel, accountCapabilityData.isSetRequestedLevel) && Objects.equals(this.verificationDeadline, accountCapabilityData.verificationDeadline) - && Objects.equals(this.verificationStatus, accountCapabilityData.verificationStatus); + && Objects.equals( + this.isSetVerificationDeadline, accountCapabilityData.isSetVerificationDeadline) + && Objects.equals(this.verificationStatus, accountCapabilityData.verificationStatus) + && Objects.equals( + this.isSetVerificationStatus, accountCapabilityData.isSetVerificationStatus); } @Override public int hashCode() { return Objects.hash( allowed, + isSetAllowed, allowedLevel, + isSetAllowedLevel, capability, + isSetCapability, problems, + isSetProblems, requested, + isSetRequested, requestedLevel, + isSetRequestedLevel, verificationDeadline, - verificationStatus); + isSetVerificationDeadline, + verificationStatus, + isSetVerificationStatus); } @Override @@ -460,6 +546,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetAllowedLevel) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_LEVEL, this.allowedLevel); + } + if (isSetCapability) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITY, this.capability); + } + if (isSetProblems) { + addIfNull(nulls, JSON_PROPERTY_PROBLEMS, this.problems); + } + if (isSetRequested) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED, this.requested); + } + if (isSetRequestedLevel) { + addIfNull(nulls, JSON_PROPERTY_REQUESTED_LEVEL, this.requestedLevel); + } + if (isSetVerificationDeadline) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_DEADLINE, this.verificationDeadline); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountCapabilityData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/AccountCreateNotificationData.java b/src/main/java/com/adyen/model/java/AccountCreateNotificationData.java similarity index 81% rename from src/main/java/com/adyen/model/managementwebhooks/AccountCreateNotificationData.java rename to src/main/java/com/adyen/model/java/AccountCreateNotificationData.java index d6a12689c..0c3d05f62 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/AccountCreateNotificationData.java +++ b/src/main/java/com/adyen/model/java/AccountCreateNotificationData.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,18 +33,39 @@ public class AccountCreateNotificationData { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_COMPANY_ID = "companyId"; private String companyId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompanyId = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountCreateNotificationData() {} /** @@ -61,6 +84,7 @@ public AccountCreateNotificationData() {} public AccountCreateNotificationData capabilities( Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -105,6 +129,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -116,6 +141,7 @@ public void setCapabilities(Map capabilities) { */ public AccountCreateNotificationData companyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set return this; } @@ -139,6 +165,7 @@ public String getCompanyId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompanyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set } /** @@ -152,6 +179,7 @@ public void setCompanyId(String companyId) { */ public AccountCreateNotificationData legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -179,6 +207,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -190,6 +219,7 @@ public void setLegalEntityId(String legalEntityId) { */ public AccountCreateNotificationData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -213,6 +243,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -242,6 +273,7 @@ public void setMerchantId(String merchantId) { */ public AccountCreateNotificationData status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -301,6 +333,27 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountCreateNotificationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AccountCreateNotificationData object is equal to o. */ @@ -314,15 +367,30 @@ public boolean equals(Object o) { } AccountCreateNotificationData accountCreateNotificationData = (AccountCreateNotificationData) o; return Objects.equals(this.capabilities, accountCreateNotificationData.capabilities) + && Objects.equals(this.isSetCapabilities, accountCreateNotificationData.isSetCapabilities) && Objects.equals(this.companyId, accountCreateNotificationData.companyId) + && Objects.equals(this.isSetCompanyId, accountCreateNotificationData.isSetCompanyId) && Objects.equals(this.legalEntityId, accountCreateNotificationData.legalEntityId) + && Objects.equals(this.isSetLegalEntityId, accountCreateNotificationData.isSetLegalEntityId) && Objects.equals(this.merchantId, accountCreateNotificationData.merchantId) - && Objects.equals(this.status, accountCreateNotificationData.status); + && Objects.equals(this.isSetMerchantId, accountCreateNotificationData.isSetMerchantId) + && Objects.equals(this.status, accountCreateNotificationData.status) + && Objects.equals(this.isSetStatus, accountCreateNotificationData.isSetStatus); } @Override public int hashCode() { - return Objects.hash(capabilities, companyId, legalEntityId, merchantId, status); + return Objects.hash( + capabilities, + isSetCapabilities, + companyId, + isSetCompanyId, + legalEntityId, + isSetLegalEntityId, + merchantId, + isSetMerchantId, + status, + isSetStatus); } @Override @@ -348,6 +416,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetCompanyId) { + addIfNull(nulls, JSON_PROPERTY_COMPANY_ID, this.companyId); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountCreateNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/AccountNotificationResponse.java b/src/main/java/com/adyen/model/java/AccountNotificationResponse.java similarity index 66% rename from src/main/java/com/adyen/model/managementwebhooks/AccountNotificationResponse.java rename to src/main/java/com/adyen/model/java/AccountNotificationResponse.java index 8528fe458..dfe22b46c 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/AccountNotificationResponse.java +++ b/src/main/java/com/adyen/model/java/AccountNotificationResponse.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class AccountNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountNotificationResponse() {} /** @@ -35,6 +46,7 @@ public AccountNotificationResponse() {} */ public AccountNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -62,6 +74,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AccountNotificationResponse object is equal to o. */ @@ -75,12 +108,14 @@ public boolean equals(Object o) { } AccountNotificationResponse accountNotificationResponse = (AccountNotificationResponse) o; return Objects.equals( - this.notificationResponse, accountNotificationResponse.notificationResponse); + this.notificationResponse, accountNotificationResponse.notificationResponse) + && Objects.equals( + this.isSetNotificationResponse, accountNotificationResponse.isSetNotificationResponse); } @Override public int hashCode() { - return Objects.hash(notificationResponse); + return Objects.hash(notificationResponse, isSetNotificationResponse); } @Override @@ -104,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/AccountUpdateNotificationData.java b/src/main/java/com/adyen/model/java/AccountUpdateNotificationData.java similarity index 83% rename from src/main/java/com/adyen/model/managementwebhooks/AccountUpdateNotificationData.java rename to src/main/java/com/adyen/model/java/AccountUpdateNotificationData.java index 2a9512303..7dab2e2f0 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/AccountUpdateNotificationData.java +++ b/src/main/java/com/adyen/model/java/AccountUpdateNotificationData.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,15 +32,33 @@ public class AccountUpdateNotificationData { public static final String JSON_PROPERTY_CAPABILITIES = "capabilities"; private Map capabilities; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapabilities = false; + public static final String JSON_PROPERTY_LEGAL_ENTITY_ID = "legalEntityId"; private String legalEntityId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegalEntityId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountUpdateNotificationData() {} /** @@ -59,6 +79,7 @@ public AccountUpdateNotificationData() {} public AccountUpdateNotificationData capabilities( Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set return this; } @@ -107,6 +128,7 @@ public Map getCapabilities() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapabilities(Map capabilities) { this.capabilities = capabilities; + isSetCapabilities = true; // mark as set } /** @@ -120,6 +142,7 @@ public void setCapabilities(Map capabilities) { */ public AccountUpdateNotificationData legalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set return this; } @@ -147,6 +170,7 @@ public String getLegalEntityId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegalEntityId(String legalEntityId) { this.legalEntityId = legalEntityId; + isSetLegalEntityId = true; // mark as set } /** @@ -158,6 +182,7 @@ public void setLegalEntityId(String legalEntityId) { */ public AccountUpdateNotificationData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -181,6 +206,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -210,6 +236,7 @@ public void setMerchantId(String merchantId) { */ public AccountUpdateNotificationData status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -269,6 +296,27 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountUpdateNotificationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AccountUpdateNotificationData object is equal to o. */ @@ -282,14 +330,26 @@ public boolean equals(Object o) { } AccountUpdateNotificationData accountUpdateNotificationData = (AccountUpdateNotificationData) o; return Objects.equals(this.capabilities, accountUpdateNotificationData.capabilities) + && Objects.equals(this.isSetCapabilities, accountUpdateNotificationData.isSetCapabilities) && Objects.equals(this.legalEntityId, accountUpdateNotificationData.legalEntityId) + && Objects.equals(this.isSetLegalEntityId, accountUpdateNotificationData.isSetLegalEntityId) && Objects.equals(this.merchantId, accountUpdateNotificationData.merchantId) - && Objects.equals(this.status, accountUpdateNotificationData.status); + && Objects.equals(this.isSetMerchantId, accountUpdateNotificationData.isSetMerchantId) + && Objects.equals(this.status, accountUpdateNotificationData.status) + && Objects.equals(this.isSetStatus, accountUpdateNotificationData.isSetStatus); } @Override public int hashCode() { - return Objects.hash(capabilities, legalEntityId, merchantId, status); + return Objects.hash( + capabilities, + isSetCapabilities, + legalEntityId, + isSetLegalEntityId, + merchantId, + isSetMerchantId, + status, + isSetStatus); } @Override @@ -314,6 +374,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCapabilities) { + addIfNull(nulls, JSON_PROPERTY_CAPABILITIES, this.capabilities); + } + if (isSetLegalEntityId) { + addIfNull(nulls, JSON_PROPERTY_LEGAL_ENTITY_ID, this.legalEntityId); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountUpdateNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblem.java b/src/main/java/com/adyen/model/java/CapabilityProblem.java similarity index 66% rename from src/main/java/com/adyen/model/managementwebhooks/CapabilityProblem.java rename to src/main/java/com/adyen/model/java/CapabilityProblem.java index 8f27a0397..5ff9449e7 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblem.java +++ b/src/main/java/com/adyen/model/java/CapabilityProblem.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class CapabilityProblem { public static final String JSON_PROPERTY_ENTITY = "entity"; private CapabilityProblemEntity entity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntity = false; + public static final String JSON_PROPERTY_VERIFICATION_ERRORS = "verificationErrors"; private List verificationErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationErrors = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilityProblem() {} /** @@ -41,6 +55,7 @@ public CapabilityProblem() {} */ public CapabilityProblem entity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set return this; } @@ -64,6 +79,7 @@ public CapabilityProblemEntity getEntity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntity(CapabilityProblemEntity entity) { this.entity = entity; + isSetEntity = true; // mark as set } /** @@ -74,6 +90,7 @@ public void setEntity(CapabilityProblemEntity entity) { */ public CapabilityProblem verificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set return this; } @@ -105,6 +122,27 @@ public List getVerificationErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationErrors(List verificationErrors) { this.verificationErrors = verificationErrors; + isSetVerificationErrors = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilityProblem includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapabilityProblem object is equal to o. */ @@ -118,12 +156,14 @@ public boolean equals(Object o) { } CapabilityProblem capabilityProblem = (CapabilityProblem) o; return Objects.equals(this.entity, capabilityProblem.entity) - && Objects.equals(this.verificationErrors, capabilityProblem.verificationErrors); + && Objects.equals(this.isSetEntity, capabilityProblem.isSetEntity) + && Objects.equals(this.verificationErrors, capabilityProblem.verificationErrors) + && Objects.equals(this.isSetVerificationErrors, capabilityProblem.isSetVerificationErrors); } @Override public int hashCode() { - return Objects.hash(entity, verificationErrors); + return Objects.hash(entity, isSetEntity, verificationErrors, isSetVerificationErrors); } @Override @@ -146,6 +186,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEntity) { + addIfNull(nulls, JSON_PROPERTY_ENTITY, this.entity); + } + if (isSetVerificationErrors) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_ERRORS, this.verificationErrors); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapabilityProblem given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntity.java b/src/main/java/com/adyen/model/java/CapabilityProblemEntity.java similarity index 74% rename from src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntity.java rename to src/main/java/com/adyen/model/java/CapabilityProblemEntity.java index 919708775..e886e0135 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntity.java +++ b/src/main/java/com/adyen/model/java/CapabilityProblemEntity.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,12 +36,21 @@ public class CapabilityProblemEntity { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_OWNER = "owner"; private CapabilityProblemEntityRecursive owner; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwner = false; + /** The type of entity. Possible values: **LegalEntity**, **BankAccount**, or **Document**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -86,6 +97,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilityProblemEntity() {} /** @@ -98,6 +118,7 @@ public CapabilityProblemEntity() {} */ public CapabilityProblemEntity documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -133,6 +154,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -143,6 +165,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntity id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -166,6 +189,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -176,6 +200,7 @@ public void setId(String id) { */ public CapabilityProblemEntity owner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set return this; } @@ -199,6 +224,7 @@ public CapabilityProblemEntityRecursive getOwner() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwner(CapabilityProblemEntityRecursive owner) { this.owner = owner; + isSetOwner = true; // mark as set } /** @@ -210,6 +236,7 @@ public void setOwner(CapabilityProblemEntityRecursive owner) { */ public CapabilityProblemEntity type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -235,6 +262,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilityProblemEntity includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapabilityProblemEntity object is equal to o. */ @@ -248,14 +296,18 @@ public boolean equals(Object o) { } CapabilityProblemEntity capabilityProblemEntity = (CapabilityProblemEntity) o; return Objects.equals(this.documents, capabilityProblemEntity.documents) + && Objects.equals(this.isSetDocuments, capabilityProblemEntity.isSetDocuments) && Objects.equals(this.id, capabilityProblemEntity.id) + && Objects.equals(this.isSetId, capabilityProblemEntity.isSetId) && Objects.equals(this.owner, capabilityProblemEntity.owner) - && Objects.equals(this.type, capabilityProblemEntity.type); + && Objects.equals(this.isSetOwner, capabilityProblemEntity.isSetOwner) + && Objects.equals(this.type, capabilityProblemEntity.type) + && Objects.equals(this.isSetType, capabilityProblemEntity.isSetType); } @Override public int hashCode() { - return Objects.hash(documents, id, owner, type); + return Objects.hash(documents, isSetDocuments, id, isSetId, owner, isSetOwner, type, isSetType); } @Override @@ -280,6 +332,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetOwner) { + addIfNull(nulls, JSON_PROPERTY_OWNER, this.owner); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapabilityProblemEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntityRecursive.java b/src/main/java/com/adyen/model/java/CapabilityProblemEntityRecursive.java similarity index 75% rename from src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntityRecursive.java rename to src/main/java/com/adyen/model/java/CapabilityProblemEntityRecursive.java index ae32f3409..7aa6926ca 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/CapabilityProblemEntityRecursive.java +++ b/src/main/java/com/adyen/model/java/CapabilityProblemEntityRecursive.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class CapabilityProblemEntityRecursive { public static final String JSON_PROPERTY_DOCUMENTS = "documents"; private List documents; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocuments = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + /** The type of entity. Possible values: **LegalEntity**, **BankAccount**, or **Document**. */ public enum TypeEnum { BANKACCOUNT(String.valueOf("BankAccount")), @@ -84,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CapabilityProblemEntityRecursive() {} /** @@ -97,6 +114,7 @@ public CapabilityProblemEntityRecursive() {} */ public CapabilityProblemEntityRecursive documents(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set return this; } @@ -132,6 +150,7 @@ public List getDocuments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocuments(List documents) { this.documents = documents; + isSetDocuments = true; // mark as set } /** @@ -143,6 +162,7 @@ public void setDocuments(List documents) { */ public CapabilityProblemEntityRecursive id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -166,6 +186,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -178,6 +199,7 @@ public void setId(String id) { */ public CapabilityProblemEntityRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -203,6 +225,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CapabilityProblemEntityRecursive includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CapabilityProblemEntity-recursive object is equal to o. */ @@ -217,13 +260,16 @@ public boolean equals(Object o) { CapabilityProblemEntityRecursive capabilityProblemEntityRecursive = (CapabilityProblemEntityRecursive) o; return Objects.equals(this.documents, capabilityProblemEntityRecursive.documents) + && Objects.equals(this.isSetDocuments, capabilityProblemEntityRecursive.isSetDocuments) && Objects.equals(this.id, capabilityProblemEntityRecursive.id) - && Objects.equals(this.type, capabilityProblemEntityRecursive.type); + && Objects.equals(this.isSetId, capabilityProblemEntityRecursive.isSetId) + && Objects.equals(this.type, capabilityProblemEntityRecursive.type) + && Objects.equals(this.isSetType, capabilityProblemEntityRecursive.isSetType); } @Override public int hashCode() { - return Objects.hash(documents, id, type); + return Objects.hash(documents, isSetDocuments, id, isSetId, type, isSetType); } @Override @@ -247,6 +293,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDocuments) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENTS, this.documents); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CapabilityProblemEntityRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/MerchantCreatedNotificationRequest.java b/src/main/java/com/adyen/model/java/MerchantCreatedNotificationRequest.java similarity index 73% rename from src/main/java/com/adyen/model/managementwebhooks/MerchantCreatedNotificationRequest.java rename to src/main/java/com/adyen/model/java/MerchantCreatedNotificationRequest.java index aa8536e88..c602e0836 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/MerchantCreatedNotificationRequest.java +++ b/src/main/java/com/adyen/model/java/MerchantCreatedNotificationRequest.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class MerchantCreatedNotificationRequest { public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_DATA = "data"; private AccountCreateNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { MERCHANT_CREATED(String.valueOf("merchant.created")); @@ -81,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantCreatedNotificationRequest() {} /** @@ -92,6 +112,7 @@ public MerchantCreatedNotificationRequest() {} */ public MerchantCreatedNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public MerchantCreatedNotificationRequest data(AccountCreateNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public AccountCreateNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(AccountCreateNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(AccountCreateNotificationData data) { */ public MerchantCreatedNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public MerchantCreatedNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantCreatedNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantCreatedNotificationRequest object is equal to o. */ @@ -234,14 +282,20 @@ public boolean equals(Object o) { MerchantCreatedNotificationRequest merchantCreatedNotificationRequest = (MerchantCreatedNotificationRequest) o; return Objects.equals(this.createdAt, merchantCreatedNotificationRequest.createdAt) + && Objects.equals(this.isSetCreatedAt, merchantCreatedNotificationRequest.isSetCreatedAt) && Objects.equals(this.data, merchantCreatedNotificationRequest.data) + && Objects.equals(this.isSetData, merchantCreatedNotificationRequest.isSetData) && Objects.equals(this.environment, merchantCreatedNotificationRequest.environment) - && Objects.equals(this.type, merchantCreatedNotificationRequest.type); + && Objects.equals( + this.isSetEnvironment, merchantCreatedNotificationRequest.isSetEnvironment) + && Objects.equals(this.type, merchantCreatedNotificationRequest.type) + && Objects.equals(this.isSetType, merchantCreatedNotificationRequest.isSetType); } @Override public int hashCode() { - return Objects.hash(createdAt, data, environment, type); + return Objects.hash( + createdAt, isSetCreatedAt, data, isSetData, environment, isSetEnvironment, type, isSetType); } @Override @@ -266,6 +320,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantCreatedNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/MerchantUpdatedNotificationRequest.java b/src/main/java/com/adyen/model/java/MerchantUpdatedNotificationRequest.java similarity index 73% rename from src/main/java/com/adyen/model/managementwebhooks/MerchantUpdatedNotificationRequest.java rename to src/main/java/com/adyen/model/java/MerchantUpdatedNotificationRequest.java index 0e8404f70..249ab3fa9 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/MerchantUpdatedNotificationRequest.java +++ b/src/main/java/com/adyen/model/java/MerchantUpdatedNotificationRequest.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class MerchantUpdatedNotificationRequest { public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_DATA = "data"; private AccountUpdateNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { MERCHANT_UPDATED(String.valueOf("merchant.updated")); @@ -81,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantUpdatedNotificationRequest() {} /** @@ -92,6 +112,7 @@ public MerchantUpdatedNotificationRequest() {} */ public MerchantUpdatedNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public MerchantUpdatedNotificationRequest data(AccountUpdateNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public AccountUpdateNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(AccountUpdateNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(AccountUpdateNotificationData data) { */ public MerchantUpdatedNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public MerchantUpdatedNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantUpdatedNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantUpdatedNotificationRequest object is equal to o. */ @@ -234,14 +282,20 @@ public boolean equals(Object o) { MerchantUpdatedNotificationRequest merchantUpdatedNotificationRequest = (MerchantUpdatedNotificationRequest) o; return Objects.equals(this.createdAt, merchantUpdatedNotificationRequest.createdAt) + && Objects.equals(this.isSetCreatedAt, merchantUpdatedNotificationRequest.isSetCreatedAt) && Objects.equals(this.data, merchantUpdatedNotificationRequest.data) + && Objects.equals(this.isSetData, merchantUpdatedNotificationRequest.isSetData) && Objects.equals(this.environment, merchantUpdatedNotificationRequest.environment) - && Objects.equals(this.type, merchantUpdatedNotificationRequest.type); + && Objects.equals( + this.isSetEnvironment, merchantUpdatedNotificationRequest.isSetEnvironment) + && Objects.equals(this.type, merchantUpdatedNotificationRequest.type) + && Objects.equals(this.isSetType, merchantUpdatedNotificationRequest.isSetType); } @Override public int hashCode() { - return Objects.hash(createdAt, data, environment, type); + return Objects.hash( + createdAt, isSetCreatedAt, data, isSetData, environment, isSetEnvironment, type, isSetType); } @Override @@ -266,6 +320,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantUpdatedNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/MidServiceNotificationData.java b/src/main/java/com/adyen/model/java/MidServiceNotificationData.java similarity index 79% rename from src/main/java/com/adyen/model/managementwebhooks/MidServiceNotificationData.java rename to src/main/java/com/adyen/model/java/MidServiceNotificationData.java index ed4003593..6da2de54a 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/MidServiceNotificationData.java +++ b/src/main/java/com/adyen/model/java/MidServiceNotificationData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,18 +39,33 @@ public class MidServiceNotificationData { public static final String JSON_PROPERTY_ALLOWED = "allowed"; private Boolean allowed; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowed = false; + public static final String JSON_PROPERTY_ENABLED = "enabled"; private Boolean enabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnabled = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The status of the request to add a payment method. Possible values: * **success**: the payment * method was added. * **failure**: the request failed. * **capabilityPending**: the @@ -103,12 +120,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_STORE_ID = "storeId"; private String storeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + /** * Payment method status. Possible values: * **valid** * **pending** * **invalid** * **rejected** */ @@ -159,6 +185,15 @@ public static VerificationStatusEnum fromValue(String value) { public static final String JSON_PROPERTY_VERIFICATION_STATUS = "verificationStatus"; private VerificationStatusEnum verificationStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVerificationStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MidServiceNotificationData() {} /** @@ -171,6 +206,7 @@ public MidServiceNotificationData() {} */ public MidServiceNotificationData allowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set return this; } @@ -198,6 +234,7 @@ public Boolean getAllowed() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowed(Boolean allowed) { this.allowed = allowed; + isSetAllowed = true; // mark as set } /** @@ -209,6 +246,7 @@ public void setAllowed(Boolean allowed) { */ public MidServiceNotificationData enabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set return this; } @@ -234,6 +272,7 @@ public Boolean getEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnabled(Boolean enabled) { this.enabled = enabled; + isSetEnabled = true; // mark as set } /** @@ -244,6 +283,7 @@ public void setEnabled(Boolean enabled) { */ public MidServiceNotificationData id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -267,6 +307,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -277,6 +318,7 @@ public void setId(String id) { */ public MidServiceNotificationData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -300,6 +342,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -310,6 +353,7 @@ public void setMerchantId(String merchantId) { */ public MidServiceNotificationData reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -333,6 +377,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -347,6 +392,7 @@ public void setReference(String reference) { */ public MidServiceNotificationData status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -378,6 +424,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -392,6 +439,7 @@ public void setStatus(StatusEnum status) { */ public MidServiceNotificationData storeId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set return this; } @@ -423,6 +471,7 @@ public String getStoreId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set } /** @@ -435,6 +484,7 @@ public void setStoreId(String storeId) { */ public MidServiceNotificationData type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -462,6 +512,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -473,6 +524,7 @@ public void setType(String type) { */ public MidServiceNotificationData verificationStatus(VerificationStatusEnum verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set return this; } @@ -498,6 +550,27 @@ public VerificationStatusEnum getVerificationStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVerificationStatus(VerificationStatusEnum verificationStatus) { this.verificationStatus = verificationStatus; + isSetVerificationStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MidServiceNotificationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MidServiceNotificationData object is equal to o. */ @@ -511,20 +584,47 @@ public boolean equals(Object o) { } MidServiceNotificationData midServiceNotificationData = (MidServiceNotificationData) o; return Objects.equals(this.allowed, midServiceNotificationData.allowed) + && Objects.equals(this.isSetAllowed, midServiceNotificationData.isSetAllowed) && Objects.equals(this.enabled, midServiceNotificationData.enabled) + && Objects.equals(this.isSetEnabled, midServiceNotificationData.isSetEnabled) && Objects.equals(this.id, midServiceNotificationData.id) + && Objects.equals(this.isSetId, midServiceNotificationData.isSetId) && Objects.equals(this.merchantId, midServiceNotificationData.merchantId) + && Objects.equals(this.isSetMerchantId, midServiceNotificationData.isSetMerchantId) && Objects.equals(this.reference, midServiceNotificationData.reference) + && Objects.equals(this.isSetReference, midServiceNotificationData.isSetReference) && Objects.equals(this.status, midServiceNotificationData.status) + && Objects.equals(this.isSetStatus, midServiceNotificationData.isSetStatus) && Objects.equals(this.storeId, midServiceNotificationData.storeId) + && Objects.equals(this.isSetStoreId, midServiceNotificationData.isSetStoreId) && Objects.equals(this.type, midServiceNotificationData.type) - && Objects.equals(this.verificationStatus, midServiceNotificationData.verificationStatus); + && Objects.equals(this.isSetType, midServiceNotificationData.isSetType) + && Objects.equals(this.verificationStatus, midServiceNotificationData.verificationStatus) + && Objects.equals( + this.isSetVerificationStatus, midServiceNotificationData.isSetVerificationStatus); } @Override public int hashCode() { return Objects.hash( - allowed, enabled, id, merchantId, reference, status, storeId, type, verificationStatus); + allowed, + isSetAllowed, + enabled, + isSetEnabled, + id, + isSetId, + merchantId, + isSetMerchantId, + reference, + isSetReference, + status, + isSetStatus, + storeId, + isSetStoreId, + type, + isSetType, + verificationStatus, + isSetVerificationStatus); } @Override @@ -554,6 +654,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllowed) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED, this.allowed); + } + if (isSetEnabled) { + addIfNull(nulls, JSON_PROPERTY_ENABLED, this.enabled); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStoreId) { + addIfNull(nulls, JSON_PROPERTY_STORE_ID, this.storeId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetVerificationStatus) { + addIfNull(nulls, JSON_PROPERTY_VERIFICATION_STATUS, this.verificationStatus); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MidServiceNotificationData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodCreatedNotificationRequest.java b/src/main/java/com/adyen/model/java/PaymentMethodCreatedNotificationRequest.java similarity index 73% rename from src/main/java/com/adyen/model/managementwebhooks/PaymentMethodCreatedNotificationRequest.java rename to src/main/java/com/adyen/model/java/PaymentMethodCreatedNotificationRequest.java index 280047e23..1ff8c5861 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodCreatedNotificationRequest.java +++ b/src/main/java/com/adyen/model/java/PaymentMethodCreatedNotificationRequest.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class PaymentMethodCreatedNotificationRequest { public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_DATA = "data"; private MidServiceNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { PAYMENTMETHOD_CREATED(String.valueOf("paymentMethod.created")); @@ -81,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodCreatedNotificationRequest() {} /** @@ -92,6 +112,7 @@ public PaymentMethodCreatedNotificationRequest() {} */ public PaymentMethodCreatedNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public PaymentMethodCreatedNotificationRequest data(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public MidServiceNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(MidServiceNotificationData data) { */ public PaymentMethodCreatedNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public PaymentMethodCreatedNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodCreatedNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentMethodCreatedNotificationRequest object is equal to o. */ @@ -234,14 +282,21 @@ public boolean equals(Object o) { PaymentMethodCreatedNotificationRequest paymentMethodCreatedNotificationRequest = (PaymentMethodCreatedNotificationRequest) o; return Objects.equals(this.createdAt, paymentMethodCreatedNotificationRequest.createdAt) + && Objects.equals( + this.isSetCreatedAt, paymentMethodCreatedNotificationRequest.isSetCreatedAt) && Objects.equals(this.data, paymentMethodCreatedNotificationRequest.data) + && Objects.equals(this.isSetData, paymentMethodCreatedNotificationRequest.isSetData) && Objects.equals(this.environment, paymentMethodCreatedNotificationRequest.environment) - && Objects.equals(this.type, paymentMethodCreatedNotificationRequest.type); + && Objects.equals( + this.isSetEnvironment, paymentMethodCreatedNotificationRequest.isSetEnvironment) + && Objects.equals(this.type, paymentMethodCreatedNotificationRequest.type) + && Objects.equals(this.isSetType, paymentMethodCreatedNotificationRequest.isSetType); } @Override public int hashCode() { - return Objects.hash(createdAt, data, environment, type); + return Objects.hash( + createdAt, isSetCreatedAt, data, isSetData, environment, isSetEnvironment, type, isSetType); } @Override @@ -266,6 +321,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodCreatedNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodNotificationResponse.java b/src/main/java/com/adyen/model/java/PaymentMethodNotificationResponse.java similarity index 66% rename from src/main/java/com/adyen/model/managementwebhooks/PaymentMethodNotificationResponse.java rename to src/main/java/com/adyen/model/java/PaymentMethodNotificationResponse.java index 05eadf327..af9d8a19e 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodNotificationResponse.java +++ b/src/main/java/com/adyen/model/java/PaymentMethodNotificationResponse.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class PaymentMethodNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodNotificationResponse() {} /** @@ -36,6 +47,7 @@ public PaymentMethodNotificationResponse() {} */ public PaymentMethodNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentMethodNotificationResponse object is equal to o. */ @@ -77,12 +110,15 @@ public boolean equals(Object o) { PaymentMethodNotificationResponse paymentMethodNotificationResponse = (PaymentMethodNotificationResponse) o; return Objects.equals( - this.notificationResponse, paymentMethodNotificationResponse.notificationResponse); + this.notificationResponse, paymentMethodNotificationResponse.notificationResponse) + && Objects.equals( + this.isSetNotificationResponse, + paymentMethodNotificationResponse.isSetNotificationResponse); } @Override public int hashCode() { - return Objects.hash(notificationResponse); + return Objects.hash(notificationResponse, isSetNotificationResponse); } @Override @@ -106,6 +142,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodRequestRemovedNotificationRequest.java b/src/main/java/com/adyen/model/java/PaymentMethodRequestRemovedNotificationRequest.java similarity index 73% rename from src/main/java/com/adyen/model/managementwebhooks/PaymentMethodRequestRemovedNotificationRequest.java rename to src/main/java/com/adyen/model/java/PaymentMethodRequestRemovedNotificationRequest.java index 3b5017488..705b31954 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodRequestRemovedNotificationRequest.java +++ b/src/main/java/com/adyen/model/java/PaymentMethodRequestRemovedNotificationRequest.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class PaymentMethodRequestRemovedNotificationRequest { public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_DATA = "data"; private MidServiceNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { PAYMENTMETHODREQUEST_REMOVED(String.valueOf("paymentMethodRequest.removed")); @@ -81,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodRequestRemovedNotificationRequest() {} /** @@ -92,6 +112,7 @@ public PaymentMethodRequestRemovedNotificationRequest() {} */ public PaymentMethodRequestRemovedNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public PaymentMethodRequestRemovedNotificationRequest data(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public MidServiceNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(MidServiceNotificationData data) { */ public PaymentMethodRequestRemovedNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public PaymentMethodRequestRemovedNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,28 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodRequestRemovedNotificationRequest includeNullValues( + boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentMethodRequestRemovedNotificationRequest object is equal to o. */ @@ -234,15 +283,22 @@ public boolean equals(Object o) { PaymentMethodRequestRemovedNotificationRequest paymentMethodRequestRemovedNotificationRequest = (PaymentMethodRequestRemovedNotificationRequest) o; return Objects.equals(this.createdAt, paymentMethodRequestRemovedNotificationRequest.createdAt) + && Objects.equals( + this.isSetCreatedAt, paymentMethodRequestRemovedNotificationRequest.isSetCreatedAt) && Objects.equals(this.data, paymentMethodRequestRemovedNotificationRequest.data) + && Objects.equals(this.isSetData, paymentMethodRequestRemovedNotificationRequest.isSetData) && Objects.equals( this.environment, paymentMethodRequestRemovedNotificationRequest.environment) - && Objects.equals(this.type, paymentMethodRequestRemovedNotificationRequest.type); + && Objects.equals( + this.isSetEnvironment, paymentMethodRequestRemovedNotificationRequest.isSetEnvironment) + && Objects.equals(this.type, paymentMethodRequestRemovedNotificationRequest.type) + && Objects.equals(this.isSetType, paymentMethodRequestRemovedNotificationRequest.isSetType); } @Override public int hashCode() { - return Objects.hash(createdAt, data, environment, type); + return Objects.hash( + createdAt, isSetCreatedAt, data, isSetData, environment, isSetEnvironment, type, isSetType); } @Override @@ -267,6 +323,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodRequestRemovedNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodScheduledForRemovalNotificationRequest.java b/src/main/java/com/adyen/model/java/PaymentMethodScheduledForRemovalNotificationRequest.java similarity index 73% rename from src/main/java/com/adyen/model/managementwebhooks/PaymentMethodScheduledForRemovalNotificationRequest.java rename to src/main/java/com/adyen/model/java/PaymentMethodScheduledForRemovalNotificationRequest.java index 938a6b65d..7ec13a189 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/PaymentMethodScheduledForRemovalNotificationRequest.java +++ b/src/main/java/com/adyen/model/java/PaymentMethodScheduledForRemovalNotificationRequest.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class PaymentMethodScheduledForRemovalNotificationRequest { public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_DATA = "data"; private MidServiceNotificationData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { PAYMENTMETHODREQUEST_SCHEDULEDFORREMOVAL( @@ -82,6 +93,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodScheduledForRemovalNotificationRequest() {} /** @@ -93,6 +113,7 @@ public PaymentMethodScheduledForRemovalNotificationRequest() {} */ public PaymentMethodScheduledForRemovalNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -116,6 +137,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -127,6 +149,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public PaymentMethodScheduledForRemovalNotificationRequest data(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -150,6 +173,7 @@ public MidServiceNotificationData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(MidServiceNotificationData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -162,6 +186,7 @@ public void setData(MidServiceNotificationData data) { */ public PaymentMethodScheduledForRemovalNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -187,6 +212,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -198,6 +224,7 @@ public void setEnvironment(String environment) { */ public PaymentMethodScheduledForRemovalNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -221,6 +248,28 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodScheduledForRemovalNotificationRequest includeNullValues( + boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** @@ -239,15 +288,25 @@ public boolean equals(Object o) { (PaymentMethodScheduledForRemovalNotificationRequest) o; return Objects.equals( this.createdAt, paymentMethodScheduledForRemovalNotificationRequest.createdAt) + && Objects.equals( + this.isSetCreatedAt, paymentMethodScheduledForRemovalNotificationRequest.isSetCreatedAt) && Objects.equals(this.data, paymentMethodScheduledForRemovalNotificationRequest.data) + && Objects.equals( + this.isSetData, paymentMethodScheduledForRemovalNotificationRequest.isSetData) && Objects.equals( this.environment, paymentMethodScheduledForRemovalNotificationRequest.environment) - && Objects.equals(this.type, paymentMethodScheduledForRemovalNotificationRequest.type); + && Objects.equals( + this.isSetEnvironment, + paymentMethodScheduledForRemovalNotificationRequest.isSetEnvironment) + && Objects.equals(this.type, paymentMethodScheduledForRemovalNotificationRequest.type) + && Objects.equals( + this.isSetType, paymentMethodScheduledForRemovalNotificationRequest.isSetType); } @Override public int hashCode() { - return Objects.hash(createdAt, data, environment, type); + return Objects.hash( + createdAt, isSetCreatedAt, data, isSetData, environment, isSetEnvironment, type, isSetType); } @Override @@ -272,6 +331,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodScheduledForRemovalNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/RemediatingAction.java b/src/main/java/com/adyen/model/java/RemediatingAction.java similarity index 66% rename from src/main/java/com/adyen/model/managementwebhooks/RemediatingAction.java rename to src/main/java/com/adyen/model/java/RemediatingAction.java index 87ac426e5..dbaa656e4 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/RemediatingAction.java +++ b/src/main/java/com/adyen/model/java/RemediatingAction.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class RemediatingAction { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RemediatingAction() {} /** @@ -36,6 +50,7 @@ public RemediatingAction() {} */ public RemediatingAction code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCode(String code) { */ public RemediatingAction message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RemediatingAction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RemediatingAction object is equal to o. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } RemediatingAction remediatingAction = (RemediatingAction) o; return Objects.equals(this.code, remediatingAction.code) - && Objects.equals(this.message, remediatingAction.message); + && Objects.equals(this.isSetCode, remediatingAction.isSetCode) + && Objects.equals(this.message, remediatingAction.message) + && Objects.equals(this.isSetMessage, remediatingAction.isSetMessage); } @Override public int hashCode() { - return Objects.hash(code, message); + return Objects.hash(code, isSetCode, message, isSetMessage); } @Override @@ -133,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RemediatingAction given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationRequest.java b/src/main/java/com/adyen/model/java/TerminalAssignmentNotificationRequest.java similarity index 73% rename from src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationRequest.java rename to src/main/java/com/adyen/model/java/TerminalAssignmentNotificationRequest.java index cc29279e2..f7c79eb27 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationRequest.java +++ b/src/main/java/com/adyen/model/java/TerminalAssignmentNotificationRequest.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class TerminalAssignmentNotificationRequest { public static final String JSON_PROPERTY_ASSIGNED_TO_ACCOUNT = "assignedToAccount"; private String assignedToAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssignedToAccount = false; + public static final String JSON_PROPERTY_ASSIGNED_TO_STORE = "assignedToStore"; private String assignedToStore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssignedToStore = false; + public static final String JSON_PROPERTY_ASSIGNED_TO_STORE_ID = "assignedToStoreId"; private String assignedToStoreId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAssignedToStoreId = false; + public static final String JSON_PROPERTY_EVENT_DATE = "eventDate"; private String eventDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEventDate = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_UNIQUE_TERMINAL_ID = "uniqueTerminalId"; private String uniqueTerminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUniqueTerminalId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalAssignmentNotificationRequest() {} /** @@ -57,6 +83,7 @@ public TerminalAssignmentNotificationRequest() {} */ public TerminalAssignmentNotificationRequest assignedToAccount(String assignedToAccount) { this.assignedToAccount = assignedToAccount; + isSetAssignedToAccount = true; // mark as set return this; } @@ -82,6 +109,7 @@ public String getAssignedToAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAssignedToAccount(String assignedToAccount) { this.assignedToAccount = assignedToAccount; + isSetAssignedToAccount = true; // mark as set } /** @@ -95,6 +123,7 @@ public void setAssignedToAccount(String assignedToAccount) { */ public TerminalAssignmentNotificationRequest assignedToStore(String assignedToStore) { this.assignedToStore = assignedToStore; + isSetAssignedToStore = true; // mark as set return this; } @@ -122,6 +151,7 @@ public String getAssignedToStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAssignedToStore(String assignedToStore) { this.assignedToStore = assignedToStore; + isSetAssignedToStore = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setAssignedToStore(String assignedToStore) { */ public TerminalAssignmentNotificationRequest assignedToStoreId(String assignedToStoreId) { this.assignedToStoreId = assignedToStoreId; + isSetAssignedToStoreId = true; // mark as set return this; } @@ -156,6 +187,7 @@ public String getAssignedToStoreId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAssignedToStoreId(String assignedToStoreId) { this.assignedToStoreId = assignedToStoreId; + isSetAssignedToStoreId = true; // mark as set } /** @@ -167,6 +199,7 @@ public void setAssignedToStoreId(String assignedToStoreId) { */ public TerminalAssignmentNotificationRequest eventDate(String eventDate) { this.eventDate = eventDate; + isSetEventDate = true; // mark as set return this; } @@ -190,6 +223,7 @@ public String getEventDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEventDate(String eventDate) { this.eventDate = eventDate; + isSetEventDate = true; // mark as set } /** @@ -201,6 +235,7 @@ public void setEventDate(String eventDate) { */ public TerminalAssignmentNotificationRequest pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -224,6 +259,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -235,6 +271,7 @@ public void setPspReference(String pspReference) { */ public TerminalAssignmentNotificationRequest uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -258,6 +295,27 @@ public String getUniqueTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalAssignmentNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TerminalAssignmentNotificationRequest object is equal to o. */ @@ -273,25 +331,45 @@ public boolean equals(Object o) { (TerminalAssignmentNotificationRequest) o; return Objects.equals( this.assignedToAccount, terminalAssignmentNotificationRequest.assignedToAccount) + && Objects.equals( + this.isSetAssignedToAccount, + terminalAssignmentNotificationRequest.isSetAssignedToAccount) && Objects.equals( this.assignedToStore, terminalAssignmentNotificationRequest.assignedToStore) + && Objects.equals( + this.isSetAssignedToStore, terminalAssignmentNotificationRequest.isSetAssignedToStore) && Objects.equals( this.assignedToStoreId, terminalAssignmentNotificationRequest.assignedToStoreId) + && Objects.equals( + this.isSetAssignedToStoreId, + terminalAssignmentNotificationRequest.isSetAssignedToStoreId) && Objects.equals(this.eventDate, terminalAssignmentNotificationRequest.eventDate) + && Objects.equals(this.isSetEventDate, terminalAssignmentNotificationRequest.isSetEventDate) && Objects.equals(this.pspReference, terminalAssignmentNotificationRequest.pspReference) && Objects.equals( - this.uniqueTerminalId, terminalAssignmentNotificationRequest.uniqueTerminalId); + this.isSetPspReference, terminalAssignmentNotificationRequest.isSetPspReference) + && Objects.equals( + this.uniqueTerminalId, terminalAssignmentNotificationRequest.uniqueTerminalId) + && Objects.equals( + this.isSetUniqueTerminalId, + terminalAssignmentNotificationRequest.isSetUniqueTerminalId); } @Override public int hashCode() { return Objects.hash( assignedToAccount, + isSetAssignedToAccount, assignedToStore, + isSetAssignedToStore, assignedToStoreId, + isSetAssignedToStoreId, eventDate, + isSetEventDate, pspReference, - uniqueTerminalId); + isSetPspReference, + uniqueTerminalId, + isSetUniqueTerminalId); } @Override @@ -318,6 +396,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAssignedToAccount) { + addIfNull(nulls, JSON_PROPERTY_ASSIGNED_TO_ACCOUNT, this.assignedToAccount); + } + if (isSetAssignedToStore) { + addIfNull(nulls, JSON_PROPERTY_ASSIGNED_TO_STORE, this.assignedToStore); + } + if (isSetAssignedToStoreId) { + addIfNull(nulls, JSON_PROPERTY_ASSIGNED_TO_STORE_ID, this.assignedToStoreId); + } + if (isSetEventDate) { + addIfNull(nulls, JSON_PROPERTY_EVENT_DATE, this.eventDate); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetUniqueTerminalId) { + addIfNull(nulls, JSON_PROPERTY_UNIQUE_TERMINAL_ID, this.uniqueTerminalId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalAssignmentNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationResponse.java b/src/main/java/com/adyen/model/java/TerminalAssignmentNotificationResponse.java similarity index 67% rename from src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationResponse.java rename to src/main/java/com/adyen/model/java/TerminalAssignmentNotificationResponse.java index bc39a097b..e64575561 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalAssignmentNotificationResponse.java +++ b/src/main/java/com/adyen/model/java/TerminalAssignmentNotificationResponse.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class TerminalAssignmentNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalAssignmentNotificationResponse() {} /** @@ -36,6 +47,7 @@ public TerminalAssignmentNotificationResponse() {} */ public TerminalAssignmentNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalAssignmentNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TerminalAssignmentNotificationResponse object is equal to o. */ @@ -77,12 +110,15 @@ public boolean equals(Object o) { TerminalAssignmentNotificationResponse terminalAssignmentNotificationResponse = (TerminalAssignmentNotificationResponse) o; return Objects.equals( - this.notificationResponse, terminalAssignmentNotificationResponse.notificationResponse); + this.notificationResponse, terminalAssignmentNotificationResponse.notificationResponse) + && Objects.equals( + this.isSetNotificationResponse, + terminalAssignmentNotificationResponse.isSetNotificationResponse); } @Override public int hashCode() { - return Objects.hash(notificationResponse); + return Objects.hash(notificationResponse, isSetNotificationResponse); } @Override @@ -106,6 +142,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalAssignmentNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingData.java b/src/main/java/com/adyen/model/java/TerminalBoardingData.java similarity index 68% rename from src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingData.java rename to src/main/java/com/adyen/model/java/TerminalBoardingData.java index debf480d9..da503e924 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingData.java +++ b/src/main/java/com/adyen/model/java/TerminalBoardingData.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class TerminalBoardingData { public static final String JSON_PROPERTY_COMPANY_ID = "companyId"; private String companyId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompanyId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_STORE_ID = "storeId"; private String storeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreId = false; + public static final String JSON_PROPERTY_UNIQUE_TERMINAL_ID = "uniqueTerminalId"; private String uniqueTerminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUniqueTerminalId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalBoardingData() {} /** @@ -47,6 +67,7 @@ public TerminalBoardingData() {} */ public TerminalBoardingData companyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getCompanyId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompanyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setCompanyId(String companyId) { */ public TerminalBoardingData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setMerchantId(String merchantId) { */ public TerminalBoardingData storeId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getStoreId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setStoreId(String storeId) { */ public TerminalBoardingData uniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getUniqueTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUniqueTerminalId(String uniqueTerminalId) { this.uniqueTerminalId = uniqueTerminalId; + isSetUniqueTerminalId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalBoardingData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TerminalBoardingData object is equal to o. */ @@ -182,14 +230,26 @@ public boolean equals(Object o) { } TerminalBoardingData terminalBoardingData = (TerminalBoardingData) o; return Objects.equals(this.companyId, terminalBoardingData.companyId) + && Objects.equals(this.isSetCompanyId, terminalBoardingData.isSetCompanyId) && Objects.equals(this.merchantId, terminalBoardingData.merchantId) + && Objects.equals(this.isSetMerchantId, terminalBoardingData.isSetMerchantId) && Objects.equals(this.storeId, terminalBoardingData.storeId) - && Objects.equals(this.uniqueTerminalId, terminalBoardingData.uniqueTerminalId); + && Objects.equals(this.isSetStoreId, terminalBoardingData.isSetStoreId) + && Objects.equals(this.uniqueTerminalId, terminalBoardingData.uniqueTerminalId) + && Objects.equals(this.isSetUniqueTerminalId, terminalBoardingData.isSetUniqueTerminalId); } @Override public int hashCode() { - return Objects.hash(companyId, merchantId, storeId, uniqueTerminalId); + return Objects.hash( + companyId, + isSetCompanyId, + merchantId, + isSetMerchantId, + storeId, + isSetStoreId, + uniqueTerminalId, + isSetUniqueTerminalId); } @Override @@ -214,6 +274,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCompanyId) { + addIfNull(nulls, JSON_PROPERTY_COMPANY_ID, this.companyId); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetStoreId) { + addIfNull(nulls, JSON_PROPERTY_STORE_ID, this.storeId); + } + if (isSetUniqueTerminalId) { + addIfNull(nulls, JSON_PROPERTY_UNIQUE_TERMINAL_ID, this.uniqueTerminalId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalBoardingData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationRequest.java b/src/main/java/com/adyen/model/java/TerminalBoardingNotificationRequest.java similarity index 73% rename from src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationRequest.java rename to src/main/java/com/adyen/model/java/TerminalBoardingNotificationRequest.java index f7920493e..51a8200db 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationRequest.java +++ b/src/main/java/com/adyen/model/java/TerminalBoardingNotificationRequest.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class TerminalBoardingNotificationRequest { public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_DATA = "data"; private TerminalBoardingData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { TERMINALBOARDING_TRIGGERED(String.valueOf("terminalBoarding.triggered")); @@ -81,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalBoardingNotificationRequest() {} /** @@ -92,6 +112,7 @@ public TerminalBoardingNotificationRequest() {} */ public TerminalBoardingNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public TerminalBoardingNotificationRequest data(TerminalBoardingData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public TerminalBoardingData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(TerminalBoardingData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(TerminalBoardingData data) { */ public TerminalBoardingNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public TerminalBoardingNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalBoardingNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TerminalBoardingNotificationRequest object is equal to o. */ @@ -234,14 +282,20 @@ public boolean equals(Object o) { TerminalBoardingNotificationRequest terminalBoardingNotificationRequest = (TerminalBoardingNotificationRequest) o; return Objects.equals(this.createdAt, terminalBoardingNotificationRequest.createdAt) + && Objects.equals(this.isSetCreatedAt, terminalBoardingNotificationRequest.isSetCreatedAt) && Objects.equals(this.data, terminalBoardingNotificationRequest.data) + && Objects.equals(this.isSetData, terminalBoardingNotificationRequest.isSetData) && Objects.equals(this.environment, terminalBoardingNotificationRequest.environment) - && Objects.equals(this.type, terminalBoardingNotificationRequest.type); + && Objects.equals( + this.isSetEnvironment, terminalBoardingNotificationRequest.isSetEnvironment) + && Objects.equals(this.type, terminalBoardingNotificationRequest.type) + && Objects.equals(this.isSetType, terminalBoardingNotificationRequest.isSetType); } @Override public int hashCode() { - return Objects.hash(createdAt, data, environment, type); + return Objects.hash( + createdAt, isSetCreatedAt, data, isSetData, environment, isSetEnvironment, type, isSetType); } @Override @@ -266,6 +320,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalBoardingNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationResponse.java b/src/main/java/com/adyen/model/java/TerminalBoardingNotificationResponse.java similarity index 67% rename from src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationResponse.java rename to src/main/java/com/adyen/model/java/TerminalBoardingNotificationResponse.java index 1b06bf9a1..71e6a9022 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalBoardingNotificationResponse.java +++ b/src/main/java/com/adyen/model/java/TerminalBoardingNotificationResponse.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class TerminalBoardingNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalBoardingNotificationResponse() {} /** @@ -36,6 +47,7 @@ public TerminalBoardingNotificationResponse() {} */ public TerminalBoardingNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalBoardingNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TerminalBoardingNotificationResponse object is equal to o. */ @@ -77,12 +110,15 @@ public boolean equals(Object o) { TerminalBoardingNotificationResponse terminalBoardingNotificationResponse = (TerminalBoardingNotificationResponse) o; return Objects.equals( - this.notificationResponse, terminalBoardingNotificationResponse.notificationResponse); + this.notificationResponse, terminalBoardingNotificationResponse.notificationResponse) + && Objects.equals( + this.isSetNotificationResponse, + terminalBoardingNotificationResponse.isSetNotificationResponse); } @Override public int hashCode() { - return Objects.hash(notificationResponse); + return Objects.hash(notificationResponse, isSetNotificationResponse); } @Override @@ -106,6 +142,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalBoardingNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsData.java b/src/main/java/com/adyen/model/java/TerminalSettingsData.java similarity index 73% rename from src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsData.java rename to src/main/java/com/adyen/model/java/TerminalSettingsData.java index 3e8624a86..fae000225 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsData.java +++ b/src/main/java/com/adyen/model/java/TerminalSettingsData.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,15 +36,27 @@ public class TerminalSettingsData { public static final String JSON_PROPERTY_COMPANY_ID = "companyId"; private String companyId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompanyId = false; + public static final String JSON_PROPERTY_MERCHANT_ID = "merchantId"; private String merchantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantId = false; + public static final String JSON_PROPERTY_STORE_ID = "storeId"; private String storeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreId = false; + public static final String JSON_PROPERTY_TERMINAL_ID = "terminalId"; private String terminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTerminalId = false; + /** * Indicates whether the terminal settings were updated using the Customer Area or the Management * API. @@ -90,9 +104,21 @@ public static UpdateSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_UPDATE_SOURCE = "updateSource"; private UpdateSourceEnum updateSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdateSource = false; + public static final String JSON_PROPERTY_USER = "user"; private String user; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUser = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalSettingsData() {} /** @@ -103,6 +129,7 @@ public TerminalSettingsData() {} */ public TerminalSettingsData companyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set return this; } @@ -126,6 +153,7 @@ public String getCompanyId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompanyId(String companyId) { this.companyId = companyId; + isSetCompanyId = true; // mark as set } /** @@ -136,6 +164,7 @@ public void setCompanyId(String companyId) { */ public TerminalSettingsData merchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set return this; } @@ -159,6 +188,7 @@ public String getMerchantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantId(String merchantId) { this.merchantId = merchantId; + isSetMerchantId = true; // mark as set } /** @@ -169,6 +199,7 @@ public void setMerchantId(String merchantId) { */ public TerminalSettingsData storeId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set return this; } @@ -192,6 +223,7 @@ public String getStoreId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreId(String storeId) { this.storeId = storeId; + isSetStoreId = true; // mark as set } /** @@ -202,6 +234,7 @@ public void setStoreId(String storeId) { */ public TerminalSettingsData terminalId(String terminalId) { this.terminalId = terminalId; + isSetTerminalId = true; // mark as set return this; } @@ -225,6 +258,7 @@ public String getTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTerminalId(String terminalId) { this.terminalId = terminalId; + isSetTerminalId = true; // mark as set } /** @@ -237,6 +271,7 @@ public void setTerminalId(String terminalId) { */ public TerminalSettingsData updateSource(UpdateSourceEnum updateSource) { this.updateSource = updateSource; + isSetUpdateSource = true; // mark as set return this; } @@ -264,6 +299,7 @@ public UpdateSourceEnum getUpdateSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdateSource(UpdateSourceEnum updateSource) { this.updateSource = updateSource; + isSetUpdateSource = true; // mark as set } /** @@ -275,6 +311,7 @@ public void setUpdateSource(UpdateSourceEnum updateSource) { */ public TerminalSettingsData user(String user) { this.user = user; + isSetUser = true; // mark as set return this; } @@ -300,6 +337,27 @@ public String getUser() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUser(String user) { this.user = user; + isSetUser = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalSettingsData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TerminalSettingsData object is equal to o. */ @@ -313,16 +371,34 @@ public boolean equals(Object o) { } TerminalSettingsData terminalSettingsData = (TerminalSettingsData) o; return Objects.equals(this.companyId, terminalSettingsData.companyId) + && Objects.equals(this.isSetCompanyId, terminalSettingsData.isSetCompanyId) && Objects.equals(this.merchantId, terminalSettingsData.merchantId) + && Objects.equals(this.isSetMerchantId, terminalSettingsData.isSetMerchantId) && Objects.equals(this.storeId, terminalSettingsData.storeId) + && Objects.equals(this.isSetStoreId, terminalSettingsData.isSetStoreId) && Objects.equals(this.terminalId, terminalSettingsData.terminalId) + && Objects.equals(this.isSetTerminalId, terminalSettingsData.isSetTerminalId) && Objects.equals(this.updateSource, terminalSettingsData.updateSource) - && Objects.equals(this.user, terminalSettingsData.user); + && Objects.equals(this.isSetUpdateSource, terminalSettingsData.isSetUpdateSource) + && Objects.equals(this.user, terminalSettingsData.user) + && Objects.equals(this.isSetUser, terminalSettingsData.isSetUser); } @Override public int hashCode() { - return Objects.hash(companyId, merchantId, storeId, terminalId, updateSource, user); + return Objects.hash( + companyId, + isSetCompanyId, + merchantId, + isSetMerchantId, + storeId, + isSetStoreId, + terminalId, + isSetTerminalId, + updateSource, + isSetUpdateSource, + user, + isSetUser); } @Override @@ -349,6 +425,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCompanyId) { + addIfNull(nulls, JSON_PROPERTY_COMPANY_ID, this.companyId); + } + if (isSetMerchantId) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ID, this.merchantId); + } + if (isSetStoreId) { + addIfNull(nulls, JSON_PROPERTY_STORE_ID, this.storeId); + } + if (isSetTerminalId) { + addIfNull(nulls, JSON_PROPERTY_TERMINAL_ID, this.terminalId); + } + if (isSetUpdateSource) { + addIfNull(nulls, JSON_PROPERTY_UPDATE_SOURCE, this.updateSource); + } + if (isSetUser) { + addIfNull(nulls, JSON_PROPERTY_USER, this.user); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalSettingsData given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationRequest.java b/src/main/java/com/adyen/model/java/TerminalSettingsNotificationRequest.java similarity index 73% rename from src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationRequest.java rename to src/main/java/com/adyen/model/java/TerminalSettingsNotificationRequest.java index 6f7892534..b5540ebcb 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationRequest.java +++ b/src/main/java/com/adyen/model/java/TerminalSettingsNotificationRequest.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,12 +35,21 @@ public class TerminalSettingsNotificationRequest { public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; private OffsetDateTime createdAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCreatedAt = false; + public static final String JSON_PROPERTY_DATA = "data"; private TerminalSettingsData data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_ENVIRONMENT = "environment"; private String environment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnvironment = false; + /** Type of notification. */ public enum TypeEnum { TERMINALSETTINGS_MODIFIED(String.valueOf("terminalSettings.modified")); @@ -81,6 +92,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalSettingsNotificationRequest() {} /** @@ -92,6 +112,7 @@ public TerminalSettingsNotificationRequest() {} */ public TerminalSettingsNotificationRequest createdAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set return this; } @@ -115,6 +136,7 @@ public OffsetDateTime getCreatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCreatedAt(OffsetDateTime createdAt) { this.createdAt = createdAt; + isSetCreatedAt = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCreatedAt(OffsetDateTime createdAt) { */ public TerminalSettingsNotificationRequest data(TerminalSettingsData data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -149,6 +172,7 @@ public TerminalSettingsData getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(TerminalSettingsData data) { this.data = data; + isSetData = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setData(TerminalSettingsData data) { */ public TerminalSettingsNotificationRequest environment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set return this; } @@ -186,6 +211,7 @@ public String getEnvironment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironment(String environment) { this.environment = environment; + isSetEnvironment = true; // mark as set } /** @@ -197,6 +223,7 @@ public void setEnvironment(String environment) { */ public TerminalSettingsNotificationRequest type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -220,6 +247,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalSettingsNotificationRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TerminalSettingsNotificationRequest object is equal to o. */ @@ -234,14 +282,20 @@ public boolean equals(Object o) { TerminalSettingsNotificationRequest terminalSettingsNotificationRequest = (TerminalSettingsNotificationRequest) o; return Objects.equals(this.createdAt, terminalSettingsNotificationRequest.createdAt) + && Objects.equals(this.isSetCreatedAt, terminalSettingsNotificationRequest.isSetCreatedAt) && Objects.equals(this.data, terminalSettingsNotificationRequest.data) + && Objects.equals(this.isSetData, terminalSettingsNotificationRequest.isSetData) && Objects.equals(this.environment, terminalSettingsNotificationRequest.environment) - && Objects.equals(this.type, terminalSettingsNotificationRequest.type); + && Objects.equals( + this.isSetEnvironment, terminalSettingsNotificationRequest.isSetEnvironment) + && Objects.equals(this.type, terminalSettingsNotificationRequest.type) + && Objects.equals(this.isSetType, terminalSettingsNotificationRequest.isSetType); } @Override public int hashCode() { - return Objects.hash(createdAt, data, environment, type); + return Objects.hash( + createdAt, isSetCreatedAt, data, isSetData, environment, isSetEnvironment, type, isSetType); } @Override @@ -266,6 +320,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCreatedAt) { + addIfNull(nulls, JSON_PROPERTY_CREATED_AT, this.createdAt); + } + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetEnvironment) { + addIfNull(nulls, JSON_PROPERTY_ENVIRONMENT, this.environment); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalSettingsNotificationRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationResponse.java b/src/main/java/com/adyen/model/java/TerminalSettingsNotificationResponse.java similarity index 67% rename from src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationResponse.java rename to src/main/java/com/adyen/model/java/TerminalSettingsNotificationResponse.java index 4cb54c453..166d69f49 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/TerminalSettingsNotificationResponse.java +++ b/src/main/java/com/adyen/model/java/TerminalSettingsNotificationResponse.java @@ -9,8 +9,10 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class TerminalSettingsNotificationResponse { public static final String JSON_PROPERTY_NOTIFICATION_RESPONSE = "notificationResponse"; private String notificationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationResponse = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TerminalSettingsNotificationResponse() {} /** @@ -36,6 +47,7 @@ public TerminalSettingsNotificationResponse() {} */ public TerminalSettingsNotificationResponse notificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set return this; } @@ -63,6 +75,27 @@ public String getNotificationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationResponse(String notificationResponse) { this.notificationResponse = notificationResponse; + isSetNotificationResponse = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TerminalSettingsNotificationResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TerminalSettingsNotificationResponse object is equal to o. */ @@ -77,12 +110,15 @@ public boolean equals(Object o) { TerminalSettingsNotificationResponse terminalSettingsNotificationResponse = (TerminalSettingsNotificationResponse) o; return Objects.equals( - this.notificationResponse, terminalSettingsNotificationResponse.notificationResponse); + this.notificationResponse, terminalSettingsNotificationResponse.notificationResponse) + && Objects.equals( + this.isSetNotificationResponse, + terminalSettingsNotificationResponse.isSetNotificationResponse); } @Override public int hashCode() { - return Objects.hash(notificationResponse); + return Objects.hash(notificationResponse, isSetNotificationResponse); } @Override @@ -106,6 +142,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNotificationResponse) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_RESPONSE, this.notificationResponse); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TerminalSettingsNotificationResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/VerificationError.java b/src/main/java/com/adyen/model/java/VerificationError.java similarity index 74% rename from src/main/java/com/adyen/model/managementwebhooks/VerificationError.java rename to src/main/java/com/adyen/model/java/VerificationError.java index c86fd02bd..836c9fa99 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/VerificationError.java +++ b/src/main/java/com/adyen/model/java/VerificationError.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,15 +37,27 @@ public class VerificationError { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + public static final String JSON_PROPERTY_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + public static final String JSON_PROPERTY_SUB_ERRORS = "subErrors"; private List subErrors; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubErrors = false; + /** * The type of verification error. Possible values: **invalidInput**, **dataMissing**, and * **pendingStatus**. @@ -95,6 +109,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationError() {} /** @@ -105,6 +128,7 @@ public VerificationError() {} */ public VerificationError code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -128,6 +152,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -138,6 +163,7 @@ public void setCode(String code) { */ public VerificationError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -161,6 +187,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -171,6 +198,7 @@ public void setMessage(String message) { */ public VerificationError remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -202,6 +230,7 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set } /** @@ -212,6 +241,7 @@ public void setRemediatingActions(List remediatingActions) { */ public VerificationError subErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set return this; } @@ -243,6 +273,7 @@ public List getSubErrors() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubErrors(List subErrors) { this.subErrors = subErrors; + isSetSubErrors = true; // mark as set } /** @@ -255,6 +286,7 @@ public void setSubErrors(List subErrors) { */ public VerificationError type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -282,6 +314,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationError includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this VerificationError object is equal to o. */ @@ -295,15 +348,30 @@ public boolean equals(Object o) { } VerificationError verificationError = (VerificationError) o; return Objects.equals(this.code, verificationError.code) + && Objects.equals(this.isSetCode, verificationError.isSetCode) && Objects.equals(this.message, verificationError.message) + && Objects.equals(this.isSetMessage, verificationError.isSetMessage) && Objects.equals(this.remediatingActions, verificationError.remediatingActions) + && Objects.equals(this.isSetRemediatingActions, verificationError.isSetRemediatingActions) && Objects.equals(this.subErrors, verificationError.subErrors) - && Objects.equals(this.type, verificationError.type); + && Objects.equals(this.isSetSubErrors, verificationError.isSetSubErrors) + && Objects.equals(this.type, verificationError.type) + && Objects.equals(this.isSetType, verificationError.isSetType); } @Override public int hashCode() { - return Objects.hash(code, message, remediatingActions, subErrors, type); + return Objects.hash( + code, + isSetCode, + message, + isSetMessage, + remediatingActions, + isSetRemediatingActions, + subErrors, + isSetSubErrors, + type, + isSetType); } @Override @@ -329,6 +397,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + if (isSetSubErrors) { + addIfNull(nulls, JSON_PROPERTY_SUB_ERRORS, this.subErrors); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of VerificationError given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/VerificationErrorRecursive.java b/src/main/java/com/adyen/model/java/VerificationErrorRecursive.java similarity index 74% rename from src/main/java/com/adyen/model/managementwebhooks/VerificationErrorRecursive.java rename to src/main/java/com/adyen/model/java/VerificationErrorRecursive.java index 68c11ba2c..7dee95e3d 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/VerificationErrorRecursive.java +++ b/src/main/java/com/adyen/model/java/VerificationErrorRecursive.java @@ -9,9 +9,11 @@ * Do not edit the class manually. */ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,9 +38,15 @@ public class VerificationErrorRecursive { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + /** * The type of verification error. Possible values: **invalidInput**, **dataMissing**, and * **pendingStatus**. @@ -90,9 +98,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_REMEDIATING_ACTIONS = "remediatingActions"; private List remediatingActions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemediatingActions = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VerificationErrorRecursive() {} /** @@ -103,6 +123,7 @@ public VerificationErrorRecursive() {} */ public VerificationErrorRecursive code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -126,6 +147,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -136,6 +158,7 @@ public void setCode(String code) { */ public VerificationErrorRecursive message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -159,6 +182,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -171,6 +195,7 @@ public void setMessage(String message) { */ public VerificationErrorRecursive type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -198,6 +223,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -208,6 +234,7 @@ public void setType(TypeEnum type) { */ public VerificationErrorRecursive remediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set return this; } @@ -240,6 +267,27 @@ public List getRemediatingActions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemediatingActions(List remediatingActions) { this.remediatingActions = remediatingActions; + isSetRemediatingActions = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VerificationErrorRecursive includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this VerificationError-recursive object is equal to o. */ @@ -253,14 +301,27 @@ public boolean equals(Object o) { } VerificationErrorRecursive verificationErrorRecursive = (VerificationErrorRecursive) o; return Objects.equals(this.code, verificationErrorRecursive.code) + && Objects.equals(this.isSetCode, verificationErrorRecursive.isSetCode) && Objects.equals(this.message, verificationErrorRecursive.message) + && Objects.equals(this.isSetMessage, verificationErrorRecursive.isSetMessage) && Objects.equals(this.type, verificationErrorRecursive.type) - && Objects.equals(this.remediatingActions, verificationErrorRecursive.remediatingActions); + && Objects.equals(this.isSetType, verificationErrorRecursive.isSetType) + && Objects.equals(this.remediatingActions, verificationErrorRecursive.remediatingActions) + && Objects.equals( + this.isSetRemediatingActions, verificationErrorRecursive.isSetRemediatingActions); } @Override public int hashCode() { - return Objects.hash(code, message, type, remediatingActions); + return Objects.hash( + code, + isSetCode, + message, + isSetMessage, + type, + isSetType, + remediatingActions, + isSetRemediatingActions); } @Override @@ -285,6 +346,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetRemediatingActions) { + addIfNull(nulls, JSON_PROPERTY_REMEDIATING_ACTIONS, this.remediatingActions); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of VerificationErrorRecursive given an JSON string * diff --git a/src/main/java/com/adyen/model/managementwebhooks/JSON.java b/src/main/java/com/adyen/model/managementwebhooks/JSON.java index 29d9aac38..abe09e65a 100644 --- a/src/main/java/com/adyen/model/managementwebhooks/JSON.java +++ b/src/main/java/com/adyen/model/managementwebhooks/JSON.java @@ -1,4 +1,4 @@ -package com.adyen.model.managementwebhooks; +package com.adyen.model.java; import com.adyen.serializer.ByteArrayDeserializer; import com.adyen.serializer.ByteArraySerializer; diff --git a/src/main/java/com/adyen/model/managementwebhooks/ManagementWebhooksHandler.java b/src/main/java/com/adyen/model/managementwebhooks/ManagementWebhooksHandler.java deleted file mode 100644 index b581d86e1..000000000 --- a/src/main/java/com/adyen/model/managementwebhooks/ManagementWebhooksHandler.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Management Webhooks - * - * The version of the OpenAPI document: 3 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package com.adyen.model.managementwebhooks; - -import java.util.Optional; -import java.util.logging.Logger; - -/** - * Handler for processing ManagementWebhooks. - * - *

This class provides functionality to deserialize the payload of ManagementWebhooks events. - */ -public class ManagementWebhooksHandler { - - private static final Logger LOG = Logger.getLogger(ManagementWebhooksHandler.class.getName()); - - private final String payload; - - /** - * Constructs a new handler for the given webhook payload - * - * @param payload the raw JSON payload from the webhook - */ - public ManagementWebhooksHandler(String payload) { - this.payload = payload; - } - - /** - * Attempts to deserialize the webhook payload into a MerchantCreatedNotificationRequest - * - * @return an Optional containing the deserialized object, or empty if deserialization fails - */ - public Optional getMerchantCreatedNotificationRequest() { - - var optionalMerchantCreatedNotificationRequest = - getOptionalField(MerchantCreatedNotificationRequest.class); - - if (optionalMerchantCreatedNotificationRequest.isPresent()) { - // verify event type - for (var value : MerchantCreatedNotificationRequest.TypeEnum.values()) { - if (value.equals(optionalMerchantCreatedNotificationRequest.get().getType())) { - // found matching event type - return optionalMerchantCreatedNotificationRequest; - } - } - } - - return Optional.empty(); - } - - /** - * Attempts to deserialize the webhook payload into a MerchantUpdatedNotificationRequest - * - * @return an Optional containing the deserialized object, or empty if deserialization fails - */ - public Optional getMerchantUpdatedNotificationRequest() { - - var optionalMerchantUpdatedNotificationRequest = - getOptionalField(MerchantUpdatedNotificationRequest.class); - - if (optionalMerchantUpdatedNotificationRequest.isPresent()) { - // verify event type - for (var value : MerchantUpdatedNotificationRequest.TypeEnum.values()) { - if (value.equals(optionalMerchantUpdatedNotificationRequest.get().getType())) { - // found matching event type - return optionalMerchantUpdatedNotificationRequest; - } - } - } - - return Optional.empty(); - } - - /** - * Attempts to deserialize the webhook payload into a PaymentMethodCreatedNotificationRequest - * - * @return an Optional containing the deserialized object, or empty if deserialization fails - */ - public Optional - getPaymentMethodCreatedNotificationRequest() { - - var optionalPaymentMethodCreatedNotificationRequest = - getOptionalField(PaymentMethodCreatedNotificationRequest.class); - - if (optionalPaymentMethodCreatedNotificationRequest.isPresent()) { - // verify event type - for (var value : PaymentMethodCreatedNotificationRequest.TypeEnum.values()) { - if (value.equals(optionalPaymentMethodCreatedNotificationRequest.get().getType())) { - // found matching event type - return optionalPaymentMethodCreatedNotificationRequest; - } - } - } - - return Optional.empty(); - } - - /** - * Attempts to deserialize the webhook payload into a - * PaymentMethodRequestRemovedNotificationRequest - * - * @return an Optional containing the deserialized object, or empty if deserialization fails - */ - public Optional - getPaymentMethodRequestRemovedNotificationRequest() { - - var optionalPaymentMethodRequestRemovedNotificationRequest = - getOptionalField(PaymentMethodRequestRemovedNotificationRequest.class); - - if (optionalPaymentMethodRequestRemovedNotificationRequest.isPresent()) { - // verify event type - for (var value : PaymentMethodRequestRemovedNotificationRequest.TypeEnum.values()) { - if (value.equals(optionalPaymentMethodRequestRemovedNotificationRequest.get().getType())) { - // found matching event type - return optionalPaymentMethodRequestRemovedNotificationRequest; - } - } - } - - return Optional.empty(); - } - - /** - * Attempts to deserialize the webhook payload into a - * PaymentMethodScheduledForRemovalNotificationRequest - * - * @return an Optional containing the deserialized object, or empty if deserialization fails - */ - public Optional - getPaymentMethodScheduledForRemovalNotificationRequest() { - - var optionalPaymentMethodScheduledForRemovalNotificationRequest = - getOptionalField(PaymentMethodScheduledForRemovalNotificationRequest.class); - - if (optionalPaymentMethodScheduledForRemovalNotificationRequest.isPresent()) { - // verify event type - for (var value : PaymentMethodScheduledForRemovalNotificationRequest.TypeEnum.values()) { - if (value.equals( - optionalPaymentMethodScheduledForRemovalNotificationRequest.get().getType())) { - // found matching event type - return optionalPaymentMethodScheduledForRemovalNotificationRequest; - } - } - } - - return Optional.empty(); - } - - /** - * Attempts to deserialize the webhook payload into a TerminalBoardingNotificationRequest - * - * @return an Optional containing the deserialized object, or empty if deserialization fails - */ - public Optional getTerminalBoardingNotificationRequest() { - - var optionalTerminalBoardingNotificationRequest = - getOptionalField(TerminalBoardingNotificationRequest.class); - - if (optionalTerminalBoardingNotificationRequest.isPresent()) { - // verify event type - for (var value : TerminalBoardingNotificationRequest.TypeEnum.values()) { - if (value.equals(optionalTerminalBoardingNotificationRequest.get().getType())) { - // found matching event type - return optionalTerminalBoardingNotificationRequest; - } - } - } - - return Optional.empty(); - } - - /** - * Attempts to deserialize the webhook payload into a TerminalSettingsNotificationRequest - * - * @return an Optional containing the deserialized object, or empty if deserialization fails - */ - public Optional getTerminalSettingsNotificationRequest() { - - var optionalTerminalSettingsNotificationRequest = - getOptionalField(TerminalSettingsNotificationRequest.class); - - if (optionalTerminalSettingsNotificationRequest.isPresent()) { - // verify event type - for (var value : TerminalSettingsNotificationRequest.TypeEnum.values()) { - if (value.equals(optionalTerminalSettingsNotificationRequest.get().getType())) { - // found matching event type - return optionalTerminalSettingsNotificationRequest; - } - } - } - - return Optional.empty(); - } - - /** - * Deserializes the payload into the specified class type. - * - * @param clazz the class to deserialize into - * @param the type of the class - * @return an Optional containing the deserialized object, or empty if an error occurs - */ - private Optional getOptionalField(Class clazz) { - try { - T val = JSON.getMapper().readValue(payload, clazz); - return Optional.ofNullable(val); - } catch (Exception e) { - // an error has occurred during deserialization (object not found, deserialization error) - LOG.warning("Object not found or unexpected error trying to access: " + clazz.getName()); - LOG.warning("Deserialization error: " + e.getMessage()); - return Optional.empty(); - } - } -}