Skip to content

Commit eec9753

Browse files
authored
Generate Transfers API and TransferWebhooks models (#1605)
* Generate Transfers models * Generate Transfer Webhooks models * Regenerate API models * Regenerate Webhook models
1 parent bab80c7 commit eec9753

File tree

94 files changed

+9643
-837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+9643
-837
lines changed

src/main/java/com/adyen/model/transfers/AULocalAccountIdentification.java

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
package com.adyen.model.transfers;
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;
@@ -31,9 +33,15 @@ public class AULocalAccountIdentification {
3133
public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber";
3234
private String accountNumber;
3335

36+
/** Mark when the attribute has been explicitly set. */
37+
private boolean isSetAccountNumber = false;
38+
3439
public static final String JSON_PROPERTY_BSB_CODE = "bsbCode";
3540
private String bsbCode;
3641

42+
/** Mark when the attribute has been explicitly set. */
43+
private boolean isSetBsbCode = false;
44+
3745
/** **auLocal** */
3846
public enum TypeEnum {
3947
AULOCAL(String.valueOf("auLocal"));
@@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) {
7684
public static final String JSON_PROPERTY_TYPE = "type";
7785
private TypeEnum type;
7886

87+
/** Mark when the attribute has been explicitly set. */
88+
private boolean isSetType = false;
89+
90+
/**
91+
* Sets whether attributes with null values should be explicitly included in the JSON payload.
92+
* Default is false.
93+
*/
94+
@JsonIgnore private boolean includeNullValues = false;
95+
7996
public AULocalAccountIdentification() {}
8097

8198
/**
@@ -86,6 +103,7 @@ public AULocalAccountIdentification() {}
86103
*/
87104
public AULocalAccountIdentification accountNumber(String accountNumber) {
88105
this.accountNumber = accountNumber;
106+
isSetAccountNumber = true; // mark as set
89107
return this;
90108
}
91109

@@ -109,6 +127,7 @@ public String getAccountNumber() {
109127
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
110128
public void setAccountNumber(String accountNumber) {
111129
this.accountNumber = accountNumber;
130+
isSetAccountNumber = true; // mark as set
112131
}
113132

114133
/**
@@ -121,6 +140,7 @@ public void setAccountNumber(String accountNumber) {
121140
*/
122141
public AULocalAccountIdentification bsbCode(String bsbCode) {
123142
this.bsbCode = bsbCode;
143+
isSetBsbCode = true; // mark as set
124144
return this;
125145
}
126146

@@ -148,6 +168,7 @@ public String getBsbCode() {
148168
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
149169
public void setBsbCode(String bsbCode) {
150170
this.bsbCode = bsbCode;
171+
isSetBsbCode = true; // mark as set
151172
}
152173

153174
/**
@@ -158,6 +179,7 @@ public void setBsbCode(String bsbCode) {
158179
*/
159180
public AULocalAccountIdentification type(TypeEnum type) {
160181
this.type = type;
182+
isSetType = true; // mark as set
161183
return this;
162184
}
163185

@@ -181,6 +203,27 @@ public TypeEnum getType() {
181203
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
182204
public void setType(TypeEnum type) {
183205
this.type = type;
206+
isSetType = true; // mark as set
207+
}
208+
209+
/**
210+
* Configures whether null values are explicitly serialized in the JSON payload. Default is false.
211+
*/
212+
public AULocalAccountIdentification includeNullValues(boolean includeNullValues) {
213+
this.includeNullValues = includeNullValues;
214+
return this;
215+
}
216+
217+
/** Returns whether null values are explicitly serialized in the JSON payload. */
218+
public boolean isIncludeNullValues() {
219+
return includeNullValues;
220+
}
221+
222+
/**
223+
* Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
224+
*/
225+
public void setIncludeNullValues(boolean includeNullValues) {
226+
this.includeNullValues = includeNullValues;
184227
}
185228

186229
/** Return true if this AULocalAccountIdentification object is equal to o. */
@@ -194,13 +237,16 @@ public boolean equals(Object o) {
194237
}
195238
AULocalAccountIdentification auLocalAccountIdentification = (AULocalAccountIdentification) o;
196239
return Objects.equals(this.accountNumber, auLocalAccountIdentification.accountNumber)
240+
&& Objects.equals(this.isSetAccountNumber, auLocalAccountIdentification.isSetAccountNumber)
197241
&& Objects.equals(this.bsbCode, auLocalAccountIdentification.bsbCode)
198-
&& Objects.equals(this.type, auLocalAccountIdentification.type);
242+
&& Objects.equals(this.isSetBsbCode, auLocalAccountIdentification.isSetBsbCode)
243+
&& Objects.equals(this.type, auLocalAccountIdentification.type)
244+
&& Objects.equals(this.isSetType, auLocalAccountIdentification.isSetType);
199245
}
200246

201247
@Override
202248
public int hashCode() {
203-
return Objects.hash(accountNumber, bsbCode, type);
249+
return Objects.hash(accountNumber, isSetAccountNumber, bsbCode, isSetBsbCode, type, isSetType);
204250
}
205251

206252
@Override
@@ -224,6 +270,36 @@ private String toIndentedString(Object o) {
224270
return o.toString().replace("\n", "\n ");
225271
}
226272

273+
/** Returns a map of properties to be merged into the JSON payload as explicit null values. */
274+
@JsonInclude(JsonInclude.Include.ALWAYS)
275+
@JsonAnyGetter
276+
public Map<String, Object> getExplicitNulls() {
277+
if (!this.includeNullValues) {
278+
return Collections.emptyMap();
279+
}
280+
281+
Map<String, Object> nulls = new HashMap<>();
282+
283+
if (isSetAccountNumber) {
284+
addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber);
285+
}
286+
if (isSetBsbCode) {
287+
addIfNull(nulls, JSON_PROPERTY_BSB_CODE, this.bsbCode);
288+
}
289+
if (isSetType) {
290+
addIfNull(nulls, JSON_PROPERTY_TYPE, this.type);
291+
}
292+
293+
return nulls;
294+
}
295+
296+
// add to map when value is null
297+
private void addIfNull(Map<String, Object> map, String key, Object value) {
298+
if (value == null) {
299+
map.put(key, null);
300+
}
301+
}
302+
227303
/**
228304
* Create an instance of AULocalAccountIdentification given an JSON string
229305
*

src/main/java/com/adyen/model/transfers/AdditionalBankIdentification.java

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
package com.adyen.model.transfers;
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;
@@ -30,6 +32,9 @@ public class AdditionalBankIdentification {
3032
public static final String JSON_PROPERTY_CODE = "code";
3133
private String code;
3234

35+
/** Mark when the attribute has been explicitly set. */
36+
private boolean isSetCode = false;
37+
3338
/**
3439
* The type of additional bank identification, depending on the country. Possible values: *
3540
* **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB)
@@ -89,6 +94,15 @@ public static TypeEnum fromValue(String value) {
8994
public static final String JSON_PROPERTY_TYPE = "type";
9095
private TypeEnum type;
9196

97+
/** Mark when the attribute has been explicitly set. */
98+
private boolean isSetType = false;
99+
100+
/**
101+
* Sets whether attributes with null values should be explicitly included in the JSON payload.
102+
* Default is false.
103+
*/
104+
@JsonIgnore private boolean includeNullValues = false;
105+
92106
public AdditionalBankIdentification() {}
93107

94108
/**
@@ -99,6 +113,7 @@ public AdditionalBankIdentification() {}
99113
*/
100114
public AdditionalBankIdentification code(String code) {
101115
this.code = code;
116+
isSetCode = true; // mark as set
102117
return this;
103118
}
104119

@@ -122,6 +137,7 @@ public String getCode() {
122137
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
123138
public void setCode(String code) {
124139
this.code = code;
140+
isSetCode = true; // mark as set
125141
}
126142

127143
/**
@@ -150,6 +166,7 @@ public void setCode(String code) {
150166
*/
151167
public AdditionalBankIdentification type(TypeEnum type) {
152168
this.type = type;
169+
isSetType = true; // mark as set
153170
return this;
154171
}
155172

@@ -209,6 +226,27 @@ public TypeEnum getType() {
209226
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
210227
public void setType(TypeEnum type) {
211228
this.type = type;
229+
isSetType = true; // mark as set
230+
}
231+
232+
/**
233+
* Configures whether null values are explicitly serialized in the JSON payload. Default is false.
234+
*/
235+
public AdditionalBankIdentification includeNullValues(boolean includeNullValues) {
236+
this.includeNullValues = includeNullValues;
237+
return this;
238+
}
239+
240+
/** Returns whether null values are explicitly serialized in the JSON payload. */
241+
public boolean isIncludeNullValues() {
242+
return includeNullValues;
243+
}
244+
245+
/**
246+
* Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
247+
*/
248+
public void setIncludeNullValues(boolean includeNullValues) {
249+
this.includeNullValues = includeNullValues;
212250
}
213251

214252
/** Return true if this AdditionalBankIdentification object is equal to o. */
@@ -222,12 +260,14 @@ public boolean equals(Object o) {
222260
}
223261
AdditionalBankIdentification additionalBankIdentification = (AdditionalBankIdentification) o;
224262
return Objects.equals(this.code, additionalBankIdentification.code)
225-
&& Objects.equals(this.type, additionalBankIdentification.type);
263+
&& Objects.equals(this.isSetCode, additionalBankIdentification.isSetCode)
264+
&& Objects.equals(this.type, additionalBankIdentification.type)
265+
&& Objects.equals(this.isSetType, additionalBankIdentification.isSetType);
226266
}
227267

228268
@Override
229269
public int hashCode() {
230-
return Objects.hash(code, type);
270+
return Objects.hash(code, isSetCode, type, isSetType);
231271
}
232272

233273
@Override
@@ -250,6 +290,33 @@ private String toIndentedString(Object o) {
250290
return o.toString().replace("\n", "\n ");
251291
}
252292

293+
/** Returns a map of properties to be merged into the JSON payload as explicit null values. */
294+
@JsonInclude(JsonInclude.Include.ALWAYS)
295+
@JsonAnyGetter
296+
public Map<String, Object> getExplicitNulls() {
297+
if (!this.includeNullValues) {
298+
return Collections.emptyMap();
299+
}
300+
301+
Map<String, Object> nulls = new HashMap<>();
302+
303+
if (isSetCode) {
304+
addIfNull(nulls, JSON_PROPERTY_CODE, this.code);
305+
}
306+
if (isSetType) {
307+
addIfNull(nulls, JSON_PROPERTY_TYPE, this.type);
308+
}
309+
310+
return nulls;
311+
}
312+
313+
// add to map when value is null
314+
private void addIfNull(Map<String, Object> map, String key, Object value) {
315+
if (value == null) {
316+
map.put(key, null);
317+
}
318+
}
319+
253320
/**
254321
* Create an instance of AdditionalBankIdentification given an JSON string
255322
*

0 commit comments

Comments
 (0)