From 92ce59532e2d316d72a0f4773a3a6b3fcd37892a Mon Sep 17 00:00:00 2001 From: NathanFallet Date: Fri, 23 Oct 2026 05:16:41 +0100 Subject: [PATCH] fix: send an explicit null in a PATCH of an item The client was generated with openApiNullable=false and the mapper drops nulls, so a nullable field of ItemUpdateRequest could not be cleared (packageSizeId, measurements, places, categoryId, sizeId, state). Generate with JsonNullable. Co-Authored-By: Claude Sonnet 5.5 --- README.md | 2 + pom.xml | 5 + scripts/generate.sh | 2 +- .../sdk/generated/ApiClient.java | 2 + .../com/controlresell/sdk/generated/JSON.java | 3 + .../sdk/generated/model/Account.java | 192 +++-- .../sdk/generated/model/AccountPage.java | 42 +- .../sdk/generated/model/Conversation.java | 117 ++- .../sdk/generated/model/ConversationPage.java | 42 +- .../sdk/generated/model/Customer.java | 42 +- .../sdk/generated/model/CustomerAddress.java | 142 ++-- .../sdk/generated/model/CustomerPage.java | 42 +- .../sdk/generated/model/Item.java | 442 +++++++---- .../generated/model/ItemCreateRequest.java | 442 +++++++---- .../sdk/generated/model/ItemPage.java | 42 +- .../sdk/generated/model/ItemPhoto.java | 67 +- .../generated/model/ItemUpdateRequest.java | 737 ++++++++++++------ .../sdk/generated/model/Listing.java | 117 ++- .../sdk/generated/model/ListingPage.java | 42 +- .../controlresell/sdk/generated/model/Me.java | 42 +- .../sdk/generated/model/Message.java | 67 +- .../sdk/generated/model/MessagePage.java | 42 +- .../sdk/generated/model/Order.java | 217 ++++-- .../sdk/generated/model/OrderItem.java | 42 +- .../sdk/generated/model/OrderLabel.java | 117 ++- .../sdk/generated/model/OrderLabelPage.java | 42 +- .../sdk/generated/model/OrderPage.java | 42 +- .../sdk/generated/model/PriceDropRequest.java | 102 ++- .../sdk/generated/model/PublishRequest.java | 42 +- .../sdk/generated/model/RepublishRequest.java | 127 ++- .../sdk/generated/model/SendOfferRequest.java | 42 +- .../controlresell/sdk/ControlResellTest.java | 12 + 32 files changed, 2360 insertions(+), 1098 deletions(-) diff --git a/README.md b/README.md index 16b96ae..ee2c368 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ client.items().publish(42, new PublishRequest().accountIds(List.of(accountId))); client.conversations().sendMessage(conversationId, new SendMessageRequest().text("Hello!")); ``` +On `ItemUpdateRequest`, a nullable field left unset is not sent, and one set to `null` (`.sellingPlaceId(null)`) is sent as an explicit `null`, which clears it on the API. A list is replaced as a whole: send an empty list to empty it. + Retries (rate limits, 502/503/504, network errors), `Idempotency-Key` on every `POST`, cursor pagination with plain iterables and typed errors (`ControlResellError.NotFound`, `ControlResellError.RateLimit`...) are built in. The client is generated from the API's OpenAPI document (`scripts/generate.sh`, code in `src/main/java/com/controlresell/sdk/generated`). ```sh diff --git a/pom.xml b/pom.xml index e71dc7b..1319d79 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,11 @@ jackson-databind ${jackson.version} + + org.openapitools + jackson-databind-nullable + 0.2.6 + com.fasterxml.jackson.datatype jackson-datatype-jsr310 diff --git a/scripts/generate.sh b/scripts/generate.sh index 7647a25..7b7eee6 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -30,7 +30,7 @@ java -jar "$JAR" generate \ --library native \ -o "$WORK/out" \ --global-property=apiTests=false,modelTests=false,apiDocs=false,modelDocs=false \ - --additional-properties=invokerPackage=com.controlresell.sdk.generated,apiPackage=com.controlresell.sdk.generated.api,modelPackage=com.controlresell.sdk.generated.model,openApiNullable=false,useJakartaEe=true,hideGenerationTimestamp=true \ + --additional-properties=invokerPackage=com.controlresell.sdk.generated,apiPackage=com.controlresell.sdk.generated.api,modelPackage=com.controlresell.sdk.generated.model,openApiNullable=true,useJakartaEe=true,hideGenerationTimestamp=true \ > "$WORK/generate.log" TARGET="$ROOT/src/main/java/com/controlresell/sdk/generated" diff --git a/src/main/java/com/controlresell/sdk/generated/ApiClient.java b/src/main/java/com/controlresell/sdk/generated/ApiClient.java index 78553c0..daabe76 100644 --- a/src/main/java/com/controlresell/sdk/generated/ApiClient.java +++ b/src/main/java/com/controlresell/sdk/generated/ApiClient.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import org.openapitools.jackson.nullable.JsonNullableModule; import java.io.InputStream; import java.io.IOException; @@ -204,6 +205,7 @@ public static ObjectMapper createDefaultObjectMapper() { mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); mapper.registerModule(new JavaTimeModule()); + mapper.registerModule(new JsonNullableModule()); mapper.registerModule(new RFC3339JavaTimeModule()); return mapper; } diff --git a/src/main/java/com/controlresell/sdk/generated/JSON.java b/src/main/java/com/controlresell/sdk/generated/JSON.java index 8041bd0..76a3d19 100644 --- a/src/main/java/com/controlresell/sdk/generated/JSON.java +++ b/src/main/java/com/controlresell/sdk/generated/JSON.java @@ -16,6 +16,7 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; +import org.openapitools.jackson.nullable.JsonNullableModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.controlresell.sdk.generated.model.*; @@ -41,6 +42,8 @@ public JSON() { .defaultDateFormat(new RFC3339DateFormat()) .addModule(new JavaTimeModule()) .build(); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); } /** diff --git a/src/main/java/com/controlresell/sdk/generated/model/Account.java b/src/main/java/com/controlresell/sdk/generated/model/Account.java index e3f80da..48d9f1c 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/Account.java +++ b/src/main/java/com/controlresell/sdk/generated/model/Account.java @@ -28,6 +28,10 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -63,36 +67,29 @@ public class Account { private String name; public static final String JSON_PROPERTY_LOCALE = "locale"; - @jakarta.annotation.Nullable - private String locale; + private JsonNullable locale = JsonNullable.undefined(); public static final String JSON_PROPERTY_STATUS = "status"; @jakarta.annotation.Nonnull private String status; public static final String JSON_PROPERTY_STATUS_CHANGED_AT = "statusChangedAt"; - @jakarta.annotation.Nullable - private OffsetDateTime statusChangedAt; + private JsonNullable statusChangedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_LOCK_REASON = "lockReason"; - @jakarta.annotation.Nullable - private String lockReason; + private JsonNullable lockReason = JsonNullable.undefined(); public static final String JSON_PROPERTY_COOLDOWN_ENDS_AT = "cooldownEndsAt"; - @jakarta.annotation.Nullable - private OffsetDateTime cooldownEndsAt; + private JsonNullable cooldownEndsAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_RESTRICTED_UNTIL = "restrictedUntil"; - @jakarta.annotation.Nullable - private OffsetDateTime restrictedUntil; + private JsonNullable restrictedUntil = JsonNullable.undefined(); public static final String JSON_PROPERTY_AVAILABLE_BALANCE = "availableBalance"; - @jakarta.annotation.Nullable - private Money availableBalance; + private JsonNullable availableBalance = JsonNullable.undefined(); public static final String JSON_PROPERTY_PENDING_BALANCE = "pendingBalance"; - @jakarta.annotation.Nullable - private Money pendingBalance; + private JsonNullable pendingBalance = JsonNullable.undefined(); public Account() { } @@ -170,7 +167,7 @@ public void setName(@jakarta.annotation.Nonnull String name) { public Account locale(@jakarta.annotation.Nullable String locale) { - this.locale = locale; + this.locale = JsonNullable.of(locale); return this; } @@ -179,19 +176,27 @@ public Account locale(@jakarta.annotation.Nullable String locale) { * @return locale */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_LOCALE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getLocale() { - return locale; + return locale.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_LOCALE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLocale(@jakarta.annotation.Nullable String locale) { + + public JsonNullable getLocale_JsonNullable() { + return locale; + } + + @JsonProperty(JSON_PROPERTY_LOCALE) + public void setLocale_JsonNullable(JsonNullable locale) { this.locale = locale; } + public void setLocale(@jakarta.annotation.Nullable String locale) { + this.locale = JsonNullable.of(locale); + } + public Account status(@jakarta.annotation.Nonnull String status) { this.status = status; @@ -218,7 +223,7 @@ public void setStatus(@jakarta.annotation.Nonnull String status) { public Account statusChangedAt(@jakarta.annotation.Nullable OffsetDateTime statusChangedAt) { - this.statusChangedAt = statusChangedAt; + this.statusChangedAt = JsonNullable.of(statusChangedAt); return this; } @@ -227,22 +232,30 @@ public Account statusChangedAt(@jakarta.annotation.Nullable OffsetDateTime statu * @return statusChangedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_STATUS_CHANGED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getStatusChangedAt() { - return statusChangedAt; + return statusChangedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_STATUS_CHANGED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatusChangedAt(@jakarta.annotation.Nullable OffsetDateTime statusChangedAt) { + + public JsonNullable getStatusChangedAt_JsonNullable() { + return statusChangedAt; + } + + @JsonProperty(JSON_PROPERTY_STATUS_CHANGED_AT) + public void setStatusChangedAt_JsonNullable(JsonNullable statusChangedAt) { this.statusChangedAt = statusChangedAt; } + public void setStatusChangedAt(@jakarta.annotation.Nullable OffsetDateTime statusChangedAt) { + this.statusChangedAt = JsonNullable.of(statusChangedAt); + } + public Account lockReason(@jakarta.annotation.Nullable String lockReason) { - this.lockReason = lockReason; + this.lockReason = JsonNullable.of(lockReason); return this; } @@ -251,22 +264,30 @@ public Account lockReason(@jakarta.annotation.Nullable String lockReason) { * @return lockReason */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_LOCK_REASON, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getLockReason() { - return lockReason; + return lockReason.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_LOCK_REASON, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLockReason(@jakarta.annotation.Nullable String lockReason) { + + public JsonNullable getLockReason_JsonNullable() { + return lockReason; + } + + @JsonProperty(JSON_PROPERTY_LOCK_REASON) + public void setLockReason_JsonNullable(JsonNullable lockReason) { this.lockReason = lockReason; } + public void setLockReason(@jakarta.annotation.Nullable String lockReason) { + this.lockReason = JsonNullable.of(lockReason); + } + public Account cooldownEndsAt(@jakarta.annotation.Nullable OffsetDateTime cooldownEndsAt) { - this.cooldownEndsAt = cooldownEndsAt; + this.cooldownEndsAt = JsonNullable.of(cooldownEndsAt); return this; } @@ -275,22 +296,30 @@ public Account cooldownEndsAt(@jakarta.annotation.Nullable OffsetDateTime cooldo * @return cooldownEndsAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_COOLDOWN_ENDS_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getCooldownEndsAt() { - return cooldownEndsAt; + return cooldownEndsAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_COOLDOWN_ENDS_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCooldownEndsAt(@jakarta.annotation.Nullable OffsetDateTime cooldownEndsAt) { + + public JsonNullable getCooldownEndsAt_JsonNullable() { + return cooldownEndsAt; + } + + @JsonProperty(JSON_PROPERTY_COOLDOWN_ENDS_AT) + public void setCooldownEndsAt_JsonNullable(JsonNullable cooldownEndsAt) { this.cooldownEndsAt = cooldownEndsAt; } + public void setCooldownEndsAt(@jakarta.annotation.Nullable OffsetDateTime cooldownEndsAt) { + this.cooldownEndsAt = JsonNullable.of(cooldownEndsAt); + } + public Account restrictedUntil(@jakarta.annotation.Nullable OffsetDateTime restrictedUntil) { - this.restrictedUntil = restrictedUntil; + this.restrictedUntil = JsonNullable.of(restrictedUntil); return this; } @@ -299,22 +328,30 @@ public Account restrictedUntil(@jakarta.annotation.Nullable OffsetDateTime restr * @return restrictedUntil */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RESTRICTED_UNTIL, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getRestrictedUntil() { - return restrictedUntil; + return restrictedUntil.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RESTRICTED_UNTIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRestrictedUntil(@jakarta.annotation.Nullable OffsetDateTime restrictedUntil) { + + public JsonNullable getRestrictedUntil_JsonNullable() { + return restrictedUntil; + } + + @JsonProperty(JSON_PROPERTY_RESTRICTED_UNTIL) + public void setRestrictedUntil_JsonNullable(JsonNullable restrictedUntil) { this.restrictedUntil = restrictedUntil; } + public void setRestrictedUntil(@jakarta.annotation.Nullable OffsetDateTime restrictedUntil) { + this.restrictedUntil = JsonNullable.of(restrictedUntil); + } + public Account availableBalance(@jakarta.annotation.Nullable Money availableBalance) { - this.availableBalance = availableBalance; + this.availableBalance = JsonNullable.of(availableBalance); return this; } @@ -323,22 +360,30 @@ public Account availableBalance(@jakarta.annotation.Nullable Money availableBala * @return availableBalance */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_AVAILABLE_BALANCE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getAvailableBalance() { - return availableBalance; + return availableBalance.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_AVAILABLE_BALANCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAvailableBalance(@jakarta.annotation.Nullable Money availableBalance) { + + public JsonNullable getAvailableBalance_JsonNullable() { + return availableBalance; + } + + @JsonProperty(JSON_PROPERTY_AVAILABLE_BALANCE) + public void setAvailableBalance_JsonNullable(JsonNullable availableBalance) { this.availableBalance = availableBalance; } + public void setAvailableBalance(@jakarta.annotation.Nullable Money availableBalance) { + this.availableBalance = JsonNullable.of(availableBalance); + } + public Account pendingBalance(@jakarta.annotation.Nullable Money pendingBalance) { - this.pendingBalance = pendingBalance; + this.pendingBalance = JsonNullable.of(pendingBalance); return this; } @@ -347,19 +392,27 @@ public Account pendingBalance(@jakarta.annotation.Nullable Money pendingBalance) * @return pendingBalance */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PENDING_BALANCE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getPendingBalance() { - return pendingBalance; + return pendingBalance.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PENDING_BALANCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPendingBalance(@jakarta.annotation.Nullable Money pendingBalance) { + + public JsonNullable getPendingBalance_JsonNullable() { + return pendingBalance; + } + + @JsonProperty(JSON_PROPERTY_PENDING_BALANCE) + public void setPendingBalance_JsonNullable(JsonNullable pendingBalance) { this.pendingBalance = pendingBalance; } + public void setPendingBalance(@jakarta.annotation.Nullable Money pendingBalance) { + this.pendingBalance = JsonNullable.of(pendingBalance); + } + /** * Return true if this Account object is equal to o. @@ -376,19 +429,30 @@ public boolean equals(Object o) { return Objects.equals(this.id, account.id) && Objects.equals(this.platform, account.platform) && Objects.equals(this.name, account.name) && - Objects.equals(this.locale, account.locale) && + equalsNullable(this.locale, account.locale) && Objects.equals(this.status, account.status) && - Objects.equals(this.statusChangedAt, account.statusChangedAt) && - Objects.equals(this.lockReason, account.lockReason) && - Objects.equals(this.cooldownEndsAt, account.cooldownEndsAt) && - Objects.equals(this.restrictedUntil, account.restrictedUntil) && - Objects.equals(this.availableBalance, account.availableBalance) && - Objects.equals(this.pendingBalance, account.pendingBalance); + equalsNullable(this.statusChangedAt, account.statusChangedAt) && + equalsNullable(this.lockReason, account.lockReason) && + equalsNullable(this.cooldownEndsAt, account.cooldownEndsAt) && + equalsNullable(this.restrictedUntil, account.restrictedUntil) && + equalsNullable(this.availableBalance, account.availableBalance) && + equalsNullable(this.pendingBalance, account.pendingBalance); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(id, platform, name, locale, status, statusChangedAt, lockReason, cooldownEndsAt, restrictedUntil, availableBalance, pendingBalance); + return Objects.hash(id, platform, name, hashCodeNullable(locale), status, hashCodeNullable(statusChangedAt), hashCodeNullable(lockReason), hashCodeNullable(cooldownEndsAt), hashCodeNullable(restrictedUntil), hashCodeNullable(availableBalance), hashCodeNullable(pendingBalance)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/AccountPage.java b/src/main/java/com/controlresell/sdk/generated/model/AccountPage.java index 7e59781..48b6c39 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/AccountPage.java +++ b/src/main/java/com/controlresell/sdk/generated/model/AccountPage.java @@ -28,6 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,8 +50,7 @@ public class AccountPage { private List data = new ArrayList<>(); public static final String JSON_PROPERTY_NEXT_CURSOR = "nextCursor"; - @jakarta.annotation.Nullable - private String nextCursor; + private JsonNullable nextCursor = JsonNullable.undefined(); public AccountPage() { } @@ -85,7 +88,7 @@ public void setData(@jakarta.annotation.Nonnull List data) { public AccountPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { - this.nextCursor = nextCursor; + this.nextCursor = JsonNullable.of(nextCursor); return this; } @@ -94,19 +97,27 @@ public AccountPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { * @return nextCursor */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getNextCursor() { - return nextCursor; + return nextCursor.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + + public JsonNullable getNextCursor_JsonNullable() { + return nextCursor; + } + + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + public void setNextCursor_JsonNullable(JsonNullable nextCursor) { this.nextCursor = nextCursor; } + public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + this.nextCursor = JsonNullable.of(nextCursor); + } + /** * Return true if this AccountPage object is equal to o. @@ -121,12 +132,23 @@ public boolean equals(Object o) { } AccountPage accountPage = (AccountPage) o; return Objects.equals(this.data, accountPage.data) && - Objects.equals(this.nextCursor, accountPage.nextCursor); + equalsNullable(this.nextCursor, accountPage.nextCursor); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(data, nextCursor); + return Objects.hash(data, hashCodeNullable(nextCursor)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/Conversation.java b/src/main/java/com/controlresell/sdk/generated/model/Conversation.java index a9e9593..44ac630 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/Conversation.java +++ b/src/main/java/com/controlresell/sdk/generated/model/Conversation.java @@ -28,6 +28,10 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -57,12 +61,10 @@ public class Conversation { private UUID accountId; public static final String JSON_PROPERTY_PLATFORM = "platform"; - @jakarta.annotation.Nullable - private String platform; + private JsonNullable platform = JsonNullable.undefined(); public static final String JSON_PROPERTY_BUYER_LOGIN = "buyerLogin"; - @jakarta.annotation.Nullable - private String buyerLogin; + private JsonNullable buyerLogin = JsonNullable.undefined(); public static final String JSON_PROPERTY_UNREAD = "unread"; @jakarta.annotation.Nonnull @@ -73,12 +75,10 @@ public class Conversation { private Boolean pinned; public static final String JSON_PROPERTY_LAST_MESSAGE = "lastMessage"; - @jakarta.annotation.Nullable - private Message lastMessage; + private JsonNullable lastMessage = JsonNullable.undefined(); public static final String JSON_PROPERTY_LAST_MESSAGE_AT = "lastMessageAt"; - @jakarta.annotation.Nullable - private OffsetDateTime lastMessageAt; + private JsonNullable lastMessageAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; @jakarta.annotation.Nonnull @@ -136,7 +136,7 @@ public void setAccountId(@jakarta.annotation.Nonnull UUID accountId) { public Conversation platform(@jakarta.annotation.Nullable String platform) { - this.platform = platform; + this.platform = JsonNullable.of(platform); return this; } @@ -145,22 +145,30 @@ public Conversation platform(@jakarta.annotation.Nullable String platform) { * @return platform */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PLATFORM, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getPlatform() { - return platform; + return platform.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PLATFORM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPlatform(@jakarta.annotation.Nullable String platform) { + + public JsonNullable getPlatform_JsonNullable() { + return platform; + } + + @JsonProperty(JSON_PROPERTY_PLATFORM) + public void setPlatform_JsonNullable(JsonNullable platform) { this.platform = platform; } + public void setPlatform(@jakarta.annotation.Nullable String platform) { + this.platform = JsonNullable.of(platform); + } + public Conversation buyerLogin(@jakarta.annotation.Nullable String buyerLogin) { - this.buyerLogin = buyerLogin; + this.buyerLogin = JsonNullable.of(buyerLogin); return this; } @@ -169,19 +177,27 @@ public Conversation buyerLogin(@jakarta.annotation.Nullable String buyerLogin) { * @return buyerLogin */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BUYER_LOGIN, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getBuyerLogin() { - return buyerLogin; + return buyerLogin.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BUYER_LOGIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBuyerLogin(@jakarta.annotation.Nullable String buyerLogin) { + + public JsonNullable getBuyerLogin_JsonNullable() { + return buyerLogin; + } + + @JsonProperty(JSON_PROPERTY_BUYER_LOGIN) + public void setBuyerLogin_JsonNullable(JsonNullable buyerLogin) { this.buyerLogin = buyerLogin; } + public void setBuyerLogin(@jakarta.annotation.Nullable String buyerLogin) { + this.buyerLogin = JsonNullable.of(buyerLogin); + } + public Conversation unread(@jakarta.annotation.Nonnull Boolean unread) { this.unread = unread; @@ -232,7 +248,7 @@ public void setPinned(@jakarta.annotation.Nonnull Boolean pinned) { public Conversation lastMessage(@jakarta.annotation.Nullable Message lastMessage) { - this.lastMessage = lastMessage; + this.lastMessage = JsonNullable.of(lastMessage); return this; } @@ -241,22 +257,30 @@ public Conversation lastMessage(@jakarta.annotation.Nullable Message lastMessage * @return lastMessage */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_LAST_MESSAGE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Message getLastMessage() { - return lastMessage; + return lastMessage.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_LAST_MESSAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLastMessage(@jakarta.annotation.Nullable Message lastMessage) { + + public JsonNullable getLastMessage_JsonNullable() { + return lastMessage; + } + + @JsonProperty(JSON_PROPERTY_LAST_MESSAGE) + public void setLastMessage_JsonNullable(JsonNullable lastMessage) { this.lastMessage = lastMessage; } + public void setLastMessage(@jakarta.annotation.Nullable Message lastMessage) { + this.lastMessage = JsonNullable.of(lastMessage); + } + public Conversation lastMessageAt(@jakarta.annotation.Nullable OffsetDateTime lastMessageAt) { - this.lastMessageAt = lastMessageAt; + this.lastMessageAt = JsonNullable.of(lastMessageAt); return this; } @@ -265,19 +289,27 @@ public Conversation lastMessageAt(@jakarta.annotation.Nullable OffsetDateTime la * @return lastMessageAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_LAST_MESSAGE_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getLastMessageAt() { - return lastMessageAt; + return lastMessageAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_LAST_MESSAGE_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLastMessageAt(@jakarta.annotation.Nullable OffsetDateTime lastMessageAt) { + + public JsonNullable getLastMessageAt_JsonNullable() { + return lastMessageAt; + } + + @JsonProperty(JSON_PROPERTY_LAST_MESSAGE_AT) + public void setLastMessageAt_JsonNullable(JsonNullable lastMessageAt) { this.lastMessageAt = lastMessageAt; } + public void setLastMessageAt(@jakarta.annotation.Nullable OffsetDateTime lastMessageAt) { + this.lastMessageAt = JsonNullable.of(lastMessageAt); + } + public Conversation updatedAt(@jakarta.annotation.Nonnull OffsetDateTime updatedAt) { this.updatedAt = updatedAt; @@ -317,18 +349,29 @@ public boolean equals(Object o) { Conversation conversation = (Conversation) o; return Objects.equals(this.id, conversation.id) && Objects.equals(this.accountId, conversation.accountId) && - Objects.equals(this.platform, conversation.platform) && - Objects.equals(this.buyerLogin, conversation.buyerLogin) && + equalsNullable(this.platform, conversation.platform) && + equalsNullable(this.buyerLogin, conversation.buyerLogin) && Objects.equals(this.unread, conversation.unread) && Objects.equals(this.pinned, conversation.pinned) && - Objects.equals(this.lastMessage, conversation.lastMessage) && - Objects.equals(this.lastMessageAt, conversation.lastMessageAt) && + equalsNullable(this.lastMessage, conversation.lastMessage) && + equalsNullable(this.lastMessageAt, conversation.lastMessageAt) && Objects.equals(this.updatedAt, conversation.updatedAt); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(id, accountId, platform, buyerLogin, unread, pinned, lastMessage, lastMessageAt, updatedAt); + return Objects.hash(id, accountId, hashCodeNullable(platform), hashCodeNullable(buyerLogin), unread, pinned, hashCodeNullable(lastMessage), hashCodeNullable(lastMessageAt), updatedAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/ConversationPage.java b/src/main/java/com/controlresell/sdk/generated/model/ConversationPage.java index 660ac8c..5dae976 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/ConversationPage.java +++ b/src/main/java/com/controlresell/sdk/generated/model/ConversationPage.java @@ -28,6 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,8 +50,7 @@ public class ConversationPage { private List data = new ArrayList<>(); public static final String JSON_PROPERTY_NEXT_CURSOR = "nextCursor"; - @jakarta.annotation.Nullable - private String nextCursor; + private JsonNullable nextCursor = JsonNullable.undefined(); public ConversationPage() { } @@ -85,7 +88,7 @@ public void setData(@jakarta.annotation.Nonnull List data) { public ConversationPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { - this.nextCursor = nextCursor; + this.nextCursor = JsonNullable.of(nextCursor); return this; } @@ -94,19 +97,27 @@ public ConversationPage nextCursor(@jakarta.annotation.Nullable String nextCurso * @return nextCursor */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getNextCursor() { - return nextCursor; + return nextCursor.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + + public JsonNullable getNextCursor_JsonNullable() { + return nextCursor; + } + + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + public void setNextCursor_JsonNullable(JsonNullable nextCursor) { this.nextCursor = nextCursor; } + public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + this.nextCursor = JsonNullable.of(nextCursor); + } + /** * Return true if this ConversationPage object is equal to o. @@ -121,12 +132,23 @@ public boolean equals(Object o) { } ConversationPage conversationPage = (ConversationPage) o; return Objects.equals(this.data, conversationPage.data) && - Objects.equals(this.nextCursor, conversationPage.nextCursor); + equalsNullable(this.nextCursor, conversationPage.nextCursor); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(data, nextCursor); + return Objects.hash(data, hashCodeNullable(nextCursor)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/Customer.java b/src/main/java/com/controlresell/sdk/generated/model/Customer.java index 6af2a06..5a5de52 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/Customer.java +++ b/src/main/java/com/controlresell/sdk/generated/model/Customer.java @@ -28,6 +28,10 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -58,8 +62,7 @@ public class Customer { private String lastName; public static final String JSON_PROPERTY_EMAIL = "email"; - @jakarta.annotation.Nullable - private String email; + private JsonNullable email = JsonNullable.undefined(); public static final String JSON_PROPERTY_ADDRESS = "address"; @jakarta.annotation.Nonnull @@ -145,7 +148,7 @@ public void setLastName(@jakarta.annotation.Nonnull String lastName) { public Customer email(@jakarta.annotation.Nullable String email) { - this.email = email; + this.email = JsonNullable.of(email); return this; } @@ -154,19 +157,27 @@ public Customer email(@jakarta.annotation.Nullable String email) { * @return email */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getEmail() { - return email; + return email.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_EMAIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmail(@jakarta.annotation.Nullable String email) { + + public JsonNullable getEmail_JsonNullable() { + return email; + } + + @JsonProperty(JSON_PROPERTY_EMAIL) + public void setEmail_JsonNullable(JsonNullable email) { this.email = email; } + public void setEmail(@jakarta.annotation.Nullable String email) { + this.email = JsonNullable.of(email); + } + public Customer address(@jakarta.annotation.Nonnull CustomerAddress address) { this.address = address; @@ -231,14 +242,25 @@ public boolean equals(Object o) { return Objects.equals(this.id, customer.id) && Objects.equals(this.firstName, customer.firstName) && Objects.equals(this.lastName, customer.lastName) && - Objects.equals(this.email, customer.email) && + equalsNullable(this.email, customer.email) && Objects.equals(this.address, customer.address) && Objects.equals(this.createdAt, customer.createdAt); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(id, firstName, lastName, email, address, createdAt); + return Objects.hash(id, firstName, lastName, hashCodeNullable(email), address, createdAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/CustomerAddress.java b/src/main/java/com/controlresell/sdk/generated/model/CustomerAddress.java index 7853a75..f3e4b31 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/CustomerAddress.java +++ b/src/main/java/com/controlresell/sdk/generated/model/CustomerAddress.java @@ -25,6 +25,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -42,30 +46,25 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0") public class CustomerAddress { public static final String JSON_PROPERTY_LINE1 = "line1"; - @jakarta.annotation.Nullable - private String line1; + private JsonNullable line1 = JsonNullable.undefined(); public static final String JSON_PROPERTY_LINE2 = "line2"; - @jakarta.annotation.Nullable - private String line2; + private JsonNullable line2 = JsonNullable.undefined(); public static final String JSON_PROPERTY_CITY = "city"; - @jakarta.annotation.Nullable - private String city; + private JsonNullable city = JsonNullable.undefined(); public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; - @jakarta.annotation.Nullable - private String postalCode; + private JsonNullable postalCode = JsonNullable.undefined(); public static final String JSON_PROPERTY_COUNTRY = "country"; - @jakarta.annotation.Nullable - private String country; + private JsonNullable country = JsonNullable.undefined(); public CustomerAddress() { } public CustomerAddress line1(@jakarta.annotation.Nullable String line1) { - this.line1 = line1; + this.line1 = JsonNullable.of(line1); return this; } @@ -74,22 +73,30 @@ public CustomerAddress line1(@jakarta.annotation.Nullable String line1) { * @return line1 */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_LINE1, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getLine1() { - return line1; + return line1.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_LINE1, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLine1(@jakarta.annotation.Nullable String line1) { + + public JsonNullable getLine1_JsonNullable() { + return line1; + } + + @JsonProperty(JSON_PROPERTY_LINE1) + public void setLine1_JsonNullable(JsonNullable line1) { this.line1 = line1; } + public void setLine1(@jakarta.annotation.Nullable String line1) { + this.line1 = JsonNullable.of(line1); + } + public CustomerAddress line2(@jakarta.annotation.Nullable String line2) { - this.line2 = line2; + this.line2 = JsonNullable.of(line2); return this; } @@ -98,22 +105,30 @@ public CustomerAddress line2(@jakarta.annotation.Nullable String line2) { * @return line2 */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_LINE2, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getLine2() { - return line2; + return line2.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_LINE2, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLine2(@jakarta.annotation.Nullable String line2) { + + public JsonNullable getLine2_JsonNullable() { + return line2; + } + + @JsonProperty(JSON_PROPERTY_LINE2) + public void setLine2_JsonNullable(JsonNullable line2) { this.line2 = line2; } + public void setLine2(@jakarta.annotation.Nullable String line2) { + this.line2 = JsonNullable.of(line2); + } + public CustomerAddress city(@jakarta.annotation.Nullable String city) { - this.city = city; + this.city = JsonNullable.of(city); return this; } @@ -122,22 +137,30 @@ public CustomerAddress city(@jakarta.annotation.Nullable String city) { * @return city */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CITY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getCity() { - return city; + return city.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCity(@jakarta.annotation.Nullable String city) { + + public JsonNullable getCity_JsonNullable() { + return city; + } + + @JsonProperty(JSON_PROPERTY_CITY) + public void setCity_JsonNullable(JsonNullable city) { this.city = city; } + public void setCity(@jakarta.annotation.Nullable String city) { + this.city = JsonNullable.of(city); + } + public CustomerAddress postalCode(@jakarta.annotation.Nullable String postalCode) { - this.postalCode = postalCode; + this.postalCode = JsonNullable.of(postalCode); return this; } @@ -146,22 +169,30 @@ public CustomerAddress postalCode(@jakarta.annotation.Nullable String postalCode * @return postalCode */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_POSTAL_CODE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getPostalCode() { - return postalCode; + return postalCode.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_POSTAL_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPostalCode(@jakarta.annotation.Nullable String postalCode) { + + public JsonNullable getPostalCode_JsonNullable() { + return postalCode; + } + + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + public void setPostalCode_JsonNullable(JsonNullable postalCode) { this.postalCode = postalCode; } + public void setPostalCode(@jakarta.annotation.Nullable String postalCode) { + this.postalCode = JsonNullable.of(postalCode); + } + public CustomerAddress country(@jakarta.annotation.Nullable String country) { - this.country = country; + this.country = JsonNullable.of(country); return this; } @@ -170,19 +201,27 @@ public CustomerAddress country(@jakarta.annotation.Nullable String country) { * @return country */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_COUNTRY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getCountry() { - return country; + return country.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_COUNTRY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCountry(@jakarta.annotation.Nullable String country) { + + public JsonNullable getCountry_JsonNullable() { + return country; + } + + @JsonProperty(JSON_PROPERTY_COUNTRY) + public void setCountry_JsonNullable(JsonNullable country) { this.country = country; } + public void setCountry(@jakarta.annotation.Nullable String country) { + this.country = JsonNullable.of(country); + } + /** * Return true if this CustomerAddress object is equal to o. @@ -196,16 +235,27 @@ public boolean equals(Object o) { return false; } CustomerAddress customerAddress = (CustomerAddress) o; - return Objects.equals(this.line1, customerAddress.line1) && - Objects.equals(this.line2, customerAddress.line2) && - Objects.equals(this.city, customerAddress.city) && - Objects.equals(this.postalCode, customerAddress.postalCode) && - Objects.equals(this.country, customerAddress.country); + return equalsNullable(this.line1, customerAddress.line1) && + equalsNullable(this.line2, customerAddress.line2) && + equalsNullable(this.city, customerAddress.city) && + equalsNullable(this.postalCode, customerAddress.postalCode) && + equalsNullable(this.country, customerAddress.country); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(line1, line2, city, postalCode, country); + return Objects.hash(hashCodeNullable(line1), hashCodeNullable(line2), hashCodeNullable(city), hashCodeNullable(postalCode), hashCodeNullable(country)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/CustomerPage.java b/src/main/java/com/controlresell/sdk/generated/model/CustomerPage.java index 54c65c8..be7a285 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/CustomerPage.java +++ b/src/main/java/com/controlresell/sdk/generated/model/CustomerPage.java @@ -28,6 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,8 +50,7 @@ public class CustomerPage { private List data = new ArrayList<>(); public static final String JSON_PROPERTY_NEXT_CURSOR = "nextCursor"; - @jakarta.annotation.Nullable - private String nextCursor; + private JsonNullable nextCursor = JsonNullable.undefined(); public CustomerPage() { } @@ -85,7 +88,7 @@ public void setData(@jakarta.annotation.Nonnull List data) { public CustomerPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { - this.nextCursor = nextCursor; + this.nextCursor = JsonNullable.of(nextCursor); return this; } @@ -94,19 +97,27 @@ public CustomerPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { * @return nextCursor */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getNextCursor() { - return nextCursor; + return nextCursor.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + + public JsonNullable getNextCursor_JsonNullable() { + return nextCursor; + } + + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + public void setNextCursor_JsonNullable(JsonNullable nextCursor) { this.nextCursor = nextCursor; } + public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + this.nextCursor = JsonNullable.of(nextCursor); + } + /** * Return true if this CustomerPage object is equal to o. @@ -121,12 +132,23 @@ public boolean equals(Object o) { } CustomerPage customerPage = (CustomerPage) o; return Objects.equals(this.data, customerPage.data) && - Objects.equals(this.nextCursor, customerPage.nextCursor); + equalsNullable(this.nextCursor, customerPage.nextCursor); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(data, nextCursor); + return Objects.hash(data, hashCodeNullable(nextCursor)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/Item.java b/src/main/java/com/controlresell/sdk/generated/model/Item.java index 8f47be6..dec007d 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/Item.java +++ b/src/main/java/com/controlresell/sdk/generated/model/Item.java @@ -34,6 +34,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -83,40 +87,33 @@ public class Item { private String name; public static final String JSON_PROPERTY_SKU = "sku"; - @jakarta.annotation.Nullable - private String sku; + private JsonNullable sku = JsonNullable.undefined(); public static final String JSON_PROPERTY_DESCRIPTION = "description"; - @jakarta.annotation.Nullable - private String description; + private JsonNullable description = JsonNullable.undefined(); public static final String JSON_PROPERTY_PHOTOS = "photos"; @jakarta.annotation.Nonnull private List photos = new ArrayList<>(); public static final String JSON_PROPERTY_CATEGORY_ID = "categoryId"; - @jakarta.annotation.Nullable - private Long categoryId; + private JsonNullable categoryId = JsonNullable.undefined(); public static final String JSON_PROPERTY_BRAND_ID = "brandId"; - @jakarta.annotation.Nullable - private Long brandId; + private JsonNullable brandId = JsonNullable.undefined(); public static final String JSON_PROPERTY_SIZE_ID = "sizeId"; - @jakarta.annotation.Nullable - private Long sizeId; + private JsonNullable sizeId = JsonNullable.undefined(); public static final String JSON_PROPERTY_COLOR_IDS = "colorIds"; @jakarta.annotation.Nonnull private List colorIds = new ArrayList<>(); public static final String JSON_PROPERTY_STATE = "state"; - @jakarta.annotation.Nullable - private Long state; + private JsonNullable state = JsonNullable.undefined(); public static final String JSON_PROPERTY_SEX = "sex"; - @jakarta.annotation.Nullable - private String sex; + private JsonNullable sex = JsonNullable.undefined(); public static final String JSON_PROPERTY_LABELS = "labels"; @jakarta.annotation.Nonnull @@ -127,20 +124,17 @@ public class Item { private Boolean sold; public static final String JSON_PROPERTY_PACKAGE_SIZE_ID = "packageSizeId"; - @jakarta.annotation.Nullable - private Long packageSizeId; + private JsonNullable packageSizeId = JsonNullable.undefined(); public static final String JSON_PROPERTY_MATERIAL_IDS = "materialIds"; @jakarta.annotation.Nonnull private List materialIds = new ArrayList<>(); public static final String JSON_PROPERTY_MEASUREMENT_LENGTH = "measurementLength"; - @jakarta.annotation.Nullable - private BigDecimal measurementLength; + private JsonNullable measurementLength = JsonNullable.undefined(); public static final String JSON_PROPERTY_MEASUREMENT_WIDTH = "measurementWidth"; - @jakarta.annotation.Nullable - private BigDecimal measurementWidth; + private JsonNullable measurementWidth = JsonNullable.undefined(); public static final String JSON_PROPERTY_ENUM_VALUES = "enumValues"; @jakarta.annotation.Nonnull @@ -155,32 +149,25 @@ public class Item { private List customFields = new ArrayList<>(); public static final String JSON_PROPERTY_ESTIMATED_PRICE = "estimatedPrice"; - @jakarta.annotation.Nullable - private Money estimatedPrice; + private JsonNullable estimatedPrice = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_PRICE = "purchasePrice"; - @jakarta.annotation.Nullable - private Money purchasePrice; + private JsonNullable purchasePrice = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_DATE = "purchaseDate"; - @jakarta.annotation.Nullable - private OffsetDateTime purchaseDate; + private JsonNullable purchaseDate = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_PLACE_ID = "purchasePlaceId"; - @jakarta.annotation.Nullable - private Long purchasePlaceId; + private JsonNullable purchasePlaceId = JsonNullable.undefined(); public static final String JSON_PROPERTY_SELLING_PRICE = "sellingPrice"; - @jakarta.annotation.Nullable - private Money sellingPrice; + private JsonNullable sellingPrice = JsonNullable.undefined(); public static final String JSON_PROPERTY_SELLING_DATE = "sellingDate"; - @jakarta.annotation.Nullable - private OffsetDateTime sellingDate; + private JsonNullable sellingDate = JsonNullable.undefined(); public static final String JSON_PROPERTY_SELLING_PLACE_ID = "sellingPlaceId"; - @jakarta.annotation.Nullable - private Long sellingPlaceId; + private JsonNullable sellingPlaceId = JsonNullable.undefined(); public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; @jakarta.annotation.Nonnull @@ -242,7 +229,7 @@ public void setName(@jakarta.annotation.Nonnull String name) { public Item sku(@jakarta.annotation.Nullable String sku) { - this.sku = sku; + this.sku = JsonNullable.of(sku); return this; } @@ -251,22 +238,30 @@ public Item sku(@jakarta.annotation.Nullable String sku) { * @return sku */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SKU, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getSku() { - return sku; + return sku.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SKU, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSku(@jakarta.annotation.Nullable String sku) { + + public JsonNullable getSku_JsonNullable() { + return sku; + } + + @JsonProperty(JSON_PROPERTY_SKU) + public void setSku_JsonNullable(JsonNullable sku) { this.sku = sku; } + public void setSku(@jakarta.annotation.Nullable String sku) { + this.sku = JsonNullable.of(sku); + } + public Item description(@jakarta.annotation.Nullable String description) { - this.description = description; + this.description = JsonNullable.of(description); return this; } @@ -275,19 +270,27 @@ public Item description(@jakarta.annotation.Nullable String description) { * @return description */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDescription() { - return description; + return description.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDescription(@jakarta.annotation.Nullable String description) { + + public JsonNullable getDescription_JsonNullable() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + public void setDescription_JsonNullable(JsonNullable description) { this.description = description; } + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = JsonNullable.of(description); + } + public Item photos(@jakarta.annotation.Nonnull List photos) { this.photos = photos; @@ -322,7 +325,7 @@ public void setPhotos(@jakarta.annotation.Nonnull List photos) { public Item categoryId(@jakarta.annotation.Nullable Long categoryId) { - this.categoryId = categoryId; + this.categoryId = JsonNullable.of(categoryId); return this; } @@ -331,22 +334,30 @@ public Item categoryId(@jakarta.annotation.Nullable Long categoryId) { * @return categoryId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CATEGORY_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getCategoryId() { - return categoryId; + return categoryId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CATEGORY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCategoryId(@jakarta.annotation.Nullable Long categoryId) { + + public JsonNullable getCategoryId_JsonNullable() { + return categoryId; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY_ID) + public void setCategoryId_JsonNullable(JsonNullable categoryId) { this.categoryId = categoryId; } + public void setCategoryId(@jakarta.annotation.Nullable Long categoryId) { + this.categoryId = JsonNullable.of(categoryId); + } + public Item brandId(@jakarta.annotation.Nullable Long brandId) { - this.brandId = brandId; + this.brandId = JsonNullable.of(brandId); return this; } @@ -355,22 +366,30 @@ public Item brandId(@jakarta.annotation.Nullable Long brandId) { * @return brandId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BRAND_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getBrandId() { - return brandId; + return brandId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BRAND_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBrandId(@jakarta.annotation.Nullable Long brandId) { + + public JsonNullable getBrandId_JsonNullable() { + return brandId; + } + + @JsonProperty(JSON_PROPERTY_BRAND_ID) + public void setBrandId_JsonNullable(JsonNullable brandId) { this.brandId = brandId; } + public void setBrandId(@jakarta.annotation.Nullable Long brandId) { + this.brandId = JsonNullable.of(brandId); + } + public Item sizeId(@jakarta.annotation.Nullable Long sizeId) { - this.sizeId = sizeId; + this.sizeId = JsonNullable.of(sizeId); return this; } @@ -379,19 +398,27 @@ public Item sizeId(@jakarta.annotation.Nullable Long sizeId) { * @return sizeId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SIZE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getSizeId() { - return sizeId; + return sizeId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SIZE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSizeId(@jakarta.annotation.Nullable Long sizeId) { + + public JsonNullable getSizeId_JsonNullable() { + return sizeId; + } + + @JsonProperty(JSON_PROPERTY_SIZE_ID) + public void setSizeId_JsonNullable(JsonNullable sizeId) { this.sizeId = sizeId; } + public void setSizeId(@jakarta.annotation.Nullable Long sizeId) { + this.sizeId = JsonNullable.of(sizeId); + } + public Item colorIds(@jakarta.annotation.Nonnull List colorIds) { this.colorIds = colorIds; @@ -426,7 +453,7 @@ public void setColorIds(@jakarta.annotation.Nonnull List colorIds) { public Item state(@jakarta.annotation.Nullable Long state) { - this.state = state; + this.state = JsonNullable.of(state); return this; } @@ -435,22 +462,30 @@ public Item state(@jakarta.annotation.Nullable Long state) { * @return state */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_STATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getState() { - return state; + return state.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_STATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setState(@jakarta.annotation.Nullable Long state) { + + public JsonNullable getState_JsonNullable() { + return state; + } + + @JsonProperty(JSON_PROPERTY_STATE) + public void setState_JsonNullable(JsonNullable state) { this.state = state; } + public void setState(@jakarta.annotation.Nullable Long state) { + this.state = JsonNullable.of(state); + } + public Item sex(@jakarta.annotation.Nullable String sex) { - this.sex = sex; + this.sex = JsonNullable.of(sex); return this; } @@ -459,19 +494,27 @@ public Item sex(@jakarta.annotation.Nullable String sex) { * @return sex */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SEX, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getSex() { - return sex; + return sex.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SEX, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSex(@jakarta.annotation.Nullable String sex) { + + public JsonNullable getSex_JsonNullable() { + return sex; + } + + @JsonProperty(JSON_PROPERTY_SEX) + public void setSex_JsonNullable(JsonNullable sex) { this.sex = sex; } + public void setSex(@jakarta.annotation.Nullable String sex) { + this.sex = JsonNullable.of(sex); + } + public Item labels(@jakarta.annotation.Nonnull List labels) { this.labels = labels; @@ -530,7 +573,7 @@ public void setSold(@jakarta.annotation.Nonnull Boolean sold) { public Item packageSizeId(@jakarta.annotation.Nullable Long packageSizeId) { - this.packageSizeId = packageSizeId; + this.packageSizeId = JsonNullable.of(packageSizeId); return this; } @@ -539,19 +582,27 @@ public Item packageSizeId(@jakarta.annotation.Nullable Long packageSizeId) { * @return packageSizeId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PACKAGE_SIZE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getPackageSizeId() { - return packageSizeId; + return packageSizeId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PACKAGE_SIZE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPackageSizeId(@jakarta.annotation.Nullable Long packageSizeId) { + + public JsonNullable getPackageSizeId_JsonNullable() { + return packageSizeId; + } + + @JsonProperty(JSON_PROPERTY_PACKAGE_SIZE_ID) + public void setPackageSizeId_JsonNullable(JsonNullable packageSizeId) { this.packageSizeId = packageSizeId; } + public void setPackageSizeId(@jakarta.annotation.Nullable Long packageSizeId) { + this.packageSizeId = JsonNullable.of(packageSizeId); + } + public Item materialIds(@jakarta.annotation.Nonnull List materialIds) { this.materialIds = materialIds; @@ -586,7 +637,7 @@ public void setMaterialIds(@jakarta.annotation.Nonnull List materialIds) { public Item measurementLength(@jakarta.annotation.Nullable BigDecimal measurementLength) { - this.measurementLength = measurementLength; + this.measurementLength = JsonNullable.of(measurementLength); return this; } @@ -595,22 +646,30 @@ public Item measurementLength(@jakarta.annotation.Nullable BigDecimal measuremen * @return measurementLength */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_LENGTH, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public BigDecimal getMeasurementLength() { - return measurementLength; + return measurementLength.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_LENGTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMeasurementLength(@jakarta.annotation.Nullable BigDecimal measurementLength) { + + public JsonNullable getMeasurementLength_JsonNullable() { + return measurementLength; + } + + @JsonProperty(JSON_PROPERTY_MEASUREMENT_LENGTH) + public void setMeasurementLength_JsonNullable(JsonNullable measurementLength) { this.measurementLength = measurementLength; } + public void setMeasurementLength(@jakarta.annotation.Nullable BigDecimal measurementLength) { + this.measurementLength = JsonNullable.of(measurementLength); + } + public Item measurementWidth(@jakarta.annotation.Nullable BigDecimal measurementWidth) { - this.measurementWidth = measurementWidth; + this.measurementWidth = JsonNullable.of(measurementWidth); return this; } @@ -619,19 +678,27 @@ public Item measurementWidth(@jakarta.annotation.Nullable BigDecimal measurement * @return measurementWidth */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_WIDTH, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public BigDecimal getMeasurementWidth() { - return measurementWidth; + return measurementWidth.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_WIDTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMeasurementWidth(@jakarta.annotation.Nullable BigDecimal measurementWidth) { + + public JsonNullable getMeasurementWidth_JsonNullable() { + return measurementWidth; + } + + @JsonProperty(JSON_PROPERTY_MEASUREMENT_WIDTH) + public void setMeasurementWidth_JsonNullable(JsonNullable measurementWidth) { this.measurementWidth = measurementWidth; } + public void setMeasurementWidth(@jakarta.annotation.Nullable BigDecimal measurementWidth) { + this.measurementWidth = JsonNullable.of(measurementWidth); + } + public Item enumValues(@jakarta.annotation.Nonnull List enumValues) { this.enumValues = enumValues; @@ -730,7 +797,7 @@ public void setCustomFields(@jakarta.annotation.Nonnull List cu public Item estimatedPrice(@jakarta.annotation.Nullable Money estimatedPrice) { - this.estimatedPrice = estimatedPrice; + this.estimatedPrice = JsonNullable.of(estimatedPrice); return this; } @@ -739,22 +806,30 @@ public Item estimatedPrice(@jakarta.annotation.Nullable Money estimatedPrice) { * @return estimatedPrice */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ESTIMATED_PRICE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getEstimatedPrice() { - return estimatedPrice; + return estimatedPrice.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ESTIMATED_PRICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEstimatedPrice(@jakarta.annotation.Nullable Money estimatedPrice) { + + public JsonNullable getEstimatedPrice_JsonNullable() { + return estimatedPrice; + } + + @JsonProperty(JSON_PROPERTY_ESTIMATED_PRICE) + public void setEstimatedPrice_JsonNullable(JsonNullable estimatedPrice) { this.estimatedPrice = estimatedPrice; } + public void setEstimatedPrice(@jakarta.annotation.Nullable Money estimatedPrice) { + this.estimatedPrice = JsonNullable.of(estimatedPrice); + } + public Item purchasePrice(@jakarta.annotation.Nullable Money purchasePrice) { - this.purchasePrice = purchasePrice; + this.purchasePrice = JsonNullable.of(purchasePrice); return this; } @@ -763,22 +838,30 @@ public Item purchasePrice(@jakarta.annotation.Nullable Money purchasePrice) { * @return purchasePrice */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PRICE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getPurchasePrice() { - return purchasePrice; + return purchasePrice.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PRICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPurchasePrice(@jakarta.annotation.Nullable Money purchasePrice) { + + public JsonNullable getPurchasePrice_JsonNullable() { + return purchasePrice; + } + + @JsonProperty(JSON_PROPERTY_PURCHASE_PRICE) + public void setPurchasePrice_JsonNullable(JsonNullable purchasePrice) { this.purchasePrice = purchasePrice; } + public void setPurchasePrice(@jakarta.annotation.Nullable Money purchasePrice) { + this.purchasePrice = JsonNullable.of(purchasePrice); + } + public Item purchaseDate(@jakarta.annotation.Nullable OffsetDateTime purchaseDate) { - this.purchaseDate = purchaseDate; + this.purchaseDate = JsonNullable.of(purchaseDate); return this; } @@ -787,22 +870,30 @@ public Item purchaseDate(@jakarta.annotation.Nullable OffsetDateTime purchaseDat * @return purchaseDate */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PURCHASE_DATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getPurchaseDate() { - return purchaseDate; + return purchaseDate.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PURCHASE_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPurchaseDate(@jakarta.annotation.Nullable OffsetDateTime purchaseDate) { + + public JsonNullable getPurchaseDate_JsonNullable() { + return purchaseDate; + } + + @JsonProperty(JSON_PROPERTY_PURCHASE_DATE) + public void setPurchaseDate_JsonNullable(JsonNullable purchaseDate) { this.purchaseDate = purchaseDate; } + public void setPurchaseDate(@jakarta.annotation.Nullable OffsetDateTime purchaseDate) { + this.purchaseDate = JsonNullable.of(purchaseDate); + } + public Item purchasePlaceId(@jakarta.annotation.Nullable Long purchasePlaceId) { - this.purchasePlaceId = purchasePlaceId; + this.purchasePlaceId = JsonNullable.of(purchasePlaceId); return this; } @@ -811,22 +902,30 @@ public Item purchasePlaceId(@jakarta.annotation.Nullable Long purchasePlaceId) { * @return purchasePlaceId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PLACE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getPurchasePlaceId() { - return purchasePlaceId; + return purchasePlaceId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PLACE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPurchasePlaceId(@jakarta.annotation.Nullable Long purchasePlaceId) { + + public JsonNullable getPurchasePlaceId_JsonNullable() { + return purchasePlaceId; + } + + @JsonProperty(JSON_PROPERTY_PURCHASE_PLACE_ID) + public void setPurchasePlaceId_JsonNullable(JsonNullable purchasePlaceId) { this.purchasePlaceId = purchasePlaceId; } + public void setPurchasePlaceId(@jakarta.annotation.Nullable Long purchasePlaceId) { + this.purchasePlaceId = JsonNullable.of(purchasePlaceId); + } + public Item sellingPrice(@jakarta.annotation.Nullable Money sellingPrice) { - this.sellingPrice = sellingPrice; + this.sellingPrice = JsonNullable.of(sellingPrice); return this; } @@ -835,22 +934,30 @@ public Item sellingPrice(@jakarta.annotation.Nullable Money sellingPrice) { * @return sellingPrice */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SELLING_PRICE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getSellingPrice() { - return sellingPrice; + return sellingPrice.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SELLING_PRICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSellingPrice(@jakarta.annotation.Nullable Money sellingPrice) { + + public JsonNullable getSellingPrice_JsonNullable() { + return sellingPrice; + } + + @JsonProperty(JSON_PROPERTY_SELLING_PRICE) + public void setSellingPrice_JsonNullable(JsonNullable sellingPrice) { this.sellingPrice = sellingPrice; } + public void setSellingPrice(@jakarta.annotation.Nullable Money sellingPrice) { + this.sellingPrice = JsonNullable.of(sellingPrice); + } + public Item sellingDate(@jakarta.annotation.Nullable OffsetDateTime sellingDate) { - this.sellingDate = sellingDate; + this.sellingDate = JsonNullable.of(sellingDate); return this; } @@ -859,22 +966,30 @@ public Item sellingDate(@jakarta.annotation.Nullable OffsetDateTime sellingDate) * @return sellingDate */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SELLING_DATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getSellingDate() { - return sellingDate; + return sellingDate.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SELLING_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSellingDate(@jakarta.annotation.Nullable OffsetDateTime sellingDate) { + + public JsonNullable getSellingDate_JsonNullable() { + return sellingDate; + } + + @JsonProperty(JSON_PROPERTY_SELLING_DATE) + public void setSellingDate_JsonNullable(JsonNullable sellingDate) { this.sellingDate = sellingDate; } + public void setSellingDate(@jakarta.annotation.Nullable OffsetDateTime sellingDate) { + this.sellingDate = JsonNullable.of(sellingDate); + } + public Item sellingPlaceId(@jakarta.annotation.Nullable Long sellingPlaceId) { - this.sellingPlaceId = sellingPlaceId; + this.sellingPlaceId = JsonNullable.of(sellingPlaceId); return this; } @@ -883,19 +998,27 @@ public Item sellingPlaceId(@jakarta.annotation.Nullable Long sellingPlaceId) { * @return sellingPlaceId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SELLING_PLACE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getSellingPlaceId() { - return sellingPlaceId; + return sellingPlaceId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SELLING_PLACE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSellingPlaceId(@jakarta.annotation.Nullable Long sellingPlaceId) { + + public JsonNullable getSellingPlaceId_JsonNullable() { + return sellingPlaceId; + } + + @JsonProperty(JSON_PROPERTY_SELLING_PLACE_ID) + public void setSellingPlaceId_JsonNullable(JsonNullable sellingPlaceId) { this.sellingPlaceId = sellingPlaceId; } + public void setSellingPlaceId(@jakarta.annotation.Nullable Long sellingPlaceId) { + this.sellingPlaceId = JsonNullable.of(sellingPlaceId); + } + public Item createdAt(@jakarta.annotation.Nonnull OffsetDateTime createdAt) { this.createdAt = createdAt; @@ -959,38 +1082,49 @@ public boolean equals(Object o) { Item item = (Item) o; return Objects.equals(this.id, item.id) && Objects.equals(this.name, item.name) && - Objects.equals(this.sku, item.sku) && - Objects.equals(this.description, item.description) && + equalsNullable(this.sku, item.sku) && + equalsNullable(this.description, item.description) && Objects.equals(this.photos, item.photos) && - Objects.equals(this.categoryId, item.categoryId) && - Objects.equals(this.brandId, item.brandId) && - Objects.equals(this.sizeId, item.sizeId) && + equalsNullable(this.categoryId, item.categoryId) && + equalsNullable(this.brandId, item.brandId) && + equalsNullable(this.sizeId, item.sizeId) && Objects.equals(this.colorIds, item.colorIds) && - Objects.equals(this.state, item.state) && - Objects.equals(this.sex, item.sex) && + equalsNullable(this.state, item.state) && + equalsNullable(this.sex, item.sex) && Objects.equals(this.labels, item.labels) && Objects.equals(this.sold, item.sold) && - Objects.equals(this.packageSizeId, item.packageSizeId) && + equalsNullable(this.packageSizeId, item.packageSizeId) && Objects.equals(this.materialIds, item.materialIds) && - Objects.equals(this.measurementLength, item.measurementLength) && - Objects.equals(this.measurementWidth, item.measurementWidth) && + equalsNullable(this.measurementLength, item.measurementLength) && + equalsNullable(this.measurementWidth, item.measurementWidth) && Objects.equals(this.enumValues, item.enumValues) && Objects.equals(this.attributes, item.attributes) && Objects.equals(this.customFields, item.customFields) && - Objects.equals(this.estimatedPrice, item.estimatedPrice) && - Objects.equals(this.purchasePrice, item.purchasePrice) && - Objects.equals(this.purchaseDate, item.purchaseDate) && - Objects.equals(this.purchasePlaceId, item.purchasePlaceId) && - Objects.equals(this.sellingPrice, item.sellingPrice) && - Objects.equals(this.sellingDate, item.sellingDate) && - Objects.equals(this.sellingPlaceId, item.sellingPlaceId) && + equalsNullable(this.estimatedPrice, item.estimatedPrice) && + equalsNullable(this.purchasePrice, item.purchasePrice) && + equalsNullable(this.purchaseDate, item.purchaseDate) && + equalsNullable(this.purchasePlaceId, item.purchasePlaceId) && + equalsNullable(this.sellingPrice, item.sellingPrice) && + equalsNullable(this.sellingDate, item.sellingDate) && + equalsNullable(this.sellingPlaceId, item.sellingPlaceId) && Objects.equals(this.createdAt, item.createdAt) && Objects.equals(this.updatedAt, item.updatedAt); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(id, name, sku, description, photos, categoryId, brandId, sizeId, colorIds, state, sex, labels, sold, packageSizeId, materialIds, measurementLength, measurementWidth, enumValues, attributes, customFields, estimatedPrice, purchasePrice, purchaseDate, purchasePlaceId, sellingPrice, sellingDate, sellingPlaceId, createdAt, updatedAt); + return Objects.hash(id, name, hashCodeNullable(sku), hashCodeNullable(description), photos, hashCodeNullable(categoryId), hashCodeNullable(brandId), hashCodeNullable(sizeId), colorIds, hashCodeNullable(state), hashCodeNullable(sex), labels, sold, hashCodeNullable(packageSizeId), materialIds, hashCodeNullable(measurementLength), hashCodeNullable(measurementWidth), enumValues, attributes, customFields, hashCodeNullable(estimatedPrice), hashCodeNullable(purchasePrice), hashCodeNullable(purchaseDate), hashCodeNullable(purchasePlaceId), hashCodeNullable(sellingPrice), hashCodeNullable(sellingDate), hashCodeNullable(sellingPlaceId), createdAt, updatedAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/ItemCreateRequest.java b/src/main/java/com/controlresell/sdk/generated/model/ItemCreateRequest.java index 3087cee..da75297 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/ItemCreateRequest.java +++ b/src/main/java/com/controlresell/sdk/generated/model/ItemCreateRequest.java @@ -34,6 +34,10 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -76,40 +80,33 @@ public class ItemCreateRequest { private String name; public static final String JSON_PROPERTY_SKU = "sku"; - @jakarta.annotation.Nullable - private String sku; + private JsonNullable sku = JsonNullable.undefined(); public static final String JSON_PROPERTY_DESCRIPTION = "description"; - @jakarta.annotation.Nullable - private String description; + private JsonNullable description = JsonNullable.undefined(); public static final String JSON_PROPERTY_PHOTO_IDS = "photoIds"; @jakarta.annotation.Nullable private List photoIds = new ArrayList<>(); public static final String JSON_PROPERTY_CATEGORY_ID = "categoryId"; - @jakarta.annotation.Nullable - private Long categoryId; + private JsonNullable categoryId = JsonNullable.undefined(); public static final String JSON_PROPERTY_BRAND_ID = "brandId"; - @jakarta.annotation.Nullable - private Long brandId; + private JsonNullable brandId = JsonNullable.undefined(); public static final String JSON_PROPERTY_SIZE_ID = "sizeId"; - @jakarta.annotation.Nullable - private Long sizeId; + private JsonNullable sizeId = JsonNullable.undefined(); public static final String JSON_PROPERTY_COLOR_IDS = "colorIds"; @jakarta.annotation.Nullable private List colorIds = new ArrayList<>(); public static final String JSON_PROPERTY_STATE = "state"; - @jakarta.annotation.Nullable - private Long state; + private JsonNullable state = JsonNullable.undefined(); public static final String JSON_PROPERTY_SEX = "sex"; - @jakarta.annotation.Nullable - private String sex; + private JsonNullable sex = JsonNullable.undefined(); public static final String JSON_PROPERTY_LABELS = "labels"; @jakarta.annotation.Nullable @@ -120,20 +117,17 @@ public class ItemCreateRequest { private Boolean sold; public static final String JSON_PROPERTY_PACKAGE_SIZE_ID = "packageSizeId"; - @jakarta.annotation.Nullable - private Long packageSizeId; + private JsonNullable packageSizeId = JsonNullable.undefined(); public static final String JSON_PROPERTY_MATERIAL_IDS = "materialIds"; @jakarta.annotation.Nullable private List materialIds = new ArrayList<>(); public static final String JSON_PROPERTY_MEASUREMENT_LENGTH = "measurementLength"; - @jakarta.annotation.Nullable - private BigDecimal measurementLength; + private JsonNullable measurementLength = JsonNullable.undefined(); public static final String JSON_PROPERTY_MEASUREMENT_WIDTH = "measurementWidth"; - @jakarta.annotation.Nullable - private BigDecimal measurementWidth; + private JsonNullable measurementWidth = JsonNullable.undefined(); public static final String JSON_PROPERTY_ENUM_VALUES = "enumValues"; @jakarta.annotation.Nullable @@ -148,32 +142,25 @@ public class ItemCreateRequest { private List customFields = new ArrayList<>(); public static final String JSON_PROPERTY_ESTIMATED_PRICE = "estimatedPrice"; - @jakarta.annotation.Nullable - private Money estimatedPrice; + private JsonNullable estimatedPrice = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_PRICE = "purchasePrice"; - @jakarta.annotation.Nullable - private Money purchasePrice; + private JsonNullable purchasePrice = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_DATE = "purchaseDate"; - @jakarta.annotation.Nullable - private OffsetDateTime purchaseDate; + private JsonNullable purchaseDate = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_PLACE_ID = "purchasePlaceId"; - @jakarta.annotation.Nullable - private Long purchasePlaceId; + private JsonNullable purchasePlaceId = JsonNullable.undefined(); public static final String JSON_PROPERTY_SELLING_PRICE = "sellingPrice"; - @jakarta.annotation.Nullable - private Money sellingPrice; + private JsonNullable sellingPrice = JsonNullable.undefined(); public static final String JSON_PROPERTY_SELLING_DATE = "sellingDate"; - @jakarta.annotation.Nullable - private OffsetDateTime sellingDate; + private JsonNullable sellingDate = JsonNullable.undefined(); public static final String JSON_PROPERTY_SELLING_PLACE_ID = "sellingPlaceId"; - @jakarta.annotation.Nullable - private Long sellingPlaceId; + private JsonNullable sellingPlaceId = JsonNullable.undefined(); public ItemCreateRequest() { } @@ -203,7 +190,7 @@ public void setName(@jakarta.annotation.Nonnull String name) { public ItemCreateRequest sku(@jakarta.annotation.Nullable String sku) { - this.sku = sku; + this.sku = JsonNullable.of(sku); return this; } @@ -212,22 +199,30 @@ public ItemCreateRequest sku(@jakarta.annotation.Nullable String sku) { * @return sku */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SKU, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getSku() { - return sku; + return sku.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SKU, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSku(@jakarta.annotation.Nullable String sku) { + + public JsonNullable getSku_JsonNullable() { + return sku; + } + + @JsonProperty(JSON_PROPERTY_SKU) + public void setSku_JsonNullable(JsonNullable sku) { this.sku = sku; } + public void setSku(@jakarta.annotation.Nullable String sku) { + this.sku = JsonNullable.of(sku); + } + public ItemCreateRequest description(@jakarta.annotation.Nullable String description) { - this.description = description; + this.description = JsonNullable.of(description); return this; } @@ -236,19 +231,27 @@ public ItemCreateRequest description(@jakarta.annotation.Nullable String descrip * @return description */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDescription() { - return description; + return description.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDescription(@jakarta.annotation.Nullable String description) { + + public JsonNullable getDescription_JsonNullable() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + public void setDescription_JsonNullable(JsonNullable description) { this.description = description; } + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = JsonNullable.of(description); + } + public ItemCreateRequest photoIds(@jakarta.annotation.Nullable List photoIds) { this.photoIds = photoIds; @@ -283,7 +286,7 @@ public void setPhotoIds(@jakarta.annotation.Nullable List photoIds) { public ItemCreateRequest categoryId(@jakarta.annotation.Nullable Long categoryId) { - this.categoryId = categoryId; + this.categoryId = JsonNullable.of(categoryId); return this; } @@ -292,22 +295,30 @@ public ItemCreateRequest categoryId(@jakarta.annotation.Nullable Long categoryId * @return categoryId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CATEGORY_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getCategoryId() { - return categoryId; + return categoryId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CATEGORY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCategoryId(@jakarta.annotation.Nullable Long categoryId) { + + public JsonNullable getCategoryId_JsonNullable() { + return categoryId; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY_ID) + public void setCategoryId_JsonNullable(JsonNullable categoryId) { this.categoryId = categoryId; } + public void setCategoryId(@jakarta.annotation.Nullable Long categoryId) { + this.categoryId = JsonNullable.of(categoryId); + } + public ItemCreateRequest brandId(@jakarta.annotation.Nullable Long brandId) { - this.brandId = brandId; + this.brandId = JsonNullable.of(brandId); return this; } @@ -316,22 +327,30 @@ public ItemCreateRequest brandId(@jakarta.annotation.Nullable Long brandId) { * @return brandId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BRAND_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getBrandId() { - return brandId; + return brandId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BRAND_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBrandId(@jakarta.annotation.Nullable Long brandId) { + + public JsonNullable getBrandId_JsonNullable() { + return brandId; + } + + @JsonProperty(JSON_PROPERTY_BRAND_ID) + public void setBrandId_JsonNullable(JsonNullable brandId) { this.brandId = brandId; } + public void setBrandId(@jakarta.annotation.Nullable Long brandId) { + this.brandId = JsonNullable.of(brandId); + } + public ItemCreateRequest sizeId(@jakarta.annotation.Nullable Long sizeId) { - this.sizeId = sizeId; + this.sizeId = JsonNullable.of(sizeId); return this; } @@ -340,19 +359,27 @@ public ItemCreateRequest sizeId(@jakarta.annotation.Nullable Long sizeId) { * @return sizeId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SIZE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getSizeId() { - return sizeId; + return sizeId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SIZE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSizeId(@jakarta.annotation.Nullable Long sizeId) { + + public JsonNullable getSizeId_JsonNullable() { + return sizeId; + } + + @JsonProperty(JSON_PROPERTY_SIZE_ID) + public void setSizeId_JsonNullable(JsonNullable sizeId) { this.sizeId = sizeId; } + public void setSizeId(@jakarta.annotation.Nullable Long sizeId) { + this.sizeId = JsonNullable.of(sizeId); + } + public ItemCreateRequest colorIds(@jakarta.annotation.Nullable List colorIds) { this.colorIds = colorIds; @@ -387,7 +414,7 @@ public void setColorIds(@jakarta.annotation.Nullable List colorIds) { public ItemCreateRequest state(@jakarta.annotation.Nullable Long state) { - this.state = state; + this.state = JsonNullable.of(state); return this; } @@ -396,22 +423,30 @@ public ItemCreateRequest state(@jakarta.annotation.Nullable Long state) { * @return state */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_STATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getState() { - return state; + return state.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_STATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setState(@jakarta.annotation.Nullable Long state) { + + public JsonNullable getState_JsonNullable() { + return state; + } + + @JsonProperty(JSON_PROPERTY_STATE) + public void setState_JsonNullable(JsonNullable state) { this.state = state; } + public void setState(@jakarta.annotation.Nullable Long state) { + this.state = JsonNullable.of(state); + } + public ItemCreateRequest sex(@jakarta.annotation.Nullable String sex) { - this.sex = sex; + this.sex = JsonNullable.of(sex); return this; } @@ -420,19 +455,27 @@ public ItemCreateRequest sex(@jakarta.annotation.Nullable String sex) { * @return sex */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SEX, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getSex() { - return sex; + return sex.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SEX, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSex(@jakarta.annotation.Nullable String sex) { + + public JsonNullable getSex_JsonNullable() { + return sex; + } + + @JsonProperty(JSON_PROPERTY_SEX) + public void setSex_JsonNullable(JsonNullable sex) { this.sex = sex; } + public void setSex(@jakarta.annotation.Nullable String sex) { + this.sex = JsonNullable.of(sex); + } + public ItemCreateRequest labels(@jakarta.annotation.Nullable List labels) { this.labels = labels; @@ -491,7 +534,7 @@ public void setSold(@jakarta.annotation.Nullable Boolean sold) { public ItemCreateRequest packageSizeId(@jakarta.annotation.Nullable Long packageSizeId) { - this.packageSizeId = packageSizeId; + this.packageSizeId = JsonNullable.of(packageSizeId); return this; } @@ -500,19 +543,27 @@ public ItemCreateRequest packageSizeId(@jakarta.annotation.Nullable Long package * @return packageSizeId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PACKAGE_SIZE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getPackageSizeId() { - return packageSizeId; + return packageSizeId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PACKAGE_SIZE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPackageSizeId(@jakarta.annotation.Nullable Long packageSizeId) { + + public JsonNullable getPackageSizeId_JsonNullable() { + return packageSizeId; + } + + @JsonProperty(JSON_PROPERTY_PACKAGE_SIZE_ID) + public void setPackageSizeId_JsonNullable(JsonNullable packageSizeId) { this.packageSizeId = packageSizeId; } + public void setPackageSizeId(@jakarta.annotation.Nullable Long packageSizeId) { + this.packageSizeId = JsonNullable.of(packageSizeId); + } + public ItemCreateRequest materialIds(@jakarta.annotation.Nullable List materialIds) { this.materialIds = materialIds; @@ -547,7 +598,7 @@ public void setMaterialIds(@jakarta.annotation.Nullable List materialIds) public ItemCreateRequest measurementLength(@jakarta.annotation.Nullable BigDecimal measurementLength) { - this.measurementLength = measurementLength; + this.measurementLength = JsonNullable.of(measurementLength); return this; } @@ -556,22 +607,30 @@ public ItemCreateRequest measurementLength(@jakarta.annotation.Nullable BigDecim * @return measurementLength */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_LENGTH, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public BigDecimal getMeasurementLength() { - return measurementLength; + return measurementLength.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_LENGTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMeasurementLength(@jakarta.annotation.Nullable BigDecimal measurementLength) { + + public JsonNullable getMeasurementLength_JsonNullable() { + return measurementLength; + } + + @JsonProperty(JSON_PROPERTY_MEASUREMENT_LENGTH) + public void setMeasurementLength_JsonNullable(JsonNullable measurementLength) { this.measurementLength = measurementLength; } + public void setMeasurementLength(@jakarta.annotation.Nullable BigDecimal measurementLength) { + this.measurementLength = JsonNullable.of(measurementLength); + } + public ItemCreateRequest measurementWidth(@jakarta.annotation.Nullable BigDecimal measurementWidth) { - this.measurementWidth = measurementWidth; + this.measurementWidth = JsonNullable.of(measurementWidth); return this; } @@ -580,19 +639,27 @@ public ItemCreateRequest measurementWidth(@jakarta.annotation.Nullable BigDecima * @return measurementWidth */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_WIDTH, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public BigDecimal getMeasurementWidth() { - return measurementWidth; + return measurementWidth.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_WIDTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMeasurementWidth(@jakarta.annotation.Nullable BigDecimal measurementWidth) { + + public JsonNullable getMeasurementWidth_JsonNullable() { + return measurementWidth; + } + + @JsonProperty(JSON_PROPERTY_MEASUREMENT_WIDTH) + public void setMeasurementWidth_JsonNullable(JsonNullable measurementWidth) { this.measurementWidth = measurementWidth; } + public void setMeasurementWidth(@jakarta.annotation.Nullable BigDecimal measurementWidth) { + this.measurementWidth = JsonNullable.of(measurementWidth); + } + public ItemCreateRequest enumValues(@jakarta.annotation.Nullable List enumValues) { this.enumValues = enumValues; @@ -691,7 +758,7 @@ public void setCustomFields(@jakarta.annotation.Nullable List c public ItemCreateRequest estimatedPrice(@jakarta.annotation.Nullable Money estimatedPrice) { - this.estimatedPrice = estimatedPrice; + this.estimatedPrice = JsonNullable.of(estimatedPrice); return this; } @@ -700,22 +767,30 @@ public ItemCreateRequest estimatedPrice(@jakarta.annotation.Nullable Money estim * @return estimatedPrice */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ESTIMATED_PRICE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getEstimatedPrice() { - return estimatedPrice; + return estimatedPrice.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ESTIMATED_PRICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEstimatedPrice(@jakarta.annotation.Nullable Money estimatedPrice) { + + public JsonNullable getEstimatedPrice_JsonNullable() { + return estimatedPrice; + } + + @JsonProperty(JSON_PROPERTY_ESTIMATED_PRICE) + public void setEstimatedPrice_JsonNullable(JsonNullable estimatedPrice) { this.estimatedPrice = estimatedPrice; } + public void setEstimatedPrice(@jakarta.annotation.Nullable Money estimatedPrice) { + this.estimatedPrice = JsonNullable.of(estimatedPrice); + } + public ItemCreateRequest purchasePrice(@jakarta.annotation.Nullable Money purchasePrice) { - this.purchasePrice = purchasePrice; + this.purchasePrice = JsonNullable.of(purchasePrice); return this; } @@ -724,22 +799,30 @@ public ItemCreateRequest purchasePrice(@jakarta.annotation.Nullable Money purcha * @return purchasePrice */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PRICE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getPurchasePrice() { - return purchasePrice; + return purchasePrice.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PRICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPurchasePrice(@jakarta.annotation.Nullable Money purchasePrice) { + + public JsonNullable getPurchasePrice_JsonNullable() { + return purchasePrice; + } + + @JsonProperty(JSON_PROPERTY_PURCHASE_PRICE) + public void setPurchasePrice_JsonNullable(JsonNullable purchasePrice) { this.purchasePrice = purchasePrice; } + public void setPurchasePrice(@jakarta.annotation.Nullable Money purchasePrice) { + this.purchasePrice = JsonNullable.of(purchasePrice); + } + public ItemCreateRequest purchaseDate(@jakarta.annotation.Nullable OffsetDateTime purchaseDate) { - this.purchaseDate = purchaseDate; + this.purchaseDate = JsonNullable.of(purchaseDate); return this; } @@ -748,22 +831,30 @@ public ItemCreateRequest purchaseDate(@jakarta.annotation.Nullable OffsetDateTim * @return purchaseDate */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PURCHASE_DATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getPurchaseDate() { - return purchaseDate; + return purchaseDate.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PURCHASE_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPurchaseDate(@jakarta.annotation.Nullable OffsetDateTime purchaseDate) { + + public JsonNullable getPurchaseDate_JsonNullable() { + return purchaseDate; + } + + @JsonProperty(JSON_PROPERTY_PURCHASE_DATE) + public void setPurchaseDate_JsonNullable(JsonNullable purchaseDate) { this.purchaseDate = purchaseDate; } + public void setPurchaseDate(@jakarta.annotation.Nullable OffsetDateTime purchaseDate) { + this.purchaseDate = JsonNullable.of(purchaseDate); + } + public ItemCreateRequest purchasePlaceId(@jakarta.annotation.Nullable Long purchasePlaceId) { - this.purchasePlaceId = purchasePlaceId; + this.purchasePlaceId = JsonNullable.of(purchasePlaceId); return this; } @@ -772,22 +863,30 @@ public ItemCreateRequest purchasePlaceId(@jakarta.annotation.Nullable Long purch * @return purchasePlaceId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PLACE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getPurchasePlaceId() { - return purchasePlaceId; + return purchasePlaceId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PLACE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPurchasePlaceId(@jakarta.annotation.Nullable Long purchasePlaceId) { + + public JsonNullable getPurchasePlaceId_JsonNullable() { + return purchasePlaceId; + } + + @JsonProperty(JSON_PROPERTY_PURCHASE_PLACE_ID) + public void setPurchasePlaceId_JsonNullable(JsonNullable purchasePlaceId) { this.purchasePlaceId = purchasePlaceId; } + public void setPurchasePlaceId(@jakarta.annotation.Nullable Long purchasePlaceId) { + this.purchasePlaceId = JsonNullable.of(purchasePlaceId); + } + public ItemCreateRequest sellingPrice(@jakarta.annotation.Nullable Money sellingPrice) { - this.sellingPrice = sellingPrice; + this.sellingPrice = JsonNullable.of(sellingPrice); return this; } @@ -796,22 +895,30 @@ public ItemCreateRequest sellingPrice(@jakarta.annotation.Nullable Money selling * @return sellingPrice */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SELLING_PRICE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getSellingPrice() { - return sellingPrice; + return sellingPrice.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SELLING_PRICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSellingPrice(@jakarta.annotation.Nullable Money sellingPrice) { + + public JsonNullable getSellingPrice_JsonNullable() { + return sellingPrice; + } + + @JsonProperty(JSON_PROPERTY_SELLING_PRICE) + public void setSellingPrice_JsonNullable(JsonNullable sellingPrice) { this.sellingPrice = sellingPrice; } + public void setSellingPrice(@jakarta.annotation.Nullable Money sellingPrice) { + this.sellingPrice = JsonNullable.of(sellingPrice); + } + public ItemCreateRequest sellingDate(@jakarta.annotation.Nullable OffsetDateTime sellingDate) { - this.sellingDate = sellingDate; + this.sellingDate = JsonNullable.of(sellingDate); return this; } @@ -820,22 +927,30 @@ public ItemCreateRequest sellingDate(@jakarta.annotation.Nullable OffsetDateTime * @return sellingDate */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SELLING_DATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getSellingDate() { - return sellingDate; + return sellingDate.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SELLING_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSellingDate(@jakarta.annotation.Nullable OffsetDateTime sellingDate) { + + public JsonNullable getSellingDate_JsonNullable() { + return sellingDate; + } + + @JsonProperty(JSON_PROPERTY_SELLING_DATE) + public void setSellingDate_JsonNullable(JsonNullable sellingDate) { this.sellingDate = sellingDate; } + public void setSellingDate(@jakarta.annotation.Nullable OffsetDateTime sellingDate) { + this.sellingDate = JsonNullable.of(sellingDate); + } + public ItemCreateRequest sellingPlaceId(@jakarta.annotation.Nullable Long sellingPlaceId) { - this.sellingPlaceId = sellingPlaceId; + this.sellingPlaceId = JsonNullable.of(sellingPlaceId); return this; } @@ -844,19 +959,27 @@ public ItemCreateRequest sellingPlaceId(@jakarta.annotation.Nullable Long sellin * @return sellingPlaceId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SELLING_PLACE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getSellingPlaceId() { - return sellingPlaceId; + return sellingPlaceId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SELLING_PLACE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSellingPlaceId(@jakarta.annotation.Nullable Long sellingPlaceId) { + + public JsonNullable getSellingPlaceId_JsonNullable() { + return sellingPlaceId; + } + + @JsonProperty(JSON_PROPERTY_SELLING_PLACE_ID) + public void setSellingPlaceId_JsonNullable(JsonNullable sellingPlaceId) { this.sellingPlaceId = sellingPlaceId; } + public void setSellingPlaceId(@jakarta.annotation.Nullable Long sellingPlaceId) { + this.sellingPlaceId = JsonNullable.of(sellingPlaceId); + } + /** * Return true if this ItemCreateRequest object is equal to o. @@ -871,36 +994,47 @@ public boolean equals(Object o) { } ItemCreateRequest itemCreateRequest = (ItemCreateRequest) o; return Objects.equals(this.name, itemCreateRequest.name) && - Objects.equals(this.sku, itemCreateRequest.sku) && - Objects.equals(this.description, itemCreateRequest.description) && + equalsNullable(this.sku, itemCreateRequest.sku) && + equalsNullable(this.description, itemCreateRequest.description) && Objects.equals(this.photoIds, itemCreateRequest.photoIds) && - Objects.equals(this.categoryId, itemCreateRequest.categoryId) && - Objects.equals(this.brandId, itemCreateRequest.brandId) && - Objects.equals(this.sizeId, itemCreateRequest.sizeId) && + equalsNullable(this.categoryId, itemCreateRequest.categoryId) && + equalsNullable(this.brandId, itemCreateRequest.brandId) && + equalsNullable(this.sizeId, itemCreateRequest.sizeId) && Objects.equals(this.colorIds, itemCreateRequest.colorIds) && - Objects.equals(this.state, itemCreateRequest.state) && - Objects.equals(this.sex, itemCreateRequest.sex) && + equalsNullable(this.state, itemCreateRequest.state) && + equalsNullable(this.sex, itemCreateRequest.sex) && Objects.equals(this.labels, itemCreateRequest.labels) && Objects.equals(this.sold, itemCreateRequest.sold) && - Objects.equals(this.packageSizeId, itemCreateRequest.packageSizeId) && + equalsNullable(this.packageSizeId, itemCreateRequest.packageSizeId) && Objects.equals(this.materialIds, itemCreateRequest.materialIds) && - Objects.equals(this.measurementLength, itemCreateRequest.measurementLength) && - Objects.equals(this.measurementWidth, itemCreateRequest.measurementWidth) && + equalsNullable(this.measurementLength, itemCreateRequest.measurementLength) && + equalsNullable(this.measurementWidth, itemCreateRequest.measurementWidth) && Objects.equals(this.enumValues, itemCreateRequest.enumValues) && Objects.equals(this.attributes, itemCreateRequest.attributes) && Objects.equals(this.customFields, itemCreateRequest.customFields) && - Objects.equals(this.estimatedPrice, itemCreateRequest.estimatedPrice) && - Objects.equals(this.purchasePrice, itemCreateRequest.purchasePrice) && - Objects.equals(this.purchaseDate, itemCreateRequest.purchaseDate) && - Objects.equals(this.purchasePlaceId, itemCreateRequest.purchasePlaceId) && - Objects.equals(this.sellingPrice, itemCreateRequest.sellingPrice) && - Objects.equals(this.sellingDate, itemCreateRequest.sellingDate) && - Objects.equals(this.sellingPlaceId, itemCreateRequest.sellingPlaceId); + equalsNullable(this.estimatedPrice, itemCreateRequest.estimatedPrice) && + equalsNullable(this.purchasePrice, itemCreateRequest.purchasePrice) && + equalsNullable(this.purchaseDate, itemCreateRequest.purchaseDate) && + equalsNullable(this.purchasePlaceId, itemCreateRequest.purchasePlaceId) && + equalsNullable(this.sellingPrice, itemCreateRequest.sellingPrice) && + equalsNullable(this.sellingDate, itemCreateRequest.sellingDate) && + equalsNullable(this.sellingPlaceId, itemCreateRequest.sellingPlaceId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(name, sku, description, photoIds, categoryId, brandId, sizeId, colorIds, state, sex, labels, sold, packageSizeId, materialIds, measurementLength, measurementWidth, enumValues, attributes, customFields, estimatedPrice, purchasePrice, purchaseDate, purchasePlaceId, sellingPrice, sellingDate, sellingPlaceId); + return Objects.hash(name, hashCodeNullable(sku), hashCodeNullable(description), photoIds, hashCodeNullable(categoryId), hashCodeNullable(brandId), hashCodeNullable(sizeId), colorIds, hashCodeNullable(state), hashCodeNullable(sex), labels, sold, hashCodeNullable(packageSizeId), materialIds, hashCodeNullable(measurementLength), hashCodeNullable(measurementWidth), enumValues, attributes, customFields, hashCodeNullable(estimatedPrice), hashCodeNullable(purchasePrice), hashCodeNullable(purchaseDate), hashCodeNullable(purchasePlaceId), hashCodeNullable(sellingPrice), hashCodeNullable(sellingDate), hashCodeNullable(sellingPlaceId)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/ItemPage.java b/src/main/java/com/controlresell/sdk/generated/model/ItemPage.java index e343e96..17dbdf8 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/ItemPage.java +++ b/src/main/java/com/controlresell/sdk/generated/model/ItemPage.java @@ -28,6 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,8 +50,7 @@ public class ItemPage { private List data = new ArrayList<>(); public static final String JSON_PROPERTY_NEXT_CURSOR = "nextCursor"; - @jakarta.annotation.Nullable - private String nextCursor; + private JsonNullable nextCursor = JsonNullable.undefined(); public ItemPage() { } @@ -85,7 +88,7 @@ public void setData(@jakarta.annotation.Nonnull List data) { public ItemPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { - this.nextCursor = nextCursor; + this.nextCursor = JsonNullable.of(nextCursor); return this; } @@ -94,19 +97,27 @@ public ItemPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { * @return nextCursor */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getNextCursor() { - return nextCursor; + return nextCursor.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + + public JsonNullable getNextCursor_JsonNullable() { + return nextCursor; + } + + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + public void setNextCursor_JsonNullable(JsonNullable nextCursor) { this.nextCursor = nextCursor; } + public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + this.nextCursor = JsonNullable.of(nextCursor); + } + /** * Return true if this ItemPage object is equal to o. @@ -121,12 +132,23 @@ public boolean equals(Object o) { } ItemPage itemPage = (ItemPage) o; return Objects.equals(this.data, itemPage.data) && - Objects.equals(this.nextCursor, itemPage.nextCursor); + equalsNullable(this.nextCursor, itemPage.nextCursor); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(data, nextCursor); + return Objects.hash(data, hashCodeNullable(nextCursor)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/ItemPhoto.java b/src/main/java/com/controlresell/sdk/generated/model/ItemPhoto.java index ea4e9ea..92c8bea 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/ItemPhoto.java +++ b/src/main/java/com/controlresell/sdk/generated/model/ItemPhoto.java @@ -26,6 +26,10 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -45,12 +49,10 @@ public class ItemPhoto { private UUID id; public static final String JSON_PROPERTY_INDEX = "index"; - @jakarta.annotation.Nullable - private Long index; + private JsonNullable index = JsonNullable.undefined(); public static final String JSON_PROPERTY_URL = "url"; - @jakarta.annotation.Nullable - private String url; + private JsonNullable url = JsonNullable.undefined(); public ItemPhoto() { } @@ -80,7 +82,7 @@ public void setId(@jakarta.annotation.Nonnull UUID id) { public ItemPhoto index(@jakarta.annotation.Nullable Long index) { - this.index = index; + this.index = JsonNullable.of(index); return this; } @@ -89,22 +91,30 @@ public ItemPhoto index(@jakarta.annotation.Nullable Long index) { * @return index */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_INDEX, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getIndex() { - return index; + return index.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_INDEX, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIndex(@jakarta.annotation.Nullable Long index) { + + public JsonNullable getIndex_JsonNullable() { + return index; + } + + @JsonProperty(JSON_PROPERTY_INDEX) + public void setIndex_JsonNullable(JsonNullable index) { this.index = index; } + public void setIndex(@jakarta.annotation.Nullable Long index) { + this.index = JsonNullable.of(index); + } + public ItemPhoto url(@jakarta.annotation.Nullable String url) { - this.url = url; + this.url = JsonNullable.of(url); return this; } @@ -113,19 +123,27 @@ public ItemPhoto url(@jakarta.annotation.Nullable String url) { * @return url */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_URL, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getUrl() { - return url; + return url.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_URL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUrl(@jakarta.annotation.Nullable String url) { + + public JsonNullable getUrl_JsonNullable() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + public void setUrl_JsonNullable(JsonNullable url) { this.url = url; } + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = JsonNullable.of(url); + } + /** * Return true if this ItemPhoto object is equal to o. @@ -140,13 +158,24 @@ public boolean equals(Object o) { } ItemPhoto itemPhoto = (ItemPhoto) o; return Objects.equals(this.id, itemPhoto.id) && - Objects.equals(this.index, itemPhoto.index) && - Objects.equals(this.url, itemPhoto.url); + equalsNullable(this.index, itemPhoto.index) && + equalsNullable(this.url, itemPhoto.url); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(id, index, url); + return Objects.hash(id, hashCodeNullable(index), hashCodeNullable(url)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/ItemUpdateRequest.java b/src/main/java/com/controlresell/sdk/generated/model/ItemUpdateRequest.java index c4a938d..2e54062 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/ItemUpdateRequest.java +++ b/src/main/java/com/controlresell/sdk/generated/model/ItemUpdateRequest.java @@ -34,6 +34,10 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -72,114 +76,88 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0") public class ItemUpdateRequest { public static final String JSON_PROPERTY_NAME = "name"; - @jakarta.annotation.Nullable - private String name; + private JsonNullable name = JsonNullable.undefined(); public static final String JSON_PROPERTY_SKU = "sku"; - @jakarta.annotation.Nullable - private String sku; + private JsonNullable sku = JsonNullable.undefined(); public static final String JSON_PROPERTY_DESCRIPTION = "description"; - @jakarta.annotation.Nullable - private String description; + private JsonNullable description = JsonNullable.undefined(); public static final String JSON_PROPERTY_PHOTO_IDS = "photoIds"; - @jakarta.annotation.Nullable - private List photoIds; + private JsonNullable> photoIds = JsonNullable.>undefined(); public static final String JSON_PROPERTY_CATEGORY_ID = "categoryId"; - @jakarta.annotation.Nullable - private Long categoryId; + private JsonNullable categoryId = JsonNullable.undefined(); public static final String JSON_PROPERTY_BRAND_ID = "brandId"; - @jakarta.annotation.Nullable - private Long brandId; + private JsonNullable brandId = JsonNullable.undefined(); public static final String JSON_PROPERTY_SIZE_ID = "sizeId"; - @jakarta.annotation.Nullable - private Long sizeId; + private JsonNullable sizeId = JsonNullable.undefined(); public static final String JSON_PROPERTY_COLOR_IDS = "colorIds"; - @jakarta.annotation.Nullable - private List colorIds; + private JsonNullable> colorIds = JsonNullable.>undefined(); public static final String JSON_PROPERTY_STATE = "state"; - @jakarta.annotation.Nullable - private Long state; + private JsonNullable state = JsonNullable.undefined(); public static final String JSON_PROPERTY_SEX = "sex"; - @jakarta.annotation.Nullable - private String sex; + private JsonNullable sex = JsonNullable.undefined(); public static final String JSON_PROPERTY_LABELS = "labels"; - @jakarta.annotation.Nullable - private List labels; + private JsonNullable> labels = JsonNullable.>undefined(); public static final String JSON_PROPERTY_SOLD = "sold"; - @jakarta.annotation.Nullable - private Boolean sold; + private JsonNullable sold = JsonNullable.undefined(); public static final String JSON_PROPERTY_PACKAGE_SIZE_ID = "packageSizeId"; - @jakarta.annotation.Nullable - private Long packageSizeId; + private JsonNullable packageSizeId = JsonNullable.undefined(); public static final String JSON_PROPERTY_MATERIAL_IDS = "materialIds"; - @jakarta.annotation.Nullable - private List materialIds; + private JsonNullable> materialIds = JsonNullable.>undefined(); public static final String JSON_PROPERTY_MEASUREMENT_LENGTH = "measurementLength"; - @jakarta.annotation.Nullable - private BigDecimal measurementLength; + private JsonNullable measurementLength = JsonNullable.undefined(); public static final String JSON_PROPERTY_MEASUREMENT_WIDTH = "measurementWidth"; - @jakarta.annotation.Nullable - private BigDecimal measurementWidth; + private JsonNullable measurementWidth = JsonNullable.undefined(); public static final String JSON_PROPERTY_ENUM_VALUES = "enumValues"; - @jakarta.annotation.Nullable - private List enumValues; + private JsonNullable> enumValues = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - @jakarta.annotation.Nullable - private List attributes; + private JsonNullable> attributes = JsonNullable.>undefined(); public static final String JSON_PROPERTY_CUSTOM_FIELDS = "customFields"; - @jakarta.annotation.Nullable - private List customFields; + private JsonNullable> customFields = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ESTIMATED_PRICE = "estimatedPrice"; - @jakarta.annotation.Nullable - private Money estimatedPrice; + private JsonNullable estimatedPrice = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_PRICE = "purchasePrice"; - @jakarta.annotation.Nullable - private Money purchasePrice; + private JsonNullable purchasePrice = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_DATE = "purchaseDate"; - @jakarta.annotation.Nullable - private OffsetDateTime purchaseDate; + private JsonNullable purchaseDate = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_PLACE_ID = "purchasePlaceId"; - @jakarta.annotation.Nullable - private Long purchasePlaceId; + private JsonNullable purchasePlaceId = JsonNullable.undefined(); public static final String JSON_PROPERTY_SELLING_PRICE = "sellingPrice"; - @jakarta.annotation.Nullable - private Money sellingPrice; + private JsonNullable sellingPrice = JsonNullable.undefined(); public static final String JSON_PROPERTY_SELLING_DATE = "sellingDate"; - @jakarta.annotation.Nullable - private OffsetDateTime sellingDate; + private JsonNullable sellingDate = JsonNullable.undefined(); public static final String JSON_PROPERTY_SELLING_PLACE_ID = "sellingPlaceId"; - @jakarta.annotation.Nullable - private Long sellingPlaceId; + private JsonNullable sellingPlaceId = JsonNullable.undefined(); public ItemUpdateRequest() { } public ItemUpdateRequest name(@jakarta.annotation.Nullable String name) { - this.name = name; + this.name = JsonNullable.of(name); return this; } @@ -188,22 +166,30 @@ public ItemUpdateRequest name(@jakarta.annotation.Nullable String name) { * @return name */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getName() { - return name; + return name.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(@jakarta.annotation.Nullable String name) { + + public JsonNullable getName_JsonNullable() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + public void setName_JsonNullable(JsonNullable name) { this.name = name; } + public void setName(@jakarta.annotation.Nullable String name) { + this.name = JsonNullable.of(name); + } + public ItemUpdateRequest sku(@jakarta.annotation.Nullable String sku) { - this.sku = sku; + this.sku = JsonNullable.of(sku); return this; } @@ -212,22 +198,30 @@ public ItemUpdateRequest sku(@jakarta.annotation.Nullable String sku) { * @return sku */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SKU, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getSku() { - return sku; + return sku.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SKU, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSku(@jakarta.annotation.Nullable String sku) { + + public JsonNullable getSku_JsonNullable() { + return sku; + } + + @JsonProperty(JSON_PROPERTY_SKU) + public void setSku_JsonNullable(JsonNullable sku) { this.sku = sku; } + public void setSku(@jakarta.annotation.Nullable String sku) { + this.sku = JsonNullable.of(sku); + } + public ItemUpdateRequest description(@jakarta.annotation.Nullable String description) { - this.description = description; + this.description = JsonNullable.of(description); return this; } @@ -236,30 +230,42 @@ public ItemUpdateRequest description(@jakarta.annotation.Nullable String descrip * @return description */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDescription() { - return description; + return description.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDescription(@jakarta.annotation.Nullable String description) { + + public JsonNullable getDescription_JsonNullable() { + return description; + } + + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + public void setDescription_JsonNullable(JsonNullable description) { this.description = description; } + public void setDescription(@jakarta.annotation.Nullable String description) { + this.description = JsonNullable.of(description); + } + public ItemUpdateRequest photoIds(@jakarta.annotation.Nullable List photoIds) { - this.photoIds = photoIds; + this.photoIds = JsonNullable.>of(photoIds); return this; } public ItemUpdateRequest addPhotoIdsItem(UUID photoIdsItem) { - if (this.photoIds == null) { - this.photoIds = new ArrayList<>(); + if (this.photoIds == null || !this.photoIds.isPresent() || this.photoIds.get() == null) { + this.photoIds = JsonNullable.>of(new ArrayList<>()); + } + try { + this.photoIds.get().add(photoIdsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.photoIds.add(photoIdsItem); return this; } @@ -268,22 +274,30 @@ public ItemUpdateRequest addPhotoIdsItem(UUID photoIdsItem) { * @return photoIds */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PHOTO_IDS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public List getPhotoIds() { - return photoIds; + return photoIds.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PHOTO_IDS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPhotoIds(@jakarta.annotation.Nullable List photoIds) { + + public JsonNullable> getPhotoIds_JsonNullable() { + return photoIds; + } + + @JsonProperty(JSON_PROPERTY_PHOTO_IDS) + public void setPhotoIds_JsonNullable(JsonNullable> photoIds) { this.photoIds = photoIds; } + public void setPhotoIds(@jakarta.annotation.Nullable List photoIds) { + this.photoIds = JsonNullable.>of(photoIds); + } + public ItemUpdateRequest categoryId(@jakarta.annotation.Nullable Long categoryId) { - this.categoryId = categoryId; + this.categoryId = JsonNullable.of(categoryId); return this; } @@ -292,22 +306,30 @@ public ItemUpdateRequest categoryId(@jakarta.annotation.Nullable Long categoryId * @return categoryId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CATEGORY_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getCategoryId() { - return categoryId; + return categoryId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CATEGORY_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCategoryId(@jakarta.annotation.Nullable Long categoryId) { + + public JsonNullable getCategoryId_JsonNullable() { + return categoryId; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY_ID) + public void setCategoryId_JsonNullable(JsonNullable categoryId) { this.categoryId = categoryId; } + public void setCategoryId(@jakarta.annotation.Nullable Long categoryId) { + this.categoryId = JsonNullable.of(categoryId); + } + public ItemUpdateRequest brandId(@jakarta.annotation.Nullable Long brandId) { - this.brandId = brandId; + this.brandId = JsonNullable.of(brandId); return this; } @@ -316,22 +338,30 @@ public ItemUpdateRequest brandId(@jakarta.annotation.Nullable Long brandId) { * @return brandId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BRAND_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getBrandId() { - return brandId; + return brandId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BRAND_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBrandId(@jakarta.annotation.Nullable Long brandId) { + + public JsonNullable getBrandId_JsonNullable() { + return brandId; + } + + @JsonProperty(JSON_PROPERTY_BRAND_ID) + public void setBrandId_JsonNullable(JsonNullable brandId) { this.brandId = brandId; } + public void setBrandId(@jakarta.annotation.Nullable Long brandId) { + this.brandId = JsonNullable.of(brandId); + } + public ItemUpdateRequest sizeId(@jakarta.annotation.Nullable Long sizeId) { - this.sizeId = sizeId; + this.sizeId = JsonNullable.of(sizeId); return this; } @@ -340,30 +370,42 @@ public ItemUpdateRequest sizeId(@jakarta.annotation.Nullable Long sizeId) { * @return sizeId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SIZE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getSizeId() { - return sizeId; + return sizeId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SIZE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSizeId(@jakarta.annotation.Nullable Long sizeId) { + + public JsonNullable getSizeId_JsonNullable() { + return sizeId; + } + + @JsonProperty(JSON_PROPERTY_SIZE_ID) + public void setSizeId_JsonNullable(JsonNullable sizeId) { this.sizeId = sizeId; } + public void setSizeId(@jakarta.annotation.Nullable Long sizeId) { + this.sizeId = JsonNullable.of(sizeId); + } + public ItemUpdateRequest colorIds(@jakarta.annotation.Nullable List colorIds) { - this.colorIds = colorIds; + this.colorIds = JsonNullable.>of(colorIds); return this; } public ItemUpdateRequest addColorIdsItem(Long colorIdsItem) { - if (this.colorIds == null) { - this.colorIds = new ArrayList<>(); + if (this.colorIds == null || !this.colorIds.isPresent() || this.colorIds.get() == null) { + this.colorIds = JsonNullable.>of(new ArrayList<>()); + } + try { + this.colorIds.get().add(colorIdsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.colorIds.add(colorIdsItem); return this; } @@ -372,22 +414,30 @@ public ItemUpdateRequest addColorIdsItem(Long colorIdsItem) { * @return colorIds */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_COLOR_IDS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public List getColorIds() { - return colorIds; + return colorIds.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_COLOR_IDS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setColorIds(@jakarta.annotation.Nullable List colorIds) { + + public JsonNullable> getColorIds_JsonNullable() { + return colorIds; + } + + @JsonProperty(JSON_PROPERTY_COLOR_IDS) + public void setColorIds_JsonNullable(JsonNullable> colorIds) { this.colorIds = colorIds; } + public void setColorIds(@jakarta.annotation.Nullable List colorIds) { + this.colorIds = JsonNullable.>of(colorIds); + } + public ItemUpdateRequest state(@jakarta.annotation.Nullable Long state) { - this.state = state; + this.state = JsonNullable.of(state); return this; } @@ -396,22 +446,30 @@ public ItemUpdateRequest state(@jakarta.annotation.Nullable Long state) { * @return state */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_STATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getState() { - return state; + return state.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_STATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setState(@jakarta.annotation.Nullable Long state) { + + public JsonNullable getState_JsonNullable() { + return state; + } + + @JsonProperty(JSON_PROPERTY_STATE) + public void setState_JsonNullable(JsonNullable state) { this.state = state; } + public void setState(@jakarta.annotation.Nullable Long state) { + this.state = JsonNullable.of(state); + } + public ItemUpdateRequest sex(@jakarta.annotation.Nullable String sex) { - this.sex = sex; + this.sex = JsonNullable.of(sex); return this; } @@ -420,30 +478,42 @@ public ItemUpdateRequest sex(@jakarta.annotation.Nullable String sex) { * @return sex */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SEX, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getSex() { - return sex; + return sex.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SEX, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSex(@jakarta.annotation.Nullable String sex) { + + public JsonNullable getSex_JsonNullable() { + return sex; + } + + @JsonProperty(JSON_PROPERTY_SEX) + public void setSex_JsonNullable(JsonNullable sex) { this.sex = sex; } + public void setSex(@jakarta.annotation.Nullable String sex) { + this.sex = JsonNullable.of(sex); + } + public ItemUpdateRequest labels(@jakarta.annotation.Nullable List labels) { - this.labels = labels; + this.labels = JsonNullable.>of(labels); return this; } public ItemUpdateRequest addLabelsItem(String labelsItem) { - if (this.labels == null) { - this.labels = new ArrayList<>(); + if (this.labels == null || !this.labels.isPresent() || this.labels.get() == null) { + this.labels = JsonNullable.>of(new ArrayList<>()); + } + try { + this.labels.get().add(labelsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.labels.add(labelsItem); return this; } @@ -452,22 +522,30 @@ public ItemUpdateRequest addLabelsItem(String labelsItem) { * @return labels */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_LABELS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public List getLabels() { - return labels; + return labels.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_LABELS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLabels(@jakarta.annotation.Nullable List labels) { + + public JsonNullable> getLabels_JsonNullable() { + return labels; + } + + @JsonProperty(JSON_PROPERTY_LABELS) + public void setLabels_JsonNullable(JsonNullable> labels) { this.labels = labels; } + public void setLabels(@jakarta.annotation.Nullable List labels) { + this.labels = JsonNullable.>of(labels); + } + public ItemUpdateRequest sold(@jakarta.annotation.Nullable Boolean sold) { - this.sold = sold; + this.sold = JsonNullable.of(sold); return this; } @@ -476,22 +554,30 @@ public ItemUpdateRequest sold(@jakarta.annotation.Nullable Boolean sold) { * @return sold */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SOLD, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Boolean getSold() { - return sold; + return sold.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SOLD, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSold(@jakarta.annotation.Nullable Boolean sold) { + + public JsonNullable getSold_JsonNullable() { + return sold; + } + + @JsonProperty(JSON_PROPERTY_SOLD) + public void setSold_JsonNullable(JsonNullable sold) { this.sold = sold; } + public void setSold(@jakarta.annotation.Nullable Boolean sold) { + this.sold = JsonNullable.of(sold); + } + public ItemUpdateRequest packageSizeId(@jakarta.annotation.Nullable Long packageSizeId) { - this.packageSizeId = packageSizeId; + this.packageSizeId = JsonNullable.of(packageSizeId); return this; } @@ -500,30 +586,42 @@ public ItemUpdateRequest packageSizeId(@jakarta.annotation.Nullable Long package * @return packageSizeId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PACKAGE_SIZE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getPackageSizeId() { - return packageSizeId; + return packageSizeId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PACKAGE_SIZE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPackageSizeId(@jakarta.annotation.Nullable Long packageSizeId) { + + public JsonNullable getPackageSizeId_JsonNullable() { + return packageSizeId; + } + + @JsonProperty(JSON_PROPERTY_PACKAGE_SIZE_ID) + public void setPackageSizeId_JsonNullable(JsonNullable packageSizeId) { this.packageSizeId = packageSizeId; } + public void setPackageSizeId(@jakarta.annotation.Nullable Long packageSizeId) { + this.packageSizeId = JsonNullable.of(packageSizeId); + } + public ItemUpdateRequest materialIds(@jakarta.annotation.Nullable List materialIds) { - this.materialIds = materialIds; + this.materialIds = JsonNullable.>of(materialIds); return this; } public ItemUpdateRequest addMaterialIdsItem(Long materialIdsItem) { - if (this.materialIds == null) { - this.materialIds = new ArrayList<>(); + if (this.materialIds == null || !this.materialIds.isPresent() || this.materialIds.get() == null) { + this.materialIds = JsonNullable.>of(new ArrayList<>()); + } + try { + this.materialIds.get().add(materialIdsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.materialIds.add(materialIdsItem); return this; } @@ -532,22 +630,30 @@ public ItemUpdateRequest addMaterialIdsItem(Long materialIdsItem) { * @return materialIds */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MATERIAL_IDS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public List getMaterialIds() { - return materialIds; + return materialIds.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_MATERIAL_IDS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMaterialIds(@jakarta.annotation.Nullable List materialIds) { + + public JsonNullable> getMaterialIds_JsonNullable() { + return materialIds; + } + + @JsonProperty(JSON_PROPERTY_MATERIAL_IDS) + public void setMaterialIds_JsonNullable(JsonNullable> materialIds) { this.materialIds = materialIds; } + public void setMaterialIds(@jakarta.annotation.Nullable List materialIds) { + this.materialIds = JsonNullable.>of(materialIds); + } + public ItemUpdateRequest measurementLength(@jakarta.annotation.Nullable BigDecimal measurementLength) { - this.measurementLength = measurementLength; + this.measurementLength = JsonNullable.of(measurementLength); return this; } @@ -556,22 +662,30 @@ public ItemUpdateRequest measurementLength(@jakarta.annotation.Nullable BigDecim * @return measurementLength */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_LENGTH, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public BigDecimal getMeasurementLength() { - return measurementLength; + return measurementLength.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_LENGTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMeasurementLength(@jakarta.annotation.Nullable BigDecimal measurementLength) { + + public JsonNullable getMeasurementLength_JsonNullable() { + return measurementLength; + } + + @JsonProperty(JSON_PROPERTY_MEASUREMENT_LENGTH) + public void setMeasurementLength_JsonNullable(JsonNullable measurementLength) { this.measurementLength = measurementLength; } + public void setMeasurementLength(@jakarta.annotation.Nullable BigDecimal measurementLength) { + this.measurementLength = JsonNullable.of(measurementLength); + } + public ItemUpdateRequest measurementWidth(@jakarta.annotation.Nullable BigDecimal measurementWidth) { - this.measurementWidth = measurementWidth; + this.measurementWidth = JsonNullable.of(measurementWidth); return this; } @@ -580,30 +694,42 @@ public ItemUpdateRequest measurementWidth(@jakarta.annotation.Nullable BigDecima * @return measurementWidth */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_WIDTH, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public BigDecimal getMeasurementWidth() { - return measurementWidth; + return measurementWidth.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_MEASUREMENT_WIDTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMeasurementWidth(@jakarta.annotation.Nullable BigDecimal measurementWidth) { + + public JsonNullable getMeasurementWidth_JsonNullable() { + return measurementWidth; + } + + @JsonProperty(JSON_PROPERTY_MEASUREMENT_WIDTH) + public void setMeasurementWidth_JsonNullable(JsonNullable measurementWidth) { this.measurementWidth = measurementWidth; } + public void setMeasurementWidth(@jakarta.annotation.Nullable BigDecimal measurementWidth) { + this.measurementWidth = JsonNullable.of(measurementWidth); + } + public ItemUpdateRequest enumValues(@jakarta.annotation.Nullable List enumValues) { - this.enumValues = enumValues; + this.enumValues = JsonNullable.>of(enumValues); return this; } public ItemUpdateRequest addEnumValuesItem(ItemEnumValue enumValuesItem) { - if (this.enumValues == null) { - this.enumValues = new ArrayList<>(); + if (this.enumValues == null || !this.enumValues.isPresent() || this.enumValues.get() == null) { + this.enumValues = JsonNullable.>of(new ArrayList<>()); + } + try { + this.enumValues.get().add(enumValuesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.enumValues.add(enumValuesItem); return this; } @@ -612,30 +738,42 @@ public ItemUpdateRequest addEnumValuesItem(ItemEnumValue enumValuesItem) { * @return enumValues */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENUM_VALUES, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public List getEnumValues() { - return enumValues; + return enumValues.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ENUM_VALUES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumValues(@jakarta.annotation.Nullable List enumValues) { + + public JsonNullable> getEnumValues_JsonNullable() { + return enumValues; + } + + @JsonProperty(JSON_PROPERTY_ENUM_VALUES) + public void setEnumValues_JsonNullable(JsonNullable> enumValues) { this.enumValues = enumValues; } + public void setEnumValues(@jakarta.annotation.Nullable List enumValues) { + this.enumValues = JsonNullable.>of(enumValues); + } + public ItemUpdateRequest attributes(@jakarta.annotation.Nullable List attributes) { - this.attributes = attributes; + this.attributes = JsonNullable.>of(attributes); return this; } public ItemUpdateRequest addAttributesItem(ItemAttribute attributesItem) { - if (this.attributes == null) { - this.attributes = new ArrayList<>(); + if (this.attributes == null || !this.attributes.isPresent() || this.attributes.get() == null) { + this.attributes = JsonNullable.>of(new ArrayList<>()); + } + try { + this.attributes.get().add(attributesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.attributes.add(attributesItem); return this; } @@ -644,30 +782,42 @@ public ItemUpdateRequest addAttributesItem(ItemAttribute attributesItem) { * @return attributes */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ATTRIBUTES, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public List getAttributes() { - return attributes; + return attributes.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ATTRIBUTES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributes(@jakarta.annotation.Nullable List attributes) { + + public JsonNullable> getAttributes_JsonNullable() { + return attributes; + } + + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + public void setAttributes_JsonNullable(JsonNullable> attributes) { this.attributes = attributes; } + public void setAttributes(@jakarta.annotation.Nullable List attributes) { + this.attributes = JsonNullable.>of(attributes); + } + public ItemUpdateRequest customFields(@jakarta.annotation.Nullable List customFields) { - this.customFields = customFields; + this.customFields = JsonNullable.>of(customFields); return this; } public ItemUpdateRequest addCustomFieldsItem(ItemCustomField customFieldsItem) { - if (this.customFields == null) { - this.customFields = new ArrayList<>(); + if (this.customFields == null || !this.customFields.isPresent() || this.customFields.get() == null) { + this.customFields = JsonNullable.>of(new ArrayList<>()); + } + try { + this.customFields.get().add(customFieldsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.customFields.add(customFieldsItem); return this; } @@ -676,22 +826,30 @@ public ItemUpdateRequest addCustomFieldsItem(ItemCustomField customFieldsItem) { * @return customFields */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CUSTOM_FIELDS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public List getCustomFields() { - return customFields; + return customFields.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CUSTOM_FIELDS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomFields(@jakarta.annotation.Nullable List customFields) { + + public JsonNullable> getCustomFields_JsonNullable() { + return customFields; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_FIELDS) + public void setCustomFields_JsonNullable(JsonNullable> customFields) { this.customFields = customFields; } + public void setCustomFields(@jakarta.annotation.Nullable List customFields) { + this.customFields = JsonNullable.>of(customFields); + } + public ItemUpdateRequest estimatedPrice(@jakarta.annotation.Nullable Money estimatedPrice) { - this.estimatedPrice = estimatedPrice; + this.estimatedPrice = JsonNullable.of(estimatedPrice); return this; } @@ -700,22 +858,30 @@ public ItemUpdateRequest estimatedPrice(@jakarta.annotation.Nullable Money estim * @return estimatedPrice */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ESTIMATED_PRICE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getEstimatedPrice() { - return estimatedPrice; + return estimatedPrice.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ESTIMATED_PRICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEstimatedPrice(@jakarta.annotation.Nullable Money estimatedPrice) { + + public JsonNullable getEstimatedPrice_JsonNullable() { + return estimatedPrice; + } + + @JsonProperty(JSON_PROPERTY_ESTIMATED_PRICE) + public void setEstimatedPrice_JsonNullable(JsonNullable estimatedPrice) { this.estimatedPrice = estimatedPrice; } + public void setEstimatedPrice(@jakarta.annotation.Nullable Money estimatedPrice) { + this.estimatedPrice = JsonNullable.of(estimatedPrice); + } + public ItemUpdateRequest purchasePrice(@jakarta.annotation.Nullable Money purchasePrice) { - this.purchasePrice = purchasePrice; + this.purchasePrice = JsonNullable.of(purchasePrice); return this; } @@ -724,22 +890,30 @@ public ItemUpdateRequest purchasePrice(@jakarta.annotation.Nullable Money purcha * @return purchasePrice */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PRICE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getPurchasePrice() { - return purchasePrice; + return purchasePrice.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PRICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPurchasePrice(@jakarta.annotation.Nullable Money purchasePrice) { + + public JsonNullable getPurchasePrice_JsonNullable() { + return purchasePrice; + } + + @JsonProperty(JSON_PROPERTY_PURCHASE_PRICE) + public void setPurchasePrice_JsonNullable(JsonNullable purchasePrice) { this.purchasePrice = purchasePrice; } + public void setPurchasePrice(@jakarta.annotation.Nullable Money purchasePrice) { + this.purchasePrice = JsonNullable.of(purchasePrice); + } + public ItemUpdateRequest purchaseDate(@jakarta.annotation.Nullable OffsetDateTime purchaseDate) { - this.purchaseDate = purchaseDate; + this.purchaseDate = JsonNullable.of(purchaseDate); return this; } @@ -748,22 +922,30 @@ public ItemUpdateRequest purchaseDate(@jakarta.annotation.Nullable OffsetDateTim * @return purchaseDate */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PURCHASE_DATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getPurchaseDate() { - return purchaseDate; + return purchaseDate.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PURCHASE_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPurchaseDate(@jakarta.annotation.Nullable OffsetDateTime purchaseDate) { + + public JsonNullable getPurchaseDate_JsonNullable() { + return purchaseDate; + } + + @JsonProperty(JSON_PROPERTY_PURCHASE_DATE) + public void setPurchaseDate_JsonNullable(JsonNullable purchaseDate) { this.purchaseDate = purchaseDate; } + public void setPurchaseDate(@jakarta.annotation.Nullable OffsetDateTime purchaseDate) { + this.purchaseDate = JsonNullable.of(purchaseDate); + } + public ItemUpdateRequest purchasePlaceId(@jakarta.annotation.Nullable Long purchasePlaceId) { - this.purchasePlaceId = purchasePlaceId; + this.purchasePlaceId = JsonNullable.of(purchasePlaceId); return this; } @@ -772,22 +954,30 @@ public ItemUpdateRequest purchasePlaceId(@jakarta.annotation.Nullable Long purch * @return purchasePlaceId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PLACE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getPurchasePlaceId() { - return purchasePlaceId; + return purchasePlaceId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PURCHASE_PLACE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPurchasePlaceId(@jakarta.annotation.Nullable Long purchasePlaceId) { + + public JsonNullable getPurchasePlaceId_JsonNullable() { + return purchasePlaceId; + } + + @JsonProperty(JSON_PROPERTY_PURCHASE_PLACE_ID) + public void setPurchasePlaceId_JsonNullable(JsonNullable purchasePlaceId) { this.purchasePlaceId = purchasePlaceId; } + public void setPurchasePlaceId(@jakarta.annotation.Nullable Long purchasePlaceId) { + this.purchasePlaceId = JsonNullable.of(purchasePlaceId); + } + public ItemUpdateRequest sellingPrice(@jakarta.annotation.Nullable Money sellingPrice) { - this.sellingPrice = sellingPrice; + this.sellingPrice = JsonNullable.of(sellingPrice); return this; } @@ -796,22 +986,30 @@ public ItemUpdateRequest sellingPrice(@jakarta.annotation.Nullable Money selling * @return sellingPrice */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SELLING_PRICE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getSellingPrice() { - return sellingPrice; + return sellingPrice.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SELLING_PRICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSellingPrice(@jakarta.annotation.Nullable Money sellingPrice) { + + public JsonNullable getSellingPrice_JsonNullable() { + return sellingPrice; + } + + @JsonProperty(JSON_PROPERTY_SELLING_PRICE) + public void setSellingPrice_JsonNullable(JsonNullable sellingPrice) { this.sellingPrice = sellingPrice; } + public void setSellingPrice(@jakarta.annotation.Nullable Money sellingPrice) { + this.sellingPrice = JsonNullable.of(sellingPrice); + } + public ItemUpdateRequest sellingDate(@jakarta.annotation.Nullable OffsetDateTime sellingDate) { - this.sellingDate = sellingDate; + this.sellingDate = JsonNullable.of(sellingDate); return this; } @@ -820,22 +1018,30 @@ public ItemUpdateRequest sellingDate(@jakarta.annotation.Nullable OffsetDateTime * @return sellingDate */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SELLING_DATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getSellingDate() { - return sellingDate; + return sellingDate.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SELLING_DATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSellingDate(@jakarta.annotation.Nullable OffsetDateTime sellingDate) { + + public JsonNullable getSellingDate_JsonNullable() { + return sellingDate; + } + + @JsonProperty(JSON_PROPERTY_SELLING_DATE) + public void setSellingDate_JsonNullable(JsonNullable sellingDate) { this.sellingDate = sellingDate; } + public void setSellingDate(@jakarta.annotation.Nullable OffsetDateTime sellingDate) { + this.sellingDate = JsonNullable.of(sellingDate); + } + public ItemUpdateRequest sellingPlaceId(@jakarta.annotation.Nullable Long sellingPlaceId) { - this.sellingPlaceId = sellingPlaceId; + this.sellingPlaceId = JsonNullable.of(sellingPlaceId); return this; } @@ -844,19 +1050,27 @@ public ItemUpdateRequest sellingPlaceId(@jakarta.annotation.Nullable Long sellin * @return sellingPlaceId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SELLING_PLACE_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getSellingPlaceId() { - return sellingPlaceId; + return sellingPlaceId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SELLING_PLACE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSellingPlaceId(@jakarta.annotation.Nullable Long sellingPlaceId) { + + public JsonNullable getSellingPlaceId_JsonNullable() { + return sellingPlaceId; + } + + @JsonProperty(JSON_PROPERTY_SELLING_PLACE_ID) + public void setSellingPlaceId_JsonNullable(JsonNullable sellingPlaceId) { this.sellingPlaceId = sellingPlaceId; } + public void setSellingPlaceId(@jakarta.annotation.Nullable Long sellingPlaceId) { + this.sellingPlaceId = JsonNullable.of(sellingPlaceId); + } + /** * Return true if this ItemUpdateRequest object is equal to o. @@ -870,37 +1084,48 @@ public boolean equals(Object o) { return false; } ItemUpdateRequest itemUpdateRequest = (ItemUpdateRequest) o; - return Objects.equals(this.name, itemUpdateRequest.name) && - Objects.equals(this.sku, itemUpdateRequest.sku) && - Objects.equals(this.description, itemUpdateRequest.description) && - Objects.equals(this.photoIds, itemUpdateRequest.photoIds) && - Objects.equals(this.categoryId, itemUpdateRequest.categoryId) && - Objects.equals(this.brandId, itemUpdateRequest.brandId) && - Objects.equals(this.sizeId, itemUpdateRequest.sizeId) && - Objects.equals(this.colorIds, itemUpdateRequest.colorIds) && - Objects.equals(this.state, itemUpdateRequest.state) && - Objects.equals(this.sex, itemUpdateRequest.sex) && - Objects.equals(this.labels, itemUpdateRequest.labels) && - Objects.equals(this.sold, itemUpdateRequest.sold) && - Objects.equals(this.packageSizeId, itemUpdateRequest.packageSizeId) && - Objects.equals(this.materialIds, itemUpdateRequest.materialIds) && - Objects.equals(this.measurementLength, itemUpdateRequest.measurementLength) && - Objects.equals(this.measurementWidth, itemUpdateRequest.measurementWidth) && - Objects.equals(this.enumValues, itemUpdateRequest.enumValues) && - Objects.equals(this.attributes, itemUpdateRequest.attributes) && - Objects.equals(this.customFields, itemUpdateRequest.customFields) && - Objects.equals(this.estimatedPrice, itemUpdateRequest.estimatedPrice) && - Objects.equals(this.purchasePrice, itemUpdateRequest.purchasePrice) && - Objects.equals(this.purchaseDate, itemUpdateRequest.purchaseDate) && - Objects.equals(this.purchasePlaceId, itemUpdateRequest.purchasePlaceId) && - Objects.equals(this.sellingPrice, itemUpdateRequest.sellingPrice) && - Objects.equals(this.sellingDate, itemUpdateRequest.sellingDate) && - Objects.equals(this.sellingPlaceId, itemUpdateRequest.sellingPlaceId); + return equalsNullable(this.name, itemUpdateRequest.name) && + equalsNullable(this.sku, itemUpdateRequest.sku) && + equalsNullable(this.description, itemUpdateRequest.description) && + equalsNullable(this.photoIds, itemUpdateRequest.photoIds) && + equalsNullable(this.categoryId, itemUpdateRequest.categoryId) && + equalsNullable(this.brandId, itemUpdateRequest.brandId) && + equalsNullable(this.sizeId, itemUpdateRequest.sizeId) && + equalsNullable(this.colorIds, itemUpdateRequest.colorIds) && + equalsNullable(this.state, itemUpdateRequest.state) && + equalsNullable(this.sex, itemUpdateRequest.sex) && + equalsNullable(this.labels, itemUpdateRequest.labels) && + equalsNullable(this.sold, itemUpdateRequest.sold) && + equalsNullable(this.packageSizeId, itemUpdateRequest.packageSizeId) && + equalsNullable(this.materialIds, itemUpdateRequest.materialIds) && + equalsNullable(this.measurementLength, itemUpdateRequest.measurementLength) && + equalsNullable(this.measurementWidth, itemUpdateRequest.measurementWidth) && + equalsNullable(this.enumValues, itemUpdateRequest.enumValues) && + equalsNullable(this.attributes, itemUpdateRequest.attributes) && + equalsNullable(this.customFields, itemUpdateRequest.customFields) && + equalsNullable(this.estimatedPrice, itemUpdateRequest.estimatedPrice) && + equalsNullable(this.purchasePrice, itemUpdateRequest.purchasePrice) && + equalsNullable(this.purchaseDate, itemUpdateRequest.purchaseDate) && + equalsNullable(this.purchasePlaceId, itemUpdateRequest.purchasePlaceId) && + equalsNullable(this.sellingPrice, itemUpdateRequest.sellingPrice) && + equalsNullable(this.sellingDate, itemUpdateRequest.sellingDate) && + equalsNullable(this.sellingPlaceId, itemUpdateRequest.sellingPlaceId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(name, sku, description, photoIds, categoryId, brandId, sizeId, colorIds, state, sex, labels, sold, packageSizeId, materialIds, measurementLength, measurementWidth, enumValues, attributes, customFields, estimatedPrice, purchasePrice, purchaseDate, purchasePlaceId, sellingPrice, sellingDate, sellingPlaceId); + return Objects.hash(hashCodeNullable(name), hashCodeNullable(sku), hashCodeNullable(description), hashCodeNullable(photoIds), hashCodeNullable(categoryId), hashCodeNullable(brandId), hashCodeNullable(sizeId), hashCodeNullable(colorIds), hashCodeNullable(state), hashCodeNullable(sex), hashCodeNullable(labels), hashCodeNullable(sold), hashCodeNullable(packageSizeId), hashCodeNullable(materialIds), hashCodeNullable(measurementLength), hashCodeNullable(measurementWidth), hashCodeNullable(enumValues), hashCodeNullable(attributes), hashCodeNullable(customFields), hashCodeNullable(estimatedPrice), hashCodeNullable(purchasePrice), hashCodeNullable(purchaseDate), hashCodeNullable(purchasePlaceId), hashCodeNullable(sellingPrice), hashCodeNullable(sellingDate), hashCodeNullable(sellingPlaceId)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/Listing.java b/src/main/java/com/controlresell/sdk/generated/model/Listing.java index eb9f1df..1991523 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/Listing.java +++ b/src/main/java/com/controlresell/sdk/generated/model/Listing.java @@ -28,6 +28,10 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -65,8 +69,7 @@ public class Listing { private UUID accountId; public static final String JSON_PROPERTY_PLATFORM = "platform"; - @jakarta.annotation.Nullable - private String platform; + private JsonNullable platform = JsonNullable.undefined(); public static final String JSON_PROPERTY_PLATFORM_ID = "platformId"; @jakarta.annotation.Nonnull @@ -93,16 +96,13 @@ public class Listing { private OffsetDateTime updatedAt; public static final String JSON_PROPERTY_VIEWS_COUNT = "viewsCount"; - @jakarta.annotation.Nullable - private Long viewsCount; + private JsonNullable viewsCount = JsonNullable.undefined(); public static final String JSON_PROPERTY_FAVORITES_COUNT = "favoritesCount"; - @jakarta.annotation.Nullable - private Long favoritesCount; + private JsonNullable favoritesCount = JsonNullable.undefined(); public static final String JSON_PROPERTY_BOOSTED_UNTIL = "boostedUntil"; - @jakarta.annotation.Nullable - private OffsetDateTime boostedUntil; + private JsonNullable boostedUntil = JsonNullable.undefined(); public Listing() { } @@ -180,7 +180,7 @@ public void setAccountId(@jakarta.annotation.Nonnull UUID accountId) { public Listing platform(@jakarta.annotation.Nullable String platform) { - this.platform = platform; + this.platform = JsonNullable.of(platform); return this; } @@ -189,19 +189,27 @@ public Listing platform(@jakarta.annotation.Nullable String platform) { * @return platform */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PLATFORM, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getPlatform() { - return platform; + return platform.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PLATFORM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPlatform(@jakarta.annotation.Nullable String platform) { + + public JsonNullable getPlatform_JsonNullable() { + return platform; + } + + @JsonProperty(JSON_PROPERTY_PLATFORM) + public void setPlatform_JsonNullable(JsonNullable platform) { this.platform = platform; } + public void setPlatform(@jakarta.annotation.Nullable String platform) { + this.platform = JsonNullable.of(platform); + } + public Listing platformId(@jakarta.annotation.Nonnull String platformId) { this.platformId = platformId; @@ -348,7 +356,7 @@ public void setUpdatedAt(@jakarta.annotation.Nonnull OffsetDateTime updatedAt) { public Listing viewsCount(@jakarta.annotation.Nullable Long viewsCount) { - this.viewsCount = viewsCount; + this.viewsCount = JsonNullable.of(viewsCount); return this; } @@ -357,22 +365,30 @@ public Listing viewsCount(@jakarta.annotation.Nullable Long viewsCount) { * @return viewsCount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_VIEWS_COUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getViewsCount() { - return viewsCount; + return viewsCount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_VIEWS_COUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setViewsCount(@jakarta.annotation.Nullable Long viewsCount) { + + public JsonNullable getViewsCount_JsonNullable() { + return viewsCount; + } + + @JsonProperty(JSON_PROPERTY_VIEWS_COUNT) + public void setViewsCount_JsonNullable(JsonNullable viewsCount) { this.viewsCount = viewsCount; } + public void setViewsCount(@jakarta.annotation.Nullable Long viewsCount) { + this.viewsCount = JsonNullable.of(viewsCount); + } + public Listing favoritesCount(@jakarta.annotation.Nullable Long favoritesCount) { - this.favoritesCount = favoritesCount; + this.favoritesCount = JsonNullable.of(favoritesCount); return this; } @@ -381,22 +397,30 @@ public Listing favoritesCount(@jakarta.annotation.Nullable Long favoritesCount) * @return favoritesCount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FAVORITES_COUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getFavoritesCount() { - return favoritesCount; + return favoritesCount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_FAVORITES_COUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFavoritesCount(@jakarta.annotation.Nullable Long favoritesCount) { + + public JsonNullable getFavoritesCount_JsonNullable() { + return favoritesCount; + } + + @JsonProperty(JSON_PROPERTY_FAVORITES_COUNT) + public void setFavoritesCount_JsonNullable(JsonNullable favoritesCount) { this.favoritesCount = favoritesCount; } + public void setFavoritesCount(@jakarta.annotation.Nullable Long favoritesCount) { + this.favoritesCount = JsonNullable.of(favoritesCount); + } + public Listing boostedUntil(@jakarta.annotation.Nullable OffsetDateTime boostedUntil) { - this.boostedUntil = boostedUntil; + this.boostedUntil = JsonNullable.of(boostedUntil); return this; } @@ -405,19 +429,27 @@ public Listing boostedUntil(@jakarta.annotation.Nullable OffsetDateTime boostedU * @return boostedUntil */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BOOSTED_UNTIL, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getBoostedUntil() { - return boostedUntil; + return boostedUntil.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BOOSTED_UNTIL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBoostedUntil(@jakarta.annotation.Nullable OffsetDateTime boostedUntil) { + + public JsonNullable getBoostedUntil_JsonNullable() { + return boostedUntil; + } + + @JsonProperty(JSON_PROPERTY_BOOSTED_UNTIL) + public void setBoostedUntil_JsonNullable(JsonNullable boostedUntil) { this.boostedUntil = boostedUntil; } + public void setBoostedUntil(@jakarta.annotation.Nullable OffsetDateTime boostedUntil) { + this.boostedUntil = JsonNullable.of(boostedUntil); + } + /** * Return true if this Listing object is equal to o. @@ -434,21 +466,32 @@ public boolean equals(Object o) { return Objects.equals(this.id, listing.id) && Objects.equals(this.itemId, listing.itemId) && Objects.equals(this.accountId, listing.accountId) && - Objects.equals(this.platform, listing.platform) && + equalsNullable(this.platform, listing.platform) && Objects.equals(this.platformId, listing.platformId) && Objects.equals(this.url, listing.url) && Objects.equals(this.price, listing.price) && Objects.equals(this.status, listing.status) && Objects.equals(this.publishedAt, listing.publishedAt) && Objects.equals(this.updatedAt, listing.updatedAt) && - Objects.equals(this.viewsCount, listing.viewsCount) && - Objects.equals(this.favoritesCount, listing.favoritesCount) && - Objects.equals(this.boostedUntil, listing.boostedUntil); + equalsNullable(this.viewsCount, listing.viewsCount) && + equalsNullable(this.favoritesCount, listing.favoritesCount) && + equalsNullable(this.boostedUntil, listing.boostedUntil); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(id, itemId, accountId, platform, platformId, url, price, status, publishedAt, updatedAt, viewsCount, favoritesCount, boostedUntil); + return Objects.hash(id, itemId, accountId, hashCodeNullable(platform), platformId, url, price, status, publishedAt, updatedAt, hashCodeNullable(viewsCount), hashCodeNullable(favoritesCount), hashCodeNullable(boostedUntil)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/ListingPage.java b/src/main/java/com/controlresell/sdk/generated/model/ListingPage.java index 92ebc7d..2228932 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/ListingPage.java +++ b/src/main/java/com/controlresell/sdk/generated/model/ListingPage.java @@ -28,6 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,8 +50,7 @@ public class ListingPage { private List data = new ArrayList<>(); public static final String JSON_PROPERTY_NEXT_CURSOR = "nextCursor"; - @jakarta.annotation.Nullable - private String nextCursor; + private JsonNullable nextCursor = JsonNullable.undefined(); public ListingPage() { } @@ -85,7 +88,7 @@ public void setData(@jakarta.annotation.Nonnull List data) { public ListingPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { - this.nextCursor = nextCursor; + this.nextCursor = JsonNullable.of(nextCursor); return this; } @@ -94,19 +97,27 @@ public ListingPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { * @return nextCursor */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getNextCursor() { - return nextCursor; + return nextCursor.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + + public JsonNullable getNextCursor_JsonNullable() { + return nextCursor; + } + + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + public void setNextCursor_JsonNullable(JsonNullable nextCursor) { this.nextCursor = nextCursor; } + public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + this.nextCursor = JsonNullable.of(nextCursor); + } + /** * Return true if this ListingPage object is equal to o. @@ -121,12 +132,23 @@ public boolean equals(Object o) { } ListingPage listingPage = (ListingPage) o; return Objects.equals(this.data, listingPage.data) && - Objects.equals(this.nextCursor, listingPage.nextCursor); + equalsNullable(this.nextCursor, listingPage.nextCursor); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(data, nextCursor); + return Objects.hash(data, hashCodeNullable(nextCursor)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/Me.java b/src/main/java/com/controlresell/sdk/generated/model/Me.java index a9cfae1..fabebb5 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/Me.java +++ b/src/main/java/com/controlresell/sdk/generated/model/Me.java @@ -25,6 +25,10 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -48,8 +52,7 @@ public class Me { private String username; public static final String JSON_PROPERTY_CURRENCY = "currency"; - @jakarta.annotation.Nullable - private String currency; + private JsonNullable currency = JsonNullable.undefined(); public Me() { } @@ -103,7 +106,7 @@ public void setUsername(@jakarta.annotation.Nonnull String username) { public Me currency(@jakarta.annotation.Nullable String currency) { - this.currency = currency; + this.currency = JsonNullable.of(currency); return this; } @@ -112,19 +115,27 @@ public Me currency(@jakarta.annotation.Nullable String currency) { * @return currency */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CURRENCY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getCurrency() { - return currency; + return currency.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CURRENCY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCurrency(@jakarta.annotation.Nullable String currency) { + + public JsonNullable getCurrency_JsonNullable() { + return currency; + } + + @JsonProperty(JSON_PROPERTY_CURRENCY) + public void setCurrency_JsonNullable(JsonNullable currency) { this.currency = currency; } + public void setCurrency(@jakarta.annotation.Nullable String currency) { + this.currency = JsonNullable.of(currency); + } + /** * Return true if this Me object is equal to o. @@ -140,12 +151,23 @@ public boolean equals(Object o) { Me me = (Me) o; return Objects.equals(this.id, me.id) && Objects.equals(this.username, me.username) && - Objects.equals(this.currency, me.currency); + equalsNullable(this.currency, me.currency); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(id, username, currency); + return Objects.hash(id, username, hashCodeNullable(currency)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/Message.java b/src/main/java/com/controlresell/sdk/generated/model/Message.java index 400fefe..0620605 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/Message.java +++ b/src/main/java/com/controlresell/sdk/generated/model/Message.java @@ -28,6 +28,10 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -68,12 +72,10 @@ public class Message { private String status; public static final String JSON_PROPERTY_BODY = "body"; - @jakarta.annotation.Nullable - private String body; + private JsonNullable body = JsonNullable.undefined(); public static final String JSON_PROPERTY_OFFER = "offer"; - @jakarta.annotation.Nullable - private Offer offer; + private JsonNullable offer = JsonNullable.undefined(); public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; @jakarta.annotation.Nonnull @@ -203,7 +205,7 @@ public void setStatus(@jakarta.annotation.Nonnull String status) { public Message body(@jakarta.annotation.Nullable String body) { - this.body = body; + this.body = JsonNullable.of(body); return this; } @@ -212,22 +214,30 @@ public Message body(@jakarta.annotation.Nullable String body) { * @return body */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getBody() { - return body; + return body.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBody(@jakarta.annotation.Nullable String body) { + + public JsonNullable getBody_JsonNullable() { + return body; + } + + @JsonProperty(JSON_PROPERTY_BODY) + public void setBody_JsonNullable(JsonNullable body) { this.body = body; } + public void setBody(@jakarta.annotation.Nullable String body) { + this.body = JsonNullable.of(body); + } + public Message offer(@jakarta.annotation.Nullable Offer offer) { - this.offer = offer; + this.offer = JsonNullable.of(offer); return this; } @@ -236,19 +246,27 @@ public Message offer(@jakarta.annotation.Nullable Offer offer) { * @return offer */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_OFFER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Offer getOffer() { - return offer; + return offer.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_OFFER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOffer(@jakarta.annotation.Nullable Offer offer) { + + public JsonNullable getOffer_JsonNullable() { + return offer; + } + + @JsonProperty(JSON_PROPERTY_OFFER) + public void setOffer_JsonNullable(JsonNullable offer) { this.offer = offer; } + public void setOffer(@jakarta.annotation.Nullable Offer offer) { + this.offer = JsonNullable.of(offer); + } + public Message createdAt(@jakarta.annotation.Nonnull OffsetDateTime createdAt) { this.createdAt = createdAt; @@ -291,14 +309,25 @@ public boolean equals(Object o) { Objects.equals(this.author, message.author) && Objects.equals(this.type, message.type) && Objects.equals(this.status, message.status) && - Objects.equals(this.body, message.body) && - Objects.equals(this.offer, message.offer) && + equalsNullable(this.body, message.body) && + equalsNullable(this.offer, message.offer) && Objects.equals(this.createdAt, message.createdAt); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(id, conversationId, author, type, status, body, offer, createdAt); + return Objects.hash(id, conversationId, author, type, status, hashCodeNullable(body), hashCodeNullable(offer), createdAt); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/MessagePage.java b/src/main/java/com/controlresell/sdk/generated/model/MessagePage.java index 6da1ecf..b16f1eb 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/MessagePage.java +++ b/src/main/java/com/controlresell/sdk/generated/model/MessagePage.java @@ -28,6 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,8 +50,7 @@ public class MessagePage { private List data = new ArrayList<>(); public static final String JSON_PROPERTY_NEXT_CURSOR = "nextCursor"; - @jakarta.annotation.Nullable - private String nextCursor; + private JsonNullable nextCursor = JsonNullable.undefined(); public MessagePage() { } @@ -85,7 +88,7 @@ public void setData(@jakarta.annotation.Nonnull List data) { public MessagePage nextCursor(@jakarta.annotation.Nullable String nextCursor) { - this.nextCursor = nextCursor; + this.nextCursor = JsonNullable.of(nextCursor); return this; } @@ -94,19 +97,27 @@ public MessagePage nextCursor(@jakarta.annotation.Nullable String nextCursor) { * @return nextCursor */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getNextCursor() { - return nextCursor; + return nextCursor.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + + public JsonNullable getNextCursor_JsonNullable() { + return nextCursor; + } + + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + public void setNextCursor_JsonNullable(JsonNullable nextCursor) { this.nextCursor = nextCursor; } + public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + this.nextCursor = JsonNullable.of(nextCursor); + } + /** * Return true if this MessagePage object is equal to o. @@ -121,12 +132,23 @@ public boolean equals(Object o) { } MessagePage messagePage = (MessagePage) o; return Objects.equals(this.data, messagePage.data) && - Objects.equals(this.nextCursor, messagePage.nextCursor); + equalsNullable(this.nextCursor, messagePage.nextCursor); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(data, nextCursor); + return Objects.hash(data, hashCodeNullable(nextCursor)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/Order.java b/src/main/java/com/controlresell/sdk/generated/model/Order.java index e771505..3c6d9e0 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/Order.java +++ b/src/main/java/com/controlresell/sdk/generated/model/Order.java @@ -31,6 +31,10 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -80,40 +84,32 @@ public class Order { private String platformOrderId; public static final String JSON_PROPERTY_CONVERSATION_ID = "conversationId"; - @jakarta.annotation.Nullable - private UUID conversationId; + private JsonNullable conversationId = JsonNullable.undefined(); public static final String JSON_PROPERTY_TRANSACTION_ID = "transactionId"; - @jakarta.annotation.Nullable - private UUID transactionId; + private JsonNullable transactionId = JsonNullable.undefined(); public static final String JSON_PROPERTY_PRICE = "price"; @jakarta.annotation.Nonnull private Money price; public static final String JSON_PROPERTY_PLATFORM_FEE = "platformFee"; - @jakarta.annotation.Nullable - private Money platformFee; + private JsonNullable platformFee = JsonNullable.undefined(); public static final String JSON_PROPERTY_SHIPPING_FEE = "shippingFee"; - @jakarta.annotation.Nullable - private Money shippingFee; + private JsonNullable shippingFee = JsonNullable.undefined(); public static final String JSON_PROPERTY_SHIPPING_VAT = "shippingVat"; - @jakarta.annotation.Nullable - private Money shippingVat; + private JsonNullable shippingVat = JsonNullable.undefined(); public static final String JSON_PROPERTY_VAT_AMOUNT = "vatAmount"; - @jakarta.annotation.Nullable - private Money vatAmount; + private JsonNullable vatAmount = JsonNullable.undefined(); public static final String JSON_PROPERTY_TOTAL_AMOUNT = "totalAmount"; - @jakarta.annotation.Nullable - private Money totalAmount; + private JsonNullable totalAmount = JsonNullable.undefined(); public static final String JSON_PROPERTY_REFUND_AMOUNT = "refundAmount"; - @jakarta.annotation.Nullable - private Money refundAmount; + private JsonNullable refundAmount = JsonNullable.undefined(); public static final String JSON_PROPERTY_PREPARED = "prepared"; @jakarta.annotation.Nonnull @@ -251,7 +247,7 @@ public void setPlatformOrderId(@jakarta.annotation.Nonnull String platformOrderI public Order conversationId(@jakarta.annotation.Nullable UUID conversationId) { - this.conversationId = conversationId; + this.conversationId = JsonNullable.of(conversationId); return this; } @@ -260,22 +256,30 @@ public Order conversationId(@jakarta.annotation.Nullable UUID conversationId) { * @return conversationId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CONVERSATION_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public UUID getConversationId() { - return conversationId; + return conversationId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CONVERSATION_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setConversationId(@jakarta.annotation.Nullable UUID conversationId) { + + public JsonNullable getConversationId_JsonNullable() { + return conversationId; + } + + @JsonProperty(JSON_PROPERTY_CONVERSATION_ID) + public void setConversationId_JsonNullable(JsonNullable conversationId) { this.conversationId = conversationId; } + public void setConversationId(@jakarta.annotation.Nullable UUID conversationId) { + this.conversationId = JsonNullable.of(conversationId); + } + public Order transactionId(@jakarta.annotation.Nullable UUID transactionId) { - this.transactionId = transactionId; + this.transactionId = JsonNullable.of(transactionId); return this; } @@ -284,19 +288,27 @@ public Order transactionId(@jakarta.annotation.Nullable UUID transactionId) { * @return transactionId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_TRANSACTION_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public UUID getTransactionId() { - return transactionId; + return transactionId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_TRANSACTION_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTransactionId(@jakarta.annotation.Nullable UUID transactionId) { + + public JsonNullable getTransactionId_JsonNullable() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + public void setTransactionId_JsonNullable(JsonNullable transactionId) { this.transactionId = transactionId; } + public void setTransactionId(@jakarta.annotation.Nullable UUID transactionId) { + this.transactionId = JsonNullable.of(transactionId); + } + public Order price(@jakarta.annotation.Nonnull Money price) { this.price = price; @@ -323,7 +335,7 @@ public void setPrice(@jakarta.annotation.Nonnull Money price) { public Order platformFee(@jakarta.annotation.Nullable Money platformFee) { - this.platformFee = platformFee; + this.platformFee = JsonNullable.of(platformFee); return this; } @@ -332,22 +344,30 @@ public Order platformFee(@jakarta.annotation.Nullable Money platformFee) { * @return platformFee */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PLATFORM_FEE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getPlatformFee() { - return platformFee; + return platformFee.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PLATFORM_FEE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPlatformFee(@jakarta.annotation.Nullable Money platformFee) { + + public JsonNullable getPlatformFee_JsonNullable() { + return platformFee; + } + + @JsonProperty(JSON_PROPERTY_PLATFORM_FEE) + public void setPlatformFee_JsonNullable(JsonNullable platformFee) { this.platformFee = platformFee; } + public void setPlatformFee(@jakarta.annotation.Nullable Money platformFee) { + this.platformFee = JsonNullable.of(platformFee); + } + public Order shippingFee(@jakarta.annotation.Nullable Money shippingFee) { - this.shippingFee = shippingFee; + this.shippingFee = JsonNullable.of(shippingFee); return this; } @@ -356,22 +376,30 @@ public Order shippingFee(@jakarta.annotation.Nullable Money shippingFee) { * @return shippingFee */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SHIPPING_FEE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getShippingFee() { - return shippingFee; + return shippingFee.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SHIPPING_FEE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShippingFee(@jakarta.annotation.Nullable Money shippingFee) { + + public JsonNullable getShippingFee_JsonNullable() { + return shippingFee; + } + + @JsonProperty(JSON_PROPERTY_SHIPPING_FEE) + public void setShippingFee_JsonNullable(JsonNullable shippingFee) { this.shippingFee = shippingFee; } + public void setShippingFee(@jakarta.annotation.Nullable Money shippingFee) { + this.shippingFee = JsonNullable.of(shippingFee); + } + public Order shippingVat(@jakarta.annotation.Nullable Money shippingVat) { - this.shippingVat = shippingVat; + this.shippingVat = JsonNullable.of(shippingVat); return this; } @@ -380,22 +408,30 @@ public Order shippingVat(@jakarta.annotation.Nullable Money shippingVat) { * @return shippingVat */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SHIPPING_VAT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getShippingVat() { - return shippingVat; + return shippingVat.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SHIPPING_VAT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShippingVat(@jakarta.annotation.Nullable Money shippingVat) { + + public JsonNullable getShippingVat_JsonNullable() { + return shippingVat; + } + + @JsonProperty(JSON_PROPERTY_SHIPPING_VAT) + public void setShippingVat_JsonNullable(JsonNullable shippingVat) { this.shippingVat = shippingVat; } + public void setShippingVat(@jakarta.annotation.Nullable Money shippingVat) { + this.shippingVat = JsonNullable.of(shippingVat); + } + public Order vatAmount(@jakarta.annotation.Nullable Money vatAmount) { - this.vatAmount = vatAmount; + this.vatAmount = JsonNullable.of(vatAmount); return this; } @@ -404,22 +440,30 @@ public Order vatAmount(@jakarta.annotation.Nullable Money vatAmount) { * @return vatAmount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_VAT_AMOUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getVatAmount() { - return vatAmount; + return vatAmount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_VAT_AMOUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setVatAmount(@jakarta.annotation.Nullable Money vatAmount) { + + public JsonNullable getVatAmount_JsonNullable() { + return vatAmount; + } + + @JsonProperty(JSON_PROPERTY_VAT_AMOUNT) + public void setVatAmount_JsonNullable(JsonNullable vatAmount) { this.vatAmount = vatAmount; } + public void setVatAmount(@jakarta.annotation.Nullable Money vatAmount) { + this.vatAmount = JsonNullable.of(vatAmount); + } + public Order totalAmount(@jakarta.annotation.Nullable Money totalAmount) { - this.totalAmount = totalAmount; + this.totalAmount = JsonNullable.of(totalAmount); return this; } @@ -428,22 +472,30 @@ public Order totalAmount(@jakarta.annotation.Nullable Money totalAmount) { * @return totalAmount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_TOTAL_AMOUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getTotalAmount() { - return totalAmount; + return totalAmount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_TOTAL_AMOUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTotalAmount(@jakarta.annotation.Nullable Money totalAmount) { + + public JsonNullable getTotalAmount_JsonNullable() { + return totalAmount; + } + + @JsonProperty(JSON_PROPERTY_TOTAL_AMOUNT) + public void setTotalAmount_JsonNullable(JsonNullable totalAmount) { this.totalAmount = totalAmount; } + public void setTotalAmount(@jakarta.annotation.Nullable Money totalAmount) { + this.totalAmount = JsonNullable.of(totalAmount); + } + public Order refundAmount(@jakarta.annotation.Nullable Money refundAmount) { - this.refundAmount = refundAmount; + this.refundAmount = JsonNullable.of(refundAmount); return this; } @@ -452,19 +504,27 @@ public Order refundAmount(@jakarta.annotation.Nullable Money refundAmount) { * @return refundAmount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_REFUND_AMOUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Money getRefundAmount() { - return refundAmount; + return refundAmount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_REFUND_AMOUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRefundAmount(@jakarta.annotation.Nullable Money refundAmount) { + + public JsonNullable getRefundAmount_JsonNullable() { + return refundAmount; + } + + @JsonProperty(JSON_PROPERTY_REFUND_AMOUNT) + public void setRefundAmount_JsonNullable(JsonNullable refundAmount) { this.refundAmount = refundAmount; } + public void setRefundAmount(@jakarta.annotation.Nullable Money refundAmount) { + this.refundAmount = JsonNullable.of(refundAmount); + } + public Order prepared(@jakarta.annotation.Nonnull Boolean prepared) { this.prepared = prepared; @@ -563,23 +623,34 @@ public boolean equals(Object o) { Objects.equals(this.type, order.type) && Objects.equals(this.status, order.status) && Objects.equals(this.platformOrderId, order.platformOrderId) && - Objects.equals(this.conversationId, order.conversationId) && - Objects.equals(this.transactionId, order.transactionId) && + equalsNullable(this.conversationId, order.conversationId) && + equalsNullable(this.transactionId, order.transactionId) && Objects.equals(this.price, order.price) && - Objects.equals(this.platformFee, order.platformFee) && - Objects.equals(this.shippingFee, order.shippingFee) && - Objects.equals(this.shippingVat, order.shippingVat) && - Objects.equals(this.vatAmount, order.vatAmount) && - Objects.equals(this.totalAmount, order.totalAmount) && - Objects.equals(this.refundAmount, order.refundAmount) && + equalsNullable(this.platformFee, order.platformFee) && + equalsNullable(this.shippingFee, order.shippingFee) && + equalsNullable(this.shippingVat, order.shippingVat) && + equalsNullable(this.vatAmount, order.vatAmount) && + equalsNullable(this.totalAmount, order.totalAmount) && + equalsNullable(this.refundAmount, order.refundAmount) && Objects.equals(this.prepared, order.prepared) && Objects.equals(this.date, order.date) && Objects.equals(this.items, order.items); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(id, accountId, type, status, platformOrderId, conversationId, transactionId, price, platformFee, shippingFee, shippingVat, vatAmount, totalAmount, refundAmount, prepared, date, items); + return Objects.hash(id, accountId, type, status, platformOrderId, hashCodeNullable(conversationId), hashCodeNullable(transactionId), price, hashCodeNullable(platformFee), hashCodeNullable(shippingFee), hashCodeNullable(shippingVat), hashCodeNullable(vatAmount), hashCodeNullable(totalAmount), hashCodeNullable(refundAmount), prepared, date, items); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/OrderItem.java b/src/main/java/com/controlresell/sdk/generated/model/OrderItem.java index 2ece3aa..03b6a90 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/OrderItem.java +++ b/src/main/java/com/controlresell/sdk/generated/model/OrderItem.java @@ -26,6 +26,10 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -44,8 +48,7 @@ public class OrderItem { private UUID listingId; public static final String JSON_PROPERTY_ITEM_ID = "itemId"; - @jakarta.annotation.Nullable - private Long itemId; + private JsonNullable itemId = JsonNullable.undefined(); public OrderItem() { } @@ -75,7 +78,7 @@ public void setListingId(@jakarta.annotation.Nonnull UUID listingId) { public OrderItem itemId(@jakarta.annotation.Nullable Long itemId) { - this.itemId = itemId; + this.itemId = JsonNullable.of(itemId); return this; } @@ -84,19 +87,27 @@ public OrderItem itemId(@jakarta.annotation.Nullable Long itemId) { * @return itemId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ITEM_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Long getItemId() { - return itemId; + return itemId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ITEM_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setItemId(@jakarta.annotation.Nullable Long itemId) { + + public JsonNullable getItemId_JsonNullable() { + return itemId; + } + + @JsonProperty(JSON_PROPERTY_ITEM_ID) + public void setItemId_JsonNullable(JsonNullable itemId) { this.itemId = itemId; } + public void setItemId(@jakarta.annotation.Nullable Long itemId) { + this.itemId = JsonNullable.of(itemId); + } + /** * Return true if this OrderItem object is equal to o. @@ -111,12 +122,23 @@ public boolean equals(Object o) { } OrderItem orderItem = (OrderItem) o; return Objects.equals(this.listingId, orderItem.listingId) && - Objects.equals(this.itemId, orderItem.itemId); + equalsNullable(this.itemId, orderItem.itemId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(listingId, itemId); + return Objects.hash(listingId, hashCodeNullable(itemId)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/OrderLabel.java b/src/main/java/com/controlresell/sdk/generated/model/OrderLabel.java index f87eb43..fa3a81e 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/OrderLabel.java +++ b/src/main/java/com/controlresell/sdk/generated/model/OrderLabel.java @@ -27,6 +27,10 @@ import java.time.OffsetDateTime; import java.util.Arrays; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -53,20 +57,16 @@ public class OrderLabel { private UUID orderId; public static final String JSON_PROPERTY_CARRIER = "carrier"; - @jakarta.annotation.Nullable - private String carrier; + private JsonNullable carrier = JsonNullable.undefined(); public static final String JSON_PROPERTY_URL = "url"; - @jakarta.annotation.Nullable - private String url; + private JsonNullable url = JsonNullable.undefined(); public static final String JSON_PROPERTY_ORIGINAL_URL = "originalUrl"; - @jakarta.annotation.Nullable - private String originalUrl; + private JsonNullable originalUrl = JsonNullable.undefined(); public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; - @jakarta.annotation.Nullable - private OffsetDateTime createdAt; + private JsonNullable createdAt = JsonNullable.undefined(); public OrderLabel() { } @@ -120,7 +120,7 @@ public void setOrderId(@jakarta.annotation.Nonnull UUID orderId) { public OrderLabel carrier(@jakarta.annotation.Nullable String carrier) { - this.carrier = carrier; + this.carrier = JsonNullable.of(carrier); return this; } @@ -129,22 +129,30 @@ public OrderLabel carrier(@jakarta.annotation.Nullable String carrier) { * @return carrier */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CARRIER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getCarrier() { - return carrier; + return carrier.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CARRIER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCarrier(@jakarta.annotation.Nullable String carrier) { + + public JsonNullable getCarrier_JsonNullable() { + return carrier; + } + + @JsonProperty(JSON_PROPERTY_CARRIER) + public void setCarrier_JsonNullable(JsonNullable carrier) { this.carrier = carrier; } + public void setCarrier(@jakarta.annotation.Nullable String carrier) { + this.carrier = JsonNullable.of(carrier); + } + public OrderLabel url(@jakarta.annotation.Nullable String url) { - this.url = url; + this.url = JsonNullable.of(url); return this; } @@ -153,22 +161,30 @@ public OrderLabel url(@jakarta.annotation.Nullable String url) { * @return url */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_URL, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getUrl() { - return url; + return url.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_URL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUrl(@jakarta.annotation.Nullable String url) { + + public JsonNullable getUrl_JsonNullable() { + return url; + } + + @JsonProperty(JSON_PROPERTY_URL) + public void setUrl_JsonNullable(JsonNullable url) { this.url = url; } + public void setUrl(@jakarta.annotation.Nullable String url) { + this.url = JsonNullable.of(url); + } + public OrderLabel originalUrl(@jakarta.annotation.Nullable String originalUrl) { - this.originalUrl = originalUrl; + this.originalUrl = JsonNullable.of(originalUrl); return this; } @@ -177,22 +193,30 @@ public OrderLabel originalUrl(@jakarta.annotation.Nullable String originalUrl) { * @return originalUrl */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ORIGINAL_URL, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getOriginalUrl() { - return originalUrl; + return originalUrl.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ORIGINAL_URL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOriginalUrl(@jakarta.annotation.Nullable String originalUrl) { + + public JsonNullable getOriginalUrl_JsonNullable() { + return originalUrl; + } + + @JsonProperty(JSON_PROPERTY_ORIGINAL_URL) + public void setOriginalUrl_JsonNullable(JsonNullable originalUrl) { this.originalUrl = originalUrl; } + public void setOriginalUrl(@jakarta.annotation.Nullable String originalUrl) { + this.originalUrl = JsonNullable.of(originalUrl); + } + public OrderLabel createdAt(@jakarta.annotation.Nullable OffsetDateTime createdAt) { - this.createdAt = createdAt; + this.createdAt = JsonNullable.of(createdAt); return this; } @@ -201,19 +225,27 @@ public OrderLabel createdAt(@jakarta.annotation.Nullable OffsetDateTime createdA * @return createdAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public OffsetDateTime getCreatedAt() { - return createdAt; + return createdAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CREATED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCreatedAt(@jakarta.annotation.Nullable OffsetDateTime createdAt) { + + public JsonNullable getCreatedAt_JsonNullable() { + return createdAt; + } + + @JsonProperty(JSON_PROPERTY_CREATED_AT) + public void setCreatedAt_JsonNullable(JsonNullable createdAt) { this.createdAt = createdAt; } + public void setCreatedAt(@jakarta.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = JsonNullable.of(createdAt); + } + /** * Return true if this OrderLabel object is equal to o. @@ -229,15 +261,26 @@ public boolean equals(Object o) { OrderLabel orderLabel = (OrderLabel) o; return Objects.equals(this.id, orderLabel.id) && Objects.equals(this.orderId, orderLabel.orderId) && - Objects.equals(this.carrier, orderLabel.carrier) && - Objects.equals(this.url, orderLabel.url) && - Objects.equals(this.originalUrl, orderLabel.originalUrl) && - Objects.equals(this.createdAt, orderLabel.createdAt); + equalsNullable(this.carrier, orderLabel.carrier) && + equalsNullable(this.url, orderLabel.url) && + equalsNullable(this.originalUrl, orderLabel.originalUrl) && + equalsNullable(this.createdAt, orderLabel.createdAt); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(id, orderId, carrier, url, originalUrl, createdAt); + return Objects.hash(id, orderId, hashCodeNullable(carrier), hashCodeNullable(url), hashCodeNullable(originalUrl), hashCodeNullable(createdAt)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/OrderLabelPage.java b/src/main/java/com/controlresell/sdk/generated/model/OrderLabelPage.java index f43bbce..5c6baf7 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/OrderLabelPage.java +++ b/src/main/java/com/controlresell/sdk/generated/model/OrderLabelPage.java @@ -28,6 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,8 +50,7 @@ public class OrderLabelPage { private List data = new ArrayList<>(); public static final String JSON_PROPERTY_NEXT_CURSOR = "nextCursor"; - @jakarta.annotation.Nullable - private String nextCursor; + private JsonNullable nextCursor = JsonNullable.undefined(); public OrderLabelPage() { } @@ -85,7 +88,7 @@ public void setData(@jakarta.annotation.Nonnull List data) { public OrderLabelPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { - this.nextCursor = nextCursor; + this.nextCursor = JsonNullable.of(nextCursor); return this; } @@ -94,19 +97,27 @@ public OrderLabelPage nextCursor(@jakarta.annotation.Nullable String nextCursor) * @return nextCursor */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getNextCursor() { - return nextCursor; + return nextCursor.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + + public JsonNullable getNextCursor_JsonNullable() { + return nextCursor; + } + + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + public void setNextCursor_JsonNullable(JsonNullable nextCursor) { this.nextCursor = nextCursor; } + public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + this.nextCursor = JsonNullable.of(nextCursor); + } + /** * Return true if this OrderLabelPage object is equal to o. @@ -121,12 +132,23 @@ public boolean equals(Object o) { } OrderLabelPage orderLabelPage = (OrderLabelPage) o; return Objects.equals(this.data, orderLabelPage.data) && - Objects.equals(this.nextCursor, orderLabelPage.nextCursor); + equalsNullable(this.nextCursor, orderLabelPage.nextCursor); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(data, nextCursor); + return Objects.hash(data, hashCodeNullable(nextCursor)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/OrderPage.java b/src/main/java/com/controlresell/sdk/generated/model/OrderPage.java index 030f915..da01a56 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/OrderPage.java +++ b/src/main/java/com/controlresell/sdk/generated/model/OrderPage.java @@ -28,6 +28,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,8 +50,7 @@ public class OrderPage { private List data = new ArrayList<>(); public static final String JSON_PROPERTY_NEXT_CURSOR = "nextCursor"; - @jakarta.annotation.Nullable - private String nextCursor; + private JsonNullable nextCursor = JsonNullable.undefined(); public OrderPage() { } @@ -85,7 +88,7 @@ public void setData(@jakarta.annotation.Nonnull List data) { public OrderPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { - this.nextCursor = nextCursor; + this.nextCursor = JsonNullable.of(nextCursor); return this; } @@ -94,19 +97,27 @@ public OrderPage nextCursor(@jakarta.annotation.Nullable String nextCursor) { * @return nextCursor */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getNextCursor() { - return nextCursor; + return nextCursor.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_NEXT_CURSOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + + public JsonNullable getNextCursor_JsonNullable() { + return nextCursor; + } + + @JsonProperty(JSON_PROPERTY_NEXT_CURSOR) + public void setNextCursor_JsonNullable(JsonNullable nextCursor) { this.nextCursor = nextCursor; } + public void setNextCursor(@jakarta.annotation.Nullable String nextCursor) { + this.nextCursor = JsonNullable.of(nextCursor); + } + /** * Return true if this OrderPage object is equal to o. @@ -121,12 +132,23 @@ public boolean equals(Object o) { } OrderPage orderPage = (OrderPage) o; return Objects.equals(this.data, orderPage.data) && - Objects.equals(this.nextCursor, orderPage.nextCursor); + equalsNullable(this.nextCursor, orderPage.nextCursor); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(data, nextCursor); + return Objects.hash(data, hashCodeNullable(nextCursor)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/PriceDropRequest.java b/src/main/java/com/controlresell/sdk/generated/model/PriceDropRequest.java index 5adb412..df3fed1 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/PriceDropRequest.java +++ b/src/main/java/com/controlresell/sdk/generated/model/PriceDropRequest.java @@ -28,6 +28,10 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -53,16 +57,13 @@ public class PriceDropRequest { private String value; public static final String JSON_PROPERTY_ROUND_TYPE = "roundType"; - @jakarta.annotation.Nullable - private String roundType; + private JsonNullable roundType = JsonNullable.undefined(); public static final String JSON_PROPERTY_ROUND_STEP = "roundStep"; - @jakarta.annotation.Nullable - private String roundStep; + private JsonNullable roundStep = JsonNullable.undefined(); public static final String JSON_PROPERTY_ACCOUNT_IDS = "accountIds"; - @jakarta.annotation.Nullable - private List accountIds; + private JsonNullable> accountIds = JsonNullable.>undefined(); public PriceDropRequest() { } @@ -116,7 +117,7 @@ public void setValue(@jakarta.annotation.Nonnull String value) { public PriceDropRequest roundType(@jakarta.annotation.Nullable String roundType) { - this.roundType = roundType; + this.roundType = JsonNullable.of(roundType); return this; } @@ -125,22 +126,30 @@ public PriceDropRequest roundType(@jakarta.annotation.Nullable String roundType) * @return roundType */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ROUND_TYPE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getRoundType() { - return roundType; + return roundType.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ROUND_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRoundType(@jakarta.annotation.Nullable String roundType) { + + public JsonNullable getRoundType_JsonNullable() { + return roundType; + } + + @JsonProperty(JSON_PROPERTY_ROUND_TYPE) + public void setRoundType_JsonNullable(JsonNullable roundType) { this.roundType = roundType; } + public void setRoundType(@jakarta.annotation.Nullable String roundType) { + this.roundType = JsonNullable.of(roundType); + } + public PriceDropRequest roundStep(@jakarta.annotation.Nullable String roundStep) { - this.roundStep = roundStep; + this.roundStep = JsonNullable.of(roundStep); return this; } @@ -149,30 +158,42 @@ public PriceDropRequest roundStep(@jakarta.annotation.Nullable String roundStep) * @return roundStep */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ROUND_STEP, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getRoundStep() { - return roundStep; + return roundStep.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ROUND_STEP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRoundStep(@jakarta.annotation.Nullable String roundStep) { + + public JsonNullable getRoundStep_JsonNullable() { + return roundStep; + } + + @JsonProperty(JSON_PROPERTY_ROUND_STEP) + public void setRoundStep_JsonNullable(JsonNullable roundStep) { this.roundStep = roundStep; } + public void setRoundStep(@jakarta.annotation.Nullable String roundStep) { + this.roundStep = JsonNullable.of(roundStep); + } + public PriceDropRequest accountIds(@jakarta.annotation.Nullable List accountIds) { - this.accountIds = accountIds; + this.accountIds = JsonNullable.>of(accountIds); return this; } public PriceDropRequest addAccountIdsItem(UUID accountIdsItem) { - if (this.accountIds == null) { - this.accountIds = new ArrayList<>(); + if (this.accountIds == null || !this.accountIds.isPresent() || this.accountIds.get() == null) { + this.accountIds = JsonNullable.>of(new ArrayList<>()); + } + try { + this.accountIds.get().add(accountIdsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.accountIds.add(accountIdsItem); return this; } @@ -181,19 +202,27 @@ public PriceDropRequest addAccountIdsItem(UUID accountIdsItem) { * @return accountIds */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ACCOUNT_IDS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public List getAccountIds() { - return accountIds; + return accountIds.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ACCOUNT_IDS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountIds(@jakarta.annotation.Nullable List accountIds) { + + public JsonNullable> getAccountIds_JsonNullable() { + return accountIds; + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT_IDS) + public void setAccountIds_JsonNullable(JsonNullable> accountIds) { this.accountIds = accountIds; } + public void setAccountIds(@jakarta.annotation.Nullable List accountIds) { + this.accountIds = JsonNullable.>of(accountIds); + } + /** * Return true if this PriceDropRequest object is equal to o. @@ -209,14 +238,25 @@ public boolean equals(Object o) { PriceDropRequest priceDropRequest = (PriceDropRequest) o; return Objects.equals(this.type, priceDropRequest.type) && Objects.equals(this.value, priceDropRequest.value) && - Objects.equals(this.roundType, priceDropRequest.roundType) && - Objects.equals(this.roundStep, priceDropRequest.roundStep) && - Objects.equals(this.accountIds, priceDropRequest.accountIds); + equalsNullable(this.roundType, priceDropRequest.roundType) && + equalsNullable(this.roundStep, priceDropRequest.roundStep) && + equalsNullable(this.accountIds, priceDropRequest.accountIds); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(type, value, roundType, roundStep, accountIds); + return Objects.hash(type, value, hashCodeNullable(roundType), hashCodeNullable(roundStep), hashCodeNullable(accountIds)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/PublishRequest.java b/src/main/java/com/controlresell/sdk/generated/model/PublishRequest.java index bfb1c71..b603ebb 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/PublishRequest.java +++ b/src/main/java/com/controlresell/sdk/generated/model/PublishRequest.java @@ -28,6 +28,10 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,8 +50,7 @@ public class PublishRequest { private List accountIds = new ArrayList<>(); public static final String JSON_PROPERTY_CANCEL_BEFORE_PROCEEDING = "cancelBeforeProceeding"; - @jakarta.annotation.Nullable - private Boolean cancelBeforeProceeding; + private JsonNullable cancelBeforeProceeding = JsonNullable.undefined(); public PublishRequest() { } @@ -85,7 +88,7 @@ public void setAccountIds(@jakarta.annotation.Nonnull List accountIds) { public PublishRequest cancelBeforeProceeding(@jakarta.annotation.Nullable Boolean cancelBeforeProceeding) { - this.cancelBeforeProceeding = cancelBeforeProceeding; + this.cancelBeforeProceeding = JsonNullable.of(cancelBeforeProceeding); return this; } @@ -94,19 +97,27 @@ public PublishRequest cancelBeforeProceeding(@jakarta.annotation.Nullable Boolea * @return cancelBeforeProceeding */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CANCEL_BEFORE_PROCEEDING, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Boolean getCancelBeforeProceeding() { - return cancelBeforeProceeding; + return cancelBeforeProceeding.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CANCEL_BEFORE_PROCEEDING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCancelBeforeProceeding(@jakarta.annotation.Nullable Boolean cancelBeforeProceeding) { + + public JsonNullable getCancelBeforeProceeding_JsonNullable() { + return cancelBeforeProceeding; + } + + @JsonProperty(JSON_PROPERTY_CANCEL_BEFORE_PROCEEDING) + public void setCancelBeforeProceeding_JsonNullable(JsonNullable cancelBeforeProceeding) { this.cancelBeforeProceeding = cancelBeforeProceeding; } + public void setCancelBeforeProceeding(@jakarta.annotation.Nullable Boolean cancelBeforeProceeding) { + this.cancelBeforeProceeding = JsonNullable.of(cancelBeforeProceeding); + } + /** * Return true if this PublishRequest object is equal to o. @@ -121,12 +132,23 @@ public boolean equals(Object o) { } PublishRequest publishRequest = (PublishRequest) o; return Objects.equals(this.accountIds, publishRequest.accountIds) && - Objects.equals(this.cancelBeforeProceeding, publishRequest.cancelBeforeProceeding); + equalsNullable(this.cancelBeforeProceeding, publishRequest.cancelBeforeProceeding); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(accountIds, cancelBeforeProceeding); + return Objects.hash(accountIds, hashCodeNullable(cancelBeforeProceeding)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/RepublishRequest.java b/src/main/java/com/controlresell/sdk/generated/model/RepublishRequest.java index 2c5d285..ea2f690 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/RepublishRequest.java +++ b/src/main/java/com/controlresell/sdk/generated/model/RepublishRequest.java @@ -29,6 +29,10 @@ import java.util.Arrays; import java.util.List; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -45,34 +49,34 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0") public class RepublishRequest { public static final String JSON_PROPERTY_ACCOUNT_IDS = "accountIds"; - @jakarta.annotation.Nullable - private List accountIds; + private JsonNullable> accountIds = JsonNullable.>undefined(); public static final String JSON_PROPERTY_PRICE_DROP = "priceDrop"; - @jakarta.annotation.Nullable - private PriceDropRequest priceDrop; + private JsonNullable priceDrop = JsonNullable.undefined(); public static final String JSON_PROPERTY_PRICE_VARIATION = "priceVariation"; - @jakarta.annotation.Nullable - private String priceVariation; + private JsonNullable priceVariation = JsonNullable.undefined(); public static final String JSON_PROPERTY_ALLOW_IF_DELETED = "allowIfDeleted"; - @jakarta.annotation.Nullable - private Boolean allowIfDeleted; + private JsonNullable allowIfDeleted = JsonNullable.undefined(); public RepublishRequest() { } public RepublishRequest accountIds(@jakarta.annotation.Nullable List accountIds) { - this.accountIds = accountIds; + this.accountIds = JsonNullable.>of(accountIds); return this; } public RepublishRequest addAccountIdsItem(UUID accountIdsItem) { - if (this.accountIds == null) { - this.accountIds = new ArrayList<>(); + if (this.accountIds == null || !this.accountIds.isPresent() || this.accountIds.get() == null) { + this.accountIds = JsonNullable.>of(new ArrayList<>()); + } + try { + this.accountIds.get().add(accountIdsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.accountIds.add(accountIdsItem); return this; } @@ -81,22 +85,30 @@ public RepublishRequest addAccountIdsItem(UUID accountIdsItem) { * @return accountIds */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ACCOUNT_IDS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public List getAccountIds() { - return accountIds; + return accountIds.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ACCOUNT_IDS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAccountIds(@jakarta.annotation.Nullable List accountIds) { + + public JsonNullable> getAccountIds_JsonNullable() { + return accountIds; + } + + @JsonProperty(JSON_PROPERTY_ACCOUNT_IDS) + public void setAccountIds_JsonNullable(JsonNullable> accountIds) { this.accountIds = accountIds; } + public void setAccountIds(@jakarta.annotation.Nullable List accountIds) { + this.accountIds = JsonNullable.>of(accountIds); + } + public RepublishRequest priceDrop(@jakarta.annotation.Nullable PriceDropRequest priceDrop) { - this.priceDrop = priceDrop; + this.priceDrop = JsonNullable.of(priceDrop); return this; } @@ -105,22 +117,30 @@ public RepublishRequest priceDrop(@jakarta.annotation.Nullable PriceDropRequest * @return priceDrop */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PRICE_DROP, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public PriceDropRequest getPriceDrop() { - return priceDrop; + return priceDrop.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PRICE_DROP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPriceDrop(@jakarta.annotation.Nullable PriceDropRequest priceDrop) { + + public JsonNullable getPriceDrop_JsonNullable() { + return priceDrop; + } + + @JsonProperty(JSON_PROPERTY_PRICE_DROP) + public void setPriceDrop_JsonNullable(JsonNullable priceDrop) { this.priceDrop = priceDrop; } + public void setPriceDrop(@jakarta.annotation.Nullable PriceDropRequest priceDrop) { + this.priceDrop = JsonNullable.of(priceDrop); + } + public RepublishRequest priceVariation(@jakarta.annotation.Nullable String priceVariation) { - this.priceVariation = priceVariation; + this.priceVariation = JsonNullable.of(priceVariation); return this; } @@ -129,22 +149,30 @@ public RepublishRequest priceVariation(@jakarta.annotation.Nullable String price * @return priceVariation */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PRICE_VARIATION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getPriceVariation() { - return priceVariation; + return priceVariation.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PRICE_VARIATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPriceVariation(@jakarta.annotation.Nullable String priceVariation) { + + public JsonNullable getPriceVariation_JsonNullable() { + return priceVariation; + } + + @JsonProperty(JSON_PROPERTY_PRICE_VARIATION) + public void setPriceVariation_JsonNullable(JsonNullable priceVariation) { this.priceVariation = priceVariation; } + public void setPriceVariation(@jakarta.annotation.Nullable String priceVariation) { + this.priceVariation = JsonNullable.of(priceVariation); + } + public RepublishRequest allowIfDeleted(@jakarta.annotation.Nullable Boolean allowIfDeleted) { - this.allowIfDeleted = allowIfDeleted; + this.allowIfDeleted = JsonNullable.of(allowIfDeleted); return this; } @@ -153,19 +181,27 @@ public RepublishRequest allowIfDeleted(@jakarta.annotation.Nullable Boolean allo * @return allowIfDeleted */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ALLOW_IF_DELETED, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Boolean getAllowIfDeleted() { - return allowIfDeleted; + return allowIfDeleted.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ALLOW_IF_DELETED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAllowIfDeleted(@jakarta.annotation.Nullable Boolean allowIfDeleted) { + + public JsonNullable getAllowIfDeleted_JsonNullable() { + return allowIfDeleted; + } + + @JsonProperty(JSON_PROPERTY_ALLOW_IF_DELETED) + public void setAllowIfDeleted_JsonNullable(JsonNullable allowIfDeleted) { this.allowIfDeleted = allowIfDeleted; } + public void setAllowIfDeleted(@jakarta.annotation.Nullable Boolean allowIfDeleted) { + this.allowIfDeleted = JsonNullable.of(allowIfDeleted); + } + /** * Return true if this RepublishRequest object is equal to o. @@ -179,15 +215,26 @@ public boolean equals(Object o) { return false; } RepublishRequest republishRequest = (RepublishRequest) o; - return Objects.equals(this.accountIds, republishRequest.accountIds) && - Objects.equals(this.priceDrop, republishRequest.priceDrop) && - Objects.equals(this.priceVariation, republishRequest.priceVariation) && - Objects.equals(this.allowIfDeleted, republishRequest.allowIfDeleted); + return equalsNullable(this.accountIds, republishRequest.accountIds) && + equalsNullable(this.priceDrop, republishRequest.priceDrop) && + equalsNullable(this.priceVariation, republishRequest.priceVariation) && + equalsNullable(this.allowIfDeleted, republishRequest.allowIfDeleted); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(accountIds, priceDrop, priceVariation, allowIfDeleted); + return Objects.hash(hashCodeNullable(accountIds), hashCodeNullable(priceDrop), hashCodeNullable(priceVariation), hashCodeNullable(allowIfDeleted)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/main/java/com/controlresell/sdk/generated/model/SendOfferRequest.java b/src/main/java/com/controlresell/sdk/generated/model/SendOfferRequest.java index d4e32b3..61af4df 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/SendOfferRequest.java +++ b/src/main/java/com/controlresell/sdk/generated/model/SendOfferRequest.java @@ -27,6 +27,10 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; import java.util.UUID; +import org.openapitools.jackson.nullable.JsonNullable; +import com.fasterxml.jackson.annotation.JsonIgnore; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -45,8 +49,7 @@ public class SendOfferRequest { private Money price; public static final String JSON_PROPERTY_TRANSACTION_ID = "transactionId"; - @jakarta.annotation.Nullable - private UUID transactionId; + private JsonNullable transactionId = JsonNullable.undefined(); public SendOfferRequest() { } @@ -76,7 +79,7 @@ public void setPrice(@jakarta.annotation.Nonnull Money price) { public SendOfferRequest transactionId(@jakarta.annotation.Nullable UUID transactionId) { - this.transactionId = transactionId; + this.transactionId = JsonNullable.of(transactionId); return this; } @@ -85,19 +88,27 @@ public SendOfferRequest transactionId(@jakarta.annotation.Nullable UUID transact * @return transactionId */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_TRANSACTION_ID, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public UUID getTransactionId() { - return transactionId; + return transactionId.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_TRANSACTION_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTransactionId(@jakarta.annotation.Nullable UUID transactionId) { + + public JsonNullable getTransactionId_JsonNullable() { + return transactionId; + } + + @JsonProperty(JSON_PROPERTY_TRANSACTION_ID) + public void setTransactionId_JsonNullable(JsonNullable transactionId) { this.transactionId = transactionId; } + public void setTransactionId(@jakarta.annotation.Nullable UUID transactionId) { + this.transactionId = JsonNullable.of(transactionId); + } + /** * Return true if this SendOfferRequest object is equal to o. @@ -112,12 +123,23 @@ public boolean equals(Object o) { } SendOfferRequest sendOfferRequest = (SendOfferRequest) o; return Objects.equals(this.price, sendOfferRequest.price) && - Objects.equals(this.transactionId, sendOfferRequest.transactionId); + equalsNullable(this.transactionId, sendOfferRequest.transactionId); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); } @Override public int hashCode() { - return Objects.hash(price, transactionId); + return Objects.hash(price, hashCodeNullable(transactionId)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/src/test/java/com/controlresell/sdk/ControlResellTest.java b/src/test/java/com/controlresell/sdk/ControlResellTest.java index 7f9091b..d29a5ac 100644 --- a/src/test/java/com/controlresell/sdk/ControlResellTest.java +++ b/src/test/java/com/controlresell/sdk/ControlResellTest.java @@ -270,6 +270,18 @@ void createPostsTheItemWithAKeyAndUpdatePatchesItWithoutOne() throws Exception { assertNull(keys.get(1)); } + @Test + void updateSendsAnExplicitNullToClearAFieldAndOmitsAnUnsetOne() throws Exception { + ControlResell sdk = client(n -> new Reply(200, item(7, "WOMEN"))); + sdk.items().update(7, new com.controlresell.sdk.generated.model.ItemUpdateRequest() + .packageSizeId(null).sellingPlaceId(12L).materialIds(List.of(3L))); + String body = bodies.get(0); + assertTrue(body.contains("\"packageSizeId\":null"), body); + assertTrue(body.contains("\"sellingPlaceId\":12"), body); + assertTrue(body.contains("\"materialIds\":[3]"), body); + assertTrue(!body.contains("measurementLength") && !body.contains("purchasePlaceId"), body); + } + private static String order(String platformOrderId) { return "{\"id\":\"" + ACCOUNT + "\",\"accountId\":\"" + ACCOUNT + "\",\"type\":\"SALE\",\"status\":\"PAID\"," + "\"platformOrderId\":\"" + platformOrderId + "\",\"price\":{\"amount\":\"12.50\",\"currency\":\"EUR\"},"