Skip to content

Commit 1d142d3

Browse files
[acswebhooks] Automated update from Adyen/adyen-openapi@37c03ec
1 parent 52e2c57 commit 1d142d3

16 files changed

+1268
-141
lines changed

src/main/java/com/adyen/model/acswebhooks/AcsWebhooksHandler.java

Lines changed: 0 additions & 100 deletions
This file was deleted.

src/main/java/com/adyen/model/acswebhooks/JSON.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.adyen.model.acswebhooks;
1+
package com.adyen.model.java;
22

33
import com.adyen.serializer.ByteArrayDeserializer;
44
import com.adyen.serializer.ByteArraySerializer;

src/main/java/com/adyen/model/acswebhooks/AbstractOpenApiSchema.java renamed to src/main/java/com/adyen/model/java/AbstractOpenApiSchema.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Do not edit the class manually.
1010
*/
1111

12-
package com.adyen.model.acswebhooks;
12+
package com.adyen.model.java;
1313

1414
import com.fasterxml.jackson.annotation.JsonValue;
1515
import jakarta.ws.rs.core.GenericType;

src/main/java/com/adyen/model/acswebhooks/Amount.java renamed to src/main/java/com/adyen/model/java/Amount.java

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
* Do not edit the class manually.
1010
*/
1111

12-
package com.adyen.model.acswebhooks;
12+
package com.adyen.model.java;
1313

