Skip to content

Commit 78e41b3

Browse files
authored
Generate LEM models (#1606)
1 parent dbbaa4b commit 78e41b3

File tree

92 files changed

+7950
-9
lines changed

Some content is hidden

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

92 files changed

+7950
-9
lines changed

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

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

1212
package com.adyen.model.legalentitymanagement;
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. */
@@ -224,6 +267,36 @@ private String toIndentedString(Object o) {
224267
return o.toString().replace("\n", "\n ");
225268
}
226269

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

src/main/java/com/adyen/model/legalentitymanagement/AcceptTermsOfServiceRequest.java

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
package com.adyen.model.legalentitymanagement;
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;
@@ -26,9 +28,21 @@ public class AcceptTermsOfServiceRequest {
2628
public static final String JSON_PROPERTY_ACCEPTED_BY = "acceptedBy";
2729
private String acceptedBy;
2830

31+
/** Mark when the attribute has been explicitly set. */
32+
private boolean isSetAcceptedBy = false;
33+
2934
public static final String JSON_PROPERTY_IP_ADDRESS = "ipAddress";
3035
private String ipAddress;
3136

37+
/** Mark when the attribute has been explicitly set. */
38+
private boolean isSetIpAddress = false;
39+
40+
/**
41+
* Sets whether attributes with null values should be explicitly included in the JSON payload.
42+
* Default is false.
43+
*/
44+
@JsonIgnore private boolean includeNullValues = false;
45+
3246
public AcceptTermsOfServiceRequest() {}
3347

3448
/**
@@ -46,6 +60,7 @@ public AcceptTermsOfServiceRequest() {}
4660
*/
4761
public AcceptTermsOfServiceRequest acceptedBy(String acceptedBy) {
4862
this.acceptedBy = acceptedBy;
63+
isSetAcceptedBy = true; // mark as set
4964
return this;
5065
}
5166

@@ -83,6 +98,7 @@ public String getAcceptedBy() {
8398
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
8499
public void setAcceptedBy(String acceptedBy) {
85100
this.acceptedBy = acceptedBy;
101+
isSetAcceptedBy = true; // mark as set
86102
}
87103

88104
/**
@@ -93,6 +109,7 @@ public void setAcceptedBy(String acceptedBy) {
93109
*/
94110
public AcceptTermsOfServiceRequest ipAddress(String ipAddress) {
95111
this.ipAddress = ipAddress;
112+
isSetIpAddress = true; // mark as set
96113
return this;
97114
}
98115

@@ -116,6 +133,27 @@ public String getIpAddress() {
116133
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
117134
public void setIpAddress(String ipAddress) {
118135
this.ipAddress = ipAddress;
136+
isSetIpAddress = true; // mark as set
137+
}
138+
139+
/**
140+
* Configures whether null values are explicitly serialized in the JSON payload. Default is false.
141+
*/
142+
public AcceptTermsOfServiceRequest includeNullValues(boolean includeNullValues) {
143+
this.includeNullValues = includeNullValues;
144+
return this;
145+
}
146+
147+
/** Returns whether null values are explicitly serialized in the JSON payload. */
148+
public boolean isIncludeNullValues() {
149+
return includeNullValues;
150+
}
151+
152+
/**
153+
* Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
154+
*/
155+
public void setIncludeNullValues(boolean includeNullValues) {
156+
this.includeNullValues = includeNullValues;
119157
}
120158

121159
/** Return true if this AcceptTermsOfServiceRequest object is equal to o. */
@@ -157,6 +195,33 @@ private String toIndentedString(Object o) {
157195
return o.toString().replace("\n", "\n ");
158196
}
159197

198+
/** Returns a map of properties to be merged into the JSON payload as explicit null values. */
199+
@JsonInclude(JsonInclude.Include.ALWAYS)
200+
@JsonAnyGetter
201+
public Map<String, Object> getExplicitNulls() {
202+
if (!this.includeNullValues) {
203+
return Collections.emptyMap();
204+
}
205+
206+
Map<String, Object> nulls = new HashMap<>();
207+
208+
if (isSetAcceptedBy) {
209+
addIfNull(nulls, JSON_PROPERTY_ACCEPTED_BY, this.acceptedBy);
210+
}
211+
if (isSetIpAddress) {
212+
addIfNull(nulls, JSON_PROPERTY_IP_ADDRESS, this.ipAddress);
213+
}
214+
215+
return nulls;
216+
}
217+
218+
// add to map when value is null
219+
private void addIfNull(Map<String, Object> map, String key, Object value) {
220+
if (value == null) {
221+
map.put(key, null);
222+
}
223+
}
224+
160225
/**
161226
* Create an instance of AcceptTermsOfServiceRequest given an JSON string
162227
*

0 commit comments

Comments
 (0)