1111
1212package com .adyen .model .legalentitymanagement ;
1313
14+ import com .fasterxml .jackson .annotation .JsonAnyGetter ;
1415import com .fasterxml .jackson .annotation .JsonCreator ;
16+ import com .fasterxml .jackson .annotation .JsonIgnore ;
1517import com .fasterxml .jackson .annotation .JsonInclude ;
1618import com .fasterxml .jackson .annotation .JsonProperty ;
1719import 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 *
0 commit comments