14+
import com.fasterxml.jackson.annotation.JsonAnyGetter;
15+
import com.fasterxml.jackson.annotation.JsonIgnore;
1416
import com.fasterxml.jackson.annotation.JsonInclude;
1517
import com.fasterxml.jackson.annotation.JsonProperty;
1618
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@@ -23,9 +25,21 @@ public class Amount {
2325
public static final String JSON_PROPERTY_CURRENCY = "currency";
2426
private String currency;
2527

28+
/** Mark when the attribute has been explicitly set. */
29+
private boolean isSetCurrency = false;
30+
2631
public static final String JSON_PROPERTY_VALUE = "value";
2732
private Long value;
2833

34+
/** Mark when the attribute has been explicitly set. */
35+
private boolean isSetValue = false;
36+
37+
/**
38+
* Sets whether attributes with null values should be explicitly included in the JSON payload.
39+
* Default is false.
40+
*/
41+
@JsonIgnore private boolean includeNullValues = false;
42+
2943
public Amount() {}
3044

3145
/**
@@ -40,6 +54,7 @@ public Amount() {}
4054
*/
4155
public Amount currency(String currency) {
4256
this.currency = currency;
57+
isSetCurrency = true; // mark as set
4358
return this;
4459
}
4560

@@ -71,6 +86,7 @@ public String getCurrency() {
7186
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
7287
public void setCurrency(String currency) {
7388
this.currency = currency;
89+
isSetCurrency = true; // mark as set
7490
}
7591

7692
/**
@@ -83,6 +99,7 @@ public void setCurrency(String currency) {
8399
*/
84100
public Amount value(Long value) {
85101
this.value = value;
102+
isSetValue = true; // mark as set
86103
return this;
87104
}
88105

@@ -110,6 +127,27 @@ public Long getValue() {
110127
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
111128
public void setValue(Long value) {
112129
this.value = value;
130+
isSetValue = true; // mark as set
131+
}
132+
133+
/**
134+
* Configures whether null values are explicitly serialized in the JSON payload. Default is false.
135+
*/
136+
public Amount includeNullValues(boolean includeNullValues) {
137+
this.includeNullValues = includeNullValues;
138+
return this;
139+
}
140+
141+
/** Returns whether null values are explicitly serialized in the JSON payload. */
142+
public boolean isIncludeNullValues() {
143+
return includeNullValues;
144+
}
145+
146+
/**
147+
* Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
148+
*/
149+
public void setIncludeNullValues(boolean includeNullValues) {
150+
this.includeNullValues = includeNullValues;
113151
}
114152

115153
/** Return true if this Amount object is equal to o. */
@@ -123,12 +161,14 @@ public boolean equals(Object o) {
123161
}
124162
Amount amount = (Amount) o;
125163
return Objects.equals(this.currency, amount.currency)
126-
&& Objects.equals(this.value, amount.value);
164+
&& Objects.equals(this.isSetCurrency, amount.isSetCurrency)
165+
&& Objects.equals(this.value, amount.value)
166+
&& Objects.equals(this.isSetValue, amount.isSetValue);
127167
}
128168

129169
@Override
130170
public int hashCode() {
131-
return Objects.hash(currency, value);
171+
return Objects.hash(currency, isSetCurrency, value, isSetValue);
132172
}
133173

134174
@Override
@@ -151,6 +191,33 @@ private String toIndentedString(Object o) {
151191
return o.toString().replace("\n", "\n ");
152192
}
153193

194+
/** Returns a map of properties to be merged into the JSON payload as explicit null values. */
195+
@JsonInclude(JsonInclude.Include.ALWAYS)
196+
@JsonAnyGetter
197+
public Map<String, Object> getExplicitNulls() {
198+
if (!this.includeNullValues) {
199+
return Collections.emptyMap();
200+
}
201+
202+
Map<String, Object> nulls = new HashMap<>();
203+
204+
if (isSetCurrency) {
205+
addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency);
206+
}
207+
if (isSetValue) {
208+
addIfNull(nulls, JSON_PROPERTY_VALUE, this.value);
209+
}
210+
211+
return nulls;
212+
}
213+
214+
// add to map when value is null
215+
private void addIfNull(Map<String, Object> map, String key, Object value) {
216+
if (value == null) {
217+
map.put(key, null);
218+
}
219+
}
220+
154221
/**
155222
* Create an instance of Amount given an JSON string
156223
*

src/main/java/com/adyen/model/acswebhooks/AuthenticationDecision.java renamed to src/main/java/com/adyen/model/java/AuthenticationDecision.java

Lines changed: 61 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
* Do not edit the class manually.
1010
*/
1111

12-
package com.adyen.model.acswebhooks;
12+
package com.adyen.model.java;
1313

14+
import com.fasterxml.jackson.annotation.JsonAnyGetter;
1415
import com.fasterxml.jackson.annotation.JsonCreator;
16+
import com.fasterxml.jackson.annotation.JsonIgnore;
1517
import com.fasterxml.jackson.annotation.JsonInclude;
1618
import com.fasterxml.jackson.annotation.JsonProperty;
1719
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@@ -72,6 +74,15 @@ public static StatusEnum fromValue(String value) {
7274
public static final String JSON_PROPERTY_STATUS = "status";
7375
private StatusEnum status;
7476

77+
/** Mark when the attribute has been explicitly set. */
78+
private boolean isSetStatus = false;
79+
80+
/**
81+
* Sets whether attributes with null values should be explicitly included in the JSON payload.
82+
* Default is false.
83+
*/
84+
@JsonIgnore private boolean includeNullValues = false;
85+
7586
public AuthenticationDecision() {}
7687

7788
/**
@@ -86,6 +97,7 @@ public AuthenticationDecision() {}
8697
*/
8798
public AuthenticationDecision status(StatusEnum status) {
8899
this.status = status;
100+
isSetStatus = true; // mark as set
89101
return this;
90102
}
91103

@@ -117,6 +129,27 @@ public StatusEnum getStatus() {
117129
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
118130
public void setStatus(StatusEnum status) {
119131
this.status = status;
132+
isSetStatus = true; // mark as set
133+
}
134+
135+
/**
136+
* Configures whether null values are explicitly serialized in the JSON payload. Default is false.
137+
*/
138+
public AuthenticationDecision includeNullValues(boolean includeNullValues) {
139+
this.includeNullValues = includeNullValues;
140+
return this;
141+
}
142+
143+
/** Returns whether null values are explicitly serialized in the JSON payload. */
144+
public boolean isIncludeNullValues() {
145+
return includeNullValues;
146+
}
147+
148+
/**
149+
* Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
150+
*/
151+
public void setIncludeNullValues(boolean includeNullValues) {
152+
this.includeNullValues = includeNullValues;
120153
}
121154

122155
/** Return true if this AuthenticationDecision object is equal to o. */
@@ -129,12 +162,13 @@ public boolean equals(Object o) {
129162
return false;
130163
}
131164
AuthenticationDecision authenticationDecision = (AuthenticationDecision) o;
132-
return Objects.equals(this.status, authenticationDecision.status);
165+
return Objects.equals(this.status, authenticationDecision.status)
166+
&& Objects.equals(this.isSetStatus, authenticationDecision.isSetStatus);
133167
}
134168

135169
@Override
136170
public int hashCode() {
137-
return Objects.hash(status);
171+
return Objects.hash(status, isSetStatus);
138172
}
139173

140174
@Override
@@ -156,6 +190,30 @@ private String toIndentedString(Object o) {
156190
return o.toString().replace("\n", "\n ");
157191
}
158192

193+
/** Returns a map of properties to be merged into the JSON payload as explicit null values. */
194+
@JsonInclude(JsonInclude.Include.ALWAYS)
195+
@JsonAnyGetter
196+
public Map<String, Object> getExplicitNulls() {
197+
if (!this.includeNullValues) {
198+
return Collections.emptyMap();
199+
}
200+
201+
Map<String, Object> nulls = new HashMap<>();
202+
203+
if (isSetStatus) {
204+
addIfNull(nulls, JSON_PROPERTY_STATUS, this.status);
205+
}
206+
207+
return nulls;
208+
}
209+
210+
// add to map when value is null
211+
private void addIfNull(Map<String, Object> map, String key, Object value) {
212+
if (value == null) {
213+
map.put(key, null);
214+
}
215+
}
216+
159217
/**
160218
* Create an instance of AuthenticationDecision given an JSON string
161219
*

0 commit comments

Comments
 (0)