From dd26aa6bb3e4e533f3b47b772b7b25d71e24222d Mon Sep 17 00:00:00 2001 From: Smart Mekiliuwa Date: Mon, 20 Jul 2026 11:36:28 +0100 Subject: [PATCH 1/2] feat: regenerate client from corrected openapi spec regenerated the java client from the spec produced by frain-dev/convoy#2742, which fixes nullable object/map handling, the bearer auth security scheme, json-only onboard, and portal link endpoints_metadata nullability. --- .../java/com/getconvoy/api/OnboardApi.java | 32 +- .../com/getconvoy/models/AuthRoleType.java | 4 +- .../models/ConfigRequestIDHeaderProvider.java | 4 +- .../models/ConfigSignatureHeaderProvider.java | 4 +- .../models/DatastoreAPIKeyResponse.java | 42 ++- .../models/DatastoreAmqpPubSubConfig.java | 117 +++++-- .../models/DatastoreDeliveryAttempt.java | 162 ++++++--- .../models/DatastoreDeliveryMode.java | 4 +- .../com/getconvoy/models/DatastoreDevice.java | 42 ++- .../models/DatastoreDeviceStatus.java | 4 +- .../models/DatastoreEncodingType.java | 4 +- .../getconvoy/models/DatastoreEndpoint.java | 242 ++++++++----- .../DatastoreEndpointAuthentication.java | 92 +++-- .../DatastoreEndpointAuthenticationType.java | 4 +- .../models/DatastoreEndpointStatus.java | 4 +- .../com/getconvoy/models/DatastoreEvent.java | 162 ++++++--- .../models/DatastoreEventDeliveryStatus.java | 4 +- .../models/DatastoreEventStatus.java | 4 +- .../models/DatastoreFilterSchema.java | 157 ++++++--- .../models/DatastoreKafkaPubSubConfig.java | 42 ++- .../models/DatastoreMetaEventAttempt.java | 87 +++-- .../DatastoreMetaEventConfiguration.java | 42 ++- .../models/DatastoreMetaEventType.java | 4 +- .../getconvoy/models/DatastoreMetadata.java | 52 ++- .../com/getconvoy/models/DatastoreOAuth2.java | 67 ++-- .../DatastoreOAuth2AuthenticationType.java | 4 +- .../models/DatastoreOAuth2ExpiryTimeUnit.java | 4 +- .../models/DatastorePageDirection.java | 4 +- .../models/DatastorePortalAuthType.java | 4 +- .../models/DatastorePortalLinkResponse.java | 42 ++- .../models/DatastoreProjectConfig.java | 167 ++++++--- .../models/DatastoreProjectType.java | 4 +- .../models/DatastoreProviderConfig.java | 42 ++- .../models/DatastorePubSubConfig.java | 117 +++++-- .../getconvoy/models/DatastorePubSubType.java | 4 +- .../com/getconvoy/models/DatastoreSecret.java | 67 ++-- .../com/getconvoy/models/DatastoreSource.java | 167 ++++++--- .../models/DatastoreSourceProvider.java | 4 +- .../getconvoy/models/DatastoreSourceType.java | 4 +- .../models/DatastoreStrategyProvider.java | 4 +- .../models/DatastoreSubscriptionType.java | 4 +- .../DatastoreTwitterProviderConfig.java | 42 ++- .../models/DatastoreVerifierConfig.java | 92 +++-- .../models/DatastoreVerifierType.java | 4 +- .../models/GetProjects400Response.java | 68 +++- .../models/ModelsBroadcastEvent.java | 87 +++-- .../models/ModelsBulkUpdateFilterRequest.java | 157 ++++++--- .../getconvoy/models/ModelsCreateEvent.java | 87 +++-- .../models/ModelsCreateEventType.java | 52 ++- .../models/ModelsCreateFilterRequest.java | 157 ++++++--- .../getconvoy/models/ModelsDynamicEvent.java | 87 +++-- .../models/ModelsEndpointResponse.java | 242 ++++++++----- .../models/ModelsEventDeliveryResponse.java | 252 +++++++++----- .../getconvoy/models/ModelsEventResponse.java | 162 ++++++--- .../models/ModelsEventTypeResponse.java | 77 +++-- .../java/com/getconvoy/models/ModelsFS.java | 157 ++++++--- .../getconvoy/models/ModelsFanoutEvent.java | 87 +++-- .../models/ModelsFilterResponse.java | 322 ++++++++++++------ .../models/ModelsFunctionRequest.java | 52 ++- .../models/ModelsMetaEventResponse.java | 92 +++-- .../models/ModelsProjectResponse.java | 92 +++-- .../models/ModelsSourceResponse.java | 167 ++++++--- .../models/ModelsSubscriptionResponse.java | 242 ++++++++----- .../models/ModelsTestFilterRequestScopes.java | 142 +++++--- .../models/ModelsUpdateEventType.java | 52 ++- .../models/ModelsUpdateFilterRequest.java | 157 ++++++--- 66 files changed, 3555 insertions(+), 1597 deletions(-) diff --git a/src/main/java/com/getconvoy/api/OnboardApi.java b/src/main/java/com/getconvoy/api/OnboardApi.java index a1f3dfc..e506e95 100644 --- a/src/main/java/com/getconvoy/api/OnboardApi.java +++ b/src/main/java/com/getconvoy/api/OnboardApi.java @@ -20,8 +20,8 @@ import com.getconvoy.models.BulkOnboard200Response; import com.getconvoy.models.BulkOnboard202Response; -import java.io.File; import com.getconvoy.models.GetProjects400Response; +import com.getconvoy.models.ModelsBulkOnboardRequest; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; @@ -170,12 +170,12 @@ private File prepareDownloadFile(HttpResponse response) throws IOEx * This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions * @param projectID Project ID (required) * @param dryRun Validate without creating (optional) - * @param body Onboard Details (JSON) (optional) + * @param modelsBulkOnboardRequest Onboard Details (JSON) (optional) * @return BulkOnboard200Response * @throws ApiException if fails to make API call */ - public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body) throws ApiException { - return bulkOnboard(projectID, dryRun, body, null); + public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable ModelsBulkOnboardRequest modelsBulkOnboardRequest) throws ApiException { + return bulkOnboard(projectID, dryRun, modelsBulkOnboardRequest, null); } /** @@ -183,13 +183,13 @@ public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String pro * This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions * @param projectID Project ID (required) * @param dryRun Validate without creating (optional) - * @param body Onboard Details (JSON) (optional) + * @param modelsBulkOnboardRequest Onboard Details (JSON) (optional) * @param headers Optional headers to include in the request * @return BulkOnboard200Response * @throws ApiException if fails to make API call */ - public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body, Map headers) throws ApiException { - ApiResponse localVarResponse = bulkOnboardWithHttpInfo(projectID, dryRun, body, headers); + public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable ModelsBulkOnboardRequest modelsBulkOnboardRequest, Map headers) throws ApiException { + ApiResponse localVarResponse = bulkOnboardWithHttpInfo(projectID, dryRun, modelsBulkOnboardRequest, headers); return localVarResponse.getData(); } @@ -198,12 +198,12 @@ public BulkOnboard200Response bulkOnboard(@jakarta.annotation.Nonnull String pro * This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions * @param projectID Project ID (required) * @param dryRun Validate without creating (optional) - * @param body Onboard Details (JSON) (optional) + * @param modelsBulkOnboardRequest Onboard Details (JSON) (optional) * @return ApiResponse<BulkOnboard200Response> * @throws ApiException if fails to make API call */ - public ApiResponse bulkOnboardWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body) throws ApiException { - return bulkOnboardWithHttpInfo(projectID, dryRun, body, null); + public ApiResponse bulkOnboardWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable ModelsBulkOnboardRequest modelsBulkOnboardRequest) throws ApiException { + return bulkOnboardWithHttpInfo(projectID, dryRun, modelsBulkOnboardRequest, null); } /** @@ -211,13 +211,13 @@ public ApiResponse bulkOnboardWithHttpInfo(@jakarta.anno * This endpoint accepts a CSV file or JSON body to bulk-create endpoints with subscriptions * @param projectID Project ID (required) * @param dryRun Validate without creating (optional) - * @param body Onboard Details (JSON) (optional) + * @param modelsBulkOnboardRequest Onboard Details (JSON) (optional) * @param headers Optional headers to include in the request * @return ApiResponse<BulkOnboard200Response> * @throws ApiException if fails to make API call */ - public ApiResponse bulkOnboardWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body, Map headers) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = bulkOnboardRequestBuilder(projectID, dryRun, body, headers); + public ApiResponse bulkOnboardWithHttpInfo(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable ModelsBulkOnboardRequest modelsBulkOnboardRequest, Map headers) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = bulkOnboardRequestBuilder(projectID, dryRun, modelsBulkOnboardRequest, headers); try { HttpResponse localVarResponse = memberVarHttpClient.send( localVarRequestBuilder.build(), @@ -264,7 +264,7 @@ public ApiResponse bulkOnboardWithHttpInfo(@jakarta.anno } } - private HttpRequest.Builder bulkOnboardRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable File body, Map headers) throws ApiException { + private HttpRequest.Builder bulkOnboardRequestBuilder(@jakarta.annotation.Nonnull String projectID, @jakarta.annotation.Nullable Boolean dryRun, @jakarta.annotation.Nullable ModelsBulkOnboardRequest modelsBulkOnboardRequest, Map headers) throws ApiException { // verify the required parameter 'projectID' is set if (projectID == null) { throw new ApiException(400, "Missing the required parameter 'projectID' when calling bulkOnboard"); @@ -292,11 +292,11 @@ private HttpRequest.Builder bulkOnboardRequestBuilder(@jakarta.annotation.Nonnul localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); } - localVarRequestBuilder.header("Content-Type", "application/octet-stream"); + localVarRequestBuilder.header("Content-Type", "application/json"); localVarRequestBuilder.header("Accept", "application/json"); try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(modelsBulkOnboardRequest); localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); } catch (IOException e) { throw new ApiException(e); diff --git a/src/main/java/com/getconvoy/models/AuthRoleType.java b/src/main/java/com/getconvoy/models/AuthRoleType.java index c7d6271..7af6f9c 100644 --- a/src/main/java/com/getconvoy/models/AuthRoleType.java +++ b/src/main/java/com/getconvoy/models/AuthRoleType.java @@ -58,7 +58,9 @@ public enum AuthRoleType { /** * */ - RoleAPI("api"); + RoleAPI("api"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/ConfigRequestIDHeaderProvider.java b/src/main/java/com/getconvoy/models/ConfigRequestIDHeaderProvider.java index 00fc245..f425077 100644 --- a/src/main/java/com/getconvoy/models/ConfigRequestIDHeaderProvider.java +++ b/src/main/java/com/getconvoy/models/ConfigRequestIDHeaderProvider.java @@ -30,7 +30,9 @@ */ public enum ConfigRequestIDHeaderProvider { - DefaultRequestIDHeader("X-Convoy-Idempotency-Key"); + DefaultRequestIDHeader("X-Convoy-Idempotency-Key"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/ConfigSignatureHeaderProvider.java b/src/main/java/com/getconvoy/models/ConfigSignatureHeaderProvider.java index ca334f1..c3d0c03 100644 --- a/src/main/java/com/getconvoy/models/ConfigSignatureHeaderProvider.java +++ b/src/main/java/com/getconvoy/models/ConfigSignatureHeaderProvider.java @@ -30,7 +30,9 @@ */ public enum ConfigSignatureHeaderProvider { - DefaultSignatureHeader("X-Convoy-Signature"); + DefaultSignatureHeader("X-Convoy-Signature"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreAPIKeyResponse.java b/src/main/java/com/getconvoy/models/DatastoreAPIKeyResponse.java index deb6ccc..0f2d468 100644 --- a/src/main/java/com/getconvoy/models/DatastoreAPIKeyResponse.java +++ b/src/main/java/com/getconvoy/models/DatastoreAPIKeyResponse.java @@ -26,6 +26,10 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.getconvoy.models.DatastoreRole; 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; @@ -50,8 +54,7 @@ public class DatastoreAPIKeyResponse { private String createdAt; public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @jakarta.annotation.Nullable - private String expiresAt; + private JsonNullable expiresAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_KEY = "key"; @jakarta.annotation.Nullable @@ -105,7 +108,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public DatastoreAPIKeyResponse expiresAt(@jakarta.annotation.Nullable String expiresAt) { - this.expiresAt = expiresAt; + this.expiresAt = JsonNullable.of(expiresAt); return this; } @@ -114,19 +117,27 @@ public DatastoreAPIKeyResponse expiresAt(@jakarta.annotation.Nullable String exp * @return expiresAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getExpiresAt() { - return expiresAt; + return expiresAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@jakarta.annotation.Nullable String expiresAt) { + + public JsonNullable getExpiresAt_JsonNullable() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + public void setExpiresAt_JsonNullable(JsonNullable expiresAt) { this.expiresAt = expiresAt; } + public void setExpiresAt(@jakarta.annotation.Nullable String expiresAt) { + this.expiresAt = JsonNullable.of(expiresAt); + } + public DatastoreAPIKeyResponse key(@jakarta.annotation.Nullable String key) { this.key = key; @@ -285,7 +296,7 @@ public boolean equals(Object o) { } DatastoreAPIKeyResponse datastoreAPIKeyResponse = (DatastoreAPIKeyResponse) o; return Objects.equals(this.createdAt, datastoreAPIKeyResponse.createdAt) && - Objects.equals(this.expiresAt, datastoreAPIKeyResponse.expiresAt) && + equalsNullable(this.expiresAt, datastoreAPIKeyResponse.expiresAt) && Objects.equals(this.key, datastoreAPIKeyResponse.key) && Objects.equals(this.keyType, datastoreAPIKeyResponse.keyType) && Objects.equals(this.name, datastoreAPIKeyResponse.name) && @@ -294,9 +305,20 @@ public boolean equals(Object o) { Objects.equals(this.userId, datastoreAPIKeyResponse.userId); } + 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(createdAt, expiresAt, key, keyType, name, role, uid, userId); + return Objects.hash(createdAt, hashCodeNullable(expiresAt), key, keyType, name, role, uid, userId); + } + + 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/getconvoy/models/DatastoreAmqpPubSubConfig.java b/src/main/java/com/getconvoy/models/DatastoreAmqpPubSubConfig.java index f19dc69..2f8716a 100644 --- a/src/main/java/com/getconvoy/models/DatastoreAmqpPubSubConfig.java +++ b/src/main/java/com/getconvoy/models/DatastoreAmqpPubSubConfig.java @@ -26,6 +26,10 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.getconvoy.models.DatastoreAmqpCredentials; 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; @@ -51,16 +55,13 @@ public class DatastoreAmqpPubSubConfig { private String host; public static final String JSON_PROPERTY_AUTH = "auth"; - @jakarta.annotation.Nullable - private DatastoreAmqpCredentials auth; + private JsonNullable auth = JsonNullable.undefined(); public static final String JSON_PROPERTY_BINDED_EXCHANGE = "bindedExchange"; - @jakarta.annotation.Nullable - private String bindedExchange; + private JsonNullable bindedExchange = JsonNullable.undefined(); public static final String JSON_PROPERTY_DEAD_LETTER_EXCHANGE = "deadLetterExchange"; - @jakarta.annotation.Nullable - private String deadLetterExchange; + private JsonNullable deadLetterExchange = JsonNullable.undefined(); public static final String JSON_PROPERTY_PORT = "port"; @jakarta.annotation.Nullable @@ -79,8 +80,7 @@ public class DatastoreAmqpPubSubConfig { private String schema; public static final String JSON_PROPERTY_VHOST = "vhost"; - @jakarta.annotation.Nullable - private String vhost; + private JsonNullable vhost = JsonNullable.undefined(); public DatastoreAmqpPubSubConfig() { } @@ -110,7 +110,7 @@ public void setHost(@jakarta.annotation.Nullable String host) { public DatastoreAmqpPubSubConfig auth(@jakarta.annotation.Nullable DatastoreAmqpCredentials auth) { - this.auth = auth; + this.auth = JsonNullable.of(auth); return this; } @@ -119,22 +119,30 @@ public DatastoreAmqpPubSubConfig auth(@jakarta.annotation.Nullable DatastoreAmqp * @return auth */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreAmqpCredentials getAuth() { - return auth; + return auth.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAuth(@jakarta.annotation.Nullable DatastoreAmqpCredentials auth) { + + public JsonNullable getAuth_JsonNullable() { + return auth; + } + + @JsonProperty(JSON_PROPERTY_AUTH) + public void setAuth_JsonNullable(JsonNullable auth) { this.auth = auth; } + public void setAuth(@jakarta.annotation.Nullable DatastoreAmqpCredentials auth) { + this.auth = JsonNullable.of(auth); + } + public DatastoreAmqpPubSubConfig bindedExchange(@jakarta.annotation.Nullable String bindedExchange) { - this.bindedExchange = bindedExchange; + this.bindedExchange = JsonNullable.of(bindedExchange); return this; } @@ -143,22 +151,30 @@ public DatastoreAmqpPubSubConfig bindedExchange(@jakarta.annotation.Nullable Str * @return bindedExchange */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BINDED_EXCHANGE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getBindedExchange() { - return bindedExchange; + return bindedExchange.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BINDED_EXCHANGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBindedExchange(@jakarta.annotation.Nullable String bindedExchange) { + + public JsonNullable getBindedExchange_JsonNullable() { + return bindedExchange; + } + + @JsonProperty(JSON_PROPERTY_BINDED_EXCHANGE) + public void setBindedExchange_JsonNullable(JsonNullable bindedExchange) { this.bindedExchange = bindedExchange; } + public void setBindedExchange(@jakarta.annotation.Nullable String bindedExchange) { + this.bindedExchange = JsonNullable.of(bindedExchange); + } + public DatastoreAmqpPubSubConfig deadLetterExchange(@jakarta.annotation.Nullable String deadLetterExchange) { - this.deadLetterExchange = deadLetterExchange; + this.deadLetterExchange = JsonNullable.of(deadLetterExchange); return this; } @@ -167,19 +183,27 @@ public DatastoreAmqpPubSubConfig deadLetterExchange(@jakarta.annotation.Nullable * @return deadLetterExchange */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DEAD_LETTER_EXCHANGE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeadLetterExchange() { - return deadLetterExchange; + return deadLetterExchange.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DEAD_LETTER_EXCHANGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeadLetterExchange(@jakarta.annotation.Nullable String deadLetterExchange) { + + public JsonNullable getDeadLetterExchange_JsonNullable() { + return deadLetterExchange; + } + + @JsonProperty(JSON_PROPERTY_DEAD_LETTER_EXCHANGE) + public void setDeadLetterExchange_JsonNullable(JsonNullable deadLetterExchange) { this.deadLetterExchange = deadLetterExchange; } + public void setDeadLetterExchange(@jakarta.annotation.Nullable String deadLetterExchange) { + this.deadLetterExchange = JsonNullable.of(deadLetterExchange); + } + public DatastoreAmqpPubSubConfig port(@jakarta.annotation.Nullable String port) { this.port = port; @@ -278,7 +302,7 @@ public void setSchema(@jakarta.annotation.Nullable String schema) { public DatastoreAmqpPubSubConfig vhost(@jakarta.annotation.Nullable String vhost) { - this.vhost = vhost; + this.vhost = JsonNullable.of(vhost); return this; } @@ -287,19 +311,27 @@ public DatastoreAmqpPubSubConfig vhost(@jakarta.annotation.Nullable String vhost * @return vhost */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_VHOST, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getVhost() { - return vhost; + return vhost.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_VHOST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setVhost(@jakarta.annotation.Nullable String vhost) { + + public JsonNullable getVhost_JsonNullable() { + return vhost; + } + + @JsonProperty(JSON_PROPERTY_VHOST) + public void setVhost_JsonNullable(JsonNullable vhost) { this.vhost = vhost; } + public void setVhost(@jakarta.annotation.Nullable String vhost) { + this.vhost = JsonNullable.of(vhost); + } + /** * Return true if this datastore.AmqpPubSubConfig object is equal to o. @@ -314,19 +346,30 @@ public boolean equals(Object o) { } DatastoreAmqpPubSubConfig datastoreAmqpPubSubConfig = (DatastoreAmqpPubSubConfig) o; return Objects.equals(this.host, datastoreAmqpPubSubConfig.host) && - Objects.equals(this.auth, datastoreAmqpPubSubConfig.auth) && - Objects.equals(this.bindedExchange, datastoreAmqpPubSubConfig.bindedExchange) && - Objects.equals(this.deadLetterExchange, datastoreAmqpPubSubConfig.deadLetterExchange) && + equalsNullable(this.auth, datastoreAmqpPubSubConfig.auth) && + equalsNullable(this.bindedExchange, datastoreAmqpPubSubConfig.bindedExchange) && + equalsNullable(this.deadLetterExchange, datastoreAmqpPubSubConfig.deadLetterExchange) && Objects.equals(this.port, datastoreAmqpPubSubConfig.port) && Objects.equals(this.queue, datastoreAmqpPubSubConfig.queue) && Objects.equals(this.routingKey, datastoreAmqpPubSubConfig.routingKey) && Objects.equals(this.schema, datastoreAmqpPubSubConfig.schema) && - Objects.equals(this.vhost, datastoreAmqpPubSubConfig.vhost); + equalsNullable(this.vhost, datastoreAmqpPubSubConfig.vhost); + } + + 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(host, auth, bindedExchange, deadLetterExchange, port, queue, routingKey, schema, vhost); + return Objects.hash(host, hashCodeNullable(auth), hashCodeNullable(bindedExchange), hashCodeNullable(deadLetterExchange), port, queue, routingKey, schema, hashCodeNullable(vhost)); + } + + 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/getconvoy/models/DatastoreDeliveryAttempt.java b/src/main/java/com/getconvoy/models/DatastoreDeliveryAttempt.java index 7064086..2c41b92 100644 --- a/src/main/java/com/getconvoy/models/DatastoreDeliveryAttempt.java +++ b/src/main/java/com/getconvoy/models/DatastoreDeliveryAttempt.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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; @@ -66,8 +70,7 @@ public class DatastoreDeliveryAttempt { private String createdAt; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_ENDPOINT_ID = "endpoint_id"; @jakarta.annotation.Nullable @@ -98,24 +101,20 @@ public class DatastoreDeliveryAttempt { private String projectId; public static final String JSON_PROPERTY_REQUEST_HTTP_HEADER = "request_http_header"; - @jakarta.annotation.Nullable - private Map requestHttpHeader = new HashMap<>(); + private JsonNullable> requestHttpHeader = JsonNullable.>undefined(); public static final String JSON_PROPERTY_REQUESTED_AT = "requested_at"; - @jakarta.annotation.Nullable - private String requestedAt; + private JsonNullable requestedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_RESPONDED_AT = "responded_at"; - @jakarta.annotation.Nullable - private String respondedAt; + private JsonNullable respondedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; @jakarta.annotation.Nullable private String responseData; public static final String JSON_PROPERTY_RESPONSE_HTTP_HEADER = "response_http_header"; - @jakarta.annotation.Nullable - private Map responseHttpHeader = new HashMap<>(); + private JsonNullable> responseHttpHeader = JsonNullable.>undefined(); public static final String JSON_PROPERTY_STATUS = "status"; @jakarta.annotation.Nullable @@ -185,7 +184,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public DatastoreDeliveryAttempt deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -194,19 +193,27 @@ public DatastoreDeliveryAttempt deletedAt(@jakarta.annotation.Nullable String de * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public DatastoreDeliveryAttempt endpointId(@jakarta.annotation.Nullable String endpointId) { this.endpointId = endpointId; @@ -377,15 +384,19 @@ public void setProjectId(@jakarta.annotation.Nullable String projectId) { public DatastoreDeliveryAttempt requestHttpHeader(@jakarta.annotation.Nullable Map requestHttpHeader) { - this.requestHttpHeader = requestHttpHeader; + this.requestHttpHeader = JsonNullable.>of(requestHttpHeader); return this; } public DatastoreDeliveryAttempt putRequestHttpHeaderItem(String key, String requestHttpHeaderItem) { - if (this.requestHttpHeader == null) { - this.requestHttpHeader = new HashMap<>(); + if (this.requestHttpHeader == null || !this.requestHttpHeader.isPresent()) { + this.requestHttpHeader = JsonNullable.>of(new HashMap<>()); + } + try { + this.requestHttpHeader.get().put(key, requestHttpHeaderItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.requestHttpHeader.put(key, requestHttpHeaderItem); return this; } @@ -394,22 +405,30 @@ public DatastoreDeliveryAttempt putRequestHttpHeaderItem(String key, String requ * @return requestHttpHeader */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_REQUEST_HTTP_HEADER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getRequestHttpHeader() { - return requestHttpHeader; + return requestHttpHeader.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_REQUEST_HTTP_HEADER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestHttpHeader(@jakarta.annotation.Nullable Map requestHttpHeader) { + + public JsonNullable> getRequestHttpHeader_JsonNullable() { + return requestHttpHeader; + } + + @JsonProperty(JSON_PROPERTY_REQUEST_HTTP_HEADER) + public void setRequestHttpHeader_JsonNullable(JsonNullable> requestHttpHeader) { this.requestHttpHeader = requestHttpHeader; } + public void setRequestHttpHeader(@jakarta.annotation.Nullable Map requestHttpHeader) { + this.requestHttpHeader = JsonNullable.>of(requestHttpHeader); + } + public DatastoreDeliveryAttempt requestedAt(@jakarta.annotation.Nullable String requestedAt) { - this.requestedAt = requestedAt; + this.requestedAt = JsonNullable.of(requestedAt); return this; } @@ -418,22 +437,30 @@ public DatastoreDeliveryAttempt requestedAt(@jakarta.annotation.Nullable String * @return requestedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_REQUESTED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getRequestedAt() { - return requestedAt; + return requestedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_REQUESTED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestedAt(@jakarta.annotation.Nullable String requestedAt) { + + public JsonNullable getRequestedAt_JsonNullable() { + return requestedAt; + } + + @JsonProperty(JSON_PROPERTY_REQUESTED_AT) + public void setRequestedAt_JsonNullable(JsonNullable requestedAt) { this.requestedAt = requestedAt; } + public void setRequestedAt(@jakarta.annotation.Nullable String requestedAt) { + this.requestedAt = JsonNullable.of(requestedAt); + } + public DatastoreDeliveryAttempt respondedAt(@jakarta.annotation.Nullable String respondedAt) { - this.respondedAt = respondedAt; + this.respondedAt = JsonNullable.of(respondedAt); return this; } @@ -442,19 +469,27 @@ public DatastoreDeliveryAttempt respondedAt(@jakarta.annotation.Nullable String * @return respondedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RESPONDED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getRespondedAt() { - return respondedAt; + return respondedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RESPONDED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRespondedAt(@jakarta.annotation.Nullable String respondedAt) { + + public JsonNullable getRespondedAt_JsonNullable() { + return respondedAt; + } + + @JsonProperty(JSON_PROPERTY_RESPONDED_AT) + public void setRespondedAt_JsonNullable(JsonNullable respondedAt) { this.respondedAt = respondedAt; } + public void setRespondedAt(@jakarta.annotation.Nullable String respondedAt) { + this.respondedAt = JsonNullable.of(respondedAt); + } + public DatastoreDeliveryAttempt responseData(@jakarta.annotation.Nullable String responseData) { this.responseData = responseData; @@ -481,15 +516,19 @@ public void setResponseData(@jakarta.annotation.Nullable String responseData) { public DatastoreDeliveryAttempt responseHttpHeader(@jakarta.annotation.Nullable Map responseHttpHeader) { - this.responseHttpHeader = responseHttpHeader; + this.responseHttpHeader = JsonNullable.>of(responseHttpHeader); return this; } public DatastoreDeliveryAttempt putResponseHttpHeaderItem(String key, String responseHttpHeaderItem) { - if (this.responseHttpHeader == null) { - this.responseHttpHeader = new HashMap<>(); + if (this.responseHttpHeader == null || !this.responseHttpHeader.isPresent()) { + this.responseHttpHeader = JsonNullable.>of(new HashMap<>()); + } + try { + this.responseHttpHeader.get().put(key, responseHttpHeaderItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.responseHttpHeader.put(key, responseHttpHeaderItem); return this; } @@ -498,19 +537,27 @@ public DatastoreDeliveryAttempt putResponseHttpHeaderItem(String key, String res * @return responseHttpHeader */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RESPONSE_HTTP_HEADER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getResponseHttpHeader() { - return responseHttpHeader; + return responseHttpHeader.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RESPONSE_HTTP_HEADER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setResponseHttpHeader(@jakarta.annotation.Nullable Map responseHttpHeader) { + + public JsonNullable> getResponseHttpHeader_JsonNullable() { + return responseHttpHeader; + } + + @JsonProperty(JSON_PROPERTY_RESPONSE_HTTP_HEADER) + public void setResponseHttpHeader_JsonNullable(JsonNullable> responseHttpHeader) { this.responseHttpHeader = responseHttpHeader; } + public void setResponseHttpHeader(@jakarta.annotation.Nullable Map responseHttpHeader) { + this.responseHttpHeader = JsonNullable.>of(responseHttpHeader); + } + public DatastoreDeliveryAttempt status(@jakarta.annotation.Nullable Boolean status) { this.status = status; @@ -622,7 +669,7 @@ public boolean equals(Object o) { DatastoreDeliveryAttempt datastoreDeliveryAttempt = (DatastoreDeliveryAttempt) o; return Objects.equals(this.apiVersion, datastoreDeliveryAttempt.apiVersion) && Objects.equals(this.createdAt, datastoreDeliveryAttempt.createdAt) && - Objects.equals(this.deletedAt, datastoreDeliveryAttempt.deletedAt) && + equalsNullable(this.deletedAt, datastoreDeliveryAttempt.deletedAt) && Objects.equals(this.endpointId, datastoreDeliveryAttempt.endpointId) && Objects.equals(this.error, datastoreDeliveryAttempt.error) && Objects.equals(this.httpStatus, datastoreDeliveryAttempt.httpStatus) && @@ -630,20 +677,31 @@ public boolean equals(Object o) { Objects.equals(this.method, datastoreDeliveryAttempt.method) && Objects.equals(this.msgId, datastoreDeliveryAttempt.msgId) && Objects.equals(this.projectId, datastoreDeliveryAttempt.projectId) && - Objects.equals(this.requestHttpHeader, datastoreDeliveryAttempt.requestHttpHeader) && - Objects.equals(this.requestedAt, datastoreDeliveryAttempt.requestedAt) && - Objects.equals(this.respondedAt, datastoreDeliveryAttempt.respondedAt) && + equalsNullable(this.requestHttpHeader, datastoreDeliveryAttempt.requestHttpHeader) && + equalsNullable(this.requestedAt, datastoreDeliveryAttempt.requestedAt) && + equalsNullable(this.respondedAt, datastoreDeliveryAttempt.respondedAt) && Objects.equals(this.responseData, datastoreDeliveryAttempt.responseData) && - Objects.equals(this.responseHttpHeader, datastoreDeliveryAttempt.responseHttpHeader) && + equalsNullable(this.responseHttpHeader, datastoreDeliveryAttempt.responseHttpHeader) && Objects.equals(this.status, datastoreDeliveryAttempt.status) && Objects.equals(this.uid, datastoreDeliveryAttempt.uid) && Objects.equals(this.updatedAt, datastoreDeliveryAttempt.updatedAt) && Objects.equals(this.url, datastoreDeliveryAttempt.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(apiVersion, createdAt, deletedAt, endpointId, error, httpStatus, ipAddress, method, msgId, projectId, requestHttpHeader, requestedAt, respondedAt, responseData, responseHttpHeader, status, uid, updatedAt, url); + return Objects.hash(apiVersion, createdAt, hashCodeNullable(deletedAt), endpointId, error, httpStatus, ipAddress, method, msgId, projectId, hashCodeNullable(requestHttpHeader), hashCodeNullable(requestedAt), hashCodeNullable(respondedAt), responseData, hashCodeNullable(responseHttpHeader), status, uid, updatedAt, 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/getconvoy/models/DatastoreDeliveryMode.java b/src/main/java/com/getconvoy/models/DatastoreDeliveryMode.java index f328e7e..1ce3b91 100644 --- a/src/main/java/com/getconvoy/models/DatastoreDeliveryMode.java +++ b/src/main/java/com/getconvoy/models/DatastoreDeliveryMode.java @@ -32,7 +32,9 @@ public enum DatastoreDeliveryMode { AtLeastOnceDeliveryMode("at_least_once"), - AtMostOnceDeliveryMode("at_most_once"); + AtMostOnceDeliveryMode("at_most_once"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreDevice.java b/src/main/java/com/getconvoy/models/DatastoreDevice.java index 4b7f296..bd42048 100644 --- a/src/main/java/com/getconvoy/models/DatastoreDevice.java +++ b/src/main/java/com/getconvoy/models/DatastoreDevice.java @@ -26,6 +26,10 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.getconvoy.models.DatastoreDeviceStatus; 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; @@ -51,8 +55,7 @@ public class DatastoreDevice { private String createdAt; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_ENDPOINT_ID = "endpoint_id"; @jakarta.annotation.Nullable @@ -110,7 +113,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public DatastoreDevice deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -119,19 +122,27 @@ public DatastoreDevice deletedAt(@jakarta.annotation.Nullable String deletedAt) * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public DatastoreDevice endpointId(@jakarta.annotation.Nullable String endpointId) { this.endpointId = endpointId; @@ -314,7 +325,7 @@ public boolean equals(Object o) { } DatastoreDevice datastoreDevice = (DatastoreDevice) o; return Objects.equals(this.createdAt, datastoreDevice.createdAt) && - Objects.equals(this.deletedAt, datastoreDevice.deletedAt) && + equalsNullable(this.deletedAt, datastoreDevice.deletedAt) && Objects.equals(this.endpointId, datastoreDevice.endpointId) && Objects.equals(this.hostName, datastoreDevice.hostName) && Objects.equals(this.lastSeenAt, datastoreDevice.lastSeenAt) && @@ -324,9 +335,20 @@ public boolean equals(Object o) { Objects.equals(this.updatedAt, datastoreDevice.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(createdAt, deletedAt, endpointId, hostName, lastSeenAt, projectId, status, uid, updatedAt); + return Objects.hash(createdAt, hashCodeNullable(deletedAt), endpointId, hostName, lastSeenAt, projectId, status, uid, 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/getconvoy/models/DatastoreDeviceStatus.java b/src/main/java/com/getconvoy/models/DatastoreDeviceStatus.java index d35cb1a..64a9306 100644 --- a/src/main/java/com/getconvoy/models/DatastoreDeviceStatus.java +++ b/src/main/java/com/getconvoy/models/DatastoreDeviceStatus.java @@ -34,7 +34,9 @@ public enum DatastoreDeviceStatus { DeviceStatusOnline("online"), - DeviceStatusDisabled("disabled"); + DeviceStatusDisabled("disabled"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreEncodingType.java b/src/main/java/com/getconvoy/models/DatastoreEncodingType.java index 68135ac..744befc 100644 --- a/src/main/java/com/getconvoy/models/DatastoreEncodingType.java +++ b/src/main/java/com/getconvoy/models/DatastoreEncodingType.java @@ -32,7 +32,9 @@ public enum DatastoreEncodingType { Base64Encoding("base64"), - HexEncoding("hex"); + HexEncoding("hex"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreEndpoint.java b/src/main/java/com/getconvoy/models/DatastoreEndpoint.java index 0fb1858..c328125 100644 --- a/src/main/java/com/getconvoy/models/DatastoreEndpoint.java +++ b/src/main/java/com/getconvoy/models/DatastoreEndpoint.java @@ -32,6 +32,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; @@ -75,12 +79,10 @@ public class DatastoreEndpoint { private Boolean advancedSignatures; public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; - @jakarta.annotation.Nullable - private DatastoreEndpointAuthentication authentication; + private JsonNullable authentication = JsonNullable.undefined(); public static final String JSON_PROPERTY_CB_STATE = "cb_state"; - @jakarta.annotation.Nullable - private String cbState; + private JsonNullable cbState = JsonNullable.undefined(); public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; @jakarta.annotation.Nullable @@ -91,8 +93,7 @@ public class DatastoreEndpoint { private String createdAt; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_DESCRIPTION = "description"; @jakarta.annotation.Nullable @@ -103,20 +104,17 @@ public class DatastoreEndpoint { private Integer events; public static final String JSON_PROPERTY_FAILURE_COUNT = "failure_count"; - @jakarta.annotation.Nullable - private Integer failureCount; + private JsonNullable failureCount = JsonNullable.undefined(); public static final String JSON_PROPERTY_FAILURE_RATE = "failure_rate"; - @jakarta.annotation.Nullable - private BigDecimal failureRate; + private JsonNullable failureRate = JsonNullable.undefined(); public static final String JSON_PROPERTY_HTTP_TIMEOUT = "http_timeout"; @jakarta.annotation.Nullable private Integer httpTimeout; public static final String JSON_PROPERTY_MTLS_CLIENT_CERT = "mtls_client_cert"; - @jakarta.annotation.Nullable - private DatastoreMtlsClientCert mtlsClientCert; + private JsonNullable mtlsClientCert = JsonNullable.undefined(); public static final String JSON_PROPERTY_NAME = "name"; @jakarta.annotation.Nullable @@ -127,8 +125,7 @@ public class DatastoreEndpoint { private String ownerId; public static final String JSON_PROPERTY_PERIOD_FAILURE_RATE = "period_failure_rate"; - @jakarta.annotation.Nullable - private BigDecimal periodFailureRate; + private JsonNullable periodFailureRate = JsonNullable.undefined(); public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; @jakarta.annotation.Nullable @@ -143,8 +140,7 @@ public class DatastoreEndpoint { private Integer rateLimitDuration; public static final String JSON_PROPERTY_RETRY_COUNT = "retry_count"; - @jakarta.annotation.Nullable - private Integer retryCount; + private JsonNullable retryCount = JsonNullable.undefined(); public static final String JSON_PROPERTY_SECRETS = "secrets"; @jakarta.annotation.Nullable @@ -159,8 +155,7 @@ public class DatastoreEndpoint { private DatastoreEndpointStatus status; public static final String JSON_PROPERTY_SUCCESS_COUNT = "success_count"; - @jakarta.annotation.Nullable - private Integer successCount; + private JsonNullable successCount = JsonNullable.undefined(); public static final String JSON_PROPERTY_SUPPORT_EMAIL = "support_email"; @jakarta.annotation.Nullable @@ -206,7 +201,7 @@ public void setAdvancedSignatures(@jakarta.annotation.Nullable Boolean advancedS public DatastoreEndpoint authentication(@jakarta.annotation.Nullable DatastoreEndpointAuthentication authentication) { - this.authentication = authentication; + this.authentication = JsonNullable.of(authentication); return this; } @@ -215,22 +210,30 @@ public DatastoreEndpoint authentication(@jakarta.annotation.Nullable DatastoreEn * @return authentication */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreEndpointAuthentication getAuthentication() { - return authentication; + return authentication.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAuthentication(@jakarta.annotation.Nullable DatastoreEndpointAuthentication authentication) { + + public JsonNullable getAuthentication_JsonNullable() { + return authentication; + } + + @JsonProperty(JSON_PROPERTY_AUTHENTICATION) + public void setAuthentication_JsonNullable(JsonNullable authentication) { this.authentication = authentication; } + public void setAuthentication(@jakarta.annotation.Nullable DatastoreEndpointAuthentication authentication) { + this.authentication = JsonNullable.of(authentication); + } + public DatastoreEndpoint cbState(@jakarta.annotation.Nullable String cbState) { - this.cbState = cbState; + this.cbState = JsonNullable.of(cbState); return this; } @@ -239,19 +242,27 @@ public DatastoreEndpoint cbState(@jakarta.annotation.Nullable String cbState) { * @return cbState */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CB_STATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getCbState() { - return cbState; + return cbState.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CB_STATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCbState(@jakarta.annotation.Nullable String cbState) { + + public JsonNullable getCbState_JsonNullable() { + return cbState; + } + + @JsonProperty(JSON_PROPERTY_CB_STATE) + public void setCbState_JsonNullable(JsonNullable cbState) { this.cbState = cbState; } + public void setCbState(@jakarta.annotation.Nullable String cbState) { + this.cbState = JsonNullable.of(cbState); + } + public DatastoreEndpoint contentType(@jakarta.annotation.Nullable String contentType) { this.contentType = contentType; @@ -302,7 +313,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public DatastoreEndpoint deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -311,19 +322,27 @@ public DatastoreEndpoint deletedAt(@jakarta.annotation.Nullable String deletedAt * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public DatastoreEndpoint description(@jakarta.annotation.Nullable String description) { this.description = description; @@ -374,7 +393,7 @@ public void setEvents(@jakarta.annotation.Nullable Integer events) { public DatastoreEndpoint failureCount(@jakarta.annotation.Nullable Integer failureCount) { - this.failureCount = failureCount; + this.failureCount = JsonNullable.of(failureCount); return this; } @@ -383,22 +402,30 @@ public DatastoreEndpoint failureCount(@jakarta.annotation.Nullable Integer failu * @return failureCount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FAILURE_COUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Integer getFailureCount() { - return failureCount; + return failureCount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_FAILURE_COUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFailureCount(@jakarta.annotation.Nullable Integer failureCount) { + + public JsonNullable getFailureCount_JsonNullable() { + return failureCount; + } + + @JsonProperty(JSON_PROPERTY_FAILURE_COUNT) + public void setFailureCount_JsonNullable(JsonNullable failureCount) { this.failureCount = failureCount; } + public void setFailureCount(@jakarta.annotation.Nullable Integer failureCount) { + this.failureCount = JsonNullable.of(failureCount); + } + public DatastoreEndpoint failureRate(@jakarta.annotation.Nullable BigDecimal failureRate) { - this.failureRate = failureRate; + this.failureRate = JsonNullable.of(failureRate); return this; } @@ -407,19 +434,27 @@ public DatastoreEndpoint failureRate(@jakarta.annotation.Nullable BigDecimal fai * @return failureRate */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FAILURE_RATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public BigDecimal getFailureRate() { - return failureRate; + return failureRate.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_FAILURE_RATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFailureRate(@jakarta.annotation.Nullable BigDecimal failureRate) { + + public JsonNullable getFailureRate_JsonNullable() { + return failureRate; + } + + @JsonProperty(JSON_PROPERTY_FAILURE_RATE) + public void setFailureRate_JsonNullable(JsonNullable failureRate) { this.failureRate = failureRate; } + public void setFailureRate(@jakarta.annotation.Nullable BigDecimal failureRate) { + this.failureRate = JsonNullable.of(failureRate); + } + public DatastoreEndpoint httpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { this.httpTimeout = httpTimeout; @@ -446,7 +481,7 @@ public void setHttpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { public DatastoreEndpoint mtlsClientCert(@jakarta.annotation.Nullable DatastoreMtlsClientCert mtlsClientCert) { - this.mtlsClientCert = mtlsClientCert; + this.mtlsClientCert = JsonNullable.of(mtlsClientCert); return this; } @@ -455,19 +490,27 @@ public DatastoreEndpoint mtlsClientCert(@jakarta.annotation.Nullable DatastoreMt * @return mtlsClientCert */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreMtlsClientCert getMtlsClientCert() { - return mtlsClientCert; + return mtlsClientCert.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMtlsClientCert(@jakarta.annotation.Nullable DatastoreMtlsClientCert mtlsClientCert) { + + public JsonNullable getMtlsClientCert_JsonNullable() { + return mtlsClientCert; + } + + @JsonProperty(JSON_PROPERTY_MTLS_CLIENT_CERT) + public void setMtlsClientCert_JsonNullable(JsonNullable mtlsClientCert) { this.mtlsClientCert = mtlsClientCert; } + public void setMtlsClientCert(@jakarta.annotation.Nullable DatastoreMtlsClientCert mtlsClientCert) { + this.mtlsClientCert = JsonNullable.of(mtlsClientCert); + } + public DatastoreEndpoint name(@jakarta.annotation.Nullable String name) { this.name = name; @@ -518,7 +561,7 @@ public void setOwnerId(@jakarta.annotation.Nullable String ownerId) { public DatastoreEndpoint periodFailureRate(@jakarta.annotation.Nullable BigDecimal periodFailureRate) { - this.periodFailureRate = periodFailureRate; + this.periodFailureRate = JsonNullable.of(periodFailureRate); return this; } @@ -527,19 +570,27 @@ public DatastoreEndpoint periodFailureRate(@jakarta.annotation.Nullable BigDecim * @return periodFailureRate */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PERIOD_FAILURE_RATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public BigDecimal getPeriodFailureRate() { - return periodFailureRate; + return periodFailureRate.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PERIOD_FAILURE_RATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPeriodFailureRate(@jakarta.annotation.Nullable BigDecimal periodFailureRate) { + + public JsonNullable getPeriodFailureRate_JsonNullable() { + return periodFailureRate; + } + + @JsonProperty(JSON_PROPERTY_PERIOD_FAILURE_RATE) + public void setPeriodFailureRate_JsonNullable(JsonNullable periodFailureRate) { this.periodFailureRate = periodFailureRate; } + public void setPeriodFailureRate(@jakarta.annotation.Nullable BigDecimal periodFailureRate) { + this.periodFailureRate = JsonNullable.of(periodFailureRate); + } + public DatastoreEndpoint projectId(@jakarta.annotation.Nullable String projectId) { this.projectId = projectId; @@ -614,7 +665,7 @@ public void setRateLimitDuration(@jakarta.annotation.Nullable Integer rateLimitD public DatastoreEndpoint retryCount(@jakarta.annotation.Nullable Integer retryCount) { - this.retryCount = retryCount; + this.retryCount = JsonNullable.of(retryCount); return this; } @@ -623,19 +674,27 @@ public DatastoreEndpoint retryCount(@jakarta.annotation.Nullable Integer retryCo * @return retryCount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Integer getRetryCount() { - return retryCount; + return retryCount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRetryCount(@jakarta.annotation.Nullable Integer retryCount) { + + public JsonNullable getRetryCount_JsonNullable() { + return retryCount; + } + + @JsonProperty(JSON_PROPERTY_RETRY_COUNT) + public void setRetryCount_JsonNullable(JsonNullable retryCount) { this.retryCount = retryCount; } + public void setRetryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = JsonNullable.of(retryCount); + } + public DatastoreEndpoint secrets(@jakarta.annotation.Nullable List secrets) { this.secrets = secrets; @@ -718,7 +777,7 @@ public void setStatus(@jakarta.annotation.Nullable DatastoreEndpointStatus statu public DatastoreEndpoint successCount(@jakarta.annotation.Nullable Integer successCount) { - this.successCount = successCount; + this.successCount = JsonNullable.of(successCount); return this; } @@ -727,19 +786,27 @@ public DatastoreEndpoint successCount(@jakarta.annotation.Nullable Integer succe * @return successCount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SUCCESS_COUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Integer getSuccessCount() { - return successCount; + return successCount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SUCCESS_COUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSuccessCount(@jakarta.annotation.Nullable Integer successCount) { + + public JsonNullable getSuccessCount_JsonNullable() { + return successCount; + } + + @JsonProperty(JSON_PROPERTY_SUCCESS_COUNT) + public void setSuccessCount_JsonNullable(JsonNullable successCount) { this.successCount = successCount; } + public void setSuccessCount(@jakarta.annotation.Nullable Integer successCount) { + this.successCount = JsonNullable.of(successCount); + } + public DatastoreEndpoint supportEmail(@jakarta.annotation.Nullable String supportEmail) { this.supportEmail = supportEmail; @@ -850,37 +917,48 @@ public boolean equals(Object o) { } DatastoreEndpoint datastoreEndpoint = (DatastoreEndpoint) o; return Objects.equals(this.advancedSignatures, datastoreEndpoint.advancedSignatures) && - Objects.equals(this.authentication, datastoreEndpoint.authentication) && - Objects.equals(this.cbState, datastoreEndpoint.cbState) && + equalsNullable(this.authentication, datastoreEndpoint.authentication) && + equalsNullable(this.cbState, datastoreEndpoint.cbState) && Objects.equals(this.contentType, datastoreEndpoint.contentType) && Objects.equals(this.createdAt, datastoreEndpoint.createdAt) && - Objects.equals(this.deletedAt, datastoreEndpoint.deletedAt) && + equalsNullable(this.deletedAt, datastoreEndpoint.deletedAt) && Objects.equals(this.description, datastoreEndpoint.description) && Objects.equals(this.events, datastoreEndpoint.events) && - Objects.equals(this.failureCount, datastoreEndpoint.failureCount) && - Objects.equals(this.failureRate, datastoreEndpoint.failureRate) && + equalsNullable(this.failureCount, datastoreEndpoint.failureCount) && + equalsNullable(this.failureRate, datastoreEndpoint.failureRate) && Objects.equals(this.httpTimeout, datastoreEndpoint.httpTimeout) && - Objects.equals(this.mtlsClientCert, datastoreEndpoint.mtlsClientCert) && + equalsNullable(this.mtlsClientCert, datastoreEndpoint.mtlsClientCert) && Objects.equals(this.name, datastoreEndpoint.name) && Objects.equals(this.ownerId, datastoreEndpoint.ownerId) && - Objects.equals(this.periodFailureRate, datastoreEndpoint.periodFailureRate) && + equalsNullable(this.periodFailureRate, datastoreEndpoint.periodFailureRate) && Objects.equals(this.projectId, datastoreEndpoint.projectId) && Objects.equals(this.rateLimit, datastoreEndpoint.rateLimit) && Objects.equals(this.rateLimitDuration, datastoreEndpoint.rateLimitDuration) && - Objects.equals(this.retryCount, datastoreEndpoint.retryCount) && + equalsNullable(this.retryCount, datastoreEndpoint.retryCount) && Objects.equals(this.secrets, datastoreEndpoint.secrets) && Objects.equals(this.slackWebhookUrl, datastoreEndpoint.slackWebhookUrl) && Objects.equals(this.status, datastoreEndpoint.status) && - Objects.equals(this.successCount, datastoreEndpoint.successCount) && + equalsNullable(this.successCount, datastoreEndpoint.successCount) && Objects.equals(this.supportEmail, datastoreEndpoint.supportEmail) && Objects.equals(this.uid, datastoreEndpoint.uid) && Objects.equals(this.updatedAt, datastoreEndpoint.updatedAt) && Objects.equals(this.url, datastoreEndpoint.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(advancedSignatures, authentication, cbState, contentType, createdAt, deletedAt, description, events, failureCount, failureRate, httpTimeout, mtlsClientCert, name, ownerId, periodFailureRate, projectId, rateLimit, rateLimitDuration, retryCount, secrets, slackWebhookUrl, status, successCount, supportEmail, uid, updatedAt, url); + return Objects.hash(advancedSignatures, hashCodeNullable(authentication), hashCodeNullable(cbState), contentType, createdAt, hashCodeNullable(deletedAt), description, events, hashCodeNullable(failureCount), hashCodeNullable(failureRate), httpTimeout, hashCodeNullable(mtlsClientCert), name, ownerId, hashCodeNullable(periodFailureRate), projectId, rateLimit, rateLimitDuration, hashCodeNullable(retryCount), secrets, slackWebhookUrl, status, hashCodeNullable(successCount), supportEmail, uid, updatedAt, 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/getconvoy/models/DatastoreEndpointAuthentication.java b/src/main/java/com/getconvoy/models/DatastoreEndpointAuthentication.java index 99bf4a1..1934d9a 100644 --- a/src/main/java/com/getconvoy/models/DatastoreEndpointAuthentication.java +++ b/src/main/java/com/getconvoy/models/DatastoreEndpointAuthentication.java @@ -29,6 +29,10 @@ import com.getconvoy.models.DatastoreEndpointAuthenticationType; import com.getconvoy.models.DatastoreOAuth2; 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; @@ -45,16 +49,13 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastoreEndpointAuthentication { public static final String JSON_PROPERTY_API_KEY = "api_key"; - @jakarta.annotation.Nullable - private DatastoreApiKey apiKey; + private JsonNullable apiKey = JsonNullable.undefined(); public static final String JSON_PROPERTY_BASIC_AUTH = "basic_auth"; - @jakarta.annotation.Nullable - private DatastoreBasicAuth basicAuth; + private JsonNullable basicAuth = JsonNullable.undefined(); public static final String JSON_PROPERTY_OAUTH2 = "oauth2"; - @jakarta.annotation.Nullable - private DatastoreOAuth2 oauth2; + private JsonNullable oauth2 = JsonNullable.undefined(); public static final String JSON_PROPERTY_TYPE = "type"; @jakarta.annotation.Nullable @@ -64,7 +65,7 @@ public DatastoreEndpointAuthentication() { } public DatastoreEndpointAuthentication apiKey(@jakarta.annotation.Nullable DatastoreApiKey apiKey) { - this.apiKey = apiKey; + this.apiKey = JsonNullable.of(apiKey); return this; } @@ -73,22 +74,30 @@ public DatastoreEndpointAuthentication apiKey(@jakarta.annotation.Nullable Datas * @return apiKey */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreApiKey getApiKey() { - return apiKey; + return apiKey.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiKey(@jakarta.annotation.Nullable DatastoreApiKey apiKey) { + + public JsonNullable getApiKey_JsonNullable() { + return apiKey; + } + + @JsonProperty(JSON_PROPERTY_API_KEY) + public void setApiKey_JsonNullable(JsonNullable apiKey) { this.apiKey = apiKey; } + public void setApiKey(@jakarta.annotation.Nullable DatastoreApiKey apiKey) { + this.apiKey = JsonNullable.of(apiKey); + } + public DatastoreEndpointAuthentication basicAuth(@jakarta.annotation.Nullable DatastoreBasicAuth basicAuth) { - this.basicAuth = basicAuth; + this.basicAuth = JsonNullable.of(basicAuth); return this; } @@ -97,22 +106,30 @@ public DatastoreEndpointAuthentication basicAuth(@jakarta.annotation.Nullable Da * @return basicAuth */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreBasicAuth getBasicAuth() { - return basicAuth; + return basicAuth.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBasicAuth(@jakarta.annotation.Nullable DatastoreBasicAuth basicAuth) { + + public JsonNullable getBasicAuth_JsonNullable() { + return basicAuth; + } + + @JsonProperty(JSON_PROPERTY_BASIC_AUTH) + public void setBasicAuth_JsonNullable(JsonNullable basicAuth) { this.basicAuth = basicAuth; } + public void setBasicAuth(@jakarta.annotation.Nullable DatastoreBasicAuth basicAuth) { + this.basicAuth = JsonNullable.of(basicAuth); + } + public DatastoreEndpointAuthentication oauth2(@jakarta.annotation.Nullable DatastoreOAuth2 oauth2) { - this.oauth2 = oauth2; + this.oauth2 = JsonNullable.of(oauth2); return this; } @@ -121,19 +138,27 @@ public DatastoreEndpointAuthentication oauth2(@jakarta.annotation.Nullable Datas * @return oauth2 */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_OAUTH2, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreOAuth2 getOauth2() { - return oauth2; + return oauth2.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_OAUTH2, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOauth2(@jakarta.annotation.Nullable DatastoreOAuth2 oauth2) { + + public JsonNullable getOauth2_JsonNullable() { + return oauth2; + } + + @JsonProperty(JSON_PROPERTY_OAUTH2) + public void setOauth2_JsonNullable(JsonNullable oauth2) { this.oauth2 = oauth2; } + public void setOauth2(@jakarta.annotation.Nullable DatastoreOAuth2 oauth2) { + this.oauth2 = JsonNullable.of(oauth2); + } + public DatastoreEndpointAuthentication type(@jakarta.annotation.Nullable DatastoreEndpointAuthenticationType type) { this.type = type; @@ -171,15 +196,26 @@ public boolean equals(Object o) { return false; } DatastoreEndpointAuthentication datastoreEndpointAuthentication = (DatastoreEndpointAuthentication) o; - return Objects.equals(this.apiKey, datastoreEndpointAuthentication.apiKey) && - Objects.equals(this.basicAuth, datastoreEndpointAuthentication.basicAuth) && - Objects.equals(this.oauth2, datastoreEndpointAuthentication.oauth2) && + return equalsNullable(this.apiKey, datastoreEndpointAuthentication.apiKey) && + equalsNullable(this.basicAuth, datastoreEndpointAuthentication.basicAuth) && + equalsNullable(this.oauth2, datastoreEndpointAuthentication.oauth2) && Objects.equals(this.type, datastoreEndpointAuthentication.type); } + 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(apiKey, basicAuth, oauth2, type); + return Objects.hash(hashCodeNullable(apiKey), hashCodeNullable(basicAuth), hashCodeNullable(oauth2), type); + } + + 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/getconvoy/models/DatastoreEndpointAuthenticationType.java b/src/main/java/com/getconvoy/models/DatastoreEndpointAuthenticationType.java index 535466a..b40ebfb 100644 --- a/src/main/java/com/getconvoy/models/DatastoreEndpointAuthenticationType.java +++ b/src/main/java/com/getconvoy/models/DatastoreEndpointAuthenticationType.java @@ -34,7 +34,9 @@ public enum DatastoreEndpointAuthenticationType { OAuth2Authentication("oauth2"), - BasicAuthentication("basic_auth"); + BasicAuthentication("basic_auth"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreEndpointStatus.java b/src/main/java/com/getconvoy/models/DatastoreEndpointStatus.java index 15fe99f..0aa724b 100644 --- a/src/main/java/com/getconvoy/models/DatastoreEndpointStatus.java +++ b/src/main/java/com/getconvoy/models/DatastoreEndpointStatus.java @@ -34,7 +34,9 @@ public enum DatastoreEndpointStatus { InactiveEndpointStatus("inactive"), - PausedEndpointStatus("paused"); + PausedEndpointStatus("paused"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreEvent.java b/src/main/java/com/getconvoy/models/DatastoreEvent.java index b43c9fb..b15d427 100644 --- a/src/main/java/com/getconvoy/models/DatastoreEvent.java +++ b/src/main/java/com/getconvoy/models/DatastoreEvent.java @@ -32,6 +32,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +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 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastoreEvent { public static final String JSON_PROPERTY_ACKNOWLEDGED_AT = "acknowledged_at"; - @jakarta.annotation.Nullable - private String acknowledgedAt; + private JsonNullable acknowledgedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_APP_ID = "app_id"; @jakarta.annotation.Nullable @@ -77,12 +80,10 @@ public class DatastoreEvent { private String createdAt; public static final String JSON_PROPERTY_DATA = "data"; - @jakarta.annotation.Nullable - private Map data = new HashMap<>(); + private JsonNullable> data = JsonNullable.>undefined(); public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_ENDPOINT_METADATA = "endpoint_metadata"; @jakarta.annotation.Nullable @@ -97,8 +98,7 @@ public class DatastoreEvent { private String eventType; public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private Map> headers = new HashMap<>(); + private JsonNullable>> headers = JsonNullable.>>undefined(); public static final String JSON_PROPERTY_IDEMPOTENCY_KEY = "idempotency_key"; @jakarta.annotation.Nullable @@ -125,8 +125,7 @@ public class DatastoreEvent { private String sourceId; public static final String JSON_PROPERTY_SOURCE_METADATA = "source_metadata"; - @jakarta.annotation.Nullable - private DatastoreSource sourceMetadata; + private JsonNullable sourceMetadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_STATUS = "status"; @jakarta.annotation.Nullable @@ -152,7 +151,7 @@ public DatastoreEvent() { } public DatastoreEvent acknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { - this.acknowledgedAt = acknowledgedAt; + this.acknowledgedAt = JsonNullable.of(acknowledgedAt); return this; } @@ -161,19 +160,27 @@ public DatastoreEvent acknowledgedAt(@jakarta.annotation.Nullable String acknowl * @return acknowledgedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getAcknowledgedAt() { - return acknowledgedAt; + return acknowledgedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + + public JsonNullable getAcknowledgedAt_JsonNullable() { + return acknowledgedAt; + } + + @JsonProperty(JSON_PROPERTY_ACKNOWLEDGED_AT) + public void setAcknowledgedAt_JsonNullable(JsonNullable acknowledgedAt) { this.acknowledgedAt = acknowledgedAt; } + public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = JsonNullable.of(acknowledgedAt); + } + public DatastoreEvent appId(@jakarta.annotation.Nullable String appId) { this.appId = appId; @@ -224,15 +231,19 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public DatastoreEvent data(@jakarta.annotation.Nullable Map data) { - this.data = data; + this.data = JsonNullable.>of(data); return this; } public DatastoreEvent putDataItem(String key, Object dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); + if (this.data == null || !this.data.isPresent()) { + this.data = JsonNullable.>of(new HashMap<>()); + } + try { + this.data.get().put(key, dataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.data.put(key, dataItem); return this; } @@ -241,22 +252,30 @@ public DatastoreEvent putDataItem(String key, Object dataItem) { * @return data */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getData() { - return data; + return data.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setData(@jakarta.annotation.Nullable Map data) { + + public JsonNullable> getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable> data) { this.data = data; } + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = JsonNullable.>of(data); + } + public DatastoreEvent deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -265,19 +284,27 @@ public DatastoreEvent deletedAt(@jakarta.annotation.Nullable String deletedAt) { * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public DatastoreEvent endpointMetadata(@jakarta.annotation.Nullable List endpointMetadata) { this.endpointMetadata = endpointMetadata; @@ -368,15 +395,19 @@ public void setEventType(@jakarta.annotation.Nullable String eventType) { public DatastoreEvent headers(@jakarta.annotation.Nullable Map> headers) { - this.headers = headers; + this.headers = JsonNullable.>>of(headers); return this; } public DatastoreEvent putHeadersItem(String key, List headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); + if (this.headers == null || !this.headers.isPresent()) { + this.headers = JsonNullable.>>of(new HashMap<>()); + } + try { + this.headers.get().put(key, headersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.headers.put(key, headersItem); return this; } @@ -385,19 +416,27 @@ public DatastoreEvent putHeadersItem(String key, List headersItem) { * @return headers */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map> getHeaders() { - return headers; + return headers.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaders(@jakarta.annotation.Nullable Map> headers) { + + public JsonNullable>> getHeaders_JsonNullable() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + public void setHeaders_JsonNullable(JsonNullable>> headers) { this.headers = headers; } + public void setHeaders(@jakarta.annotation.Nullable Map> headers) { + this.headers = JsonNullable.>>of(headers); + } + public DatastoreEvent idempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { this.idempotencyKey = idempotencyKey; @@ -544,7 +583,7 @@ public void setSourceId(@jakarta.annotation.Nullable String sourceId) { public DatastoreEvent sourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { - this.sourceMetadata = sourceMetadata; + this.sourceMetadata = JsonNullable.of(sourceMetadata); return this; } @@ -553,19 +592,27 @@ public DatastoreEvent sourceMetadata(@jakarta.annotation.Nullable DatastoreSourc * @return sourceMetadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreSource getSourceMetadata() { - return sourceMetadata; + return sourceMetadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + + public JsonNullable getSourceMetadata_JsonNullable() { + return sourceMetadata; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_METADATA) + public void setSourceMetadata_JsonNullable(JsonNullable sourceMetadata) { this.sourceMetadata = sourceMetadata; } + public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = JsonNullable.of(sourceMetadata); + } + public DatastoreEvent status(@jakarta.annotation.Nullable DatastoreEventStatus status) { this.status = status; @@ -699,22 +746,22 @@ public boolean equals(Object o) { return false; } DatastoreEvent datastoreEvent = (DatastoreEvent) o; - return Objects.equals(this.acknowledgedAt, datastoreEvent.acknowledgedAt) && + return equalsNullable(this.acknowledgedAt, datastoreEvent.acknowledgedAt) && Objects.equals(this.appId, datastoreEvent.appId) && Objects.equals(this.createdAt, datastoreEvent.createdAt) && - Objects.equals(this.data, datastoreEvent.data) && - Objects.equals(this.deletedAt, datastoreEvent.deletedAt) && + equalsNullable(this.data, datastoreEvent.data) && + equalsNullable(this.deletedAt, datastoreEvent.deletedAt) && Objects.equals(this.endpointMetadata, datastoreEvent.endpointMetadata) && Objects.equals(this.endpoints, datastoreEvent.endpoints) && Objects.equals(this.eventType, datastoreEvent.eventType) && - Objects.equals(this.headers, datastoreEvent.headers) && + equalsNullable(this.headers, datastoreEvent.headers) && Objects.equals(this.idempotencyKey, datastoreEvent.idempotencyKey) && Objects.equals(this.isDuplicateEvent, datastoreEvent.isDuplicateEvent) && Objects.equals(this.metadata, datastoreEvent.metadata) && Objects.equals(this.projectId, datastoreEvent.projectId) && Objects.equals(this.raw, datastoreEvent.raw) && Objects.equals(this.sourceId, datastoreEvent.sourceId) && - Objects.equals(this.sourceMetadata, datastoreEvent.sourceMetadata) && + equalsNullable(this.sourceMetadata, datastoreEvent.sourceMetadata) && Objects.equals(this.status, datastoreEvent.status) && Objects.equals(this.uid, datastoreEvent.uid) && Objects.equals(this.updatedAt, datastoreEvent.updatedAt) && @@ -722,9 +769,20 @@ public boolean equals(Object o) { Objects.equals(this.urlQueryParams, datastoreEvent.urlQueryParams); } + 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(acknowledgedAt, appId, createdAt, data, deletedAt, endpointMetadata, endpoints, eventType, headers, idempotencyKey, isDuplicateEvent, metadata, projectId, raw, sourceId, sourceMetadata, status, uid, updatedAt, urlPath, urlQueryParams); + return Objects.hash(hashCodeNullable(acknowledgedAt), appId, createdAt, hashCodeNullable(data), hashCodeNullable(deletedAt), endpointMetadata, endpoints, eventType, hashCodeNullable(headers), idempotencyKey, isDuplicateEvent, metadata, projectId, raw, sourceId, hashCodeNullable(sourceMetadata), status, uid, updatedAt, urlPath, urlQueryParams); + } + + 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/getconvoy/models/DatastoreEventDeliveryStatus.java b/src/main/java/com/getconvoy/models/DatastoreEventDeliveryStatus.java index 57aad7a..cdcf6d5 100644 --- a/src/main/java/com/getconvoy/models/DatastoreEventDeliveryStatus.java +++ b/src/main/java/com/getconvoy/models/DatastoreEventDeliveryStatus.java @@ -40,7 +40,9 @@ public enum DatastoreEventDeliveryStatus { SuccessEventStatus("Success"), - RetryEventStatus("Retry"); + RetryEventStatus("Retry"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreEventStatus.java b/src/main/java/com/getconvoy/models/DatastoreEventStatus.java index 39d5768..301aa98 100644 --- a/src/main/java/com/getconvoy/models/DatastoreEventStatus.java +++ b/src/main/java/com/getconvoy/models/DatastoreEventStatus.java @@ -38,7 +38,9 @@ public enum DatastoreEventStatus { RetryStatus("Retry"), - PendingStatus("Pending"); + PendingStatus("Pending"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java b/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java index d4e7150..ad0944d 100644 --- a/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java +++ b/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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,38 +48,38 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastoreFilterSchema { public static final String JSON_PROPERTY_BODY = "body"; - @jakarta.annotation.Nullable - private Map body = new HashMap<>(); + private JsonNullable> body = JsonNullable.>undefined(); public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private Map headers = new HashMap<>(); + private JsonNullable> headers = JsonNullable.>undefined(); public static final String JSON_PROPERTY_IS_FLATTENED = "is_flattened"; @jakarta.annotation.Nullable private Boolean isFlattened; public static final String JSON_PROPERTY_PATH = "path"; - @jakarta.annotation.Nullable - private Map path = new HashMap<>(); + private JsonNullable> path = JsonNullable.>undefined(); public static final String JSON_PROPERTY_QUERY = "query"; - @jakarta.annotation.Nullable - private Map query = new HashMap<>(); + private JsonNullable> query = JsonNullable.>undefined(); public DatastoreFilterSchema() { } public DatastoreFilterSchema body(@jakarta.annotation.Nullable Map body) { - this.body = body; + this.body = JsonNullable.>of(body); return this; } public DatastoreFilterSchema putBodyItem(String key, Object bodyItem) { - if (this.body == null) { - this.body = new HashMap<>(); + if (this.body == null || !this.body.isPresent()) { + this.body = JsonNullable.>of(new HashMap<>()); + } + try { + this.body.get().put(key, bodyItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.body.put(key, bodyItem); return this; } @@ -84,30 +88,42 @@ public DatastoreFilterSchema putBodyItem(String key, Object bodyItem) { * @return body */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getBody() { - return body; + return body.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setBody(@jakarta.annotation.Nullable Map 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 Map body) { + this.body = JsonNullable.>of(body); + } + public DatastoreFilterSchema headers(@jakarta.annotation.Nullable Map headers) { - this.headers = headers; + this.headers = JsonNullable.>of(headers); return this; } public DatastoreFilterSchema putHeadersItem(String key, Object headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); + if (this.headers == null || !this.headers.isPresent()) { + this.headers = JsonNullable.>of(new HashMap<>()); + } + try { + this.headers.get().put(key, headersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.headers.put(key, headersItem); return this; } @@ -116,19 +132,27 @@ public DatastoreFilterSchema putHeadersItem(String key, Object headersItem) { * @return headers */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getHeaders() { - return headers; + return headers.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaders(@jakarta.annotation.Nullable Map headers) { + + public JsonNullable> getHeaders_JsonNullable() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + public void setHeaders_JsonNullable(JsonNullable> headers) { this.headers = headers; } + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = JsonNullable.>of(headers); + } + public DatastoreFilterSchema isFlattened(@jakarta.annotation.Nullable Boolean isFlattened) { this.isFlattened = isFlattened; @@ -155,15 +179,19 @@ public void setIsFlattened(@jakarta.annotation.Nullable Boolean isFlattened) { public DatastoreFilterSchema path(@jakarta.annotation.Nullable Map path) { - this.path = path; + this.path = JsonNullable.>of(path); return this; } public DatastoreFilterSchema putPathItem(String key, Object pathItem) { - if (this.path == null) { - this.path = new HashMap<>(); + if (this.path == null || !this.path.isPresent()) { + this.path = JsonNullable.>of(new HashMap<>()); + } + try { + this.path.get().put(key, pathItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.path.put(key, pathItem); return this; } @@ -172,30 +200,42 @@ public DatastoreFilterSchema putPathItem(String key, Object pathItem) { * @return path */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getPath() { - return path; + return path.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setPath(@jakarta.annotation.Nullable Map path) { + + public JsonNullable> getPath_JsonNullable() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + public void setPath_JsonNullable(JsonNullable> path) { this.path = path; } + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = JsonNullable.>of(path); + } + public DatastoreFilterSchema query(@jakarta.annotation.Nullable Map query) { - this.query = query; + this.query = JsonNullable.>of(query); return this; } public DatastoreFilterSchema putQueryItem(String key, Object queryItem) { - if (this.query == null) { - this.query = new HashMap<>(); + if (this.query == null || !this.query.isPresent()) { + this.query = JsonNullable.>of(new HashMap<>()); + } + try { + this.query.get().put(key, queryItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.query.put(key, queryItem); return this; } @@ -204,19 +244,27 @@ public DatastoreFilterSchema putQueryItem(String key, Object queryItem) { * @return query */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getQuery() { - return query; + return query.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setQuery(@jakarta.annotation.Nullable Map query) { + + public JsonNullable> getQuery_JsonNullable() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + public void setQuery_JsonNullable(JsonNullable> query) { this.query = query; } + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = JsonNullable.>of(query); + } + /** * Return true if this datastore.FilterSchema object is equal to o. @@ -230,16 +278,27 @@ public boolean equals(Object o) { return false; } DatastoreFilterSchema datastoreFilterSchema = (DatastoreFilterSchema) o; - return Objects.equals(this.body, datastoreFilterSchema.body) && - Objects.equals(this.headers, datastoreFilterSchema.headers) && + return equalsNullable(this.body, datastoreFilterSchema.body) && + equalsNullable(this.headers, datastoreFilterSchema.headers) && Objects.equals(this.isFlattened, datastoreFilterSchema.isFlattened) && - Objects.equals(this.path, datastoreFilterSchema.path) && - Objects.equals(this.query, datastoreFilterSchema.query); + equalsNullable(this.path, datastoreFilterSchema.path) && + equalsNullable(this.query, datastoreFilterSchema.query); + } + + 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(body, headers, isFlattened, path, query); + return Objects.hash(hashCodeNullable(body), hashCodeNullable(headers), isFlattened, hashCodeNullable(path), hashCodeNullable(query)); + } + + 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/getconvoy/models/DatastoreKafkaPubSubConfig.java b/src/main/java/com/getconvoy/models/DatastoreKafkaPubSubConfig.java index c17cd55..5d5f602 100644 --- a/src/main/java/com/getconvoy/models/DatastoreKafkaPubSubConfig.java +++ b/src/main/java/com/getconvoy/models/DatastoreKafkaPubSubConfig.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; @@ -44,8 +48,7 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastoreKafkaPubSubConfig { public static final String JSON_PROPERTY_AUTH = "auth"; - @jakarta.annotation.Nullable - private DatastoreKafkaAuth auth; + private JsonNullable auth = JsonNullable.undefined(); public static final String JSON_PROPERTY_BROKERS = "brokers"; @jakarta.annotation.Nullable @@ -63,7 +66,7 @@ public DatastoreKafkaPubSubConfig() { } public DatastoreKafkaPubSubConfig auth(@jakarta.annotation.Nullable DatastoreKafkaAuth auth) { - this.auth = auth; + this.auth = JsonNullable.of(auth); return this; } @@ -72,19 +75,27 @@ public DatastoreKafkaPubSubConfig auth(@jakarta.annotation.Nullable DatastoreKaf * @return auth */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreKafkaAuth getAuth() { - return auth; + return auth.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_AUTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAuth(@jakarta.annotation.Nullable DatastoreKafkaAuth auth) { + + public JsonNullable getAuth_JsonNullable() { + return auth; + } + + @JsonProperty(JSON_PROPERTY_AUTH) + public void setAuth_JsonNullable(JsonNullable auth) { this.auth = auth; } + public void setAuth(@jakarta.annotation.Nullable DatastoreKafkaAuth auth) { + this.auth = JsonNullable.of(auth); + } + public DatastoreKafkaPubSubConfig brokers(@jakarta.annotation.Nullable List brokers) { this.brokers = brokers; @@ -178,15 +189,26 @@ public boolean equals(Object o) { return false; } DatastoreKafkaPubSubConfig datastoreKafkaPubSubConfig = (DatastoreKafkaPubSubConfig) o; - return Objects.equals(this.auth, datastoreKafkaPubSubConfig.auth) && + return equalsNullable(this.auth, datastoreKafkaPubSubConfig.auth) && Objects.equals(this.brokers, datastoreKafkaPubSubConfig.brokers) && Objects.equals(this.consumerGroupId, datastoreKafkaPubSubConfig.consumerGroupId) && Objects.equals(this.topicName, datastoreKafkaPubSubConfig.topicName); } + 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(auth, brokers, consumerGroupId, topicName); + return Objects.hash(hashCodeNullable(auth), brokers, consumerGroupId, topicName); + } + + 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/getconvoy/models/DatastoreMetaEventAttempt.java b/src/main/java/com/getconvoy/models/DatastoreMetaEventAttempt.java index a9d9493..5a1beef 100644 --- a/src/main/java/com/getconvoy/models/DatastoreMetaEventAttempt.java +++ b/src/main/java/com/getconvoy/models/DatastoreMetaEventAttempt.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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,32 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastoreMetaEventAttempt { public static final String JSON_PROPERTY_REQUEST_HTTP_HEADER = "request_http_header"; - @jakarta.annotation.Nullable - private Map requestHttpHeader = new HashMap<>(); + private JsonNullable> requestHttpHeader = JsonNullable.>undefined(); public static final String JSON_PROPERTY_RESPONSE_DATA = "response_data"; @jakarta.annotation.Nullable private String responseData; public static final String JSON_PROPERTY_RESPONSE_HTTP_HEADER = "response_http_header"; - @jakarta.annotation.Nullable - private Map responseHttpHeader = new HashMap<>(); + private JsonNullable> responseHttpHeader = JsonNullable.>undefined(); public DatastoreMetaEventAttempt() { } public DatastoreMetaEventAttempt requestHttpHeader(@jakarta.annotation.Nullable Map requestHttpHeader) { - this.requestHttpHeader = requestHttpHeader; + this.requestHttpHeader = JsonNullable.>of(requestHttpHeader); return this; } public DatastoreMetaEventAttempt putRequestHttpHeaderItem(String key, String requestHttpHeaderItem) { - if (this.requestHttpHeader == null) { - this.requestHttpHeader = new HashMap<>(); + if (this.requestHttpHeader == null || !this.requestHttpHeader.isPresent()) { + this.requestHttpHeader = JsonNullable.>of(new HashMap<>()); + } + try { + this.requestHttpHeader.get().put(key, requestHttpHeaderItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.requestHttpHeader.put(key, requestHttpHeaderItem); return this; } @@ -74,19 +80,27 @@ public DatastoreMetaEventAttempt putRequestHttpHeaderItem(String key, String req * @return requestHttpHeader */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_REQUEST_HTTP_HEADER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getRequestHttpHeader() { - return requestHttpHeader; + return requestHttpHeader.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_REQUEST_HTTP_HEADER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestHttpHeader(@jakarta.annotation.Nullable Map requestHttpHeader) { + + public JsonNullable> getRequestHttpHeader_JsonNullable() { + return requestHttpHeader; + } + + @JsonProperty(JSON_PROPERTY_REQUEST_HTTP_HEADER) + public void setRequestHttpHeader_JsonNullable(JsonNullable> requestHttpHeader) { this.requestHttpHeader = requestHttpHeader; } + public void setRequestHttpHeader(@jakarta.annotation.Nullable Map requestHttpHeader) { + this.requestHttpHeader = JsonNullable.>of(requestHttpHeader); + } + public DatastoreMetaEventAttempt responseData(@jakarta.annotation.Nullable String responseData) { this.responseData = responseData; @@ -113,15 +127,19 @@ public void setResponseData(@jakarta.annotation.Nullable String responseData) { public DatastoreMetaEventAttempt responseHttpHeader(@jakarta.annotation.Nullable Map responseHttpHeader) { - this.responseHttpHeader = responseHttpHeader; + this.responseHttpHeader = JsonNullable.>of(responseHttpHeader); return this; } public DatastoreMetaEventAttempt putResponseHttpHeaderItem(String key, String responseHttpHeaderItem) { - if (this.responseHttpHeader == null) { - this.responseHttpHeader = new HashMap<>(); + if (this.responseHttpHeader == null || !this.responseHttpHeader.isPresent()) { + this.responseHttpHeader = JsonNullable.>of(new HashMap<>()); + } + try { + this.responseHttpHeader.get().put(key, responseHttpHeaderItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.responseHttpHeader.put(key, responseHttpHeaderItem); return this; } @@ -130,19 +148,27 @@ public DatastoreMetaEventAttempt putResponseHttpHeaderItem(String key, String re * @return responseHttpHeader */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RESPONSE_HTTP_HEADER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getResponseHttpHeader() { - return responseHttpHeader; + return responseHttpHeader.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RESPONSE_HTTP_HEADER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setResponseHttpHeader(@jakarta.annotation.Nullable Map responseHttpHeader) { + + public JsonNullable> getResponseHttpHeader_JsonNullable() { + return responseHttpHeader; + } + + @JsonProperty(JSON_PROPERTY_RESPONSE_HTTP_HEADER) + public void setResponseHttpHeader_JsonNullable(JsonNullable> responseHttpHeader) { this.responseHttpHeader = responseHttpHeader; } + public void setResponseHttpHeader(@jakarta.annotation.Nullable Map responseHttpHeader) { + this.responseHttpHeader = JsonNullable.>of(responseHttpHeader); + } + /** * Return true if this datastore.MetaEventAttempt object is equal to o. @@ -156,14 +182,25 @@ public boolean equals(Object o) { return false; } DatastoreMetaEventAttempt datastoreMetaEventAttempt = (DatastoreMetaEventAttempt) o; - return Objects.equals(this.requestHttpHeader, datastoreMetaEventAttempt.requestHttpHeader) && + return equalsNullable(this.requestHttpHeader, datastoreMetaEventAttempt.requestHttpHeader) && Objects.equals(this.responseData, datastoreMetaEventAttempt.responseData) && - Objects.equals(this.responseHttpHeader, datastoreMetaEventAttempt.responseHttpHeader); + equalsNullable(this.responseHttpHeader, datastoreMetaEventAttempt.responseHttpHeader); + } + + 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(requestHttpHeader, responseData, responseHttpHeader); + return Objects.hash(hashCodeNullable(requestHttpHeader), responseData, hashCodeNullable(responseHttpHeader)); + } + + 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/getconvoy/models/DatastoreMetaEventConfiguration.java b/src/main/java/com/getconvoy/models/DatastoreMetaEventConfiguration.java index 79b4c6d..5d23978 100644 --- a/src/main/java/com/getconvoy/models/DatastoreMetaEventConfiguration.java +++ b/src/main/java/com/getconvoy/models/DatastoreMetaEventConfiguration.java @@ -29,6 +29,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; @@ -55,8 +59,7 @@ public class DatastoreMetaEventConfiguration { private Boolean isEnabled; public static final String JSON_PROPERTY_PUB_SUB = "pub_sub"; - @jakarta.annotation.Nullable - private DatastorePubSubConfig pubSub; + private JsonNullable pubSub = JsonNullable.undefined(); public static final String JSON_PROPERTY_SECRET = "secret"; @jakarta.annotation.Nullable @@ -130,7 +133,7 @@ public void setIsEnabled(@jakarta.annotation.Nullable Boolean isEnabled) { public DatastoreMetaEventConfiguration pubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { - this.pubSub = pubSub; + this.pubSub = JsonNullable.of(pubSub); return this; } @@ -139,19 +142,27 @@ public DatastoreMetaEventConfiguration pubSub(@jakarta.annotation.Nullable Datas * @return pubSub */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastorePubSubConfig getPubSub() { - return pubSub; + return pubSub.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + + public JsonNullable getPubSub_JsonNullable() { + return pubSub; + } + + @JsonProperty(JSON_PROPERTY_PUB_SUB) + public void setPubSub_JsonNullable(JsonNullable pubSub) { this.pubSub = pubSub; } + public void setPubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + this.pubSub = JsonNullable.of(pubSub); + } + public DatastoreMetaEventConfiguration secret(@jakarta.annotation.Nullable String secret) { this.secret = secret; @@ -239,15 +250,26 @@ public boolean equals(Object o) { DatastoreMetaEventConfiguration datastoreMetaEventConfiguration = (DatastoreMetaEventConfiguration) o; return Objects.equals(this.eventType, datastoreMetaEventConfiguration.eventType) && Objects.equals(this.isEnabled, datastoreMetaEventConfiguration.isEnabled) && - Objects.equals(this.pubSub, datastoreMetaEventConfiguration.pubSub) && + equalsNullable(this.pubSub, datastoreMetaEventConfiguration.pubSub) && Objects.equals(this.secret, datastoreMetaEventConfiguration.secret) && Objects.equals(this.type, datastoreMetaEventConfiguration.type) && Objects.equals(this.url, datastoreMetaEventConfiguration.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(eventType, isEnabled, pubSub, secret, type, url); + return Objects.hash(eventType, isEnabled, hashCodeNullable(pubSub), secret, type, 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/getconvoy/models/DatastoreMetaEventType.java b/src/main/java/com/getconvoy/models/DatastoreMetaEventType.java index 0dea45f..a397158 100644 --- a/src/main/java/com/getconvoy/models/DatastoreMetaEventType.java +++ b/src/main/java/com/getconvoy/models/DatastoreMetaEventType.java @@ -32,7 +32,9 @@ public enum DatastoreMetaEventType { HTTPMetaEvent("http"), - PubSubMetaEvent("pub_sub"); + PubSubMetaEvent("pub_sub"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreMetadata.java b/src/main/java/com/getconvoy/models/DatastoreMetadata.java index 17d2e4a..12bb6b3 100644 --- a/src/main/java/com/getconvoy/models/DatastoreMetadata.java +++ b/src/main/java/com/getconvoy/models/DatastoreMetadata.java @@ -28,6 +28,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastoreMetadata { public static final String JSON_PROPERTY_DATA = "data"; - @jakarta.annotation.Nullable - private Map data = new HashMap<>(); + private JsonNullable> data = JsonNullable.>undefined(); public static final String JSON_PROPERTY_INTERVAL_SECONDS = "interval_seconds"; @jakarta.annotation.Nullable @@ -83,15 +86,19 @@ public DatastoreMetadata() { } public DatastoreMetadata data(@jakarta.annotation.Nullable Map data) { - this.data = data; + this.data = JsonNullable.>of(data); return this; } public DatastoreMetadata putDataItem(String key, Object dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); + if (this.data == null || !this.data.isPresent()) { + this.data = JsonNullable.>of(new HashMap<>()); + } + try { + this.data.get().put(key, dataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.data.put(key, dataItem); return this; } @@ -100,19 +107,27 @@ public DatastoreMetadata putDataItem(String key, Object dataItem) { * @return data */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getData() { - return data; + return data.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setData(@jakarta.annotation.Nullable Map data) { + + public JsonNullable> getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable> data) { this.data = data; } + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = JsonNullable.>of(data); + } + public DatastoreMetadata intervalSeconds(@jakarta.annotation.Nullable Integer intervalSeconds) { this.intervalSeconds = intervalSeconds; @@ -294,7 +309,7 @@ public boolean equals(Object o) { return false; } DatastoreMetadata datastoreMetadata = (DatastoreMetadata) o; - return Objects.equals(this.data, datastoreMetadata.data) && + return equalsNullable(this.data, datastoreMetadata.data) && Objects.equals(this.intervalSeconds, datastoreMetadata.intervalSeconds) && Objects.equals(this.maxRetrySeconds, datastoreMetadata.maxRetrySeconds) && Objects.equals(this.nextSendTime, datastoreMetadata.nextSendTime) && @@ -304,9 +319,20 @@ public boolean equals(Object o) { Objects.equals(this.strategy, datastoreMetadata.strategy); } + 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, intervalSeconds, maxRetrySeconds, nextSendTime, numTrials, raw, retryLimit, strategy); + return Objects.hash(hashCodeNullable(data), intervalSeconds, maxRetrySeconds, nextSendTime, numTrials, raw, retryLimit, strategy); + } + + 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/getconvoy/models/DatastoreOAuth2.java b/src/main/java/com/getconvoy/models/DatastoreOAuth2.java index e6a4a4e..c5ac561 100644 --- a/src/main/java/com/getconvoy/models/DatastoreOAuth2.java +++ b/src/main/java/com/getconvoy/models/DatastoreOAuth2.java @@ -29,6 +29,10 @@ import com.getconvoy.models.DatastoreOAuth2FieldMapping; import com.getconvoy.models.DatastoreOAuth2SigningKey; 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; @@ -74,8 +78,7 @@ public class DatastoreOAuth2 { private DatastoreOAuth2ExpiryTimeUnit expiryTimeUnit; public static final String JSON_PROPERTY_FIELD_MAPPING = "field_mapping"; - @jakarta.annotation.Nullable - private DatastoreOAuth2FieldMapping fieldMapping; + private JsonNullable fieldMapping = JsonNullable.undefined(); public static final String JSON_PROPERTY_GRANT_TYPE = "grant_type"; @jakarta.annotation.Nullable @@ -94,8 +97,7 @@ public class DatastoreOAuth2 { private String signingAlgorithm; public static final String JSON_PROPERTY_SIGNING_KEY = "signing_key"; - @jakarta.annotation.Nullable - private DatastoreOAuth2SigningKey signingKey; + private JsonNullable signingKey = JsonNullable.undefined(); public static final String JSON_PROPERTY_SUBJECT = "subject"; @jakarta.annotation.Nullable @@ -229,7 +231,7 @@ public void setExpiryTimeUnit(@jakarta.annotation.Nullable DatastoreOAuth2Expiry public DatastoreOAuth2 fieldMapping(@jakarta.annotation.Nullable DatastoreOAuth2FieldMapping fieldMapping) { - this.fieldMapping = fieldMapping; + this.fieldMapping = JsonNullable.of(fieldMapping); return this; } @@ -238,19 +240,27 @@ public DatastoreOAuth2 fieldMapping(@jakarta.annotation.Nullable DatastoreOAuth2 * @return fieldMapping */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FIELD_MAPPING, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreOAuth2FieldMapping getFieldMapping() { - return fieldMapping; + return fieldMapping.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_FIELD_MAPPING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFieldMapping(@jakarta.annotation.Nullable DatastoreOAuth2FieldMapping fieldMapping) { + + public JsonNullable getFieldMapping_JsonNullable() { + return fieldMapping; + } + + @JsonProperty(JSON_PROPERTY_FIELD_MAPPING) + public void setFieldMapping_JsonNullable(JsonNullable fieldMapping) { this.fieldMapping = fieldMapping; } + public void setFieldMapping(@jakarta.annotation.Nullable DatastoreOAuth2FieldMapping fieldMapping) { + this.fieldMapping = JsonNullable.of(fieldMapping); + } + public DatastoreOAuth2 grantType(@jakarta.annotation.Nullable String grantType) { this.grantType = grantType; @@ -349,7 +359,7 @@ public void setSigningAlgorithm(@jakarta.annotation.Nullable String signingAlgor public DatastoreOAuth2 signingKey(@jakarta.annotation.Nullable DatastoreOAuth2SigningKey signingKey) { - this.signingKey = signingKey; + this.signingKey = JsonNullable.of(signingKey); return this; } @@ -358,19 +368,27 @@ public DatastoreOAuth2 signingKey(@jakarta.annotation.Nullable DatastoreOAuth2Si * @return signingKey */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SIGNING_KEY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreOAuth2SigningKey getSigningKey() { - return signingKey; + return signingKey.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SIGNING_KEY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSigningKey(@jakarta.annotation.Nullable DatastoreOAuth2SigningKey signingKey) { + + public JsonNullable getSigningKey_JsonNullable() { + return signingKey; + } + + @JsonProperty(JSON_PROPERTY_SIGNING_KEY) + public void setSigningKey_JsonNullable(JsonNullable signingKey) { this.signingKey = signingKey; } + public void setSigningKey(@jakarta.annotation.Nullable DatastoreOAuth2SigningKey signingKey) { + this.signingKey = JsonNullable.of(signingKey); + } + public DatastoreOAuth2 subject(@jakarta.annotation.Nullable String subject) { this.subject = subject; @@ -437,19 +455,30 @@ public boolean equals(Object o) { Objects.equals(this.clientId, datastoreOAuth2.clientId) && Objects.equals(this.clientSecret, datastoreOAuth2.clientSecret) && Objects.equals(this.expiryTimeUnit, datastoreOAuth2.expiryTimeUnit) && - Objects.equals(this.fieldMapping, datastoreOAuth2.fieldMapping) && + equalsNullable(this.fieldMapping, datastoreOAuth2.fieldMapping) && Objects.equals(this.grantType, datastoreOAuth2.grantType) && Objects.equals(this.issuer, datastoreOAuth2.issuer) && Objects.equals(this.scope, datastoreOAuth2.scope) && Objects.equals(this.signingAlgorithm, datastoreOAuth2.signingAlgorithm) && - Objects.equals(this.signingKey, datastoreOAuth2.signingKey) && + equalsNullable(this.signingKey, datastoreOAuth2.signingKey) && Objects.equals(this.subject, datastoreOAuth2.subject) && Objects.equals(this.url, datastoreOAuth2.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(audience, authenticationType, clientId, clientSecret, expiryTimeUnit, fieldMapping, grantType, issuer, scope, signingAlgorithm, signingKey, subject, url); + return Objects.hash(audience, authenticationType, clientId, clientSecret, expiryTimeUnit, hashCodeNullable(fieldMapping), grantType, issuer, scope, signingAlgorithm, hashCodeNullable(signingKey), subject, 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/getconvoy/models/DatastoreOAuth2AuthenticationType.java b/src/main/java/com/getconvoy/models/DatastoreOAuth2AuthenticationType.java index c5bf614..d05fddb 100644 --- a/src/main/java/com/getconvoy/models/DatastoreOAuth2AuthenticationType.java +++ b/src/main/java/com/getconvoy/models/DatastoreOAuth2AuthenticationType.java @@ -32,7 +32,9 @@ public enum DatastoreOAuth2AuthenticationType { SharedSecretAuth("shared_secret"), - ClientAssertionAuth("client_assertion"); + ClientAssertionAuth("client_assertion"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreOAuth2ExpiryTimeUnit.java b/src/main/java/com/getconvoy/models/DatastoreOAuth2ExpiryTimeUnit.java index 377eacd..790df09 100644 --- a/src/main/java/com/getconvoy/models/DatastoreOAuth2ExpiryTimeUnit.java +++ b/src/main/java/com/getconvoy/models/DatastoreOAuth2ExpiryTimeUnit.java @@ -36,7 +36,9 @@ public enum DatastoreOAuth2ExpiryTimeUnit { ExpiryTimeUnitMinutes("minutes"), - ExpiryTimeUnitHours("hours"); + ExpiryTimeUnitHours("hours"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastorePageDirection.java b/src/main/java/com/getconvoy/models/DatastorePageDirection.java index e94b81c..f667df2 100644 --- a/src/main/java/com/getconvoy/models/DatastorePageDirection.java +++ b/src/main/java/com/getconvoy/models/DatastorePageDirection.java @@ -32,7 +32,9 @@ public enum DatastorePageDirection { Next("next"), - Prev("prev"); + Prev("prev"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastorePortalAuthType.java b/src/main/java/com/getconvoy/models/DatastorePortalAuthType.java index 227c496..7bde4b7 100644 --- a/src/main/java/com/getconvoy/models/DatastorePortalAuthType.java +++ b/src/main/java/com/getconvoy/models/DatastorePortalAuthType.java @@ -32,7 +32,9 @@ public enum DatastorePortalAuthType { PortalAuthTypeRefreshToken("refresh_token"), - PortalAuthTypeStaticToken("static_token"); + PortalAuthTypeStaticToken("static_token"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastorePortalLinkResponse.java b/src/main/java/com/getconvoy/models/DatastorePortalLinkResponse.java index 98f18ad..e476864 100644 --- a/src/main/java/com/getconvoy/models/DatastorePortalLinkResponse.java +++ b/src/main/java/com/getconvoy/models/DatastorePortalLinkResponse.java @@ -29,6 +29,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; @@ -72,8 +76,7 @@ public class DatastorePortalLinkResponse { private String createdAt; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_ENDPOINT_COUNT = "endpoint_count"; @jakarta.annotation.Nullable @@ -215,7 +218,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public DatastorePortalLinkResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -224,19 +227,27 @@ public DatastorePortalLinkResponse deletedAt(@jakarta.annotation.Nullable String * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public DatastorePortalLinkResponse endpointCount(@jakarta.annotation.Nullable Integer endpointCount) { this.endpointCount = endpointCount; @@ -510,7 +521,7 @@ public boolean equals(Object o) { Objects.equals(this.authType, datastorePortalLinkResponse.authType) && Objects.equals(this.canManageEndpoint, datastorePortalLinkResponse.canManageEndpoint) && Objects.equals(this.createdAt, datastorePortalLinkResponse.createdAt) && - Objects.equals(this.deletedAt, datastorePortalLinkResponse.deletedAt) && + equalsNullable(this.deletedAt, datastorePortalLinkResponse.deletedAt) && Objects.equals(this.endpointCount, datastorePortalLinkResponse.endpointCount) && Objects.equals(this.endpoints, datastorePortalLinkResponse.endpoints) && Objects.equals(this.endpointsMetadata, datastorePortalLinkResponse.endpointsMetadata) && @@ -523,9 +534,20 @@ public boolean equals(Object o) { Objects.equals(this.url, datastorePortalLinkResponse.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(authKey, authType, canManageEndpoint, createdAt, deletedAt, endpointCount, endpoints, endpointsMetadata, name, ownerId, projectId, token, uid, updatedAt, url); + return Objects.hash(authKey, authType, canManageEndpoint, createdAt, hashCodeNullable(deletedAt), endpointCount, endpoints, endpointsMetadata, name, ownerId, projectId, token, uid, updatedAt, 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/getconvoy/models/DatastoreProjectConfig.java b/src/main/java/com/getconvoy/models/DatastoreProjectConfig.java index b36934f..52522ac 100644 --- a/src/main/java/com/getconvoy/models/DatastoreProjectConfig.java +++ b/src/main/java/com/getconvoy/models/DatastoreProjectConfig.java @@ -32,6 +32,10 @@ import com.getconvoy.models.DatastoreSignatureConfiguration; import com.getconvoy.models.DatastoreStrategyConfiguration; 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; @@ -61,8 +65,7 @@ public class DatastoreProjectConfig { private Boolean addEventIdTraceHeaders; public static final String JSON_PROPERTY_CIRCUIT_BREAKER = "circuit_breaker"; - @jakarta.annotation.Nullable - private DatastoreCircuitBreakerConfiguration circuitBreaker; + private JsonNullable circuitBreaker = JsonNullable.undefined(); public static final String JSON_PROPERTY_DISABLE_ENDPOINT = "disable_endpoint"; @jakarta.annotation.Nullable @@ -73,16 +76,14 @@ public class DatastoreProjectConfig { private Integer maxPayloadReadSize; public static final String JSON_PROPERTY_META_EVENT = "meta_event"; - @jakarta.annotation.Nullable - private DatastoreMetaEventConfiguration metaEvent; + private JsonNullable metaEvent = JsonNullable.undefined(); public static final String JSON_PROPERTY_MULTIPLE_ENDPOINT_SUBSCRIPTIONS = "multiple_endpoint_subscriptions"; @jakarta.annotation.Nullable private Boolean multipleEndpointSubscriptions; public static final String JSON_PROPERTY_RATELIMIT = "ratelimit"; - @jakarta.annotation.Nullable - private DatastoreRateLimitConfiguration ratelimit; + private JsonNullable ratelimit = JsonNullable.undefined(); public static final String JSON_PROPERTY_REPLAY_ATTACKS_PREVENTION_ENABLED = "replay_attacks_prevention_enabled"; @jakarta.annotation.Nullable @@ -97,16 +98,13 @@ public class DatastoreProjectConfig { private String searchPolicy; public static final String JSON_PROPERTY_SIGNATURE = "signature"; - @jakarta.annotation.Nullable - private DatastoreSignatureConfiguration signature; + private JsonNullable signature = JsonNullable.undefined(); public static final String JSON_PROPERTY_SSL = "ssl"; - @jakarta.annotation.Nullable - private DatastoreSSLConfiguration ssl; + private JsonNullable ssl = JsonNullable.undefined(); public static final String JSON_PROPERTY_STRATEGY = "strategy"; - @jakarta.annotation.Nullable - private DatastoreStrategyConfiguration strategy; + private JsonNullable strategy = JsonNullable.undefined(); public DatastoreProjectConfig() { } @@ -136,7 +134,7 @@ public void setAddEventIdTraceHeaders(@jakarta.annotation.Nullable Boolean addEv public DatastoreProjectConfig circuitBreaker(@jakarta.annotation.Nullable DatastoreCircuitBreakerConfiguration circuitBreaker) { - this.circuitBreaker = circuitBreaker; + this.circuitBreaker = JsonNullable.of(circuitBreaker); return this; } @@ -145,19 +143,27 @@ public DatastoreProjectConfig circuitBreaker(@jakarta.annotation.Nullable Datast * @return circuitBreaker */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CIRCUIT_BREAKER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreCircuitBreakerConfiguration getCircuitBreaker() { - return circuitBreaker; + return circuitBreaker.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CIRCUIT_BREAKER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCircuitBreaker(@jakarta.annotation.Nullable DatastoreCircuitBreakerConfiguration circuitBreaker) { + + public JsonNullable getCircuitBreaker_JsonNullable() { + return circuitBreaker; + } + + @JsonProperty(JSON_PROPERTY_CIRCUIT_BREAKER) + public void setCircuitBreaker_JsonNullable(JsonNullable circuitBreaker) { this.circuitBreaker = circuitBreaker; } + public void setCircuitBreaker(@jakarta.annotation.Nullable DatastoreCircuitBreakerConfiguration circuitBreaker) { + this.circuitBreaker = JsonNullable.of(circuitBreaker); + } + public DatastoreProjectConfig disableEndpoint(@jakarta.annotation.Nullable Boolean disableEndpoint) { this.disableEndpoint = disableEndpoint; @@ -208,7 +214,7 @@ public void setMaxPayloadReadSize(@jakarta.annotation.Nullable Integer maxPayloa public DatastoreProjectConfig metaEvent(@jakarta.annotation.Nullable DatastoreMetaEventConfiguration metaEvent) { - this.metaEvent = metaEvent; + this.metaEvent = JsonNullable.of(metaEvent); return this; } @@ -217,19 +223,27 @@ public DatastoreProjectConfig metaEvent(@jakarta.annotation.Nullable DatastoreMe * @return metaEvent */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_META_EVENT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreMetaEventConfiguration getMetaEvent() { - return metaEvent; + return metaEvent.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_META_EVENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMetaEvent(@jakarta.annotation.Nullable DatastoreMetaEventConfiguration metaEvent) { + + public JsonNullable getMetaEvent_JsonNullable() { + return metaEvent; + } + + @JsonProperty(JSON_PROPERTY_META_EVENT) + public void setMetaEvent_JsonNullable(JsonNullable metaEvent) { this.metaEvent = metaEvent; } + public void setMetaEvent(@jakarta.annotation.Nullable DatastoreMetaEventConfiguration metaEvent) { + this.metaEvent = JsonNullable.of(metaEvent); + } + public DatastoreProjectConfig multipleEndpointSubscriptions(@jakarta.annotation.Nullable Boolean multipleEndpointSubscriptions) { this.multipleEndpointSubscriptions = multipleEndpointSubscriptions; @@ -256,7 +270,7 @@ public void setMultipleEndpointSubscriptions(@jakarta.annotation.Nullable Boolea public DatastoreProjectConfig ratelimit(@jakarta.annotation.Nullable DatastoreRateLimitConfiguration ratelimit) { - this.ratelimit = ratelimit; + this.ratelimit = JsonNullable.of(ratelimit); return this; } @@ -265,19 +279,27 @@ public DatastoreProjectConfig ratelimit(@jakarta.annotation.Nullable DatastoreRa * @return ratelimit */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RATELIMIT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreRateLimitConfiguration getRatelimit() { - return ratelimit; + return ratelimit.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RATELIMIT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRatelimit(@jakarta.annotation.Nullable DatastoreRateLimitConfiguration ratelimit) { + + public JsonNullable getRatelimit_JsonNullable() { + return ratelimit; + } + + @JsonProperty(JSON_PROPERTY_RATELIMIT) + public void setRatelimit_JsonNullable(JsonNullable ratelimit) { this.ratelimit = ratelimit; } + public void setRatelimit(@jakarta.annotation.Nullable DatastoreRateLimitConfiguration ratelimit) { + this.ratelimit = JsonNullable.of(ratelimit); + } + public DatastoreProjectConfig replayAttacksPreventionEnabled(@jakarta.annotation.Nullable Boolean replayAttacksPreventionEnabled) { this.replayAttacksPreventionEnabled = replayAttacksPreventionEnabled; @@ -352,7 +374,7 @@ public void setSearchPolicy(@jakarta.annotation.Nullable String searchPolicy) { public DatastoreProjectConfig signature(@jakarta.annotation.Nullable DatastoreSignatureConfiguration signature) { - this.signature = signature; + this.signature = JsonNullable.of(signature); return this; } @@ -361,22 +383,30 @@ public DatastoreProjectConfig signature(@jakarta.annotation.Nullable DatastoreSi * @return signature */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreSignatureConfiguration getSignature() { - return signature; + return signature.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SIGNATURE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSignature(@jakarta.annotation.Nullable DatastoreSignatureConfiguration signature) { + + public JsonNullable getSignature_JsonNullable() { + return signature; + } + + @JsonProperty(JSON_PROPERTY_SIGNATURE) + public void setSignature_JsonNullable(JsonNullable signature) { this.signature = signature; } + public void setSignature(@jakarta.annotation.Nullable DatastoreSignatureConfiguration signature) { + this.signature = JsonNullable.of(signature); + } + public DatastoreProjectConfig ssl(@jakarta.annotation.Nullable DatastoreSSLConfiguration ssl) { - this.ssl = ssl; + this.ssl = JsonNullable.of(ssl); return this; } @@ -385,22 +415,30 @@ public DatastoreProjectConfig ssl(@jakarta.annotation.Nullable DatastoreSSLConfi * @return ssl */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SSL, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreSSLConfiguration getSsl() { - return ssl; + return ssl.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SSL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSsl(@jakarta.annotation.Nullable DatastoreSSLConfiguration ssl) { + + public JsonNullable getSsl_JsonNullable() { + return ssl; + } + + @JsonProperty(JSON_PROPERTY_SSL) + public void setSsl_JsonNullable(JsonNullable ssl) { this.ssl = ssl; } + public void setSsl(@jakarta.annotation.Nullable DatastoreSSLConfiguration ssl) { + this.ssl = JsonNullable.of(ssl); + } + public DatastoreProjectConfig strategy(@jakarta.annotation.Nullable DatastoreStrategyConfiguration strategy) { - this.strategy = strategy; + this.strategy = JsonNullable.of(strategy); return this; } @@ -409,19 +447,27 @@ public DatastoreProjectConfig strategy(@jakarta.annotation.Nullable DatastoreStr * @return strategy */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_STRATEGY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreStrategyConfiguration getStrategy() { - return strategy; + return strategy.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_STRATEGY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStrategy(@jakarta.annotation.Nullable DatastoreStrategyConfiguration strategy) { + + public JsonNullable getStrategy_JsonNullable() { + return strategy; + } + + @JsonProperty(JSON_PROPERTY_STRATEGY) + public void setStrategy_JsonNullable(JsonNullable strategy) { this.strategy = strategy; } + public void setStrategy(@jakarta.annotation.Nullable DatastoreStrategyConfiguration strategy) { + this.strategy = JsonNullable.of(strategy); + } + /** * Return true if this datastore.ProjectConfig object is equal to o. @@ -436,23 +482,34 @@ public boolean equals(Object o) { } DatastoreProjectConfig datastoreProjectConfig = (DatastoreProjectConfig) o; return Objects.equals(this.addEventIdTraceHeaders, datastoreProjectConfig.addEventIdTraceHeaders) && - Objects.equals(this.circuitBreaker, datastoreProjectConfig.circuitBreaker) && + equalsNullable(this.circuitBreaker, datastoreProjectConfig.circuitBreaker) && Objects.equals(this.disableEndpoint, datastoreProjectConfig.disableEndpoint) && Objects.equals(this.maxPayloadReadSize, datastoreProjectConfig.maxPayloadReadSize) && - Objects.equals(this.metaEvent, datastoreProjectConfig.metaEvent) && + equalsNullable(this.metaEvent, datastoreProjectConfig.metaEvent) && Objects.equals(this.multipleEndpointSubscriptions, datastoreProjectConfig.multipleEndpointSubscriptions) && - Objects.equals(this.ratelimit, datastoreProjectConfig.ratelimit) && + equalsNullable(this.ratelimit, datastoreProjectConfig.ratelimit) && Objects.equals(this.replayAttacksPreventionEnabled, datastoreProjectConfig.replayAttacksPreventionEnabled) && Objects.equals(this.requestIdHeader, datastoreProjectConfig.requestIdHeader) && Objects.equals(this.searchPolicy, datastoreProjectConfig.searchPolicy) && - Objects.equals(this.signature, datastoreProjectConfig.signature) && - Objects.equals(this.ssl, datastoreProjectConfig.ssl) && - Objects.equals(this.strategy, datastoreProjectConfig.strategy); + equalsNullable(this.signature, datastoreProjectConfig.signature) && + equalsNullable(this.ssl, datastoreProjectConfig.ssl) && + equalsNullable(this.strategy, datastoreProjectConfig.strategy); + } + + 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(addEventIdTraceHeaders, circuitBreaker, disableEndpoint, maxPayloadReadSize, metaEvent, multipleEndpointSubscriptions, ratelimit, replayAttacksPreventionEnabled, requestIdHeader, searchPolicy, signature, ssl, strategy); + return Objects.hash(addEventIdTraceHeaders, hashCodeNullable(circuitBreaker), disableEndpoint, maxPayloadReadSize, hashCodeNullable(metaEvent), multipleEndpointSubscriptions, hashCodeNullable(ratelimit), replayAttacksPreventionEnabled, requestIdHeader, searchPolicy, hashCodeNullable(signature), hashCodeNullable(ssl), hashCodeNullable(strategy)); + } + + 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/getconvoy/models/DatastoreProjectType.java b/src/main/java/com/getconvoy/models/DatastoreProjectType.java index 541c721..ff1ae9b 100644 --- a/src/main/java/com/getconvoy/models/DatastoreProjectType.java +++ b/src/main/java/com/getconvoy/models/DatastoreProjectType.java @@ -32,7 +32,9 @@ public enum DatastoreProjectType { OutgoingProject("outgoing"), - IncomingProject("incoming"); + IncomingProject("incoming"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreProviderConfig.java b/src/main/java/com/getconvoy/models/DatastoreProviderConfig.java index f45d88f..12fad27 100644 --- a/src/main/java/com/getconvoy/models/DatastoreProviderConfig.java +++ b/src/main/java/com/getconvoy/models/DatastoreProviderConfig.java @@ -26,6 +26,10 @@ import com.fasterxml.jackson.annotation.JsonValue; import com.getconvoy.models.DatastoreTwitterProviderConfig; 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; @@ -39,14 +43,13 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastoreProviderConfig { public static final String JSON_PROPERTY_TWITTER = "twitter"; - @jakarta.annotation.Nullable - private DatastoreTwitterProviderConfig twitter; + private JsonNullable twitter = JsonNullable.undefined(); public DatastoreProviderConfig() { } public DatastoreProviderConfig twitter(@jakarta.annotation.Nullable DatastoreTwitterProviderConfig twitter) { - this.twitter = twitter; + this.twitter = JsonNullable.of(twitter); return this; } @@ -55,19 +58,27 @@ public DatastoreProviderConfig twitter(@jakarta.annotation.Nullable DatastoreTwi * @return twitter */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_TWITTER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreTwitterProviderConfig getTwitter() { - return twitter; + return twitter.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_TWITTER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTwitter(@jakarta.annotation.Nullable DatastoreTwitterProviderConfig twitter) { + + public JsonNullable getTwitter_JsonNullable() { + return twitter; + } + + @JsonProperty(JSON_PROPERTY_TWITTER) + public void setTwitter_JsonNullable(JsonNullable twitter) { this.twitter = twitter; } + public void setTwitter(@jakarta.annotation.Nullable DatastoreTwitterProviderConfig twitter) { + this.twitter = JsonNullable.of(twitter); + } + /** * Return true if this datastore.ProviderConfig object is equal to o. @@ -81,12 +92,23 @@ public boolean equals(Object o) { return false; } DatastoreProviderConfig datastoreProviderConfig = (DatastoreProviderConfig) o; - return Objects.equals(this.twitter, datastoreProviderConfig.twitter); + return equalsNullable(this.twitter, datastoreProviderConfig.twitter); + } + + 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(twitter); + return Objects.hash(hashCodeNullable(twitter)); + } + + 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/getconvoy/models/DatastorePubSubConfig.java b/src/main/java/com/getconvoy/models/DatastorePubSubConfig.java index 7ba16af..1284eb1 100644 --- a/src/main/java/com/getconvoy/models/DatastorePubSubConfig.java +++ b/src/main/java/com/getconvoy/models/DatastorePubSubConfig.java @@ -30,6 +30,10 @@ import com.getconvoy.models.DatastorePubSubType; import com.getconvoy.models.DatastoreSQSPubSubConfig; 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,20 +52,16 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastorePubSubConfig { public static final String JSON_PROPERTY_AMQP = "amqp"; - @jakarta.annotation.Nullable - private DatastoreAmqpPubSubConfig amqp; + private JsonNullable amqp = JsonNullable.undefined(); public static final String JSON_PROPERTY_GOOGLE = "google"; - @jakarta.annotation.Nullable - private DatastoreGooglePubSubConfig google; + private JsonNullable google = JsonNullable.undefined(); public static final String JSON_PROPERTY_KAFKA = "kafka"; - @jakarta.annotation.Nullable - private DatastoreKafkaPubSubConfig kafka; + private JsonNullable kafka = JsonNullable.undefined(); public static final String JSON_PROPERTY_SQS = "sqs"; - @jakarta.annotation.Nullable - private DatastoreSQSPubSubConfig sqs; + private JsonNullable sqs = JsonNullable.undefined(); public static final String JSON_PROPERTY_TYPE = "type"; @jakarta.annotation.Nullable @@ -75,7 +75,7 @@ public DatastorePubSubConfig() { } public DatastorePubSubConfig amqp(@jakarta.annotation.Nullable DatastoreAmqpPubSubConfig amqp) { - this.amqp = amqp; + this.amqp = JsonNullable.of(amqp); return this; } @@ -84,22 +84,30 @@ public DatastorePubSubConfig amqp(@jakarta.annotation.Nullable DatastoreAmqpPubS * @return amqp */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_AMQP, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreAmqpPubSubConfig getAmqp() { - return amqp; + return amqp.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_AMQP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAmqp(@jakarta.annotation.Nullable DatastoreAmqpPubSubConfig amqp) { + + public JsonNullable getAmqp_JsonNullable() { + return amqp; + } + + @JsonProperty(JSON_PROPERTY_AMQP) + public void setAmqp_JsonNullable(JsonNullable amqp) { this.amqp = amqp; } + public void setAmqp(@jakarta.annotation.Nullable DatastoreAmqpPubSubConfig amqp) { + this.amqp = JsonNullable.of(amqp); + } + public DatastorePubSubConfig google(@jakarta.annotation.Nullable DatastoreGooglePubSubConfig google) { - this.google = google; + this.google = JsonNullable.of(google); return this; } @@ -108,22 +116,30 @@ public DatastorePubSubConfig google(@jakarta.annotation.Nullable DatastoreGoogle * @return google */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_GOOGLE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreGooglePubSubConfig getGoogle() { - return google; + return google.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_GOOGLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setGoogle(@jakarta.annotation.Nullable DatastoreGooglePubSubConfig google) { + + public JsonNullable getGoogle_JsonNullable() { + return google; + } + + @JsonProperty(JSON_PROPERTY_GOOGLE) + public void setGoogle_JsonNullable(JsonNullable google) { this.google = google; } + public void setGoogle(@jakarta.annotation.Nullable DatastoreGooglePubSubConfig google) { + this.google = JsonNullable.of(google); + } + public DatastorePubSubConfig kafka(@jakarta.annotation.Nullable DatastoreKafkaPubSubConfig kafka) { - this.kafka = kafka; + this.kafka = JsonNullable.of(kafka); return this; } @@ -132,22 +148,30 @@ public DatastorePubSubConfig kafka(@jakarta.annotation.Nullable DatastoreKafkaPu * @return kafka */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_KAFKA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreKafkaPubSubConfig getKafka() { - return kafka; + return kafka.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_KAFKA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKafka(@jakarta.annotation.Nullable DatastoreKafkaPubSubConfig kafka) { + + public JsonNullable getKafka_JsonNullable() { + return kafka; + } + + @JsonProperty(JSON_PROPERTY_KAFKA) + public void setKafka_JsonNullable(JsonNullable kafka) { this.kafka = kafka; } + public void setKafka(@jakarta.annotation.Nullable DatastoreKafkaPubSubConfig kafka) { + this.kafka = JsonNullable.of(kafka); + } + public DatastorePubSubConfig sqs(@jakarta.annotation.Nullable DatastoreSQSPubSubConfig sqs) { - this.sqs = sqs; + this.sqs = JsonNullable.of(sqs); return this; } @@ -156,19 +180,27 @@ public DatastorePubSubConfig sqs(@jakarta.annotation.Nullable DatastoreSQSPubSub * @return sqs */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SQS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreSQSPubSubConfig getSqs() { - return sqs; + return sqs.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SQS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSqs(@jakarta.annotation.Nullable DatastoreSQSPubSubConfig sqs) { + + public JsonNullable getSqs_JsonNullable() { + return sqs; + } + + @JsonProperty(JSON_PROPERTY_SQS) + public void setSqs_JsonNullable(JsonNullable sqs) { this.sqs = sqs; } + public void setSqs(@jakarta.annotation.Nullable DatastoreSQSPubSubConfig sqs) { + this.sqs = JsonNullable.of(sqs); + } + public DatastorePubSubConfig type(@jakarta.annotation.Nullable DatastorePubSubType type) { this.type = type; @@ -230,17 +262,28 @@ public boolean equals(Object o) { return false; } DatastorePubSubConfig datastorePubSubConfig = (DatastorePubSubConfig) o; - return Objects.equals(this.amqp, datastorePubSubConfig.amqp) && - Objects.equals(this.google, datastorePubSubConfig.google) && - Objects.equals(this.kafka, datastorePubSubConfig.kafka) && - Objects.equals(this.sqs, datastorePubSubConfig.sqs) && + return equalsNullable(this.amqp, datastorePubSubConfig.amqp) && + equalsNullable(this.google, datastorePubSubConfig.google) && + equalsNullable(this.kafka, datastorePubSubConfig.kafka) && + equalsNullable(this.sqs, datastorePubSubConfig.sqs) && Objects.equals(this.type, datastorePubSubConfig.type) && Objects.equals(this.workers, datastorePubSubConfig.workers); } + 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(amqp, google, kafka, sqs, type, workers); + return Objects.hash(hashCodeNullable(amqp), hashCodeNullable(google), hashCodeNullable(kafka), hashCodeNullable(sqs), type, workers); + } + + 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/getconvoy/models/DatastorePubSubType.java b/src/main/java/com/getconvoy/models/DatastorePubSubType.java index b3b8b0a..6220ad7 100644 --- a/src/main/java/com/getconvoy/models/DatastorePubSubType.java +++ b/src/main/java/com/getconvoy/models/DatastorePubSubType.java @@ -36,7 +36,9 @@ public enum DatastorePubSubType { KafkaPubSub("kafka"), - AmqpPubSub("amqp"); + AmqpPubSub("amqp"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreSecret.java b/src/main/java/com/getconvoy/models/DatastoreSecret.java index 94f2c69..cb5d186 100644 --- a/src/main/java/com/getconvoy/models/DatastoreSecret.java +++ b/src/main/java/com/getconvoy/models/DatastoreSecret.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; @@ -47,12 +51,10 @@ public class DatastoreSecret { private String createdAt; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at"; - @jakarta.annotation.Nullable - private String expiresAt; + private JsonNullable expiresAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_UID = "uid"; @jakarta.annotation.Nullable @@ -94,7 +96,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public DatastoreSecret deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -103,22 +105,30 @@ public DatastoreSecret deletedAt(@jakarta.annotation.Nullable String deletedAt) * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public DatastoreSecret expiresAt(@jakarta.annotation.Nullable String expiresAt) { - this.expiresAt = expiresAt; + this.expiresAt = JsonNullable.of(expiresAt); return this; } @@ -127,19 +137,27 @@ public DatastoreSecret expiresAt(@jakarta.annotation.Nullable String expiresAt) * @return expiresAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getExpiresAt() { - return expiresAt; + return expiresAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_EXPIRES_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setExpiresAt(@jakarta.annotation.Nullable String expiresAt) { + + public JsonNullable getExpiresAt_JsonNullable() { + return expiresAt; + } + + @JsonProperty(JSON_PROPERTY_EXPIRES_AT) + public void setExpiresAt_JsonNullable(JsonNullable expiresAt) { this.expiresAt = expiresAt; } + public void setExpiresAt(@jakarta.annotation.Nullable String expiresAt) { + this.expiresAt = JsonNullable.of(expiresAt); + } + public DatastoreSecret uid(@jakarta.annotation.Nullable String uid) { this.uid = uid; @@ -226,16 +244,27 @@ public boolean equals(Object o) { } DatastoreSecret datastoreSecret = (DatastoreSecret) o; return Objects.equals(this.createdAt, datastoreSecret.createdAt) && - Objects.equals(this.deletedAt, datastoreSecret.deletedAt) && - Objects.equals(this.expiresAt, datastoreSecret.expiresAt) && + equalsNullable(this.deletedAt, datastoreSecret.deletedAt) && + equalsNullable(this.expiresAt, datastoreSecret.expiresAt) && Objects.equals(this.uid, datastoreSecret.uid) && Objects.equals(this.updatedAt, datastoreSecret.updatedAt) && Objects.equals(this.value, datastoreSecret.value); } + 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(createdAt, deletedAt, expiresAt, uid, updatedAt, value); + return Objects.hash(createdAt, hashCodeNullable(deletedAt), hashCodeNullable(expiresAt), uid, updatedAt, value); + } + + 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/getconvoy/models/DatastoreSource.java b/src/main/java/com/getconvoy/models/DatastoreSource.java index 0b865f8..ec5a612 100644 --- a/src/main/java/com/getconvoy/models/DatastoreSource.java +++ b/src/main/java/com/getconvoy/models/DatastoreSource.java @@ -33,6 +33,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; @@ -65,8 +69,7 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastoreSource { public static final String JSON_PROPERTY_BODY_FUNCTION = "body_function"; - @jakarta.annotation.Nullable - private String bodyFunction; + private JsonNullable bodyFunction = JsonNullable.undefined(); public static final String JSON_PROPERTY_CREATED_AT = "created_at"; @jakarta.annotation.Nullable @@ -77,8 +80,7 @@ public class DatastoreSource { private DatastoreCustomResponse customResponse; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_EVENT_TYPE_LOCATION = "event_type_location"; @jakarta.annotation.Nullable @@ -89,8 +91,7 @@ public class DatastoreSource { private List forwardHeaders = new ArrayList<>(); public static final String JSON_PROPERTY_HEADER_FUNCTION = "header_function"; - @jakarta.annotation.Nullable - private String headerFunction; + private JsonNullable headerFunction = JsonNullable.undefined(); public static final String JSON_PROPERTY_IDEMPOTENCY_KEYS = "idempotency_keys"; @jakarta.annotation.Nullable @@ -117,12 +118,10 @@ public class DatastoreSource { private DatastoreSourceProvider provider; public static final String JSON_PROPERTY_PROVIDER_CONFIG = "provider_config"; - @jakarta.annotation.Nullable - private DatastoreProviderConfig providerConfig; + private JsonNullable providerConfig = JsonNullable.undefined(); public static final String JSON_PROPERTY_PUB_SUB = "pub_sub"; - @jakarta.annotation.Nullable - private DatastorePubSubConfig pubSub; + private JsonNullable pubSub = JsonNullable.undefined(); public static final String JSON_PROPERTY_TYPE = "type"; @jakarta.annotation.Nullable @@ -141,14 +140,13 @@ public class DatastoreSource { private String url; public static final String JSON_PROPERTY_VERIFIER = "verifier"; - @jakarta.annotation.Nullable - private DatastoreVerifierConfig verifier; + private JsonNullable verifier = JsonNullable.undefined(); public DatastoreSource() { } public DatastoreSource bodyFunction(@jakarta.annotation.Nullable String bodyFunction) { - this.bodyFunction = bodyFunction; + this.bodyFunction = JsonNullable.of(bodyFunction); return this; } @@ -157,19 +155,27 @@ public DatastoreSource bodyFunction(@jakarta.annotation.Nullable String bodyFunc * @return bodyFunction */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getBodyFunction() { - return bodyFunction; + return bodyFunction.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + + public JsonNullable getBodyFunction_JsonNullable() { + return bodyFunction; + } + + @JsonProperty(JSON_PROPERTY_BODY_FUNCTION) + public void setBodyFunction_JsonNullable(JsonNullable bodyFunction) { this.bodyFunction = bodyFunction; } + public void setBodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + this.bodyFunction = JsonNullable.of(bodyFunction); + } + public DatastoreSource createdAt(@jakarta.annotation.Nullable String createdAt) { this.createdAt = createdAt; @@ -220,7 +226,7 @@ public void setCustomResponse(@jakarta.annotation.Nullable DatastoreCustomRespon public DatastoreSource deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -229,19 +235,27 @@ public DatastoreSource deletedAt(@jakarta.annotation.Nullable String deletedAt) * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public DatastoreSource eventTypeLocation(@jakarta.annotation.Nullable String eventTypeLocation) { this.eventTypeLocation = eventTypeLocation; @@ -300,7 +314,7 @@ public void setForwardHeaders(@jakarta.annotation.Nullable List forwardH public DatastoreSource headerFunction(@jakarta.annotation.Nullable String headerFunction) { - this.headerFunction = headerFunction; + this.headerFunction = JsonNullable.of(headerFunction); return this; } @@ -309,19 +323,27 @@ public DatastoreSource headerFunction(@jakarta.annotation.Nullable String header * @return headerFunction */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getHeaderFunction() { - return headerFunction; + return headerFunction.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaderFunction(@jakarta.annotation.Nullable String headerFunction) { + + public JsonNullable getHeaderFunction_JsonNullable() { + return headerFunction; + } + + @JsonProperty(JSON_PROPERTY_HEADER_FUNCTION) + public void setHeaderFunction_JsonNullable(JsonNullable headerFunction) { this.headerFunction = headerFunction; } + public void setHeaderFunction(@jakarta.annotation.Nullable String headerFunction) { + this.headerFunction = JsonNullable.of(headerFunction); + } + public DatastoreSource idempotencyKeys(@jakarta.annotation.Nullable List idempotencyKeys) { this.idempotencyKeys = idempotencyKeys; @@ -476,7 +498,7 @@ public void setProvider(@jakarta.annotation.Nullable DatastoreSourceProvider pro public DatastoreSource providerConfig(@jakarta.annotation.Nullable DatastoreProviderConfig providerConfig) { - this.providerConfig = providerConfig; + this.providerConfig = JsonNullable.of(providerConfig); return this; } @@ -485,22 +507,30 @@ public DatastoreSource providerConfig(@jakarta.annotation.Nullable DatastoreProv * @return providerConfig */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PROVIDER_CONFIG, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreProviderConfig getProviderConfig() { - return providerConfig; + return providerConfig.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PROVIDER_CONFIG, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setProviderConfig(@jakarta.annotation.Nullable DatastoreProviderConfig providerConfig) { + + public JsonNullable getProviderConfig_JsonNullable() { + return providerConfig; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_CONFIG) + public void setProviderConfig_JsonNullable(JsonNullable providerConfig) { this.providerConfig = providerConfig; } + public void setProviderConfig(@jakarta.annotation.Nullable DatastoreProviderConfig providerConfig) { + this.providerConfig = JsonNullable.of(providerConfig); + } + public DatastoreSource pubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { - this.pubSub = pubSub; + this.pubSub = JsonNullable.of(pubSub); return this; } @@ -509,19 +539,27 @@ public DatastoreSource pubSub(@jakarta.annotation.Nullable DatastorePubSubConfig * @return pubSub */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastorePubSubConfig getPubSub() { - return pubSub; + return pubSub.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + + public JsonNullable getPubSub_JsonNullable() { + return pubSub; + } + + @JsonProperty(JSON_PROPERTY_PUB_SUB) + public void setPubSub_JsonNullable(JsonNullable pubSub) { this.pubSub = pubSub; } + public void setPubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + this.pubSub = JsonNullable.of(pubSub); + } + public DatastoreSource type(@jakarta.annotation.Nullable DatastoreSourceType type) { this.type = type; @@ -620,7 +658,7 @@ public void setUrl(@jakarta.annotation.Nullable String url) { public DatastoreSource verifier(@jakarta.annotation.Nullable DatastoreVerifierConfig verifier) { - this.verifier = verifier; + this.verifier = JsonNullable.of(verifier); return this; } @@ -629,19 +667,27 @@ public DatastoreSource verifier(@jakarta.annotation.Nullable DatastoreVerifierCo * @return verifier */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreVerifierConfig getVerifier() { - return verifier; + return verifier.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setVerifier(@jakarta.annotation.Nullable DatastoreVerifierConfig verifier) { + + public JsonNullable getVerifier_JsonNullable() { + return verifier; + } + + @JsonProperty(JSON_PROPERTY_VERIFIER) + public void setVerifier_JsonNullable(JsonNullable verifier) { this.verifier = verifier; } + public void setVerifier(@jakarta.annotation.Nullable DatastoreVerifierConfig verifier) { + this.verifier = JsonNullable.of(verifier); + } + /** * Return true if this datastore.Source object is equal to o. @@ -655,31 +701,42 @@ public boolean equals(Object o) { return false; } DatastoreSource datastoreSource = (DatastoreSource) o; - return Objects.equals(this.bodyFunction, datastoreSource.bodyFunction) && + return equalsNullable(this.bodyFunction, datastoreSource.bodyFunction) && Objects.equals(this.createdAt, datastoreSource.createdAt) && Objects.equals(this.customResponse, datastoreSource.customResponse) && - Objects.equals(this.deletedAt, datastoreSource.deletedAt) && + equalsNullable(this.deletedAt, datastoreSource.deletedAt) && Objects.equals(this.eventTypeLocation, datastoreSource.eventTypeLocation) && Objects.equals(this.forwardHeaders, datastoreSource.forwardHeaders) && - Objects.equals(this.headerFunction, datastoreSource.headerFunction) && + equalsNullable(this.headerFunction, datastoreSource.headerFunction) && Objects.equals(this.idempotencyKeys, datastoreSource.idempotencyKeys) && Objects.equals(this.isDisabled, datastoreSource.isDisabled) && Objects.equals(this.maskId, datastoreSource.maskId) && Objects.equals(this.name, datastoreSource.name) && Objects.equals(this.projectId, datastoreSource.projectId) && Objects.equals(this.provider, datastoreSource.provider) && - Objects.equals(this.providerConfig, datastoreSource.providerConfig) && - Objects.equals(this.pubSub, datastoreSource.pubSub) && + equalsNullable(this.providerConfig, datastoreSource.providerConfig) && + equalsNullable(this.pubSub, datastoreSource.pubSub) && Objects.equals(this.type, datastoreSource.type) && Objects.equals(this.uid, datastoreSource.uid) && Objects.equals(this.updatedAt, datastoreSource.updatedAt) && Objects.equals(this.url, datastoreSource.url) && - Objects.equals(this.verifier, datastoreSource.verifier); + equalsNullable(this.verifier, datastoreSource.verifier); + } + + 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(bodyFunction, createdAt, customResponse, deletedAt, eventTypeLocation, forwardHeaders, headerFunction, idempotencyKeys, isDisabled, maskId, name, projectId, provider, providerConfig, pubSub, type, uid, updatedAt, url, verifier); + return Objects.hash(hashCodeNullable(bodyFunction), createdAt, customResponse, hashCodeNullable(deletedAt), eventTypeLocation, forwardHeaders, hashCodeNullable(headerFunction), idempotencyKeys, isDisabled, maskId, name, projectId, provider, hashCodeNullable(providerConfig), hashCodeNullable(pubSub), type, uid, updatedAt, url, hashCodeNullable(verifier)); + } + + 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/getconvoy/models/DatastoreSourceProvider.java b/src/main/java/com/getconvoy/models/DatastoreSourceProvider.java index ec3d904..c1c6551 100644 --- a/src/main/java/com/getconvoy/models/DatastoreSourceProvider.java +++ b/src/main/java/com/getconvoy/models/DatastoreSourceProvider.java @@ -34,7 +34,9 @@ public enum DatastoreSourceProvider { TwitterSourceProvider("twitter"), - ShopifySourceProvider("shopify"); + ShopifySourceProvider("shopify"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreSourceType.java b/src/main/java/com/getconvoy/models/DatastoreSourceType.java index 141ab4a..58125f6 100644 --- a/src/main/java/com/getconvoy/models/DatastoreSourceType.java +++ b/src/main/java/com/getconvoy/models/DatastoreSourceType.java @@ -36,7 +36,9 @@ public enum DatastoreSourceType { PubSubSource("pub_sub"), - DBChangeStream("db_change_stream"); + DBChangeStream("db_change_stream"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreStrategyProvider.java b/src/main/java/com/getconvoy/models/DatastoreStrategyProvider.java index 31c8fc0..ff60b95 100644 --- a/src/main/java/com/getconvoy/models/DatastoreStrategyProvider.java +++ b/src/main/java/com/getconvoy/models/DatastoreStrategyProvider.java @@ -32,7 +32,9 @@ public enum DatastoreStrategyProvider { LinearStrategyProvider("linear"), - ExponentialStrategyProvider("exponential"); + ExponentialStrategyProvider("exponential"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreSubscriptionType.java b/src/main/java/com/getconvoy/models/DatastoreSubscriptionType.java index 3213f18..288b19f 100644 --- a/src/main/java/com/getconvoy/models/DatastoreSubscriptionType.java +++ b/src/main/java/com/getconvoy/models/DatastoreSubscriptionType.java @@ -32,7 +32,9 @@ public enum DatastoreSubscriptionType { SubscriptionTypeCLI("cli"), - SubscriptionTypeAPI("api"); + SubscriptionTypeAPI("api"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/DatastoreTwitterProviderConfig.java b/src/main/java/com/getconvoy/models/DatastoreTwitterProviderConfig.java index 9cae824..e10a958 100644 --- a/src/main/java/com/getconvoy/models/DatastoreTwitterProviderConfig.java +++ b/src/main/java/com/getconvoy/models/DatastoreTwitterProviderConfig.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; @@ -38,14 +42,13 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastoreTwitterProviderConfig { public static final String JSON_PROPERTY_CRC_VERIFIED_AT = "crc_verified_at"; - @jakarta.annotation.Nullable - private String crcVerifiedAt; + private JsonNullable crcVerifiedAt = JsonNullable.undefined(); public DatastoreTwitterProviderConfig() { } public DatastoreTwitterProviderConfig crcVerifiedAt(@jakarta.annotation.Nullable String crcVerifiedAt) { - this.crcVerifiedAt = crcVerifiedAt; + this.crcVerifiedAt = JsonNullable.of(crcVerifiedAt); return this; } @@ -54,19 +57,27 @@ public DatastoreTwitterProviderConfig crcVerifiedAt(@jakarta.annotation.Nullable * @return crcVerifiedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CRC_VERIFIED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getCrcVerifiedAt() { - return crcVerifiedAt; + return crcVerifiedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CRC_VERIFIED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCrcVerifiedAt(@jakarta.annotation.Nullable String crcVerifiedAt) { + + public JsonNullable getCrcVerifiedAt_JsonNullable() { + return crcVerifiedAt; + } + + @JsonProperty(JSON_PROPERTY_CRC_VERIFIED_AT) + public void setCrcVerifiedAt_JsonNullable(JsonNullable crcVerifiedAt) { this.crcVerifiedAt = crcVerifiedAt; } + public void setCrcVerifiedAt(@jakarta.annotation.Nullable String crcVerifiedAt) { + this.crcVerifiedAt = JsonNullable.of(crcVerifiedAt); + } + /** * Return true if this datastore.TwitterProviderConfig object is equal to o. @@ -80,12 +91,23 @@ public boolean equals(Object o) { return false; } DatastoreTwitterProviderConfig datastoreTwitterProviderConfig = (DatastoreTwitterProviderConfig) o; - return Objects.equals(this.crcVerifiedAt, datastoreTwitterProviderConfig.crcVerifiedAt); + return equalsNullable(this.crcVerifiedAt, datastoreTwitterProviderConfig.crcVerifiedAt); + } + + 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(crcVerifiedAt); + return Objects.hash(hashCodeNullable(crcVerifiedAt)); + } + + 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/getconvoy/models/DatastoreVerifierConfig.java b/src/main/java/com/getconvoy/models/DatastoreVerifierConfig.java index d36c50a..f62d94f 100644 --- a/src/main/java/com/getconvoy/models/DatastoreVerifierConfig.java +++ b/src/main/java/com/getconvoy/models/DatastoreVerifierConfig.java @@ -29,6 +29,10 @@ import com.getconvoy.models.DatastoreHMac; import com.getconvoy.models.DatastoreVerifierType; 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; @@ -45,16 +49,13 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class DatastoreVerifierConfig { public static final String JSON_PROPERTY_API_KEY = "api_key"; - @jakarta.annotation.Nullable - private DatastoreApiKey apiKey; + private JsonNullable apiKey = JsonNullable.undefined(); public static final String JSON_PROPERTY_BASIC_AUTH = "basic_auth"; - @jakarta.annotation.Nullable - private DatastoreBasicAuth basicAuth; + private JsonNullable basicAuth = JsonNullable.undefined(); public static final String JSON_PROPERTY_HMAC = "hmac"; - @jakarta.annotation.Nullable - private DatastoreHMac hmac; + private JsonNullable hmac = JsonNullable.undefined(); public static final String JSON_PROPERTY_TYPE = "type"; @jakarta.annotation.Nullable @@ -64,7 +65,7 @@ public DatastoreVerifierConfig() { } public DatastoreVerifierConfig apiKey(@jakarta.annotation.Nullable DatastoreApiKey apiKey) { - this.apiKey = apiKey; + this.apiKey = JsonNullable.of(apiKey); return this; } @@ -73,22 +74,30 @@ public DatastoreVerifierConfig apiKey(@jakarta.annotation.Nullable DatastoreApiK * @return apiKey */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreApiKey getApiKey() { - return apiKey; + return apiKey.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_API_KEY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setApiKey(@jakarta.annotation.Nullable DatastoreApiKey apiKey) { + + public JsonNullable getApiKey_JsonNullable() { + return apiKey; + } + + @JsonProperty(JSON_PROPERTY_API_KEY) + public void setApiKey_JsonNullable(JsonNullable apiKey) { this.apiKey = apiKey; } + public void setApiKey(@jakarta.annotation.Nullable DatastoreApiKey apiKey) { + this.apiKey = JsonNullable.of(apiKey); + } + public DatastoreVerifierConfig basicAuth(@jakarta.annotation.Nullable DatastoreBasicAuth basicAuth) { - this.basicAuth = basicAuth; + this.basicAuth = JsonNullable.of(basicAuth); return this; } @@ -97,22 +106,30 @@ public DatastoreVerifierConfig basicAuth(@jakarta.annotation.Nullable DatastoreB * @return basicAuth */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreBasicAuth getBasicAuth() { - return basicAuth; + return basicAuth.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BASIC_AUTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBasicAuth(@jakarta.annotation.Nullable DatastoreBasicAuth basicAuth) { + + public JsonNullable getBasicAuth_JsonNullable() { + return basicAuth; + } + + @JsonProperty(JSON_PROPERTY_BASIC_AUTH) + public void setBasicAuth_JsonNullable(JsonNullable basicAuth) { this.basicAuth = basicAuth; } + public void setBasicAuth(@jakarta.annotation.Nullable DatastoreBasicAuth basicAuth) { + this.basicAuth = JsonNullable.of(basicAuth); + } + public DatastoreVerifierConfig hmac(@jakarta.annotation.Nullable DatastoreHMac hmac) { - this.hmac = hmac; + this.hmac = JsonNullable.of(hmac); return this; } @@ -121,19 +138,27 @@ public DatastoreVerifierConfig hmac(@jakarta.annotation.Nullable DatastoreHMac h * @return hmac */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HMAC, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreHMac getHmac() { - return hmac; + return hmac.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HMAC, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHmac(@jakarta.annotation.Nullable DatastoreHMac hmac) { + + public JsonNullable getHmac_JsonNullable() { + return hmac; + } + + @JsonProperty(JSON_PROPERTY_HMAC) + public void setHmac_JsonNullable(JsonNullable hmac) { this.hmac = hmac; } + public void setHmac(@jakarta.annotation.Nullable DatastoreHMac hmac) { + this.hmac = JsonNullable.of(hmac); + } + public DatastoreVerifierConfig type(@jakarta.annotation.Nullable DatastoreVerifierType type) { this.type = type; @@ -171,15 +196,26 @@ public boolean equals(Object o) { return false; } DatastoreVerifierConfig datastoreVerifierConfig = (DatastoreVerifierConfig) o; - return Objects.equals(this.apiKey, datastoreVerifierConfig.apiKey) && - Objects.equals(this.basicAuth, datastoreVerifierConfig.basicAuth) && - Objects.equals(this.hmac, datastoreVerifierConfig.hmac) && + return equalsNullable(this.apiKey, datastoreVerifierConfig.apiKey) && + equalsNullable(this.basicAuth, datastoreVerifierConfig.basicAuth) && + equalsNullable(this.hmac, datastoreVerifierConfig.hmac) && Objects.equals(this.type, datastoreVerifierConfig.type); } + 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(apiKey, basicAuth, hmac, type); + return Objects.hash(hashCodeNullable(apiKey), hashCodeNullable(basicAuth), hashCodeNullable(hmac), type); + } + + 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/getconvoy/models/DatastoreVerifierType.java b/src/main/java/com/getconvoy/models/DatastoreVerifierType.java index fc4ce11..8b2a4f0 100644 --- a/src/main/java/com/getconvoy/models/DatastoreVerifierType.java +++ b/src/main/java/com/getconvoy/models/DatastoreVerifierType.java @@ -36,7 +36,9 @@ public enum DatastoreVerifierType { BasicAuthVerifier("basic_auth"), - APIKeyVerifier("api_key"); + APIKeyVerifier("api_key"), + + EMPTY(""); private String value; diff --git a/src/main/java/com/getconvoy/models/GetProjects400Response.java b/src/main/java/com/getconvoy/models/GetProjects400Response.java index a8c117d..d63ac01 100644 --- a/src/main/java/com/getconvoy/models/GetProjects400Response.java +++ b/src/main/java/com/getconvoy/models/GetProjects400Response.java @@ -25,6 +25,12 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +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 +54,7 @@ public class GetProjects400Response { private Boolean status; public static final String JSON_PROPERTY_DATA = "data"; - @jakarta.annotation.Nullable - private Object data; + private JsonNullable> data = JsonNullable.>undefined(); public GetProjects400Response() { } @@ -102,8 +107,20 @@ public void setStatus(@jakarta.annotation.Nullable Boolean status) { } - public GetProjects400Response data(@jakarta.annotation.Nullable Object data) { - this.data = data; + public GetProjects400Response data(@jakarta.annotation.Nullable Map data) { + this.data = JsonNullable.>of(data); + return this; + } + + public GetProjects400Response putDataItem(String key, Object dataItem) { + if (this.data == null || !this.data.isPresent()) { + this.data = JsonNullable.>of(new HashMap<>()); + } + try { + this.data.get().put(key, dataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } return this; } @@ -112,19 +129,27 @@ public GetProjects400Response data(@jakarta.annotation.Nullable Object data) { * @return data */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Object getData() { - return data; + @JsonIgnore + public Map getData() { + return data.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setData(@jakarta.annotation.Nullable Object data) { + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable> getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable> data) { this.data = data; } + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = JsonNullable.>of(data); + } + /** * Return true if this GetProjects_400_response object is equal to o. @@ -140,12 +165,23 @@ public boolean equals(Object o) { GetProjects400Response getProjects400Response = (GetProjects400Response) o; return Objects.equals(this.message, getProjects400Response.message) && Objects.equals(this.status, getProjects400Response.status) && - Objects.equals(this.data, getProjects400Response.data); + equalsNullable(this.data, getProjects400Response.data); + } + + 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(message, status, data); + return Objects.hash(message, status, hashCodeNullable(data)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override @@ -211,7 +247,11 @@ public String toUrlQueryString(String prefix) { // add `data` to the URL query string if (getData() != null) { - joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getData())))); + for (String _key : getData().keySet()) { + joiner.add(String.format(java.util.Locale.ROOT, "%sdata%s%s=%s", prefix, suffix, + "".equals(suffix) ? "" : String.format(java.util.Locale.ROOT, "%s%d%s", containerPrefix, _key, containerSuffix), + getData().get(_key), ApiClient.urlEncode(ApiClient.valueToString(getData().get(_key))))); + } } return joiner.toString(); diff --git a/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java b/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java index 332eb50..cd3e2e7 100644 --- a/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java +++ b/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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,12 +52,10 @@ public class ModelsBroadcastEvent { private String acknowledgedAt; public static final String JSON_PROPERTY_CUSTOM_HEADERS = "custom_headers"; - @jakarta.annotation.Nullable - private Map customHeaders = new HashMap<>(); + private JsonNullable> customHeaders = JsonNullable.>undefined(); public static final String JSON_PROPERTY_DATA = "data"; - @jakarta.annotation.Nullable - private Map data = new HashMap<>(); + private JsonNullable> data = JsonNullable.>undefined(); public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; @jakarta.annotation.Nullable @@ -91,15 +93,19 @@ public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt public ModelsBroadcastEvent customHeaders(@jakarta.annotation.Nullable Map customHeaders) { - this.customHeaders = customHeaders; + this.customHeaders = JsonNullable.>of(customHeaders); return this; } public ModelsBroadcastEvent putCustomHeadersItem(String key, String customHeadersItem) { - if (this.customHeaders == null) { - this.customHeaders = new HashMap<>(); + if (this.customHeaders == null || !this.customHeaders.isPresent()) { + this.customHeaders = JsonNullable.>of(new HashMap<>()); + } + try { + this.customHeaders.get().put(key, customHeadersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.customHeaders.put(key, customHeadersItem); return this; } @@ -108,30 +114,42 @@ public ModelsBroadcastEvent putCustomHeadersItem(String key, String customHeader * @return customHeaders */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getCustomHeaders() { - return customHeaders; + return customHeaders.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + + public JsonNullable> getCustomHeaders_JsonNullable() { + return customHeaders; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_HEADERS) + public void setCustomHeaders_JsonNullable(JsonNullable> customHeaders) { this.customHeaders = customHeaders; } + public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = JsonNullable.>of(customHeaders); + } + public ModelsBroadcastEvent data(@jakarta.annotation.Nullable Map data) { - this.data = data; + this.data = JsonNullable.>of(data); return this; } public ModelsBroadcastEvent putDataItem(String key, Object dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); + if (this.data == null || !this.data.isPresent()) { + this.data = JsonNullable.>of(new HashMap<>()); + } + try { + this.data.get().put(key, dataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.data.put(key, dataItem); return this; } @@ -140,19 +158,27 @@ public ModelsBroadcastEvent putDataItem(String key, Object dataItem) { * @return data */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getData() { - return data; + return data.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setData(@jakarta.annotation.Nullable Map data) { + + public JsonNullable> getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable> data) { this.data = data; } + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = JsonNullable.>of(data); + } + public ModelsBroadcastEvent eventType(@jakarta.annotation.Nullable String eventType) { this.eventType = eventType; @@ -215,15 +241,26 @@ public boolean equals(Object o) { } ModelsBroadcastEvent modelsBroadcastEvent = (ModelsBroadcastEvent) o; return Objects.equals(this.acknowledgedAt, modelsBroadcastEvent.acknowledgedAt) && - Objects.equals(this.customHeaders, modelsBroadcastEvent.customHeaders) && - Objects.equals(this.data, modelsBroadcastEvent.data) && + equalsNullable(this.customHeaders, modelsBroadcastEvent.customHeaders) && + equalsNullable(this.data, modelsBroadcastEvent.data) && Objects.equals(this.eventType, modelsBroadcastEvent.eventType) && Objects.equals(this.idempotencyKey, modelsBroadcastEvent.idempotencyKey); } + 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(acknowledgedAt, customHeaders, data, eventType, idempotencyKey); + return Objects.hash(acknowledgedAt, hashCodeNullable(customHeaders), hashCodeNullable(data), eventType, idempotencyKey); + } + + 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/getconvoy/models/ModelsBulkUpdateFilterRequest.java b/src/main/java/com/getconvoy/models/ModelsBulkUpdateFilterRequest.java index b3be79c..a8d2324 100644 --- a/src/main/java/com/getconvoy/models/ModelsBulkUpdateFilterRequest.java +++ b/src/main/java/com/getconvoy/models/ModelsBulkUpdateFilterRequest.java @@ -28,6 +28,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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; @@ -47,8 +51,7 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsBulkUpdateFilterRequest { public static final String JSON_PROPERTY_BODY = "body"; - @jakarta.annotation.Nullable - private Map body = new HashMap<>(); + private JsonNullable> body = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ENABLED_AT = "enabled_at"; @jakarta.annotation.Nullable @@ -59,16 +62,13 @@ public class ModelsBulkUpdateFilterRequest { private String eventType; public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private Map headers = new HashMap<>(); + private JsonNullable> headers = JsonNullable.>undefined(); public static final String JSON_PROPERTY_PATH = "path"; - @jakarta.annotation.Nullable - private Map path = new HashMap<>(); + private JsonNullable> path = JsonNullable.>undefined(); public static final String JSON_PROPERTY_QUERY = "query"; - @jakarta.annotation.Nullable - private Map query = new HashMap<>(); + private JsonNullable> query = JsonNullable.>undefined(); public static final String JSON_PROPERTY_UID = "uid"; @jakarta.annotation.Nonnull @@ -78,15 +78,19 @@ public ModelsBulkUpdateFilterRequest() { } public ModelsBulkUpdateFilterRequest body(@jakarta.annotation.Nullable Map body) { - this.body = body; + this.body = JsonNullable.>of(body); return this; } public ModelsBulkUpdateFilterRequest putBodyItem(String key, Object bodyItem) { - if (this.body == null) { - this.body = new HashMap<>(); + if (this.body == null || !this.body.isPresent()) { + this.body = JsonNullable.>of(new HashMap<>()); + } + try { + this.body.get().put(key, bodyItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.body.put(key, bodyItem); return this; } @@ -95,19 +99,27 @@ public ModelsBulkUpdateFilterRequest putBodyItem(String key, Object bodyItem) { * @return body */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getBody() { - return body; + return body.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setBody(@jakarta.annotation.Nullable Map 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 Map body) { + this.body = JsonNullable.>of(body); + } + public ModelsBulkUpdateFilterRequest enabledAt(@jakarta.annotation.Nullable ModelsOptionalTime enabledAt) { this.enabledAt = enabledAt; @@ -158,15 +170,19 @@ public void setEventType(@jakarta.annotation.Nullable String eventType) { public ModelsBulkUpdateFilterRequest headers(@jakarta.annotation.Nullable Map headers) { - this.headers = headers; + this.headers = JsonNullable.>of(headers); return this; } public ModelsBulkUpdateFilterRequest putHeadersItem(String key, Object headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); + if (this.headers == null || !this.headers.isPresent()) { + this.headers = JsonNullable.>of(new HashMap<>()); + } + try { + this.headers.get().put(key, headersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.headers.put(key, headersItem); return this; } @@ -175,30 +191,42 @@ public ModelsBulkUpdateFilterRequest putHeadersItem(String key, Object headersIt * @return headers */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getHeaders() { - return headers; + return headers.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaders(@jakarta.annotation.Nullable Map headers) { + + public JsonNullable> getHeaders_JsonNullable() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + public void setHeaders_JsonNullable(JsonNullable> headers) { this.headers = headers; } + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = JsonNullable.>of(headers); + } + public ModelsBulkUpdateFilterRequest path(@jakarta.annotation.Nullable Map path) { - this.path = path; + this.path = JsonNullable.>of(path); return this; } public ModelsBulkUpdateFilterRequest putPathItem(String key, Object pathItem) { - if (this.path == null) { - this.path = new HashMap<>(); + if (this.path == null || !this.path.isPresent()) { + this.path = JsonNullable.>of(new HashMap<>()); + } + try { + this.path.get().put(key, pathItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.path.put(key, pathItem); return this; } @@ -207,30 +235,42 @@ public ModelsBulkUpdateFilterRequest putPathItem(String key, Object pathItem) { * @return path */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getPath() { - return path; + return path.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setPath(@jakarta.annotation.Nullable Map path) { + + public JsonNullable> getPath_JsonNullable() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + public void setPath_JsonNullable(JsonNullable> path) { this.path = path; } + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = JsonNullable.>of(path); + } + public ModelsBulkUpdateFilterRequest query(@jakarta.annotation.Nullable Map query) { - this.query = query; + this.query = JsonNullable.>of(query); return this; } public ModelsBulkUpdateFilterRequest putQueryItem(String key, Object queryItem) { - if (this.query == null) { - this.query = new HashMap<>(); + if (this.query == null || !this.query.isPresent()) { + this.query = JsonNullable.>of(new HashMap<>()); + } + try { + this.query.get().put(key, queryItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.query.put(key, queryItem); return this; } @@ -239,19 +279,27 @@ public ModelsBulkUpdateFilterRequest putQueryItem(String key, Object queryItem) * @return query */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getQuery() { - return query; + return query.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setQuery(@jakarta.annotation.Nullable Map query) { + + public JsonNullable> getQuery_JsonNullable() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + public void setQuery_JsonNullable(JsonNullable> query) { this.query = query; } + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = JsonNullable.>of(query); + } + public ModelsBulkUpdateFilterRequest uid(@jakarta.annotation.Nonnull String uid) { this.uid = uid; @@ -289,18 +337,29 @@ public boolean equals(Object o) { return false; } ModelsBulkUpdateFilterRequest modelsBulkUpdateFilterRequest = (ModelsBulkUpdateFilterRequest) o; - return Objects.equals(this.body, modelsBulkUpdateFilterRequest.body) && + return equalsNullable(this.body, modelsBulkUpdateFilterRequest.body) && Objects.equals(this.enabledAt, modelsBulkUpdateFilterRequest.enabledAt) && Objects.equals(this.eventType, modelsBulkUpdateFilterRequest.eventType) && - Objects.equals(this.headers, modelsBulkUpdateFilterRequest.headers) && - Objects.equals(this.path, modelsBulkUpdateFilterRequest.path) && - Objects.equals(this.query, modelsBulkUpdateFilterRequest.query) && + equalsNullable(this.headers, modelsBulkUpdateFilterRequest.headers) && + equalsNullable(this.path, modelsBulkUpdateFilterRequest.path) && + equalsNullable(this.query, modelsBulkUpdateFilterRequest.query) && Objects.equals(this.uid, modelsBulkUpdateFilterRequest.uid); } + 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(body, enabledAt, eventType, headers, path, query, uid); + return Objects.hash(hashCodeNullable(body), enabledAt, eventType, hashCodeNullable(headers), hashCodeNullable(path), hashCodeNullable(query), uid); + } + + 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/getconvoy/models/ModelsCreateEvent.java b/src/main/java/com/getconvoy/models/ModelsCreateEvent.java index 6f91582..16653f1 100644 --- a/src/main/java/com/getconvoy/models/ModelsCreateEvent.java +++ b/src/main/java/com/getconvoy/models/ModelsCreateEvent.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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; @@ -49,12 +53,10 @@ public class ModelsCreateEvent { private String appId; public static final String JSON_PROPERTY_CUSTOM_HEADERS = "custom_headers"; - @jakarta.annotation.Nullable - private Map customHeaders = new HashMap<>(); + private JsonNullable> customHeaders = JsonNullable.>undefined(); public static final String JSON_PROPERTY_DATA = "data"; - @jakarta.annotation.Nullable - private Map data = new HashMap<>(); + private JsonNullable> data = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ENDPOINT_ID = "endpoint_id"; @jakarta.annotation.Nullable @@ -96,15 +98,19 @@ public void setAppId(@jakarta.annotation.Nullable String appId) { public ModelsCreateEvent customHeaders(@jakarta.annotation.Nullable Map customHeaders) { - this.customHeaders = customHeaders; + this.customHeaders = JsonNullable.>of(customHeaders); return this; } public ModelsCreateEvent putCustomHeadersItem(String key, String customHeadersItem) { - if (this.customHeaders == null) { - this.customHeaders = new HashMap<>(); + if (this.customHeaders == null || !this.customHeaders.isPresent()) { + this.customHeaders = JsonNullable.>of(new HashMap<>()); + } + try { + this.customHeaders.get().put(key, customHeadersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.customHeaders.put(key, customHeadersItem); return this; } @@ -113,30 +119,42 @@ public ModelsCreateEvent putCustomHeadersItem(String key, String customHeadersIt * @return customHeaders */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getCustomHeaders() { - return customHeaders; + return customHeaders.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + + public JsonNullable> getCustomHeaders_JsonNullable() { + return customHeaders; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_HEADERS) + public void setCustomHeaders_JsonNullable(JsonNullable> customHeaders) { this.customHeaders = customHeaders; } + public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = JsonNullable.>of(customHeaders); + } + public ModelsCreateEvent data(@jakarta.annotation.Nullable Map data) { - this.data = data; + this.data = JsonNullable.>of(data); return this; } public ModelsCreateEvent putDataItem(String key, Object dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); + if (this.data == null || !this.data.isPresent()) { + this.data = JsonNullable.>of(new HashMap<>()); + } + try { + this.data.get().put(key, dataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.data.put(key, dataItem); return this; } @@ -145,19 +163,27 @@ public ModelsCreateEvent putDataItem(String key, Object dataItem) { * @return data */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getData() { - return data; + return data.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setData(@jakarta.annotation.Nullable Map data) { + + public JsonNullable> getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable> data) { this.data = data; } + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = JsonNullable.>of(data); + } + public ModelsCreateEvent endpointId(@jakarta.annotation.Nullable String endpointId) { this.endpointId = endpointId; @@ -244,16 +270,27 @@ public boolean equals(Object o) { } ModelsCreateEvent modelsCreateEvent = (ModelsCreateEvent) o; return Objects.equals(this.appId, modelsCreateEvent.appId) && - Objects.equals(this.customHeaders, modelsCreateEvent.customHeaders) && - Objects.equals(this.data, modelsCreateEvent.data) && + equalsNullable(this.customHeaders, modelsCreateEvent.customHeaders) && + equalsNullable(this.data, modelsCreateEvent.data) && Objects.equals(this.endpointId, modelsCreateEvent.endpointId) && Objects.equals(this.eventType, modelsCreateEvent.eventType) && Objects.equals(this.idempotencyKey, modelsCreateEvent.idempotencyKey); } + 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(appId, customHeaders, data, endpointId, eventType, idempotencyKey); + return Objects.hash(appId, hashCodeNullable(customHeaders), hashCodeNullable(data), endpointId, eventType, idempotencyKey); + } + + 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/getconvoy/models/ModelsCreateEventType.java b/src/main/java/com/getconvoy/models/ModelsCreateEventType.java index 00108b3..4949b57 100644 --- a/src/main/java/com/getconvoy/models/ModelsCreateEventType.java +++ b/src/main/java/com/getconvoy/models/ModelsCreateEventType.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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; @@ -51,8 +55,7 @@ public class ModelsCreateEventType { private String description; public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema"; - @jakarta.annotation.Nullable - private Map jsonSchema = new HashMap<>(); + private JsonNullable> jsonSchema = JsonNullable.>undefined(); public static final String JSON_PROPERTY_NAME = "name"; @jakarta.annotation.Nullable @@ -110,15 +113,19 @@ public void setDescription(@jakarta.annotation.Nullable String description) { public ModelsCreateEventType jsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { - this.jsonSchema = jsonSchema; + this.jsonSchema = JsonNullable.>of(jsonSchema); return this; } public ModelsCreateEventType putJsonSchemaItem(String key, Object jsonSchemaItem) { - if (this.jsonSchema == null) { - this.jsonSchema = new HashMap<>(); + if (this.jsonSchema == null || !this.jsonSchema.isPresent()) { + this.jsonSchema = JsonNullable.>of(new HashMap<>()); + } + try { + this.jsonSchema.get().put(key, jsonSchemaItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.jsonSchema.put(key, jsonSchemaItem); return this; } @@ -127,19 +134,27 @@ public ModelsCreateEventType putJsonSchemaItem(String key, Object jsonSchemaItem * @return jsonSchema */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getJsonSchema() { - return jsonSchema; + return jsonSchema.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setJsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + + public JsonNullable> getJsonSchema_JsonNullable() { + return jsonSchema; + } + + @JsonProperty(JSON_PROPERTY_JSON_SCHEMA) + public void setJsonSchema_JsonNullable(JsonNullable> jsonSchema) { this.jsonSchema = jsonSchema; } + public void setJsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + this.jsonSchema = JsonNullable.>of(jsonSchema); + } + public ModelsCreateEventType name(@jakarta.annotation.Nullable String name) { this.name = name; @@ -179,13 +194,24 @@ public boolean equals(Object o) { ModelsCreateEventType modelsCreateEventType = (ModelsCreateEventType) o; return Objects.equals(this.category, modelsCreateEventType.category) && Objects.equals(this.description, modelsCreateEventType.description) && - Objects.equals(this.jsonSchema, modelsCreateEventType.jsonSchema) && + equalsNullable(this.jsonSchema, modelsCreateEventType.jsonSchema) && Objects.equals(this.name, modelsCreateEventType.name); } + 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(category, description, jsonSchema, name); + return Objects.hash(category, description, hashCodeNullable(jsonSchema), name); + } + + 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/getconvoy/models/ModelsCreateFilterRequest.java b/src/main/java/com/getconvoy/models/ModelsCreateFilterRequest.java index 4abaeb2..00daeb4 100644 --- a/src/main/java/com/getconvoy/models/ModelsCreateFilterRequest.java +++ b/src/main/java/com/getconvoy/models/ModelsCreateFilterRequest.java @@ -28,6 +28,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsCreateFilterRequest { public static final String JSON_PROPERTY_BODY = "body"; - @jakarta.annotation.Nullable - private Map body; + private JsonNullable> body = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ENABLED_AT = "enabled_at"; @jakarta.annotation.Nullable @@ -58,30 +61,31 @@ public class ModelsCreateFilterRequest { private String eventType; public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private Map headers; + private JsonNullable> headers = JsonNullable.>undefined(); public static final String JSON_PROPERTY_PATH = "path"; - @jakarta.annotation.Nullable - private Map path; + private JsonNullable> path = JsonNullable.>undefined(); public static final String JSON_PROPERTY_QUERY = "query"; - @jakarta.annotation.Nullable - private Map query; + private JsonNullable> query = JsonNullable.>undefined(); public ModelsCreateFilterRequest() { } public ModelsCreateFilterRequest body(@jakarta.annotation.Nullable Map body) { - this.body = body; + this.body = JsonNullable.>of(body); return this; } public ModelsCreateFilterRequest putBodyItem(String key, Object bodyItem) { - if (this.body == null) { - this.body = new HashMap<>(); + if (this.body == null || !this.body.isPresent()) { + this.body = JsonNullable.>of(new HashMap<>()); + } + try { + this.body.get().put(key, bodyItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.body.put(key, bodyItem); return this; } @@ -90,19 +94,27 @@ public ModelsCreateFilterRequest putBodyItem(String key, Object bodyItem) { * @return body */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getBody() { - return body; + return body.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setBody(@jakarta.annotation.Nullable Map 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 Map body) { + this.body = JsonNullable.>of(body); + } + public ModelsCreateFilterRequest enabledAt(@jakarta.annotation.Nullable ModelsOptionalTime enabledAt) { this.enabledAt = enabledAt; @@ -153,15 +165,19 @@ public void setEventType(@jakarta.annotation.Nonnull String eventType) { public ModelsCreateFilterRequest headers(@jakarta.annotation.Nullable Map headers) { - this.headers = headers; + this.headers = JsonNullable.>of(headers); return this; } public ModelsCreateFilterRequest putHeadersItem(String key, Object headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); + if (this.headers == null || !this.headers.isPresent()) { + this.headers = JsonNullable.>of(new HashMap<>()); + } + try { + this.headers.get().put(key, headersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.headers.put(key, headersItem); return this; } @@ -170,30 +186,42 @@ public ModelsCreateFilterRequest putHeadersItem(String key, Object headersItem) * @return headers */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getHeaders() { - return headers; + return headers.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaders(@jakarta.annotation.Nullable Map headers) { + + public JsonNullable> getHeaders_JsonNullable() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + public void setHeaders_JsonNullable(JsonNullable> headers) { this.headers = headers; } + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = JsonNullable.>of(headers); + } + public ModelsCreateFilterRequest path(@jakarta.annotation.Nullable Map path) { - this.path = path; + this.path = JsonNullable.>of(path); return this; } public ModelsCreateFilterRequest putPathItem(String key, Object pathItem) { - if (this.path == null) { - this.path = new HashMap<>(); + if (this.path == null || !this.path.isPresent()) { + this.path = JsonNullable.>of(new HashMap<>()); + } + try { + this.path.get().put(key, pathItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.path.put(key, pathItem); return this; } @@ -202,30 +230,42 @@ public ModelsCreateFilterRequest putPathItem(String key, Object pathItem) { * @return path */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getPath() { - return path; + return path.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setPath(@jakarta.annotation.Nullable Map path) { + + public JsonNullable> getPath_JsonNullable() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + public void setPath_JsonNullable(JsonNullable> path) { this.path = path; } + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = JsonNullable.>of(path); + } + public ModelsCreateFilterRequest query(@jakarta.annotation.Nullable Map query) { - this.query = query; + this.query = JsonNullable.>of(query); return this; } public ModelsCreateFilterRequest putQueryItem(String key, Object queryItem) { - if (this.query == null) { - this.query = new HashMap<>(); + if (this.query == null || !this.query.isPresent()) { + this.query = JsonNullable.>of(new HashMap<>()); + } + try { + this.query.get().put(key, queryItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.query.put(key, queryItem); return this; } @@ -234,19 +274,27 @@ public ModelsCreateFilterRequest putQueryItem(String key, Object queryItem) { * @return query */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getQuery() { - return query; + return query.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setQuery(@jakarta.annotation.Nullable Map query) { + + public JsonNullable> getQuery_JsonNullable() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + public void setQuery_JsonNullable(JsonNullable> query) { this.query = query; } + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = JsonNullable.>of(query); + } + /** * Return true if this models.CreateFilterRequest object is equal to o. @@ -260,17 +308,28 @@ public boolean equals(Object o) { return false; } ModelsCreateFilterRequest modelsCreateFilterRequest = (ModelsCreateFilterRequest) o; - return Objects.equals(this.body, modelsCreateFilterRequest.body) && + return equalsNullable(this.body, modelsCreateFilterRequest.body) && Objects.equals(this.enabledAt, modelsCreateFilterRequest.enabledAt) && Objects.equals(this.eventType, modelsCreateFilterRequest.eventType) && - Objects.equals(this.headers, modelsCreateFilterRequest.headers) && - Objects.equals(this.path, modelsCreateFilterRequest.path) && - Objects.equals(this.query, modelsCreateFilterRequest.query); + equalsNullable(this.headers, modelsCreateFilterRequest.headers) && + equalsNullable(this.path, modelsCreateFilterRequest.path) && + equalsNullable(this.query, modelsCreateFilterRequest.query); + } + + 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(body, enabledAt, eventType, headers, path, query); + return Objects.hash(hashCodeNullable(body), enabledAt, eventType, hashCodeNullable(headers), hashCodeNullable(path), hashCodeNullable(query)); + } + + 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/getconvoy/models/ModelsDynamicEvent.java b/src/main/java/com/getconvoy/models/ModelsDynamicEvent.java index c6d8dd0..0f5ae74 100644 --- a/src/main/java/com/getconvoy/models/ModelsDynamicEvent.java +++ b/src/main/java/com/getconvoy/models/ModelsDynamicEvent.java @@ -29,6 +29,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +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,12 +52,10 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsDynamicEvent { public static final String JSON_PROPERTY_CUSTOM_HEADERS = "custom_headers"; - @jakarta.annotation.Nullable - private Map customHeaders = new HashMap<>(); + private JsonNullable> customHeaders = JsonNullable.>undefined(); public static final String JSON_PROPERTY_DATA = "data"; - @jakarta.annotation.Nullable - private Map data = new HashMap<>(); + private JsonNullable> data = JsonNullable.>undefined(); public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; @jakarta.annotation.Nullable @@ -79,15 +81,19 @@ public ModelsDynamicEvent() { } public ModelsDynamicEvent customHeaders(@jakarta.annotation.Nullable Map customHeaders) { - this.customHeaders = customHeaders; + this.customHeaders = JsonNullable.>of(customHeaders); return this; } public ModelsDynamicEvent putCustomHeadersItem(String key, String customHeadersItem) { - if (this.customHeaders == null) { - this.customHeaders = new HashMap<>(); + if (this.customHeaders == null || !this.customHeaders.isPresent()) { + this.customHeaders = JsonNullable.>of(new HashMap<>()); + } + try { + this.customHeaders.get().put(key, customHeadersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.customHeaders.put(key, customHeadersItem); return this; } @@ -96,30 +102,42 @@ public ModelsDynamicEvent putCustomHeadersItem(String key, String customHeadersI * @return customHeaders */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getCustomHeaders() { - return customHeaders; + return customHeaders.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + + public JsonNullable> getCustomHeaders_JsonNullable() { + return customHeaders; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_HEADERS) + public void setCustomHeaders_JsonNullable(JsonNullable> customHeaders) { this.customHeaders = customHeaders; } + public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = JsonNullable.>of(customHeaders); + } + public ModelsDynamicEvent data(@jakarta.annotation.Nullable Map data) { - this.data = data; + this.data = JsonNullable.>of(data); return this; } public ModelsDynamicEvent putDataItem(String key, Object dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); + if (this.data == null || !this.data.isPresent()) { + this.data = JsonNullable.>of(new HashMap<>()); + } + try { + this.data.get().put(key, dataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.data.put(key, dataItem); return this; } @@ -128,19 +146,27 @@ public ModelsDynamicEvent putDataItem(String key, Object dataItem) { * @return data */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getData() { - return data; + return data.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setData(@jakarta.annotation.Nullable Map data) { + + public JsonNullable> getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable> data) { this.data = data; } + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = JsonNullable.>of(data); + } + public ModelsDynamicEvent eventType(@jakarta.annotation.Nullable String eventType) { this.eventType = eventType; @@ -282,8 +308,8 @@ public boolean equals(Object o) { return false; } ModelsDynamicEvent modelsDynamicEvent = (ModelsDynamicEvent) o; - return Objects.equals(this.customHeaders, modelsDynamicEvent.customHeaders) && - Objects.equals(this.data, modelsDynamicEvent.data) && + return equalsNullable(this.customHeaders, modelsDynamicEvent.customHeaders) && + equalsNullable(this.data, modelsDynamicEvent.data) && Objects.equals(this.eventType, modelsDynamicEvent.eventType) && Objects.equals(this.eventTypes, modelsDynamicEvent.eventTypes) && Objects.equals(this.idempotencyKey, modelsDynamicEvent.idempotencyKey) && @@ -291,9 +317,20 @@ public boolean equals(Object o) { Objects.equals(this.url, modelsDynamicEvent.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(customHeaders, data, eventType, eventTypes, idempotencyKey, secret, url); + return Objects.hash(hashCodeNullable(customHeaders), hashCodeNullable(data), eventType, eventTypes, idempotencyKey, secret, 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/getconvoy/models/ModelsEndpointResponse.java b/src/main/java/com/getconvoy/models/ModelsEndpointResponse.java index 19c98e3..5a1f4cb 100644 --- a/src/main/java/com/getconvoy/models/ModelsEndpointResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsEndpointResponse.java @@ -32,6 +32,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; @@ -75,12 +79,10 @@ public class ModelsEndpointResponse { private Boolean advancedSignatures; public static final String JSON_PROPERTY_AUTHENTICATION = "authentication"; - @jakarta.annotation.Nullable - private DatastoreEndpointAuthentication authentication; + private JsonNullable authentication = JsonNullable.undefined(); public static final String JSON_PROPERTY_CB_STATE = "cb_state"; - @jakarta.annotation.Nullable - private String cbState; + private JsonNullable cbState = JsonNullable.undefined(); public static final String JSON_PROPERTY_CONTENT_TYPE = "content_type"; @jakarta.annotation.Nullable @@ -91,8 +93,7 @@ public class ModelsEndpointResponse { private String createdAt; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_DESCRIPTION = "description"; @jakarta.annotation.Nullable @@ -103,20 +104,17 @@ public class ModelsEndpointResponse { private Integer events; public static final String JSON_PROPERTY_FAILURE_COUNT = "failure_count"; - @jakarta.annotation.Nullable - private Integer failureCount; + private JsonNullable failureCount = JsonNullable.undefined(); public static final String JSON_PROPERTY_FAILURE_RATE = "failure_rate"; - @jakarta.annotation.Nullable - private BigDecimal failureRate; + private JsonNullable failureRate = JsonNullable.undefined(); public static final String JSON_PROPERTY_HTTP_TIMEOUT = "http_timeout"; @jakarta.annotation.Nullable private Integer httpTimeout; public static final String JSON_PROPERTY_MTLS_CLIENT_CERT = "mtls_client_cert"; - @jakarta.annotation.Nullable - private DatastoreMtlsClientCert mtlsClientCert; + private JsonNullable mtlsClientCert = JsonNullable.undefined(); public static final String JSON_PROPERTY_NAME = "name"; @jakarta.annotation.Nullable @@ -127,8 +125,7 @@ public class ModelsEndpointResponse { private String ownerId; public static final String JSON_PROPERTY_PERIOD_FAILURE_RATE = "period_failure_rate"; - @jakarta.annotation.Nullable - private BigDecimal periodFailureRate; + private JsonNullable periodFailureRate = JsonNullable.undefined(); public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; @jakarta.annotation.Nullable @@ -143,8 +140,7 @@ public class ModelsEndpointResponse { private Integer rateLimitDuration; public static final String JSON_PROPERTY_RETRY_COUNT = "retry_count"; - @jakarta.annotation.Nullable - private Integer retryCount; + private JsonNullable retryCount = JsonNullable.undefined(); public static final String JSON_PROPERTY_SECRETS = "secrets"; @jakarta.annotation.Nullable @@ -159,8 +155,7 @@ public class ModelsEndpointResponse { private DatastoreEndpointStatus status; public static final String JSON_PROPERTY_SUCCESS_COUNT = "success_count"; - @jakarta.annotation.Nullable - private Integer successCount; + private JsonNullable successCount = JsonNullable.undefined(); public static final String JSON_PROPERTY_SUPPORT_EMAIL = "support_email"; @jakarta.annotation.Nullable @@ -206,7 +201,7 @@ public void setAdvancedSignatures(@jakarta.annotation.Nullable Boolean advancedS public ModelsEndpointResponse authentication(@jakarta.annotation.Nullable DatastoreEndpointAuthentication authentication) { - this.authentication = authentication; + this.authentication = JsonNullable.of(authentication); return this; } @@ -215,22 +210,30 @@ public ModelsEndpointResponse authentication(@jakarta.annotation.Nullable Datast * @return authentication */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreEndpointAuthentication getAuthentication() { - return authentication; + return authentication.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_AUTHENTICATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAuthentication(@jakarta.annotation.Nullable DatastoreEndpointAuthentication authentication) { + + public JsonNullable getAuthentication_JsonNullable() { + return authentication; + } + + @JsonProperty(JSON_PROPERTY_AUTHENTICATION) + public void setAuthentication_JsonNullable(JsonNullable authentication) { this.authentication = authentication; } + public void setAuthentication(@jakarta.annotation.Nullable DatastoreEndpointAuthentication authentication) { + this.authentication = JsonNullable.of(authentication); + } + public ModelsEndpointResponse cbState(@jakarta.annotation.Nullable String cbState) { - this.cbState = cbState; + this.cbState = JsonNullable.of(cbState); return this; } @@ -239,19 +242,27 @@ public ModelsEndpointResponse cbState(@jakarta.annotation.Nullable String cbStat * @return cbState */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CB_STATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getCbState() { - return cbState; + return cbState.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CB_STATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCbState(@jakarta.annotation.Nullable String cbState) { + + public JsonNullable getCbState_JsonNullable() { + return cbState; + } + + @JsonProperty(JSON_PROPERTY_CB_STATE) + public void setCbState_JsonNullable(JsonNullable cbState) { this.cbState = cbState; } + public void setCbState(@jakarta.annotation.Nullable String cbState) { + this.cbState = JsonNullable.of(cbState); + } + public ModelsEndpointResponse contentType(@jakarta.annotation.Nullable String contentType) { this.contentType = contentType; @@ -302,7 +313,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public ModelsEndpointResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -311,19 +322,27 @@ public ModelsEndpointResponse deletedAt(@jakarta.annotation.Nullable String dele * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public ModelsEndpointResponse description(@jakarta.annotation.Nullable String description) { this.description = description; @@ -374,7 +393,7 @@ public void setEvents(@jakarta.annotation.Nullable Integer events) { public ModelsEndpointResponse failureCount(@jakarta.annotation.Nullable Integer failureCount) { - this.failureCount = failureCount; + this.failureCount = JsonNullable.of(failureCount); return this; } @@ -383,22 +402,30 @@ public ModelsEndpointResponse failureCount(@jakarta.annotation.Nullable Integer * @return failureCount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FAILURE_COUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Integer getFailureCount() { - return failureCount; + return failureCount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_FAILURE_COUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFailureCount(@jakarta.annotation.Nullable Integer failureCount) { + + public JsonNullable getFailureCount_JsonNullable() { + return failureCount; + } + + @JsonProperty(JSON_PROPERTY_FAILURE_COUNT) + public void setFailureCount_JsonNullable(JsonNullable failureCount) { this.failureCount = failureCount; } + public void setFailureCount(@jakarta.annotation.Nullable Integer failureCount) { + this.failureCount = JsonNullable.of(failureCount); + } + public ModelsEndpointResponse failureRate(@jakarta.annotation.Nullable BigDecimal failureRate) { - this.failureRate = failureRate; + this.failureRate = JsonNullable.of(failureRate); return this; } @@ -407,19 +434,27 @@ public ModelsEndpointResponse failureRate(@jakarta.annotation.Nullable BigDecima * @return failureRate */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FAILURE_RATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public BigDecimal getFailureRate() { - return failureRate; + return failureRate.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_FAILURE_RATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFailureRate(@jakarta.annotation.Nullable BigDecimal failureRate) { + + public JsonNullable getFailureRate_JsonNullable() { + return failureRate; + } + + @JsonProperty(JSON_PROPERTY_FAILURE_RATE) + public void setFailureRate_JsonNullable(JsonNullable failureRate) { this.failureRate = failureRate; } + public void setFailureRate(@jakarta.annotation.Nullable BigDecimal failureRate) { + this.failureRate = JsonNullable.of(failureRate); + } + public ModelsEndpointResponse httpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { this.httpTimeout = httpTimeout; @@ -446,7 +481,7 @@ public void setHttpTimeout(@jakarta.annotation.Nullable Integer httpTimeout) { public ModelsEndpointResponse mtlsClientCert(@jakarta.annotation.Nullable DatastoreMtlsClientCert mtlsClientCert) { - this.mtlsClientCert = mtlsClientCert; + this.mtlsClientCert = JsonNullable.of(mtlsClientCert); return this; } @@ -455,19 +490,27 @@ public ModelsEndpointResponse mtlsClientCert(@jakarta.annotation.Nullable Datast * @return mtlsClientCert */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreMtlsClientCert getMtlsClientCert() { - return mtlsClientCert; + return mtlsClientCert.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_MTLS_CLIENT_CERT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMtlsClientCert(@jakarta.annotation.Nullable DatastoreMtlsClientCert mtlsClientCert) { + + public JsonNullable getMtlsClientCert_JsonNullable() { + return mtlsClientCert; + } + + @JsonProperty(JSON_PROPERTY_MTLS_CLIENT_CERT) + public void setMtlsClientCert_JsonNullable(JsonNullable mtlsClientCert) { this.mtlsClientCert = mtlsClientCert; } + public void setMtlsClientCert(@jakarta.annotation.Nullable DatastoreMtlsClientCert mtlsClientCert) { + this.mtlsClientCert = JsonNullable.of(mtlsClientCert); + } + public ModelsEndpointResponse name(@jakarta.annotation.Nullable String name) { this.name = name; @@ -518,7 +561,7 @@ public void setOwnerId(@jakarta.annotation.Nullable String ownerId) { public ModelsEndpointResponse periodFailureRate(@jakarta.annotation.Nullable BigDecimal periodFailureRate) { - this.periodFailureRate = periodFailureRate; + this.periodFailureRate = JsonNullable.of(periodFailureRate); return this; } @@ -527,19 +570,27 @@ public ModelsEndpointResponse periodFailureRate(@jakarta.annotation.Nullable Big * @return periodFailureRate */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PERIOD_FAILURE_RATE, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public BigDecimal getPeriodFailureRate() { - return periodFailureRate; + return periodFailureRate.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PERIOD_FAILURE_RATE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPeriodFailureRate(@jakarta.annotation.Nullable BigDecimal periodFailureRate) { + + public JsonNullable getPeriodFailureRate_JsonNullable() { + return periodFailureRate; + } + + @JsonProperty(JSON_PROPERTY_PERIOD_FAILURE_RATE) + public void setPeriodFailureRate_JsonNullable(JsonNullable periodFailureRate) { this.periodFailureRate = periodFailureRate; } + public void setPeriodFailureRate(@jakarta.annotation.Nullable BigDecimal periodFailureRate) { + this.periodFailureRate = JsonNullable.of(periodFailureRate); + } + public ModelsEndpointResponse projectId(@jakarta.annotation.Nullable String projectId) { this.projectId = projectId; @@ -614,7 +665,7 @@ public void setRateLimitDuration(@jakarta.annotation.Nullable Integer rateLimitD public ModelsEndpointResponse retryCount(@jakarta.annotation.Nullable Integer retryCount) { - this.retryCount = retryCount; + this.retryCount = JsonNullable.of(retryCount); return this; } @@ -623,19 +674,27 @@ public ModelsEndpointResponse retryCount(@jakarta.annotation.Nullable Integer re * @return retryCount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Integer getRetryCount() { - return retryCount; + return retryCount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RETRY_COUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRetryCount(@jakarta.annotation.Nullable Integer retryCount) { + + public JsonNullable getRetryCount_JsonNullable() { + return retryCount; + } + + @JsonProperty(JSON_PROPERTY_RETRY_COUNT) + public void setRetryCount_JsonNullable(JsonNullable retryCount) { this.retryCount = retryCount; } + public void setRetryCount(@jakarta.annotation.Nullable Integer retryCount) { + this.retryCount = JsonNullable.of(retryCount); + } + public ModelsEndpointResponse secrets(@jakarta.annotation.Nullable List secrets) { this.secrets = secrets; @@ -718,7 +777,7 @@ public void setStatus(@jakarta.annotation.Nullable DatastoreEndpointStatus statu public ModelsEndpointResponse successCount(@jakarta.annotation.Nullable Integer successCount) { - this.successCount = successCount; + this.successCount = JsonNullable.of(successCount); return this; } @@ -727,19 +786,27 @@ public ModelsEndpointResponse successCount(@jakarta.annotation.Nullable Integer * @return successCount */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SUCCESS_COUNT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Integer getSuccessCount() { - return successCount; + return successCount.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SUCCESS_COUNT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSuccessCount(@jakarta.annotation.Nullable Integer successCount) { + + public JsonNullable getSuccessCount_JsonNullable() { + return successCount; + } + + @JsonProperty(JSON_PROPERTY_SUCCESS_COUNT) + public void setSuccessCount_JsonNullable(JsonNullable successCount) { this.successCount = successCount; } + public void setSuccessCount(@jakarta.annotation.Nullable Integer successCount) { + this.successCount = JsonNullable.of(successCount); + } + public ModelsEndpointResponse supportEmail(@jakarta.annotation.Nullable String supportEmail) { this.supportEmail = supportEmail; @@ -850,37 +917,48 @@ public boolean equals(Object o) { } ModelsEndpointResponse modelsEndpointResponse = (ModelsEndpointResponse) o; return Objects.equals(this.advancedSignatures, modelsEndpointResponse.advancedSignatures) && - Objects.equals(this.authentication, modelsEndpointResponse.authentication) && - Objects.equals(this.cbState, modelsEndpointResponse.cbState) && + equalsNullable(this.authentication, modelsEndpointResponse.authentication) && + equalsNullable(this.cbState, modelsEndpointResponse.cbState) && Objects.equals(this.contentType, modelsEndpointResponse.contentType) && Objects.equals(this.createdAt, modelsEndpointResponse.createdAt) && - Objects.equals(this.deletedAt, modelsEndpointResponse.deletedAt) && + equalsNullable(this.deletedAt, modelsEndpointResponse.deletedAt) && Objects.equals(this.description, modelsEndpointResponse.description) && Objects.equals(this.events, modelsEndpointResponse.events) && - Objects.equals(this.failureCount, modelsEndpointResponse.failureCount) && - Objects.equals(this.failureRate, modelsEndpointResponse.failureRate) && + equalsNullable(this.failureCount, modelsEndpointResponse.failureCount) && + equalsNullable(this.failureRate, modelsEndpointResponse.failureRate) && Objects.equals(this.httpTimeout, modelsEndpointResponse.httpTimeout) && - Objects.equals(this.mtlsClientCert, modelsEndpointResponse.mtlsClientCert) && + equalsNullable(this.mtlsClientCert, modelsEndpointResponse.mtlsClientCert) && Objects.equals(this.name, modelsEndpointResponse.name) && Objects.equals(this.ownerId, modelsEndpointResponse.ownerId) && - Objects.equals(this.periodFailureRate, modelsEndpointResponse.periodFailureRate) && + equalsNullable(this.periodFailureRate, modelsEndpointResponse.periodFailureRate) && Objects.equals(this.projectId, modelsEndpointResponse.projectId) && Objects.equals(this.rateLimit, modelsEndpointResponse.rateLimit) && Objects.equals(this.rateLimitDuration, modelsEndpointResponse.rateLimitDuration) && - Objects.equals(this.retryCount, modelsEndpointResponse.retryCount) && + equalsNullable(this.retryCount, modelsEndpointResponse.retryCount) && Objects.equals(this.secrets, modelsEndpointResponse.secrets) && Objects.equals(this.slackWebhookUrl, modelsEndpointResponse.slackWebhookUrl) && Objects.equals(this.status, modelsEndpointResponse.status) && - Objects.equals(this.successCount, modelsEndpointResponse.successCount) && + equalsNullable(this.successCount, modelsEndpointResponse.successCount) && Objects.equals(this.supportEmail, modelsEndpointResponse.supportEmail) && Objects.equals(this.uid, modelsEndpointResponse.uid) && Objects.equals(this.updatedAt, modelsEndpointResponse.updatedAt) && Objects.equals(this.url, modelsEndpointResponse.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(advancedSignatures, authentication, cbState, contentType, createdAt, deletedAt, description, events, failureCount, failureRate, httpTimeout, mtlsClientCert, name, ownerId, periodFailureRate, projectId, rateLimit, rateLimitDuration, retryCount, secrets, slackWebhookUrl, status, successCount, supportEmail, uid, updatedAt, url); + return Objects.hash(advancedSignatures, hashCodeNullable(authentication), hashCodeNullable(cbState), contentType, createdAt, hashCodeNullable(deletedAt), description, events, hashCodeNullable(failureCount), hashCodeNullable(failureRate), httpTimeout, hashCodeNullable(mtlsClientCert), name, ownerId, hashCodeNullable(periodFailureRate), projectId, rateLimit, rateLimitDuration, hashCodeNullable(retryCount), secrets, slackWebhookUrl, status, hashCodeNullable(successCount), supportEmail, uid, updatedAt, 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/getconvoy/models/ModelsEventDeliveryResponse.java b/src/main/java/com/getconvoy/models/ModelsEventDeliveryResponse.java index 8ef1af3..433e7b5 100644 --- a/src/main/java/com/getconvoy/models/ModelsEventDeliveryResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsEventDeliveryResponse.java @@ -37,6 +37,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +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; @@ -75,20 +79,17 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsEventDeliveryResponse { public static final String JSON_PROPERTY_ACKNOWLEDGED_AT = "acknowledged_at"; - @jakarta.annotation.Nullable - private String acknowledgedAt; + private JsonNullable acknowledgedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_CLI_METADATA = "cli_metadata"; - @jakarta.annotation.Nullable - private DatastoreCLIMetadata cliMetadata; + private JsonNullable cliMetadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_CREATED_AT = "created_at"; @jakarta.annotation.Nullable private String createdAt; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_DELIVERY_MODE = "delivery_mode"; @jakarta.annotation.Nullable @@ -103,32 +104,28 @@ public class ModelsEventDeliveryResponse { private String deviceId; public static final String JSON_PROPERTY_DEVICE_METADATA = "device_metadata"; - @jakarta.annotation.Nullable - private DatastoreDevice deviceMetadata; + private JsonNullable deviceMetadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_ENDPOINT_ID = "endpoint_id"; @jakarta.annotation.Nullable private String endpointId; public static final String JSON_PROPERTY_ENDPOINT_METADATA = "endpoint_metadata"; - @jakarta.annotation.Nullable - private DatastoreEndpoint endpointMetadata; + private JsonNullable endpointMetadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_EVENT_ID = "event_id"; @jakarta.annotation.Nullable private String eventId; public static final String JSON_PROPERTY_EVENT_METADATA = "event_metadata"; - @jakarta.annotation.Nullable - private DatastoreEvent eventMetadata; + private JsonNullable eventMetadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; @jakarta.annotation.Nullable private String eventType; public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private Map> headers = new HashMap<>(); + private JsonNullable>> headers = JsonNullable.>>undefined(); public static final String JSON_PROPERTY_IDEMPOTENCY_KEY = "idempotency_key"; @jakarta.annotation.Nullable @@ -143,16 +140,14 @@ public class ModelsEventDeliveryResponse { private BigDecimal latencySeconds; public static final String JSON_PROPERTY_METADATA = "metadata"; - @jakarta.annotation.Nullable - private DatastoreMetadata metadata; + private JsonNullable metadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; @jakarta.annotation.Nullable private String projectId; public static final String JSON_PROPERTY_SOURCE_METADATA = "source_metadata"; - @jakarta.annotation.Nullable - private DatastoreSource sourceMetadata; + private JsonNullable sourceMetadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_STATUS = "status"; @jakarta.annotation.Nullable @@ -182,7 +177,7 @@ public ModelsEventDeliveryResponse() { } public ModelsEventDeliveryResponse acknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { - this.acknowledgedAt = acknowledgedAt; + this.acknowledgedAt = JsonNullable.of(acknowledgedAt); return this; } @@ -191,22 +186,30 @@ public ModelsEventDeliveryResponse acknowledgedAt(@jakarta.annotation.Nullable S * @return acknowledgedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getAcknowledgedAt() { - return acknowledgedAt; + return acknowledgedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + + public JsonNullable getAcknowledgedAt_JsonNullable() { + return acknowledgedAt; + } + + @JsonProperty(JSON_PROPERTY_ACKNOWLEDGED_AT) + public void setAcknowledgedAt_JsonNullable(JsonNullable acknowledgedAt) { this.acknowledgedAt = acknowledgedAt; } + public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = JsonNullable.of(acknowledgedAt); + } + public ModelsEventDeliveryResponse cliMetadata(@jakarta.annotation.Nullable DatastoreCLIMetadata cliMetadata) { - this.cliMetadata = cliMetadata; + this.cliMetadata = JsonNullable.of(cliMetadata); return this; } @@ -215,19 +218,27 @@ public ModelsEventDeliveryResponse cliMetadata(@jakarta.annotation.Nullable Data * @return cliMetadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CLI_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreCLIMetadata getCliMetadata() { - return cliMetadata; + return cliMetadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CLI_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCliMetadata(@jakarta.annotation.Nullable DatastoreCLIMetadata cliMetadata) { + + public JsonNullable getCliMetadata_JsonNullable() { + return cliMetadata; + } + + @JsonProperty(JSON_PROPERTY_CLI_METADATA) + public void setCliMetadata_JsonNullable(JsonNullable cliMetadata) { this.cliMetadata = cliMetadata; } + public void setCliMetadata(@jakarta.annotation.Nullable DatastoreCLIMetadata cliMetadata) { + this.cliMetadata = JsonNullable.of(cliMetadata); + } + public ModelsEventDeliveryResponse createdAt(@jakarta.annotation.Nullable String createdAt) { this.createdAt = createdAt; @@ -254,7 +265,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public ModelsEventDeliveryResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -263,19 +274,27 @@ public ModelsEventDeliveryResponse deletedAt(@jakarta.annotation.Nullable String * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public ModelsEventDeliveryResponse deliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode deliveryMode) { this.deliveryMode = deliveryMode; @@ -350,7 +369,7 @@ public void setDeviceId(@jakarta.annotation.Nullable String deviceId) { public ModelsEventDeliveryResponse deviceMetadata(@jakarta.annotation.Nullable DatastoreDevice deviceMetadata) { - this.deviceMetadata = deviceMetadata; + this.deviceMetadata = JsonNullable.of(deviceMetadata); return this; } @@ -359,19 +378,27 @@ public ModelsEventDeliveryResponse deviceMetadata(@jakarta.annotation.Nullable D * @return deviceMetadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DEVICE_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreDevice getDeviceMetadata() { - return deviceMetadata; + return deviceMetadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DEVICE_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeviceMetadata(@jakarta.annotation.Nullable DatastoreDevice deviceMetadata) { + + public JsonNullable getDeviceMetadata_JsonNullable() { + return deviceMetadata; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_METADATA) + public void setDeviceMetadata_JsonNullable(JsonNullable deviceMetadata) { this.deviceMetadata = deviceMetadata; } + public void setDeviceMetadata(@jakarta.annotation.Nullable DatastoreDevice deviceMetadata) { + this.deviceMetadata = JsonNullable.of(deviceMetadata); + } + public ModelsEventDeliveryResponse endpointId(@jakarta.annotation.Nullable String endpointId) { this.endpointId = endpointId; @@ -398,7 +425,7 @@ public void setEndpointId(@jakarta.annotation.Nullable String endpointId) { public ModelsEventDeliveryResponse endpointMetadata(@jakarta.annotation.Nullable DatastoreEndpoint endpointMetadata) { - this.endpointMetadata = endpointMetadata; + this.endpointMetadata = JsonNullable.of(endpointMetadata); return this; } @@ -407,19 +434,27 @@ public ModelsEventDeliveryResponse endpointMetadata(@jakarta.annotation.Nullable * @return endpointMetadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreEndpoint getEndpointMetadata() { - return endpointMetadata; + return endpointMetadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEndpointMetadata(@jakarta.annotation.Nullable DatastoreEndpoint endpointMetadata) { + + public JsonNullable getEndpointMetadata_JsonNullable() { + return endpointMetadata; + } + + @JsonProperty(JSON_PROPERTY_ENDPOINT_METADATA) + public void setEndpointMetadata_JsonNullable(JsonNullable endpointMetadata) { this.endpointMetadata = endpointMetadata; } + public void setEndpointMetadata(@jakarta.annotation.Nullable DatastoreEndpoint endpointMetadata) { + this.endpointMetadata = JsonNullable.of(endpointMetadata); + } + public ModelsEventDeliveryResponse eventId(@jakarta.annotation.Nullable String eventId) { this.eventId = eventId; @@ -446,7 +481,7 @@ public void setEventId(@jakarta.annotation.Nullable String eventId) { public ModelsEventDeliveryResponse eventMetadata(@jakarta.annotation.Nullable DatastoreEvent eventMetadata) { - this.eventMetadata = eventMetadata; + this.eventMetadata = JsonNullable.of(eventMetadata); return this; } @@ -455,19 +490,27 @@ public ModelsEventDeliveryResponse eventMetadata(@jakarta.annotation.Nullable Da * @return eventMetadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_EVENT_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreEvent getEventMetadata() { - return eventMetadata; + return eventMetadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_EVENT_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEventMetadata(@jakarta.annotation.Nullable DatastoreEvent eventMetadata) { + + public JsonNullable getEventMetadata_JsonNullable() { + return eventMetadata; + } + + @JsonProperty(JSON_PROPERTY_EVENT_METADATA) + public void setEventMetadata_JsonNullable(JsonNullable eventMetadata) { this.eventMetadata = eventMetadata; } + public void setEventMetadata(@jakarta.annotation.Nullable DatastoreEvent eventMetadata) { + this.eventMetadata = JsonNullable.of(eventMetadata); + } + public ModelsEventDeliveryResponse eventType(@jakarta.annotation.Nullable String eventType) { this.eventType = eventType; @@ -494,15 +537,19 @@ public void setEventType(@jakarta.annotation.Nullable String eventType) { public ModelsEventDeliveryResponse headers(@jakarta.annotation.Nullable Map> headers) { - this.headers = headers; + this.headers = JsonNullable.>>of(headers); return this; } public ModelsEventDeliveryResponse putHeadersItem(String key, List headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); + if (this.headers == null || !this.headers.isPresent()) { + this.headers = JsonNullable.>>of(new HashMap<>()); + } + try { + this.headers.get().put(key, headersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.headers.put(key, headersItem); return this; } @@ -511,19 +558,27 @@ public ModelsEventDeliveryResponse putHeadersItem(String key, List heade * @return headers */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map> getHeaders() { - return headers; + return headers.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaders(@jakarta.annotation.Nullable Map> headers) { + + public JsonNullable>> getHeaders_JsonNullable() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + public void setHeaders_JsonNullable(JsonNullable>> headers) { this.headers = headers; } + public void setHeaders(@jakarta.annotation.Nullable Map> headers) { + this.headers = JsonNullable.>>of(headers); + } + public ModelsEventDeliveryResponse idempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { this.idempotencyKey = idempotencyKey; @@ -598,7 +653,7 @@ public void setLatencySeconds(@jakarta.annotation.Nullable BigDecimal latencySec public ModelsEventDeliveryResponse metadata(@jakarta.annotation.Nullable DatastoreMetadata metadata) { - this.metadata = metadata; + this.metadata = JsonNullable.of(metadata); return this; } @@ -607,19 +662,27 @@ public ModelsEventDeliveryResponse metadata(@jakarta.annotation.Nullable Datasto * @return metadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreMetadata getMetadata() { - return metadata; + return metadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@jakarta.annotation.Nullable DatastoreMetadata metadata) { + + public JsonNullable getMetadata_JsonNullable() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + public void setMetadata_JsonNullable(JsonNullable metadata) { this.metadata = metadata; } + public void setMetadata(@jakarta.annotation.Nullable DatastoreMetadata metadata) { + this.metadata = JsonNullable.of(metadata); + } + public ModelsEventDeliveryResponse projectId(@jakarta.annotation.Nullable String projectId) { this.projectId = projectId; @@ -646,7 +709,7 @@ public void setProjectId(@jakarta.annotation.Nullable String projectId) { public ModelsEventDeliveryResponse sourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { - this.sourceMetadata = sourceMetadata; + this.sourceMetadata = JsonNullable.of(sourceMetadata); return this; } @@ -655,19 +718,27 @@ public ModelsEventDeliveryResponse sourceMetadata(@jakarta.annotation.Nullable D * @return sourceMetadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreSource getSourceMetadata() { - return sourceMetadata; + return sourceMetadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + + public JsonNullable getSourceMetadata_JsonNullable() { + return sourceMetadata; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_METADATA) + public void setSourceMetadata_JsonNullable(JsonNullable sourceMetadata) { this.sourceMetadata = sourceMetadata; } + public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = JsonNullable.of(sourceMetadata); + } + public ModelsEventDeliveryResponse status(@jakarta.annotation.Nullable DatastoreEventDeliveryStatus status) { this.status = status; @@ -825,26 +896,26 @@ public boolean equals(Object o) { return false; } ModelsEventDeliveryResponse modelsEventDeliveryResponse = (ModelsEventDeliveryResponse) o; - return Objects.equals(this.acknowledgedAt, modelsEventDeliveryResponse.acknowledgedAt) && - Objects.equals(this.cliMetadata, modelsEventDeliveryResponse.cliMetadata) && + return equalsNullable(this.acknowledgedAt, modelsEventDeliveryResponse.acknowledgedAt) && + equalsNullable(this.cliMetadata, modelsEventDeliveryResponse.cliMetadata) && Objects.equals(this.createdAt, modelsEventDeliveryResponse.createdAt) && - Objects.equals(this.deletedAt, modelsEventDeliveryResponse.deletedAt) && + equalsNullable(this.deletedAt, modelsEventDeliveryResponse.deletedAt) && Objects.equals(this.deliveryMode, modelsEventDeliveryResponse.deliveryMode) && Objects.equals(this.description, modelsEventDeliveryResponse.description) && Objects.equals(this.deviceId, modelsEventDeliveryResponse.deviceId) && - Objects.equals(this.deviceMetadata, modelsEventDeliveryResponse.deviceMetadata) && + equalsNullable(this.deviceMetadata, modelsEventDeliveryResponse.deviceMetadata) && Objects.equals(this.endpointId, modelsEventDeliveryResponse.endpointId) && - Objects.equals(this.endpointMetadata, modelsEventDeliveryResponse.endpointMetadata) && + equalsNullable(this.endpointMetadata, modelsEventDeliveryResponse.endpointMetadata) && Objects.equals(this.eventId, modelsEventDeliveryResponse.eventId) && - Objects.equals(this.eventMetadata, modelsEventDeliveryResponse.eventMetadata) && + equalsNullable(this.eventMetadata, modelsEventDeliveryResponse.eventMetadata) && Objects.equals(this.eventType, modelsEventDeliveryResponse.eventType) && - Objects.equals(this.headers, modelsEventDeliveryResponse.headers) && + equalsNullable(this.headers, modelsEventDeliveryResponse.headers) && Objects.equals(this.idempotencyKey, modelsEventDeliveryResponse.idempotencyKey) && Objects.equals(this.latency, modelsEventDeliveryResponse.latency) && Objects.equals(this.latencySeconds, modelsEventDeliveryResponse.latencySeconds) && - Objects.equals(this.metadata, modelsEventDeliveryResponse.metadata) && + equalsNullable(this.metadata, modelsEventDeliveryResponse.metadata) && Objects.equals(this.projectId, modelsEventDeliveryResponse.projectId) && - Objects.equals(this.sourceMetadata, modelsEventDeliveryResponse.sourceMetadata) && + equalsNullable(this.sourceMetadata, modelsEventDeliveryResponse.sourceMetadata) && Objects.equals(this.status, modelsEventDeliveryResponse.status) && Objects.equals(this.subscriptionId, modelsEventDeliveryResponse.subscriptionId) && Objects.equals(this.targetUrl, modelsEventDeliveryResponse.targetUrl) && @@ -853,9 +924,20 @@ public boolean equals(Object o) { Objects.equals(this.urlQueryParams, modelsEventDeliveryResponse.urlQueryParams); } + 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(acknowledgedAt, cliMetadata, createdAt, deletedAt, deliveryMode, description, deviceId, deviceMetadata, endpointId, endpointMetadata, eventId, eventMetadata, eventType, headers, idempotencyKey, latency, latencySeconds, metadata, projectId, sourceMetadata, status, subscriptionId, targetUrl, uid, updatedAt, urlQueryParams); + return Objects.hash(hashCodeNullable(acknowledgedAt), hashCodeNullable(cliMetadata), createdAt, hashCodeNullable(deletedAt), deliveryMode, description, deviceId, hashCodeNullable(deviceMetadata), endpointId, hashCodeNullable(endpointMetadata), eventId, hashCodeNullable(eventMetadata), eventType, hashCodeNullable(headers), idempotencyKey, latency, latencySeconds, hashCodeNullable(metadata), projectId, hashCodeNullable(sourceMetadata), status, subscriptionId, targetUrl, uid, updatedAt, urlQueryParams); + } + + 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/getconvoy/models/ModelsEventResponse.java b/src/main/java/com/getconvoy/models/ModelsEventResponse.java index 15e1022..2ffe026 100644 --- a/src/main/java/com/getconvoy/models/ModelsEventResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsEventResponse.java @@ -32,6 +32,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +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 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsEventResponse { public static final String JSON_PROPERTY_ACKNOWLEDGED_AT = "acknowledged_at"; - @jakarta.annotation.Nullable - private String acknowledgedAt; + private JsonNullable acknowledgedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_APP_ID = "app_id"; @jakarta.annotation.Nullable @@ -77,12 +80,10 @@ public class ModelsEventResponse { private String createdAt; public static final String JSON_PROPERTY_DATA = "data"; - @jakarta.annotation.Nullable - private Map data = new HashMap<>(); + private JsonNullable> data = JsonNullable.>undefined(); public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_ENDPOINT_METADATA = "endpoint_metadata"; @jakarta.annotation.Nullable @@ -97,8 +98,7 @@ public class ModelsEventResponse { private String eventType; public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private Map> headers = new HashMap<>(); + private JsonNullable>> headers = JsonNullable.>>undefined(); public static final String JSON_PROPERTY_IDEMPOTENCY_KEY = "idempotency_key"; @jakarta.annotation.Nullable @@ -125,8 +125,7 @@ public class ModelsEventResponse { private String sourceId; public static final String JSON_PROPERTY_SOURCE_METADATA = "source_metadata"; - @jakarta.annotation.Nullable - private DatastoreSource sourceMetadata; + private JsonNullable sourceMetadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_STATUS = "status"; @jakarta.annotation.Nullable @@ -152,7 +151,7 @@ public ModelsEventResponse() { } public ModelsEventResponse acknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { - this.acknowledgedAt = acknowledgedAt; + this.acknowledgedAt = JsonNullable.of(acknowledgedAt); return this; } @@ -161,19 +160,27 @@ public ModelsEventResponse acknowledgedAt(@jakarta.annotation.Nullable String ac * @return acknowledgedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getAcknowledgedAt() { - return acknowledgedAt; + return acknowledgedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ACKNOWLEDGED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + + public JsonNullable getAcknowledgedAt_JsonNullable() { + return acknowledgedAt; + } + + @JsonProperty(JSON_PROPERTY_ACKNOWLEDGED_AT) + public void setAcknowledgedAt_JsonNullable(JsonNullable acknowledgedAt) { this.acknowledgedAt = acknowledgedAt; } + public void setAcknowledgedAt(@jakarta.annotation.Nullable String acknowledgedAt) { + this.acknowledgedAt = JsonNullable.of(acknowledgedAt); + } + public ModelsEventResponse appId(@jakarta.annotation.Nullable String appId) { this.appId = appId; @@ -224,15 +231,19 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public ModelsEventResponse data(@jakarta.annotation.Nullable Map data) { - this.data = data; + this.data = JsonNullable.>of(data); return this; } public ModelsEventResponse putDataItem(String key, Object dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); + if (this.data == null || !this.data.isPresent()) { + this.data = JsonNullable.>of(new HashMap<>()); + } + try { + this.data.get().put(key, dataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.data.put(key, dataItem); return this; } @@ -241,22 +252,30 @@ public ModelsEventResponse putDataItem(String key, Object dataItem) { * @return data */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getData() { - return data; + return data.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setData(@jakarta.annotation.Nullable Map data) { + + public JsonNullable> getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable> data) { this.data = data; } + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = JsonNullable.>of(data); + } + public ModelsEventResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -265,19 +284,27 @@ public ModelsEventResponse deletedAt(@jakarta.annotation.Nullable String deleted * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public ModelsEventResponse endpointMetadata(@jakarta.annotation.Nullable List endpointMetadata) { this.endpointMetadata = endpointMetadata; @@ -368,15 +395,19 @@ public void setEventType(@jakarta.annotation.Nullable String eventType) { public ModelsEventResponse headers(@jakarta.annotation.Nullable Map> headers) { - this.headers = headers; + this.headers = JsonNullable.>>of(headers); return this; } public ModelsEventResponse putHeadersItem(String key, List headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); + if (this.headers == null || !this.headers.isPresent()) { + this.headers = JsonNullable.>>of(new HashMap<>()); + } + try { + this.headers.get().put(key, headersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.headers.put(key, headersItem); return this; } @@ -385,19 +416,27 @@ public ModelsEventResponse putHeadersItem(String key, List headersItem) * @return headers */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map> getHeaders() { - return headers; + return headers.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaders(@jakarta.annotation.Nullable Map> headers) { + + public JsonNullable>> getHeaders_JsonNullable() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + public void setHeaders_JsonNullable(JsonNullable>> headers) { this.headers = headers; } + public void setHeaders(@jakarta.annotation.Nullable Map> headers) { + this.headers = JsonNullable.>>of(headers); + } + public ModelsEventResponse idempotencyKey(@jakarta.annotation.Nullable String idempotencyKey) { this.idempotencyKey = idempotencyKey; @@ -544,7 +583,7 @@ public void setSourceId(@jakarta.annotation.Nullable String sourceId) { public ModelsEventResponse sourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { - this.sourceMetadata = sourceMetadata; + this.sourceMetadata = JsonNullable.of(sourceMetadata); return this; } @@ -553,19 +592,27 @@ public ModelsEventResponse sourceMetadata(@jakarta.annotation.Nullable Datastore * @return sourceMetadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreSource getSourceMetadata() { - return sourceMetadata; + return sourceMetadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + + public JsonNullable getSourceMetadata_JsonNullable() { + return sourceMetadata; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_METADATA) + public void setSourceMetadata_JsonNullable(JsonNullable sourceMetadata) { this.sourceMetadata = sourceMetadata; } + public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = JsonNullable.of(sourceMetadata); + } + public ModelsEventResponse status(@jakarta.annotation.Nullable DatastoreEventStatus status) { this.status = status; @@ -699,22 +746,22 @@ public boolean equals(Object o) { return false; } ModelsEventResponse modelsEventResponse = (ModelsEventResponse) o; - return Objects.equals(this.acknowledgedAt, modelsEventResponse.acknowledgedAt) && + return equalsNullable(this.acknowledgedAt, modelsEventResponse.acknowledgedAt) && Objects.equals(this.appId, modelsEventResponse.appId) && Objects.equals(this.createdAt, modelsEventResponse.createdAt) && - Objects.equals(this.data, modelsEventResponse.data) && - Objects.equals(this.deletedAt, modelsEventResponse.deletedAt) && + equalsNullable(this.data, modelsEventResponse.data) && + equalsNullable(this.deletedAt, modelsEventResponse.deletedAt) && Objects.equals(this.endpointMetadata, modelsEventResponse.endpointMetadata) && Objects.equals(this.endpoints, modelsEventResponse.endpoints) && Objects.equals(this.eventType, modelsEventResponse.eventType) && - Objects.equals(this.headers, modelsEventResponse.headers) && + equalsNullable(this.headers, modelsEventResponse.headers) && Objects.equals(this.idempotencyKey, modelsEventResponse.idempotencyKey) && Objects.equals(this.isDuplicateEvent, modelsEventResponse.isDuplicateEvent) && Objects.equals(this.metadata, modelsEventResponse.metadata) && Objects.equals(this.projectId, modelsEventResponse.projectId) && Objects.equals(this.raw, modelsEventResponse.raw) && Objects.equals(this.sourceId, modelsEventResponse.sourceId) && - Objects.equals(this.sourceMetadata, modelsEventResponse.sourceMetadata) && + equalsNullable(this.sourceMetadata, modelsEventResponse.sourceMetadata) && Objects.equals(this.status, modelsEventResponse.status) && Objects.equals(this.uid, modelsEventResponse.uid) && Objects.equals(this.updatedAt, modelsEventResponse.updatedAt) && @@ -722,9 +769,20 @@ public boolean equals(Object o) { Objects.equals(this.urlQueryParams, modelsEventResponse.urlQueryParams); } + 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(acknowledgedAt, appId, createdAt, data, deletedAt, endpointMetadata, endpoints, eventType, headers, idempotencyKey, isDuplicateEvent, metadata, projectId, raw, sourceId, sourceMetadata, status, uid, updatedAt, urlPath, urlQueryParams); + return Objects.hash(hashCodeNullable(acknowledgedAt), appId, createdAt, hashCodeNullable(data), hashCodeNullable(deletedAt), endpointMetadata, endpoints, eventType, hashCodeNullable(headers), idempotencyKey, isDuplicateEvent, metadata, projectId, raw, sourceId, hashCodeNullable(sourceMetadata), status, uid, updatedAt, urlPath, urlQueryParams); + } + + 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/getconvoy/models/ModelsEventTypeResponse.java b/src/main/java/com/getconvoy/models/ModelsEventTypeResponse.java index 48a4aa7..a8282e3 100644 --- a/src/main/java/com/getconvoy/models/ModelsEventTypeResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsEventTypeResponse.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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; @@ -49,16 +53,14 @@ public class ModelsEventTypeResponse { private String category; public static final String JSON_PROPERTY_DEPRECATED_AT = "deprecated_at"; - @jakarta.annotation.Nullable - private String deprecatedAt; + private JsonNullable deprecatedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_DESCRIPTION = "description"; @jakarta.annotation.Nullable private String description; public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema"; - @jakarta.annotation.Nullable - private Map jsonSchema = new HashMap<>(); + private JsonNullable> jsonSchema = JsonNullable.>undefined(); public static final String JSON_PROPERTY_NAME = "name"; @jakarta.annotation.Nullable @@ -96,7 +98,7 @@ public void setCategory(@jakarta.annotation.Nullable String category) { public ModelsEventTypeResponse deprecatedAt(@jakarta.annotation.Nullable String deprecatedAt) { - this.deprecatedAt = deprecatedAt; + this.deprecatedAt = JsonNullable.of(deprecatedAt); return this; } @@ -105,19 +107,27 @@ public ModelsEventTypeResponse deprecatedAt(@jakarta.annotation.Nullable String * @return deprecatedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DEPRECATED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeprecatedAt() { - return deprecatedAt; + return deprecatedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DEPRECATED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeprecatedAt(@jakarta.annotation.Nullable String deprecatedAt) { + + public JsonNullable getDeprecatedAt_JsonNullable() { + return deprecatedAt; + } + + @JsonProperty(JSON_PROPERTY_DEPRECATED_AT) + public void setDeprecatedAt_JsonNullable(JsonNullable deprecatedAt) { this.deprecatedAt = deprecatedAt; } + public void setDeprecatedAt(@jakarta.annotation.Nullable String deprecatedAt) { + this.deprecatedAt = JsonNullable.of(deprecatedAt); + } + public ModelsEventTypeResponse description(@jakarta.annotation.Nullable String description) { this.description = description; @@ -144,15 +154,19 @@ public void setDescription(@jakarta.annotation.Nullable String description) { public ModelsEventTypeResponse jsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { - this.jsonSchema = jsonSchema; + this.jsonSchema = JsonNullable.>of(jsonSchema); return this; } public ModelsEventTypeResponse putJsonSchemaItem(String key, Object jsonSchemaItem) { - if (this.jsonSchema == null) { - this.jsonSchema = new HashMap<>(); + if (this.jsonSchema == null || !this.jsonSchema.isPresent()) { + this.jsonSchema = JsonNullable.>of(new HashMap<>()); + } + try { + this.jsonSchema.get().put(key, jsonSchemaItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.jsonSchema.put(key, jsonSchemaItem); return this; } @@ -161,19 +175,27 @@ public ModelsEventTypeResponse putJsonSchemaItem(String key, Object jsonSchemaIt * @return jsonSchema */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getJsonSchema() { - return jsonSchema; + return jsonSchema.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setJsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + + public JsonNullable> getJsonSchema_JsonNullable() { + return jsonSchema; + } + + @JsonProperty(JSON_PROPERTY_JSON_SCHEMA) + public void setJsonSchema_JsonNullable(JsonNullable> jsonSchema) { this.jsonSchema = jsonSchema; } + public void setJsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + this.jsonSchema = JsonNullable.>of(jsonSchema); + } + public ModelsEventTypeResponse name(@jakarta.annotation.Nullable String name) { this.name = name; @@ -236,16 +258,27 @@ public boolean equals(Object o) { } ModelsEventTypeResponse modelsEventTypeResponse = (ModelsEventTypeResponse) o; return Objects.equals(this.category, modelsEventTypeResponse.category) && - Objects.equals(this.deprecatedAt, modelsEventTypeResponse.deprecatedAt) && + equalsNullable(this.deprecatedAt, modelsEventTypeResponse.deprecatedAt) && Objects.equals(this.description, modelsEventTypeResponse.description) && - Objects.equals(this.jsonSchema, modelsEventTypeResponse.jsonSchema) && + equalsNullable(this.jsonSchema, modelsEventTypeResponse.jsonSchema) && Objects.equals(this.name, modelsEventTypeResponse.name) && Objects.equals(this.uid, modelsEventTypeResponse.uid); } + 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(category, deprecatedAt, description, jsonSchema, name, uid); + return Objects.hash(category, hashCodeNullable(deprecatedAt), description, hashCodeNullable(jsonSchema), name, uid); + } + + 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/getconvoy/models/ModelsFS.java b/src/main/java/com/getconvoy/models/ModelsFS.java index a1d38b1..3a3328e 100644 --- a/src/main/java/com/getconvoy/models/ModelsFS.java +++ b/src/main/java/com/getconvoy/models/ModelsFS.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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; @@ -43,34 +47,34 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsFS { public static final String JSON_PROPERTY_BODY = "body"; - @jakarta.annotation.Nullable - private Map body = new HashMap<>(); + private JsonNullable> body = JsonNullable.>undefined(); public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private Map headers = new HashMap<>(); + private JsonNullable> headers = JsonNullable.>undefined(); public static final String JSON_PROPERTY_PATH = "path"; - @jakarta.annotation.Nullable - private Map path = new HashMap<>(); + private JsonNullable> path = JsonNullable.>undefined(); public static final String JSON_PROPERTY_QUERY = "query"; - @jakarta.annotation.Nullable - private Map query = new HashMap<>(); + private JsonNullable> query = JsonNullable.>undefined(); public ModelsFS() { } public ModelsFS body(@jakarta.annotation.Nullable Map body) { - this.body = body; + this.body = JsonNullable.>of(body); return this; } public ModelsFS putBodyItem(String key, Object bodyItem) { - if (this.body == null) { - this.body = new HashMap<>(); + if (this.body == null || !this.body.isPresent()) { + this.body = JsonNullable.>of(new HashMap<>()); + } + try { + this.body.get().put(key, bodyItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.body.put(key, bodyItem); return this; } @@ -79,30 +83,42 @@ public ModelsFS putBodyItem(String key, Object bodyItem) { * @return body */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getBody() { - return body; + return body.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setBody(@jakarta.annotation.Nullable Map 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 Map body) { + this.body = JsonNullable.>of(body); + } + public ModelsFS headers(@jakarta.annotation.Nullable Map headers) { - this.headers = headers; + this.headers = JsonNullable.>of(headers); return this; } public ModelsFS putHeadersItem(String key, Object headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); + if (this.headers == null || !this.headers.isPresent()) { + this.headers = JsonNullable.>of(new HashMap<>()); + } + try { + this.headers.get().put(key, headersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.headers.put(key, headersItem); return this; } @@ -111,30 +127,42 @@ public ModelsFS putHeadersItem(String key, Object headersItem) { * @return headers */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getHeaders() { - return headers; + return headers.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaders(@jakarta.annotation.Nullable Map headers) { + + public JsonNullable> getHeaders_JsonNullable() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + public void setHeaders_JsonNullable(JsonNullable> headers) { this.headers = headers; } + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = JsonNullable.>of(headers); + } + public ModelsFS path(@jakarta.annotation.Nullable Map path) { - this.path = path; + this.path = JsonNullable.>of(path); return this; } public ModelsFS putPathItem(String key, Object pathItem) { - if (this.path == null) { - this.path = new HashMap<>(); + if (this.path == null || !this.path.isPresent()) { + this.path = JsonNullable.>of(new HashMap<>()); + } + try { + this.path.get().put(key, pathItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.path.put(key, pathItem); return this; } @@ -143,30 +171,42 @@ public ModelsFS putPathItem(String key, Object pathItem) { * @return path */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getPath() { - return path; + return path.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setPath(@jakarta.annotation.Nullable Map path) { + + public JsonNullable> getPath_JsonNullable() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + public void setPath_JsonNullable(JsonNullable> path) { this.path = path; } + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = JsonNullable.>of(path); + } + public ModelsFS query(@jakarta.annotation.Nullable Map query) { - this.query = query; + this.query = JsonNullable.>of(query); return this; } public ModelsFS putQueryItem(String key, Object queryItem) { - if (this.query == null) { - this.query = new HashMap<>(); + if (this.query == null || !this.query.isPresent()) { + this.query = JsonNullable.>of(new HashMap<>()); + } + try { + this.query.get().put(key, queryItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.query.put(key, queryItem); return this; } @@ -175,19 +215,27 @@ public ModelsFS putQueryItem(String key, Object queryItem) { * @return query */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getQuery() { - return query; + return query.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setQuery(@jakarta.annotation.Nullable Map query) { + + public JsonNullable> getQuery_JsonNullable() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + public void setQuery_JsonNullable(JsonNullable> query) { this.query = query; } + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = JsonNullable.>of(query); + } + /** * Return true if this models.FS object is equal to o. @@ -201,15 +249,26 @@ public boolean equals(Object o) { return false; } ModelsFS modelsFS = (ModelsFS) o; - return Objects.equals(this.body, modelsFS.body) && - Objects.equals(this.headers, modelsFS.headers) && - Objects.equals(this.path, modelsFS.path) && - Objects.equals(this.query, modelsFS.query); + return equalsNullable(this.body, modelsFS.body) && + equalsNullable(this.headers, modelsFS.headers) && + equalsNullable(this.path, modelsFS.path) && + equalsNullable(this.query, modelsFS.query); + } + + 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(body, headers, path, query); + return Objects.hash(hashCodeNullable(body), hashCodeNullable(headers), hashCodeNullable(path), hashCodeNullable(query)); + } + + 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/getconvoy/models/ModelsFanoutEvent.java b/src/main/java/com/getconvoy/models/ModelsFanoutEvent.java index 12c93c7..400ea8b 100644 --- a/src/main/java/com/getconvoy/models/ModelsFanoutEvent.java +++ b/src/main/java/com/getconvoy/models/ModelsFanoutEvent.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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,12 +48,10 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsFanoutEvent { public static final String JSON_PROPERTY_CUSTOM_HEADERS = "custom_headers"; - @jakarta.annotation.Nullable - private Map customHeaders = new HashMap<>(); + private JsonNullable> customHeaders = JsonNullable.>undefined(); public static final String JSON_PROPERTY_DATA = "data"; - @jakarta.annotation.Nullable - private Map data = new HashMap<>(); + private JsonNullable> data = JsonNullable.>undefined(); public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; @jakarta.annotation.Nullable @@ -67,15 +69,19 @@ public ModelsFanoutEvent() { } public ModelsFanoutEvent customHeaders(@jakarta.annotation.Nullable Map customHeaders) { - this.customHeaders = customHeaders; + this.customHeaders = JsonNullable.>of(customHeaders); return this; } public ModelsFanoutEvent putCustomHeadersItem(String key, String customHeadersItem) { - if (this.customHeaders == null) { - this.customHeaders = new HashMap<>(); + if (this.customHeaders == null || !this.customHeaders.isPresent()) { + this.customHeaders = JsonNullable.>of(new HashMap<>()); + } + try { + this.customHeaders.get().put(key, customHeadersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.customHeaders.put(key, customHeadersItem); return this; } @@ -84,30 +90,42 @@ public ModelsFanoutEvent putCustomHeadersItem(String key, String customHeadersIt * @return customHeaders */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getCustomHeaders() { - return customHeaders; + return customHeaders.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CUSTOM_HEADERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + + public JsonNullable> getCustomHeaders_JsonNullable() { + return customHeaders; + } + + @JsonProperty(JSON_PROPERTY_CUSTOM_HEADERS) + public void setCustomHeaders_JsonNullable(JsonNullable> customHeaders) { this.customHeaders = customHeaders; } + public void setCustomHeaders(@jakarta.annotation.Nullable Map customHeaders) { + this.customHeaders = JsonNullable.>of(customHeaders); + } + public ModelsFanoutEvent data(@jakarta.annotation.Nullable Map data) { - this.data = data; + this.data = JsonNullable.>of(data); return this; } public ModelsFanoutEvent putDataItem(String key, Object dataItem) { - if (this.data == null) { - this.data = new HashMap<>(); + if (this.data == null || !this.data.isPresent()) { + this.data = JsonNullable.>of(new HashMap<>()); + } + try { + this.data.get().put(key, dataItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.data.put(key, dataItem); return this; } @@ -116,19 +134,27 @@ public ModelsFanoutEvent putDataItem(String key, Object dataItem) { * @return data */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getData() { - return data; + return data.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DATA, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setData(@jakarta.annotation.Nullable Map data) { + + public JsonNullable> getData_JsonNullable() { + return data; + } + + @JsonProperty(JSON_PROPERTY_DATA) + public void setData_JsonNullable(JsonNullable> data) { this.data = data; } + public void setData(@jakarta.annotation.Nullable Map data) { + this.data = JsonNullable.>of(data); + } + public ModelsFanoutEvent eventType(@jakarta.annotation.Nullable String eventType) { this.eventType = eventType; @@ -214,16 +240,27 @@ public boolean equals(Object o) { return false; } ModelsFanoutEvent modelsFanoutEvent = (ModelsFanoutEvent) o; - return Objects.equals(this.customHeaders, modelsFanoutEvent.customHeaders) && - Objects.equals(this.data, modelsFanoutEvent.data) && + return equalsNullable(this.customHeaders, modelsFanoutEvent.customHeaders) && + equalsNullable(this.data, modelsFanoutEvent.data) && Objects.equals(this.eventType, modelsFanoutEvent.eventType) && Objects.equals(this.idempotencyKey, modelsFanoutEvent.idempotencyKey) && Objects.equals(this.ownerId, modelsFanoutEvent.ownerId); } + 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(customHeaders, data, eventType, idempotencyKey, ownerId); + return Objects.hash(hashCodeNullable(customHeaders), hashCodeNullable(data), eventType, idempotencyKey, ownerId); + } + + 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/getconvoy/models/ModelsFilterResponse.java b/src/main/java/com/getconvoy/models/ModelsFilterResponse.java index 1eafcd8..9326d0c 100644 --- a/src/main/java/com/getconvoy/models/ModelsFilterResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsFilterResponse.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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; @@ -51,44 +55,35 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsFilterResponse { public static final String JSON_PROPERTY_BODY = "body"; - @jakarta.annotation.Nullable - private Map body = new HashMap<>(); + private JsonNullable> body = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ENABLED_AT = "enabled_at"; - @jakarta.annotation.Nullable - private String enabledAt; + private JsonNullable enabledAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; @jakarta.annotation.Nullable private String eventType; public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private Map headers = new HashMap<>(); + private JsonNullable> headers = JsonNullable.>undefined(); public static final String JSON_PROPERTY_PATH = "path"; - @jakarta.annotation.Nullable - private Map path = new HashMap<>(); + private JsonNullable> path = JsonNullable.>undefined(); public static final String JSON_PROPERTY_QUERY = "query"; - @jakarta.annotation.Nullable - private Map query = new HashMap<>(); + private JsonNullable> query = JsonNullable.>undefined(); public static final String JSON_PROPERTY_RAW_BODY = "raw_body"; - @jakarta.annotation.Nullable - private Map rawBody = new HashMap<>(); + private JsonNullable> rawBody = JsonNullable.>undefined(); public static final String JSON_PROPERTY_RAW_HEADERS = "raw_headers"; - @jakarta.annotation.Nullable - private Map rawHeaders = new HashMap<>(); + private JsonNullable> rawHeaders = JsonNullable.>undefined(); public static final String JSON_PROPERTY_RAW_PATH = "raw_path"; - @jakarta.annotation.Nullable - private Map rawPath = new HashMap<>(); + private JsonNullable> rawPath = JsonNullable.>undefined(); public static final String JSON_PROPERTY_RAW_QUERY = "raw_query"; - @jakarta.annotation.Nullable - private Map rawQuery = new HashMap<>(); + private JsonNullable> rawQuery = JsonNullable.>undefined(); public static final String JSON_PROPERTY_SUBSCRIPTION_ID = "subscription_id"; @jakarta.annotation.Nullable @@ -102,15 +97,19 @@ public ModelsFilterResponse() { } public ModelsFilterResponse body(@jakarta.annotation.Nullable Map body) { - this.body = body; + this.body = JsonNullable.>of(body); return this; } public ModelsFilterResponse putBodyItem(String key, Object bodyItem) { - if (this.body == null) { - this.body = new HashMap<>(); + if (this.body == null || !this.body.isPresent()) { + this.body = JsonNullable.>of(new HashMap<>()); + } + try { + this.body.get().put(key, bodyItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.body.put(key, bodyItem); return this; } @@ -119,22 +118,30 @@ public ModelsFilterResponse putBodyItem(String key, Object bodyItem) { * @return body */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getBody() { - return body; + return body.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setBody(@jakarta.annotation.Nullable Map 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 Map body) { + this.body = JsonNullable.>of(body); + } + public ModelsFilterResponse enabledAt(@jakarta.annotation.Nullable String enabledAt) { - this.enabledAt = enabledAt; + this.enabledAt = JsonNullable.of(enabledAt); return this; } @@ -143,19 +150,27 @@ public ModelsFilterResponse enabledAt(@jakarta.annotation.Nullable String enable * @return enabledAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENABLED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getEnabledAt() { - return enabledAt; + return enabledAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ENABLED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnabledAt(@jakarta.annotation.Nullable String enabledAt) { + + public JsonNullable getEnabledAt_JsonNullable() { + return enabledAt; + } + + @JsonProperty(JSON_PROPERTY_ENABLED_AT) + public void setEnabledAt_JsonNullable(JsonNullable enabledAt) { this.enabledAt = enabledAt; } + public void setEnabledAt(@jakarta.annotation.Nullable String enabledAt) { + this.enabledAt = JsonNullable.of(enabledAt); + } + public ModelsFilterResponse eventType(@jakarta.annotation.Nullable String eventType) { this.eventType = eventType; @@ -182,15 +197,19 @@ public void setEventType(@jakarta.annotation.Nullable String eventType) { public ModelsFilterResponse headers(@jakarta.annotation.Nullable Map headers) { - this.headers = headers; + this.headers = JsonNullable.>of(headers); return this; } public ModelsFilterResponse putHeadersItem(String key, Object headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); + if (this.headers == null || !this.headers.isPresent()) { + this.headers = JsonNullable.>of(new HashMap<>()); + } + try { + this.headers.get().put(key, headersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.headers.put(key, headersItem); return this; } @@ -199,30 +218,42 @@ public ModelsFilterResponse putHeadersItem(String key, Object headersItem) { * @return headers */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getHeaders() { - return headers; + return headers.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaders(@jakarta.annotation.Nullable Map headers) { + + public JsonNullable> getHeaders_JsonNullable() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + public void setHeaders_JsonNullable(JsonNullable> headers) { this.headers = headers; } + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = JsonNullable.>of(headers); + } + public ModelsFilterResponse path(@jakarta.annotation.Nullable Map path) { - this.path = path; + this.path = JsonNullable.>of(path); return this; } public ModelsFilterResponse putPathItem(String key, Object pathItem) { - if (this.path == null) { - this.path = new HashMap<>(); + if (this.path == null || !this.path.isPresent()) { + this.path = JsonNullable.>of(new HashMap<>()); + } + try { + this.path.get().put(key, pathItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.path.put(key, pathItem); return this; } @@ -231,30 +262,42 @@ public ModelsFilterResponse putPathItem(String key, Object pathItem) { * @return path */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getPath() { - return path; + return path.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setPath(@jakarta.annotation.Nullable Map path) { + + public JsonNullable> getPath_JsonNullable() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + public void setPath_JsonNullable(JsonNullable> path) { this.path = path; } + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = JsonNullable.>of(path); + } + public ModelsFilterResponse query(@jakarta.annotation.Nullable Map query) { - this.query = query; + this.query = JsonNullable.>of(query); return this; } public ModelsFilterResponse putQueryItem(String key, Object queryItem) { - if (this.query == null) { - this.query = new HashMap<>(); + if (this.query == null || !this.query.isPresent()) { + this.query = JsonNullable.>of(new HashMap<>()); + } + try { + this.query.get().put(key, queryItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.query.put(key, queryItem); return this; } @@ -263,30 +306,42 @@ public ModelsFilterResponse putQueryItem(String key, Object queryItem) { * @return query */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getQuery() { - return query; + return query.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setQuery(@jakarta.annotation.Nullable Map query) { + + public JsonNullable> getQuery_JsonNullable() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + public void setQuery_JsonNullable(JsonNullable> query) { this.query = query; } + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = JsonNullable.>of(query); + } + public ModelsFilterResponse rawBody(@jakarta.annotation.Nullable Map rawBody) { - this.rawBody = rawBody; + this.rawBody = JsonNullable.>of(rawBody); return this; } public ModelsFilterResponse putRawBodyItem(String key, Object rawBodyItem) { - if (this.rawBody == null) { - this.rawBody = new HashMap<>(); + if (this.rawBody == null || !this.rawBody.isPresent()) { + this.rawBody = JsonNullable.>of(new HashMap<>()); + } + try { + this.rawBody.get().put(key, rawBodyItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.rawBody.put(key, rawBodyItem); return this; } @@ -295,30 +350,42 @@ public ModelsFilterResponse putRawBodyItem(String key, Object rawBodyItem) { * @return rawBody */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RAW_BODY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getRawBody() { - return rawBody; + return rawBody.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RAW_BODY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setRawBody(@jakarta.annotation.Nullable Map rawBody) { + + public JsonNullable> getRawBody_JsonNullable() { + return rawBody; + } + + @JsonProperty(JSON_PROPERTY_RAW_BODY) + public void setRawBody_JsonNullable(JsonNullable> rawBody) { this.rawBody = rawBody; } + public void setRawBody(@jakarta.annotation.Nullable Map rawBody) { + this.rawBody = JsonNullable.>of(rawBody); + } + public ModelsFilterResponse rawHeaders(@jakarta.annotation.Nullable Map rawHeaders) { - this.rawHeaders = rawHeaders; + this.rawHeaders = JsonNullable.>of(rawHeaders); return this; } public ModelsFilterResponse putRawHeadersItem(String key, Object rawHeadersItem) { - if (this.rawHeaders == null) { - this.rawHeaders = new HashMap<>(); + if (this.rawHeaders == null || !this.rawHeaders.isPresent()) { + this.rawHeaders = JsonNullable.>of(new HashMap<>()); + } + try { + this.rawHeaders.get().put(key, rawHeadersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.rawHeaders.put(key, rawHeadersItem); return this; } @@ -327,30 +394,42 @@ public ModelsFilterResponse putRawHeadersItem(String key, Object rawHeadersItem) * @return rawHeaders */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RAW_HEADERS, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getRawHeaders() { - return rawHeaders; + return rawHeaders.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RAW_HEADERS, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setRawHeaders(@jakarta.annotation.Nullable Map rawHeaders) { + + public JsonNullable> getRawHeaders_JsonNullable() { + return rawHeaders; + } + + @JsonProperty(JSON_PROPERTY_RAW_HEADERS) + public void setRawHeaders_JsonNullable(JsonNullable> rawHeaders) { this.rawHeaders = rawHeaders; } + public void setRawHeaders(@jakarta.annotation.Nullable Map rawHeaders) { + this.rawHeaders = JsonNullable.>of(rawHeaders); + } + public ModelsFilterResponse rawPath(@jakarta.annotation.Nullable Map rawPath) { - this.rawPath = rawPath; + this.rawPath = JsonNullable.>of(rawPath); return this; } public ModelsFilterResponse putRawPathItem(String key, Object rawPathItem) { - if (this.rawPath == null) { - this.rawPath = new HashMap<>(); + if (this.rawPath == null || !this.rawPath.isPresent()) { + this.rawPath = JsonNullable.>of(new HashMap<>()); + } + try { + this.rawPath.get().put(key, rawPathItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.rawPath.put(key, rawPathItem); return this; } @@ -359,30 +438,42 @@ public ModelsFilterResponse putRawPathItem(String key, Object rawPathItem) { * @return rawPath */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RAW_PATH, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getRawPath() { - return rawPath; + return rawPath.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RAW_PATH, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setRawPath(@jakarta.annotation.Nullable Map rawPath) { + + public JsonNullable> getRawPath_JsonNullable() { + return rawPath; + } + + @JsonProperty(JSON_PROPERTY_RAW_PATH) + public void setRawPath_JsonNullable(JsonNullable> rawPath) { this.rawPath = rawPath; } + public void setRawPath(@jakarta.annotation.Nullable Map rawPath) { + this.rawPath = JsonNullable.>of(rawPath); + } + public ModelsFilterResponse rawQuery(@jakarta.annotation.Nullable Map rawQuery) { - this.rawQuery = rawQuery; + this.rawQuery = JsonNullable.>of(rawQuery); return this; } public ModelsFilterResponse putRawQueryItem(String key, Object rawQueryItem) { - if (this.rawQuery == null) { - this.rawQuery = new HashMap<>(); + if (this.rawQuery == null || !this.rawQuery.isPresent()) { + this.rawQuery = JsonNullable.>of(new HashMap<>()); + } + try { + this.rawQuery.get().put(key, rawQueryItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.rawQuery.put(key, rawQueryItem); return this; } @@ -391,19 +482,27 @@ public ModelsFilterResponse putRawQueryItem(String key, Object rawQueryItem) { * @return rawQuery */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RAW_QUERY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getRawQuery() { - return rawQuery; + return rawQuery.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RAW_QUERY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setRawQuery(@jakarta.annotation.Nullable Map rawQuery) { + + public JsonNullable> getRawQuery_JsonNullable() { + return rawQuery; + } + + @JsonProperty(JSON_PROPERTY_RAW_QUERY) + public void setRawQuery_JsonNullable(JsonNullable> rawQuery) { this.rawQuery = rawQuery; } + public void setRawQuery(@jakarta.annotation.Nullable Map rawQuery) { + this.rawQuery = JsonNullable.>of(rawQuery); + } + public ModelsFilterResponse subscriptionId(@jakarta.annotation.Nullable String subscriptionId) { this.subscriptionId = subscriptionId; @@ -465,23 +564,34 @@ public boolean equals(Object o) { return false; } ModelsFilterResponse modelsFilterResponse = (ModelsFilterResponse) o; - return Objects.equals(this.body, modelsFilterResponse.body) && - Objects.equals(this.enabledAt, modelsFilterResponse.enabledAt) && + return equalsNullable(this.body, modelsFilterResponse.body) && + equalsNullable(this.enabledAt, modelsFilterResponse.enabledAt) && Objects.equals(this.eventType, modelsFilterResponse.eventType) && - Objects.equals(this.headers, modelsFilterResponse.headers) && - Objects.equals(this.path, modelsFilterResponse.path) && - Objects.equals(this.query, modelsFilterResponse.query) && - Objects.equals(this.rawBody, modelsFilterResponse.rawBody) && - Objects.equals(this.rawHeaders, modelsFilterResponse.rawHeaders) && - Objects.equals(this.rawPath, modelsFilterResponse.rawPath) && - Objects.equals(this.rawQuery, modelsFilterResponse.rawQuery) && + equalsNullable(this.headers, modelsFilterResponse.headers) && + equalsNullable(this.path, modelsFilterResponse.path) && + equalsNullable(this.query, modelsFilterResponse.query) && + equalsNullable(this.rawBody, modelsFilterResponse.rawBody) && + equalsNullable(this.rawHeaders, modelsFilterResponse.rawHeaders) && + equalsNullable(this.rawPath, modelsFilterResponse.rawPath) && + equalsNullable(this.rawQuery, modelsFilterResponse.rawQuery) && Objects.equals(this.subscriptionId, modelsFilterResponse.subscriptionId) && Objects.equals(this.uid, modelsFilterResponse.uid); } + 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(body, enabledAt, eventType, headers, path, query, rawBody, rawHeaders, rawPath, rawQuery, subscriptionId, uid); + return Objects.hash(hashCodeNullable(body), hashCodeNullable(enabledAt), eventType, hashCodeNullable(headers), hashCodeNullable(path), hashCodeNullable(query), hashCodeNullable(rawBody), hashCodeNullable(rawHeaders), hashCodeNullable(rawPath), hashCodeNullable(rawQuery), subscriptionId, uid); + } + + 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/getconvoy/models/ModelsFunctionRequest.java b/src/main/java/com/getconvoy/models/ModelsFunctionRequest.java index 5b4a82b..cbcb2ea 100644 --- a/src/main/java/com/getconvoy/models/ModelsFunctionRequest.java +++ b/src/main/java/com/getconvoy/models/ModelsFunctionRequest.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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 ModelsFunctionRequest { private String function; public static final String JSON_PROPERTY_PAYLOAD = "payload"; - @jakarta.annotation.Nullable - private Map payload = new HashMap<>(); + private JsonNullable> payload = JsonNullable.>undefined(); public static final String JSON_PROPERTY_TYPE = "type"; @jakarta.annotation.Nullable @@ -81,15 +84,19 @@ public void setFunction(@jakarta.annotation.Nullable String function) { public ModelsFunctionRequest payload(@jakarta.annotation.Nullable Map payload) { - this.payload = payload; + this.payload = JsonNullable.>of(payload); return this; } public ModelsFunctionRequest putPayloadItem(String key, Object payloadItem) { - if (this.payload == null) { - this.payload = new HashMap<>(); + if (this.payload == null || !this.payload.isPresent()) { + this.payload = JsonNullable.>of(new HashMap<>()); + } + try { + this.payload.get().put(key, payloadItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.payload.put(key, payloadItem); return this; } @@ -98,19 +105,27 @@ public ModelsFunctionRequest putPayloadItem(String key, Object payloadItem) { * @return payload */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PAYLOAD, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getPayload() { - return payload; + return payload.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PAYLOAD, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setPayload(@jakarta.annotation.Nullable Map payload) { + + public JsonNullable> getPayload_JsonNullable() { + return payload; + } + + @JsonProperty(JSON_PROPERTY_PAYLOAD) + public void setPayload_JsonNullable(JsonNullable> payload) { this.payload = payload; } + public void setPayload(@jakarta.annotation.Nullable Map payload) { + this.payload = JsonNullable.>of(payload); + } + public ModelsFunctionRequest type(@jakarta.annotation.Nullable String type) { this.type = type; @@ -149,13 +164,24 @@ public boolean equals(Object o) { } ModelsFunctionRequest modelsFunctionRequest = (ModelsFunctionRequest) o; return Objects.equals(this.function, modelsFunctionRequest.function) && - Objects.equals(this.payload, modelsFunctionRequest.payload) && + equalsNullable(this.payload, modelsFunctionRequest.payload) && Objects.equals(this.type, modelsFunctionRequest.type); } + 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(function, payload, type); + return Objects.hash(function, hashCodeNullable(payload), type); + } + + 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/getconvoy/models/ModelsMetaEventResponse.java b/src/main/java/com/getconvoy/models/ModelsMetaEventResponse.java index 81affbd..17434bc 100644 --- a/src/main/java/com/getconvoy/models/ModelsMetaEventResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsMetaEventResponse.java @@ -28,6 +28,10 @@ import com.getconvoy.models.DatastoreMetaEventAttempt; import com.getconvoy.models.DatastoreMetadata; 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; @@ -49,24 +53,21 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsMetaEventResponse { public static final String JSON_PROPERTY_ATTEMPT = "attempt"; - @jakarta.annotation.Nullable - private DatastoreMetaEventAttempt attempt; + private JsonNullable attempt = JsonNullable.undefined(); public static final String JSON_PROPERTY_CREATED_AT = "created_at"; @jakarta.annotation.Nullable private String createdAt; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_EVENT_TYPE = "event_type"; @jakarta.annotation.Nullable private String eventType; public static final String JSON_PROPERTY_METADATA = "metadata"; - @jakarta.annotation.Nullable - private DatastoreMetadata metadata; + private JsonNullable metadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; @jakarta.annotation.Nullable @@ -88,7 +89,7 @@ public ModelsMetaEventResponse() { } public ModelsMetaEventResponse attempt(@jakarta.annotation.Nullable DatastoreMetaEventAttempt attempt) { - this.attempt = attempt; + this.attempt = JsonNullable.of(attempt); return this; } @@ -97,19 +98,27 @@ public ModelsMetaEventResponse attempt(@jakarta.annotation.Nullable DatastoreMet * @return attempt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ATTEMPT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreMetaEventAttempt getAttempt() { - return attempt; + return attempt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ATTEMPT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttempt(@jakarta.annotation.Nullable DatastoreMetaEventAttempt attempt) { + + public JsonNullable getAttempt_JsonNullable() { + return attempt; + } + + @JsonProperty(JSON_PROPERTY_ATTEMPT) + public void setAttempt_JsonNullable(JsonNullable attempt) { this.attempt = attempt; } + public void setAttempt(@jakarta.annotation.Nullable DatastoreMetaEventAttempt attempt) { + this.attempt = JsonNullable.of(attempt); + } + public ModelsMetaEventResponse createdAt(@jakarta.annotation.Nullable String createdAt) { this.createdAt = createdAt; @@ -136,7 +145,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public ModelsMetaEventResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -145,19 +154,27 @@ public ModelsMetaEventResponse deletedAt(@jakarta.annotation.Nullable String del * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public ModelsMetaEventResponse eventType(@jakarta.annotation.Nullable String eventType) { this.eventType = eventType; @@ -184,7 +201,7 @@ public void setEventType(@jakarta.annotation.Nullable String eventType) { public ModelsMetaEventResponse metadata(@jakarta.annotation.Nullable DatastoreMetadata metadata) { - this.metadata = metadata; + this.metadata = JsonNullable.of(metadata); return this; } @@ -193,19 +210,27 @@ public ModelsMetaEventResponse metadata(@jakarta.annotation.Nullable DatastoreMe * @return metadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreMetadata getMetadata() { - return metadata; + return metadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMetadata(@jakarta.annotation.Nullable DatastoreMetadata metadata) { + + public JsonNullable getMetadata_JsonNullable() { + return metadata; + } + + @JsonProperty(JSON_PROPERTY_METADATA) + public void setMetadata_JsonNullable(JsonNullable metadata) { this.metadata = metadata; } + public void setMetadata(@jakarta.annotation.Nullable DatastoreMetadata metadata) { + this.metadata = JsonNullable.of(metadata); + } + public ModelsMetaEventResponse projectId(@jakarta.annotation.Nullable String projectId) { this.projectId = projectId; @@ -315,20 +340,31 @@ public boolean equals(Object o) { return false; } ModelsMetaEventResponse modelsMetaEventResponse = (ModelsMetaEventResponse) o; - return Objects.equals(this.attempt, modelsMetaEventResponse.attempt) && + return equalsNullable(this.attempt, modelsMetaEventResponse.attempt) && Objects.equals(this.createdAt, modelsMetaEventResponse.createdAt) && - Objects.equals(this.deletedAt, modelsMetaEventResponse.deletedAt) && + equalsNullable(this.deletedAt, modelsMetaEventResponse.deletedAt) && Objects.equals(this.eventType, modelsMetaEventResponse.eventType) && - Objects.equals(this.metadata, modelsMetaEventResponse.metadata) && + equalsNullable(this.metadata, modelsMetaEventResponse.metadata) && Objects.equals(this.projectId, modelsMetaEventResponse.projectId) && Objects.equals(this.status, modelsMetaEventResponse.status) && Objects.equals(this.uid, modelsMetaEventResponse.uid) && Objects.equals(this.updatedAt, modelsMetaEventResponse.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(attempt, createdAt, deletedAt, eventType, metadata, projectId, status, uid, updatedAt); + return Objects.hash(hashCodeNullable(attempt), createdAt, hashCodeNullable(deletedAt), eventType, hashCodeNullable(metadata), projectId, status, uid, 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/getconvoy/models/ModelsProjectResponse.java b/src/main/java/com/getconvoy/models/ModelsProjectResponse.java index 9d436c8..63c4b1f 100644 --- a/src/main/java/com/getconvoy/models/ModelsProjectResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsProjectResponse.java @@ -28,6 +28,10 @@ import com.getconvoy.models.DatastoreProjectStatistics; import com.getconvoy.models.DatastoreProjectType; 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; @@ -51,16 +55,14 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsProjectResponse { public static final String JSON_PROPERTY_CONFIG = "config"; - @jakarta.annotation.Nullable - private DatastoreProjectConfig config; + private JsonNullable config = JsonNullable.undefined(); public static final String JSON_PROPERTY_CREATED_AT = "created_at"; @jakarta.annotation.Nullable private String createdAt; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_LOGO_URL = "logo_url"; @jakarta.annotation.Nullable @@ -79,8 +81,7 @@ public class ModelsProjectResponse { private Integer retainedEvents; public static final String JSON_PROPERTY_STATISTICS = "statistics"; - @jakarta.annotation.Nullable - private DatastoreProjectStatistics statistics; + private JsonNullable statistics = JsonNullable.undefined(); public static final String JSON_PROPERTY_TYPE = "type"; @jakarta.annotation.Nullable @@ -98,7 +99,7 @@ public ModelsProjectResponse() { } public ModelsProjectResponse config(@jakarta.annotation.Nullable DatastoreProjectConfig config) { - this.config = config; + this.config = JsonNullable.of(config); return this; } @@ -107,19 +108,27 @@ public ModelsProjectResponse config(@jakarta.annotation.Nullable DatastoreProjec * @return config */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_CONFIG, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreProjectConfig getConfig() { - return config; + return config.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_CONFIG, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setConfig(@jakarta.annotation.Nullable DatastoreProjectConfig config) { + + public JsonNullable getConfig_JsonNullable() { + return config; + } + + @JsonProperty(JSON_PROPERTY_CONFIG) + public void setConfig_JsonNullable(JsonNullable config) { this.config = config; } + public void setConfig(@jakarta.annotation.Nullable DatastoreProjectConfig config) { + this.config = JsonNullable.of(config); + } + public ModelsProjectResponse createdAt(@jakarta.annotation.Nullable String createdAt) { this.createdAt = createdAt; @@ -146,7 +155,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public ModelsProjectResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -155,19 +164,27 @@ public ModelsProjectResponse deletedAt(@jakarta.annotation.Nullable String delet * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public ModelsProjectResponse logoUrl(@jakarta.annotation.Nullable String logoUrl) { this.logoUrl = logoUrl; @@ -266,7 +283,7 @@ public void setRetainedEvents(@jakarta.annotation.Nullable Integer retainedEvent public ModelsProjectResponse statistics(@jakarta.annotation.Nullable DatastoreProjectStatistics statistics) { - this.statistics = statistics; + this.statistics = JsonNullable.of(statistics); return this; } @@ -275,19 +292,27 @@ public ModelsProjectResponse statistics(@jakarta.annotation.Nullable DatastorePr * @return statistics */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_STATISTICS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreProjectStatistics getStatistics() { - return statistics; + return statistics.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_STATISTICS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatistics(@jakarta.annotation.Nullable DatastoreProjectStatistics statistics) { + + public JsonNullable getStatistics_JsonNullable() { + return statistics; + } + + @JsonProperty(JSON_PROPERTY_STATISTICS) + public void setStatistics_JsonNullable(JsonNullable statistics) { this.statistics = statistics; } + public void setStatistics(@jakarta.annotation.Nullable DatastoreProjectStatistics statistics) { + this.statistics = JsonNullable.of(statistics); + } + public ModelsProjectResponse type(@jakarta.annotation.Nullable DatastoreProjectType type) { this.type = type; @@ -373,22 +398,33 @@ public boolean equals(Object o) { return false; } ModelsProjectResponse modelsProjectResponse = (ModelsProjectResponse) o; - return Objects.equals(this.config, modelsProjectResponse.config) && + return equalsNullable(this.config, modelsProjectResponse.config) && Objects.equals(this.createdAt, modelsProjectResponse.createdAt) && - Objects.equals(this.deletedAt, modelsProjectResponse.deletedAt) && + equalsNullable(this.deletedAt, modelsProjectResponse.deletedAt) && Objects.equals(this.logoUrl, modelsProjectResponse.logoUrl) && Objects.equals(this.name, modelsProjectResponse.name) && Objects.equals(this.organisationId, modelsProjectResponse.organisationId) && Objects.equals(this.retainedEvents, modelsProjectResponse.retainedEvents) && - Objects.equals(this.statistics, modelsProjectResponse.statistics) && + equalsNullable(this.statistics, modelsProjectResponse.statistics) && Objects.equals(this.type, modelsProjectResponse.type) && Objects.equals(this.uid, modelsProjectResponse.uid) && Objects.equals(this.updatedAt, modelsProjectResponse.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(config, createdAt, deletedAt, logoUrl, name, organisationId, retainedEvents, statistics, type, uid, updatedAt); + return Objects.hash(hashCodeNullable(config), createdAt, hashCodeNullable(deletedAt), logoUrl, name, organisationId, retainedEvents, hashCodeNullable(statistics), type, uid, 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/getconvoy/models/ModelsSourceResponse.java b/src/main/java/com/getconvoy/models/ModelsSourceResponse.java index c3da77b..8d98356 100644 --- a/src/main/java/com/getconvoy/models/ModelsSourceResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsSourceResponse.java @@ -33,6 +33,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; @@ -65,8 +69,7 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsSourceResponse { public static final String JSON_PROPERTY_BODY_FUNCTION = "body_function"; - @jakarta.annotation.Nullable - private String bodyFunction; + private JsonNullable bodyFunction = JsonNullable.undefined(); public static final String JSON_PROPERTY_CREATED_AT = "created_at"; @jakarta.annotation.Nullable @@ -77,8 +80,7 @@ public class ModelsSourceResponse { private DatastoreCustomResponse customResponse; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_EVENT_TYPE_LOCATION = "event_type_location"; @jakarta.annotation.Nullable @@ -89,8 +91,7 @@ public class ModelsSourceResponse { private List forwardHeaders = new ArrayList<>(); public static final String JSON_PROPERTY_HEADER_FUNCTION = "header_function"; - @jakarta.annotation.Nullable - private String headerFunction; + private JsonNullable headerFunction = JsonNullable.undefined(); public static final String JSON_PROPERTY_IDEMPOTENCY_KEYS = "idempotency_keys"; @jakarta.annotation.Nullable @@ -117,12 +118,10 @@ public class ModelsSourceResponse { private DatastoreSourceProvider provider; public static final String JSON_PROPERTY_PROVIDER_CONFIG = "provider_config"; - @jakarta.annotation.Nullable - private DatastoreProviderConfig providerConfig; + private JsonNullable providerConfig = JsonNullable.undefined(); public static final String JSON_PROPERTY_PUB_SUB = "pub_sub"; - @jakarta.annotation.Nullable - private DatastorePubSubConfig pubSub; + private JsonNullable pubSub = JsonNullable.undefined(); public static final String JSON_PROPERTY_TYPE = "type"; @jakarta.annotation.Nullable @@ -141,14 +140,13 @@ public class ModelsSourceResponse { private String url; public static final String JSON_PROPERTY_VERIFIER = "verifier"; - @jakarta.annotation.Nullable - private DatastoreVerifierConfig verifier; + private JsonNullable verifier = JsonNullable.undefined(); public ModelsSourceResponse() { } public ModelsSourceResponse bodyFunction(@jakarta.annotation.Nullable String bodyFunction) { - this.bodyFunction = bodyFunction; + this.bodyFunction = JsonNullable.of(bodyFunction); return this; } @@ -157,19 +155,27 @@ public ModelsSourceResponse bodyFunction(@jakarta.annotation.Nullable String bod * @return bodyFunction */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getBodyFunction() { - return bodyFunction; + return bodyFunction.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BODY_FUNCTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + + public JsonNullable getBodyFunction_JsonNullable() { + return bodyFunction; + } + + @JsonProperty(JSON_PROPERTY_BODY_FUNCTION) + public void setBodyFunction_JsonNullable(JsonNullable bodyFunction) { this.bodyFunction = bodyFunction; } + public void setBodyFunction(@jakarta.annotation.Nullable String bodyFunction) { + this.bodyFunction = JsonNullable.of(bodyFunction); + } + public ModelsSourceResponse createdAt(@jakarta.annotation.Nullable String createdAt) { this.createdAt = createdAt; @@ -220,7 +226,7 @@ public void setCustomResponse(@jakarta.annotation.Nullable DatastoreCustomRespon public ModelsSourceResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -229,19 +235,27 @@ public ModelsSourceResponse deletedAt(@jakarta.annotation.Nullable String delete * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public ModelsSourceResponse eventTypeLocation(@jakarta.annotation.Nullable String eventTypeLocation) { this.eventTypeLocation = eventTypeLocation; @@ -300,7 +314,7 @@ public void setForwardHeaders(@jakarta.annotation.Nullable List forwardH public ModelsSourceResponse headerFunction(@jakarta.annotation.Nullable String headerFunction) { - this.headerFunction = headerFunction; + this.headerFunction = JsonNullable.of(headerFunction); return this; } @@ -309,19 +323,27 @@ public ModelsSourceResponse headerFunction(@jakarta.annotation.Nullable String h * @return headerFunction */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getHeaderFunction() { - return headerFunction; + return headerFunction.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADER_FUNCTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaderFunction(@jakarta.annotation.Nullable String headerFunction) { + + public JsonNullable getHeaderFunction_JsonNullable() { + return headerFunction; + } + + @JsonProperty(JSON_PROPERTY_HEADER_FUNCTION) + public void setHeaderFunction_JsonNullable(JsonNullable headerFunction) { this.headerFunction = headerFunction; } + public void setHeaderFunction(@jakarta.annotation.Nullable String headerFunction) { + this.headerFunction = JsonNullable.of(headerFunction); + } + public ModelsSourceResponse idempotencyKeys(@jakarta.annotation.Nullable List idempotencyKeys) { this.idempotencyKeys = idempotencyKeys; @@ -476,7 +498,7 @@ public void setProvider(@jakarta.annotation.Nullable DatastoreSourceProvider pro public ModelsSourceResponse providerConfig(@jakarta.annotation.Nullable DatastoreProviderConfig providerConfig) { - this.providerConfig = providerConfig; + this.providerConfig = JsonNullable.of(providerConfig); return this; } @@ -485,22 +507,30 @@ public ModelsSourceResponse providerConfig(@jakarta.annotation.Nullable Datastor * @return providerConfig */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PROVIDER_CONFIG, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreProviderConfig getProviderConfig() { - return providerConfig; + return providerConfig.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PROVIDER_CONFIG, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setProviderConfig(@jakarta.annotation.Nullable DatastoreProviderConfig providerConfig) { + + public JsonNullable getProviderConfig_JsonNullable() { + return providerConfig; + } + + @JsonProperty(JSON_PROPERTY_PROVIDER_CONFIG) + public void setProviderConfig_JsonNullable(JsonNullable providerConfig) { this.providerConfig = providerConfig; } + public void setProviderConfig(@jakarta.annotation.Nullable DatastoreProviderConfig providerConfig) { + this.providerConfig = JsonNullable.of(providerConfig); + } + public ModelsSourceResponse pubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { - this.pubSub = pubSub; + this.pubSub = JsonNullable.of(pubSub); return this; } @@ -509,19 +539,27 @@ public ModelsSourceResponse pubSub(@jakarta.annotation.Nullable DatastorePubSubC * @return pubSub */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastorePubSubConfig getPubSub() { - return pubSub; + return pubSub.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PUB_SUB, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + + public JsonNullable getPubSub_JsonNullable() { + return pubSub; + } + + @JsonProperty(JSON_PROPERTY_PUB_SUB) + public void setPubSub_JsonNullable(JsonNullable pubSub) { this.pubSub = pubSub; } + public void setPubSub(@jakarta.annotation.Nullable DatastorePubSubConfig pubSub) { + this.pubSub = JsonNullable.of(pubSub); + } + public ModelsSourceResponse type(@jakarta.annotation.Nullable DatastoreSourceType type) { this.type = type; @@ -620,7 +658,7 @@ public void setUrl(@jakarta.annotation.Nullable String url) { public ModelsSourceResponse verifier(@jakarta.annotation.Nullable DatastoreVerifierConfig verifier) { - this.verifier = verifier; + this.verifier = JsonNullable.of(verifier); return this; } @@ -629,19 +667,27 @@ public ModelsSourceResponse verifier(@jakarta.annotation.Nullable DatastoreVerif * @return verifier */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreVerifierConfig getVerifier() { - return verifier; + return verifier.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_VERIFIER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setVerifier(@jakarta.annotation.Nullable DatastoreVerifierConfig verifier) { + + public JsonNullable getVerifier_JsonNullable() { + return verifier; + } + + @JsonProperty(JSON_PROPERTY_VERIFIER) + public void setVerifier_JsonNullable(JsonNullable verifier) { this.verifier = verifier; } + public void setVerifier(@jakarta.annotation.Nullable DatastoreVerifierConfig verifier) { + this.verifier = JsonNullable.of(verifier); + } + /** * Return true if this models.SourceResponse object is equal to o. @@ -655,31 +701,42 @@ public boolean equals(Object o) { return false; } ModelsSourceResponse modelsSourceResponse = (ModelsSourceResponse) o; - return Objects.equals(this.bodyFunction, modelsSourceResponse.bodyFunction) && + return equalsNullable(this.bodyFunction, modelsSourceResponse.bodyFunction) && Objects.equals(this.createdAt, modelsSourceResponse.createdAt) && Objects.equals(this.customResponse, modelsSourceResponse.customResponse) && - Objects.equals(this.deletedAt, modelsSourceResponse.deletedAt) && + equalsNullable(this.deletedAt, modelsSourceResponse.deletedAt) && Objects.equals(this.eventTypeLocation, modelsSourceResponse.eventTypeLocation) && Objects.equals(this.forwardHeaders, modelsSourceResponse.forwardHeaders) && - Objects.equals(this.headerFunction, modelsSourceResponse.headerFunction) && + equalsNullable(this.headerFunction, modelsSourceResponse.headerFunction) && Objects.equals(this.idempotencyKeys, modelsSourceResponse.idempotencyKeys) && Objects.equals(this.isDisabled, modelsSourceResponse.isDisabled) && Objects.equals(this.maskId, modelsSourceResponse.maskId) && Objects.equals(this.name, modelsSourceResponse.name) && Objects.equals(this.projectId, modelsSourceResponse.projectId) && Objects.equals(this.provider, modelsSourceResponse.provider) && - Objects.equals(this.providerConfig, modelsSourceResponse.providerConfig) && - Objects.equals(this.pubSub, modelsSourceResponse.pubSub) && + equalsNullable(this.providerConfig, modelsSourceResponse.providerConfig) && + equalsNullable(this.pubSub, modelsSourceResponse.pubSub) && Objects.equals(this.type, modelsSourceResponse.type) && Objects.equals(this.uid, modelsSourceResponse.uid) && Objects.equals(this.updatedAt, modelsSourceResponse.updatedAt) && Objects.equals(this.url, modelsSourceResponse.url) && - Objects.equals(this.verifier, modelsSourceResponse.verifier); + equalsNullable(this.verifier, modelsSourceResponse.verifier); + } + + 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(bodyFunction, createdAt, customResponse, deletedAt, eventTypeLocation, forwardHeaders, headerFunction, idempotencyKeys, isDisabled, maskId, name, projectId, provider, providerConfig, pubSub, type, uid, updatedAt, url, verifier); + return Objects.hash(hashCodeNullable(bodyFunction), createdAt, customResponse, hashCodeNullable(deletedAt), eventTypeLocation, forwardHeaders, hashCodeNullable(headerFunction), idempotencyKeys, isDisabled, maskId, name, projectId, provider, hashCodeNullable(providerConfig), hashCodeNullable(pubSub), type, uid, updatedAt, url, hashCodeNullable(verifier)); + } + + 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/getconvoy/models/ModelsSubscriptionResponse.java b/src/main/java/com/getconvoy/models/ModelsSubscriptionResponse.java index 0f22d83..21ef2b3 100644 --- a/src/main/java/com/getconvoy/models/ModelsSubscriptionResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsSubscriptionResponse.java @@ -34,6 +34,10 @@ import com.getconvoy.models.DatastoreSource; import com.getconvoy.models.DatastoreSubscriptionType; 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; @@ -62,36 +66,30 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsSubscriptionResponse { public static final String JSON_PROPERTY_ALERT_CONFIG = "alert_config"; - @jakarta.annotation.Nullable - private DatastoreAlertConfiguration alertConfig; + private JsonNullable alertConfig = JsonNullable.undefined(); public static final String JSON_PROPERTY_CREATED_AT = "created_at"; @jakarta.annotation.Nullable private String createdAt; public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; - @jakarta.annotation.Nullable - private String deletedAt; + private JsonNullable deletedAt = JsonNullable.undefined(); public static final String JSON_PROPERTY_DELIVERY_MODE = "delivery_mode"; @jakarta.annotation.Nullable private DatastoreDeliveryMode deliveryMode; public static final String JSON_PROPERTY_DEVICE_METADATA = "device_metadata"; - @jakarta.annotation.Nullable - private DatastoreDevice deviceMetadata; + private JsonNullable deviceMetadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_ENDPOINT_METADATA = "endpoint_metadata"; - @jakarta.annotation.Nullable - private DatastoreEndpoint endpointMetadata; + private JsonNullable endpointMetadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_FILTER_CONFIG = "filter_config"; - @jakarta.annotation.Nullable - private DatastoreFilterConfiguration filterConfig; + private JsonNullable filterConfig = JsonNullable.undefined(); public static final String JSON_PROPERTY_FUNCTION = "function"; - @jakarta.annotation.Nullable - private String function; + private JsonNullable function = JsonNullable.undefined(); public static final String JSON_PROPERTY_NAME = "name"; @jakarta.annotation.Nullable @@ -102,16 +100,13 @@ public class ModelsSubscriptionResponse { private String projectId; public static final String JSON_PROPERTY_RATE_LIMIT_CONFIG = "rate_limit_config"; - @jakarta.annotation.Nullable - private DatastoreRateLimitConfiguration rateLimitConfig; + private JsonNullable rateLimitConfig = JsonNullable.undefined(); public static final String JSON_PROPERTY_RETRY_CONFIG = "retry_config"; - @jakarta.annotation.Nullable - private DatastoreRetryConfiguration retryConfig; + private JsonNullable retryConfig = JsonNullable.undefined(); public static final String JSON_PROPERTY_SOURCE_METADATA = "source_metadata"; - @jakarta.annotation.Nullable - private DatastoreSource sourceMetadata; + private JsonNullable sourceMetadata = JsonNullable.undefined(); public static final String JSON_PROPERTY_TYPE = "type"; @jakarta.annotation.Nullable @@ -129,7 +124,7 @@ public ModelsSubscriptionResponse() { } public ModelsSubscriptionResponse alertConfig(@jakarta.annotation.Nullable DatastoreAlertConfiguration alertConfig) { - this.alertConfig = alertConfig; + this.alertConfig = JsonNullable.of(alertConfig); return this; } @@ -138,19 +133,27 @@ public ModelsSubscriptionResponse alertConfig(@jakarta.annotation.Nullable Datas * @return alertConfig */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ALERT_CONFIG, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreAlertConfiguration getAlertConfig() { - return alertConfig; + return alertConfig.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ALERT_CONFIG, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAlertConfig(@jakarta.annotation.Nullable DatastoreAlertConfiguration alertConfig) { + + public JsonNullable getAlertConfig_JsonNullable() { + return alertConfig; + } + + @JsonProperty(JSON_PROPERTY_ALERT_CONFIG) + public void setAlertConfig_JsonNullable(JsonNullable alertConfig) { this.alertConfig = alertConfig; } + public void setAlertConfig(@jakarta.annotation.Nullable DatastoreAlertConfiguration alertConfig) { + this.alertConfig = JsonNullable.of(alertConfig); + } + public ModelsSubscriptionResponse createdAt(@jakarta.annotation.Nullable String createdAt) { this.createdAt = createdAt; @@ -177,7 +180,7 @@ public void setCreatedAt(@jakarta.annotation.Nullable String createdAt) { public ModelsSubscriptionResponse deletedAt(@jakarta.annotation.Nullable String deletedAt) { - this.deletedAt = deletedAt; + this.deletedAt = JsonNullable.of(deletedAt); return this; } @@ -186,19 +189,27 @@ public ModelsSubscriptionResponse deletedAt(@jakarta.annotation.Nullable String * @return deletedAt */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getDeletedAt() { - return deletedAt; + return deletedAt.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DELETED_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + + public JsonNullable getDeletedAt_JsonNullable() { + return deletedAt; + } + + @JsonProperty(JSON_PROPERTY_DELETED_AT) + public void setDeletedAt_JsonNullable(JsonNullable deletedAt) { this.deletedAt = deletedAt; } + public void setDeletedAt(@jakarta.annotation.Nullable String deletedAt) { + this.deletedAt = JsonNullable.of(deletedAt); + } + public ModelsSubscriptionResponse deliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode deliveryMode) { this.deliveryMode = deliveryMode; @@ -225,7 +236,7 @@ public void setDeliveryMode(@jakarta.annotation.Nullable DatastoreDeliveryMode d public ModelsSubscriptionResponse deviceMetadata(@jakarta.annotation.Nullable DatastoreDevice deviceMetadata) { - this.deviceMetadata = deviceMetadata; + this.deviceMetadata = JsonNullable.of(deviceMetadata); return this; } @@ -234,22 +245,30 @@ public ModelsSubscriptionResponse deviceMetadata(@jakarta.annotation.Nullable Da * @return deviceMetadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_DEVICE_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreDevice getDeviceMetadata() { - return deviceMetadata; + return deviceMetadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_DEVICE_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeviceMetadata(@jakarta.annotation.Nullable DatastoreDevice deviceMetadata) { + + public JsonNullable getDeviceMetadata_JsonNullable() { + return deviceMetadata; + } + + @JsonProperty(JSON_PROPERTY_DEVICE_METADATA) + public void setDeviceMetadata_JsonNullable(JsonNullable deviceMetadata) { this.deviceMetadata = deviceMetadata; } + public void setDeviceMetadata(@jakarta.annotation.Nullable DatastoreDevice deviceMetadata) { + this.deviceMetadata = JsonNullable.of(deviceMetadata); + } + public ModelsSubscriptionResponse endpointMetadata(@jakarta.annotation.Nullable DatastoreEndpoint endpointMetadata) { - this.endpointMetadata = endpointMetadata; + this.endpointMetadata = JsonNullable.of(endpointMetadata); return this; } @@ -258,22 +277,30 @@ public ModelsSubscriptionResponse endpointMetadata(@jakarta.annotation.Nullable * @return endpointMetadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreEndpoint getEndpointMetadata() { - return endpointMetadata; + return endpointMetadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_ENDPOINT_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEndpointMetadata(@jakarta.annotation.Nullable DatastoreEndpoint endpointMetadata) { + + public JsonNullable getEndpointMetadata_JsonNullable() { + return endpointMetadata; + } + + @JsonProperty(JSON_PROPERTY_ENDPOINT_METADATA) + public void setEndpointMetadata_JsonNullable(JsonNullable endpointMetadata) { this.endpointMetadata = endpointMetadata; } + public void setEndpointMetadata(@jakarta.annotation.Nullable DatastoreEndpoint endpointMetadata) { + this.endpointMetadata = JsonNullable.of(endpointMetadata); + } + public ModelsSubscriptionResponse filterConfig(@jakarta.annotation.Nullable DatastoreFilterConfiguration filterConfig) { - this.filterConfig = filterConfig; + this.filterConfig = JsonNullable.of(filterConfig); return this; } @@ -282,22 +309,30 @@ public ModelsSubscriptionResponse filterConfig(@jakarta.annotation.Nullable Data * @return filterConfig */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FILTER_CONFIG, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreFilterConfiguration getFilterConfig() { - return filterConfig; + return filterConfig.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_FILTER_CONFIG, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFilterConfig(@jakarta.annotation.Nullable DatastoreFilterConfiguration filterConfig) { + + public JsonNullable getFilterConfig_JsonNullable() { + return filterConfig; + } + + @JsonProperty(JSON_PROPERTY_FILTER_CONFIG) + public void setFilterConfig_JsonNullable(JsonNullable filterConfig) { this.filterConfig = filterConfig; } + public void setFilterConfig(@jakarta.annotation.Nullable DatastoreFilterConfiguration filterConfig) { + this.filterConfig = JsonNullable.of(filterConfig); + } + public ModelsSubscriptionResponse function(@jakarta.annotation.Nullable String function) { - this.function = function; + this.function = JsonNullable.of(function); return this; } @@ -306,19 +341,27 @@ public ModelsSubscriptionResponse function(@jakarta.annotation.Nullable String f * @return function */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_FUNCTION, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public String getFunction() { - return function; + return function.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_FUNCTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFunction(@jakarta.annotation.Nullable String function) { + + public JsonNullable getFunction_JsonNullable() { + return function; + } + + @JsonProperty(JSON_PROPERTY_FUNCTION) + public void setFunction_JsonNullable(JsonNullable function) { this.function = function; } + public void setFunction(@jakarta.annotation.Nullable String function) { + this.function = JsonNullable.of(function); + } + public ModelsSubscriptionResponse name(@jakarta.annotation.Nullable String name) { this.name = name; @@ -369,7 +412,7 @@ public void setProjectId(@jakarta.annotation.Nullable String projectId) { public ModelsSubscriptionResponse rateLimitConfig(@jakarta.annotation.Nullable DatastoreRateLimitConfiguration rateLimitConfig) { - this.rateLimitConfig = rateLimitConfig; + this.rateLimitConfig = JsonNullable.of(rateLimitConfig); return this; } @@ -378,22 +421,30 @@ public ModelsSubscriptionResponse rateLimitConfig(@jakarta.annotation.Nullable D * @return rateLimitConfig */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_CONFIG, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreRateLimitConfiguration getRateLimitConfig() { - return rateLimitConfig; + return rateLimitConfig.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RATE_LIMIT_CONFIG, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRateLimitConfig(@jakarta.annotation.Nullable DatastoreRateLimitConfiguration rateLimitConfig) { + + public JsonNullable getRateLimitConfig_JsonNullable() { + return rateLimitConfig; + } + + @JsonProperty(JSON_PROPERTY_RATE_LIMIT_CONFIG) + public void setRateLimitConfig_JsonNullable(JsonNullable rateLimitConfig) { this.rateLimitConfig = rateLimitConfig; } + public void setRateLimitConfig(@jakarta.annotation.Nullable DatastoreRateLimitConfiguration rateLimitConfig) { + this.rateLimitConfig = JsonNullable.of(rateLimitConfig); + } + public ModelsSubscriptionResponse retryConfig(@jakarta.annotation.Nullable DatastoreRetryConfiguration retryConfig) { - this.retryConfig = retryConfig; + this.retryConfig = JsonNullable.of(retryConfig); return this; } @@ -402,22 +453,30 @@ public ModelsSubscriptionResponse retryConfig(@jakarta.annotation.Nullable Datas * @return retryConfig */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_RETRY_CONFIG, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreRetryConfiguration getRetryConfig() { - return retryConfig; + return retryConfig.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_RETRY_CONFIG, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRetryConfig(@jakarta.annotation.Nullable DatastoreRetryConfiguration retryConfig) { + + public JsonNullable getRetryConfig_JsonNullable() { + return retryConfig; + } + + @JsonProperty(JSON_PROPERTY_RETRY_CONFIG) + public void setRetryConfig_JsonNullable(JsonNullable retryConfig) { this.retryConfig = retryConfig; } + public void setRetryConfig(@jakarta.annotation.Nullable DatastoreRetryConfiguration retryConfig) { + this.retryConfig = JsonNullable.of(retryConfig); + } + public ModelsSubscriptionResponse sourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { - this.sourceMetadata = sourceMetadata; + this.sourceMetadata = JsonNullable.of(sourceMetadata); return this; } @@ -426,19 +485,27 @@ public ModelsSubscriptionResponse sourceMetadata(@jakarta.annotation.Nullable Da * @return sourceMetadata */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public DatastoreSource getSourceMetadata() { - return sourceMetadata; + return sourceMetadata.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_SOURCE_METADATA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + + public JsonNullable getSourceMetadata_JsonNullable() { + return sourceMetadata; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_METADATA) + public void setSourceMetadata_JsonNullable(JsonNullable sourceMetadata) { this.sourceMetadata = sourceMetadata; } + public void setSourceMetadata(@jakarta.annotation.Nullable DatastoreSource sourceMetadata) { + this.sourceMetadata = JsonNullable.of(sourceMetadata); + } + public ModelsSubscriptionResponse type(@jakarta.annotation.Nullable DatastoreSubscriptionType type) { this.type = type; @@ -524,27 +591,38 @@ public boolean equals(Object o) { return false; } ModelsSubscriptionResponse modelsSubscriptionResponse = (ModelsSubscriptionResponse) o; - return Objects.equals(this.alertConfig, modelsSubscriptionResponse.alertConfig) && + return equalsNullable(this.alertConfig, modelsSubscriptionResponse.alertConfig) && Objects.equals(this.createdAt, modelsSubscriptionResponse.createdAt) && - Objects.equals(this.deletedAt, modelsSubscriptionResponse.deletedAt) && + equalsNullable(this.deletedAt, modelsSubscriptionResponse.deletedAt) && Objects.equals(this.deliveryMode, modelsSubscriptionResponse.deliveryMode) && - Objects.equals(this.deviceMetadata, modelsSubscriptionResponse.deviceMetadata) && - Objects.equals(this.endpointMetadata, modelsSubscriptionResponse.endpointMetadata) && - Objects.equals(this.filterConfig, modelsSubscriptionResponse.filterConfig) && - Objects.equals(this.function, modelsSubscriptionResponse.function) && + equalsNullable(this.deviceMetadata, modelsSubscriptionResponse.deviceMetadata) && + equalsNullable(this.endpointMetadata, modelsSubscriptionResponse.endpointMetadata) && + equalsNullable(this.filterConfig, modelsSubscriptionResponse.filterConfig) && + equalsNullable(this.function, modelsSubscriptionResponse.function) && Objects.equals(this.name, modelsSubscriptionResponse.name) && Objects.equals(this.projectId, modelsSubscriptionResponse.projectId) && - Objects.equals(this.rateLimitConfig, modelsSubscriptionResponse.rateLimitConfig) && - Objects.equals(this.retryConfig, modelsSubscriptionResponse.retryConfig) && - Objects.equals(this.sourceMetadata, modelsSubscriptionResponse.sourceMetadata) && + equalsNullable(this.rateLimitConfig, modelsSubscriptionResponse.rateLimitConfig) && + equalsNullable(this.retryConfig, modelsSubscriptionResponse.retryConfig) && + equalsNullable(this.sourceMetadata, modelsSubscriptionResponse.sourceMetadata) && Objects.equals(this.type, modelsSubscriptionResponse.type) && Objects.equals(this.uid, modelsSubscriptionResponse.uid) && Objects.equals(this.updatedAt, modelsSubscriptionResponse.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(alertConfig, createdAt, deletedAt, deliveryMode, deviceMetadata, endpointMetadata, filterConfig, function, name, projectId, rateLimitConfig, retryConfig, sourceMetadata, type, uid, updatedAt); + return Objects.hash(hashCodeNullable(alertConfig), createdAt, hashCodeNullable(deletedAt), deliveryMode, hashCodeNullable(deviceMetadata), hashCodeNullable(endpointMetadata), hashCodeNullable(filterConfig), hashCodeNullable(function), name, projectId, hashCodeNullable(rateLimitConfig), hashCodeNullable(retryConfig), hashCodeNullable(sourceMetadata), type, uid, 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/getconvoy/models/ModelsTestFilterRequestScopes.java b/src/main/java/com/getconvoy/models/ModelsTestFilterRequestScopes.java index 6851dd8..0031e7b 100644 --- a/src/main/java/com/getconvoy/models/ModelsTestFilterRequestScopes.java +++ b/src/main/java/com/getconvoy/models/ModelsTestFilterRequestScopes.java @@ -51,20 +51,16 @@ public class ModelsTestFilterRequestScopes { private JsonNullable body = JsonNullable.of(null); public static final String JSON_PROPERTY_HEADER = "header"; - @jakarta.annotation.Nullable - private Map header = new HashMap<>(); + private JsonNullable> header = JsonNullable.>undefined(); public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private Map headers; + private JsonNullable> headers = JsonNullable.>undefined(); public static final String JSON_PROPERTY_PATH = "path"; - @jakarta.annotation.Nullable - private Map path = new HashMap<>(); + private JsonNullable> path = JsonNullable.>undefined(); public static final String JSON_PROPERTY_QUERY = "query"; - @jakarta.annotation.Nullable - private Map query = new HashMap<>(); + private JsonNullable> query = JsonNullable.>undefined(); public ModelsTestFilterRequestScopes() { } @@ -102,15 +98,19 @@ public void setBody(@jakarta.annotation.Nullable Object body) { public ModelsTestFilterRequestScopes header(@jakarta.annotation.Nullable Map header) { - this.header = header; + this.header = JsonNullable.>of(header); return this; } public ModelsTestFilterRequestScopes putHeaderItem(String key, Object headerItem) { - if (this.header == null) { - this.header = new HashMap<>(); + if (this.header == null || !this.header.isPresent()) { + this.header = JsonNullable.>of(new HashMap<>()); + } + try { + this.header.get().put(key, headerItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.header.put(key, headerItem); return this; } @@ -119,30 +119,42 @@ public ModelsTestFilterRequestScopes putHeaderItem(String key, Object headerItem * @return header */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getHeader() { - return header; + return header.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADER, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setHeader(@jakarta.annotation.Nullable Map header) { + + public JsonNullable> getHeader_JsonNullable() { + return header; + } + + @JsonProperty(JSON_PROPERTY_HEADER) + public void setHeader_JsonNullable(JsonNullable> header) { this.header = header; } + public void setHeader(@jakarta.annotation.Nullable Map header) { + this.header = JsonNullable.>of(header); + } + public ModelsTestFilterRequestScopes headers(@jakarta.annotation.Nullable Map headers) { - this.headers = headers; + this.headers = JsonNullable.>of(headers); return this; } public ModelsTestFilterRequestScopes putHeadersItem(String key, Object headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); + if (this.headers == null || !this.headers.isPresent()) { + this.headers = JsonNullable.>of(new HashMap<>()); + } + try { + this.headers.get().put(key, headersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.headers.put(key, headersItem); return this; } @@ -151,30 +163,42 @@ public ModelsTestFilterRequestScopes putHeadersItem(String key, Object headersIt * @return headers */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getHeaders() { - return headers; + return headers.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaders(@jakarta.annotation.Nullable Map headers) { + + public JsonNullable> getHeaders_JsonNullable() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + public void setHeaders_JsonNullable(JsonNullable> headers) { this.headers = headers; } + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = JsonNullable.>of(headers); + } + public ModelsTestFilterRequestScopes path(@jakarta.annotation.Nullable Map path) { - this.path = path; + this.path = JsonNullable.>of(path); return this; } public ModelsTestFilterRequestScopes putPathItem(String key, Object pathItem) { - if (this.path == null) { - this.path = new HashMap<>(); + if (this.path == null || !this.path.isPresent()) { + this.path = JsonNullable.>of(new HashMap<>()); + } + try { + this.path.get().put(key, pathItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.path.put(key, pathItem); return this; } @@ -183,30 +207,42 @@ public ModelsTestFilterRequestScopes putPathItem(String key, Object pathItem) { * @return path */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getPath() { - return path; + return path.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setPath(@jakarta.annotation.Nullable Map path) { + + public JsonNullable> getPath_JsonNullable() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + public void setPath_JsonNullable(JsonNullable> path) { this.path = path; } + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = JsonNullable.>of(path); + } + public ModelsTestFilterRequestScopes query(@jakarta.annotation.Nullable Map query) { - this.query = query; + this.query = JsonNullable.>of(query); return this; } public ModelsTestFilterRequestScopes putQueryItem(String key, Object queryItem) { - if (this.query == null) { - this.query = new HashMap<>(); + if (this.query == null || !this.query.isPresent()) { + this.query = JsonNullable.>of(new HashMap<>()); + } + try { + this.query.get().put(key, queryItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.query.put(key, queryItem); return this; } @@ -215,19 +251,27 @@ public ModelsTestFilterRequestScopes putQueryItem(String key, Object queryItem) * @return query */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getQuery() { - return query; + return query.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setQuery(@jakarta.annotation.Nullable Map query) { + + public JsonNullable> getQuery_JsonNullable() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + public void setQuery_JsonNullable(JsonNullable> query) { this.query = query; } + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = JsonNullable.>of(query); + } + /** * Return true if this models.TestFilterRequestScopes object is equal to o. @@ -242,10 +286,10 @@ public boolean equals(Object o) { } ModelsTestFilterRequestScopes modelsTestFilterRequestScopes = (ModelsTestFilterRequestScopes) o; return equalsNullable(this.body, modelsTestFilterRequestScopes.body) && - Objects.equals(this.header, modelsTestFilterRequestScopes.header) && - Objects.equals(this.headers, modelsTestFilterRequestScopes.headers) && - Objects.equals(this.path, modelsTestFilterRequestScopes.path) && - Objects.equals(this.query, modelsTestFilterRequestScopes.query); + equalsNullable(this.header, modelsTestFilterRequestScopes.header) && + equalsNullable(this.headers, modelsTestFilterRequestScopes.headers) && + equalsNullable(this.path, modelsTestFilterRequestScopes.path) && + equalsNullable(this.query, modelsTestFilterRequestScopes.query); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -254,7 +298,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(body), header, headers, path, query); + return Objects.hash(hashCodeNullable(body), hashCodeNullable(header), hashCodeNullable(headers), hashCodeNullable(path), hashCodeNullable(query)); } private static int hashCodeNullable(JsonNullable a) { diff --git a/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java b/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java index 0946eac..25701fb 100644 --- a/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java +++ b/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java @@ -27,6 +27,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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; @@ -50,8 +54,7 @@ public class ModelsUpdateEventType { private String description; public static final String JSON_PROPERTY_JSON_SCHEMA = "json_schema"; - @jakarta.annotation.Nullable - private Map jsonSchema = new HashMap<>(); + private JsonNullable> jsonSchema = JsonNullable.>undefined(); public ModelsUpdateEventType() { } @@ -105,15 +108,19 @@ public void setDescription(@jakarta.annotation.Nullable String description) { public ModelsUpdateEventType jsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { - this.jsonSchema = jsonSchema; + this.jsonSchema = JsonNullable.>of(jsonSchema); return this; } public ModelsUpdateEventType putJsonSchemaItem(String key, Object jsonSchemaItem) { - if (this.jsonSchema == null) { - this.jsonSchema = new HashMap<>(); + if (this.jsonSchema == null || !this.jsonSchema.isPresent()) { + this.jsonSchema = JsonNullable.>of(new HashMap<>()); + } + try { + this.jsonSchema.get().put(key, jsonSchemaItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.jsonSchema.put(key, jsonSchemaItem); return this; } @@ -122,19 +129,27 @@ public ModelsUpdateEventType putJsonSchemaItem(String key, Object jsonSchemaItem * @return jsonSchema */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getJsonSchema() { - return jsonSchema; + return jsonSchema.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_JSON_SCHEMA, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setJsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + + public JsonNullable> getJsonSchema_JsonNullable() { + return jsonSchema; + } + + @JsonProperty(JSON_PROPERTY_JSON_SCHEMA) + public void setJsonSchema_JsonNullable(JsonNullable> jsonSchema) { this.jsonSchema = jsonSchema; } + public void setJsonSchema(@jakarta.annotation.Nullable Map jsonSchema) { + this.jsonSchema = JsonNullable.>of(jsonSchema); + } + /** * Return true if this models.UpdateEventType object is equal to o. @@ -150,12 +165,23 @@ public boolean equals(Object o) { ModelsUpdateEventType modelsUpdateEventType = (ModelsUpdateEventType) o; return Objects.equals(this.category, modelsUpdateEventType.category) && Objects.equals(this.description, modelsUpdateEventType.description) && - Objects.equals(this.jsonSchema, modelsUpdateEventType.jsonSchema); + equalsNullable(this.jsonSchema, modelsUpdateEventType.jsonSchema); + } + + 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(category, description, jsonSchema); + return Objects.hash(category, description, hashCodeNullable(jsonSchema)); + } + + 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/getconvoy/models/ModelsUpdateFilterRequest.java b/src/main/java/com/getconvoy/models/ModelsUpdateFilterRequest.java index c32aed6..22ad002 100644 --- a/src/main/java/com/getconvoy/models/ModelsUpdateFilterRequest.java +++ b/src/main/java/com/getconvoy/models/ModelsUpdateFilterRequest.java @@ -28,6 +28,10 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +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; @@ -47,8 +51,7 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.23.0") public class ModelsUpdateFilterRequest { public static final String JSON_PROPERTY_BODY = "body"; - @jakarta.annotation.Nullable - private Map body; + private JsonNullable> body = JsonNullable.>undefined(); public static final String JSON_PROPERTY_ENABLED_AT = "enabled_at"; @jakarta.annotation.Nullable @@ -59,34 +62,35 @@ public class ModelsUpdateFilterRequest { private String eventType; public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private Map headers; + private JsonNullable> headers = JsonNullable.>undefined(); public static final String JSON_PROPERTY_IS_FLATTENED = "is_flattened"; @jakarta.annotation.Nullable private Boolean isFlattened; public static final String JSON_PROPERTY_PATH = "path"; - @jakarta.annotation.Nullable - private Map path; + private JsonNullable> path = JsonNullable.>undefined(); public static final String JSON_PROPERTY_QUERY = "query"; - @jakarta.annotation.Nullable - private Map query; + private JsonNullable> query = JsonNullable.>undefined(); public ModelsUpdateFilterRequest() { } public ModelsUpdateFilterRequest body(@jakarta.annotation.Nullable Map body) { - this.body = body; + this.body = JsonNullable.>of(body); return this; } public ModelsUpdateFilterRequest putBodyItem(String key, Object bodyItem) { - if (this.body == null) { - this.body = new HashMap<>(); + if (this.body == null || !this.body.isPresent()) { + this.body = JsonNullable.>of(new HashMap<>()); + } + try { + this.body.get().put(key, bodyItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.body.put(key, bodyItem); return this; } @@ -95,19 +99,27 @@ public ModelsUpdateFilterRequest putBodyItem(String key, Object bodyItem) { * @return body */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getBody() { - return body; + return body.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setBody(@jakarta.annotation.Nullable Map 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 Map body) { + this.body = JsonNullable.>of(body); + } + public ModelsUpdateFilterRequest enabledAt(@jakarta.annotation.Nullable ModelsOptionalTime enabledAt) { this.enabledAt = enabledAt; @@ -158,15 +170,19 @@ public void setEventType(@jakarta.annotation.Nullable String eventType) { public ModelsUpdateFilterRequest headers(@jakarta.annotation.Nullable Map headers) { - this.headers = headers; + this.headers = JsonNullable.>of(headers); return this; } public ModelsUpdateFilterRequest putHeadersItem(String key, Object headersItem) { - if (this.headers == null) { - this.headers = new HashMap<>(); + if (this.headers == null || !this.headers.isPresent()) { + this.headers = JsonNullable.>of(new HashMap<>()); + } + try { + this.headers.get().put(key, headersItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.headers.put(key, headersItem); return this; } @@ -175,19 +191,27 @@ public ModelsUpdateFilterRequest putHeadersItem(String key, Object headersItem) * @return headers */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getHeaders() { - return headers; + return headers.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setHeaders(@jakarta.annotation.Nullable Map headers) { + + public JsonNullable> getHeaders_JsonNullable() { + return headers; + } + + @JsonProperty(JSON_PROPERTY_HEADERS) + public void setHeaders_JsonNullable(JsonNullable> headers) { this.headers = headers; } + public void setHeaders(@jakarta.annotation.Nullable Map headers) { + this.headers = JsonNullable.>of(headers); + } + public ModelsUpdateFilterRequest isFlattened(@jakarta.annotation.Nullable Boolean isFlattened) { this.isFlattened = isFlattened; @@ -214,15 +238,19 @@ public void setIsFlattened(@jakarta.annotation.Nullable Boolean isFlattened) { public ModelsUpdateFilterRequest path(@jakarta.annotation.Nullable Map path) { - this.path = path; + this.path = JsonNullable.>of(path); return this; } public ModelsUpdateFilterRequest putPathItem(String key, Object pathItem) { - if (this.path == null) { - this.path = new HashMap<>(); + if (this.path == null || !this.path.isPresent()) { + this.path = JsonNullable.>of(new HashMap<>()); + } + try { + this.path.get().put(key, pathItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.path.put(key, pathItem); return this; } @@ -231,30 +259,42 @@ public ModelsUpdateFilterRequest putPathItem(String key, Object pathItem) { * @return path */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getPath() { - return path; + return path.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_PATH, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setPath(@jakarta.annotation.Nullable Map path) { + + public JsonNullable> getPath_JsonNullable() { + return path; + } + + @JsonProperty(JSON_PROPERTY_PATH) + public void setPath_JsonNullable(JsonNullable> path) { this.path = path; } + public void setPath(@jakarta.annotation.Nullable Map path) { + this.path = JsonNullable.>of(path); + } + public ModelsUpdateFilterRequest query(@jakarta.annotation.Nullable Map query) { - this.query = query; + this.query = JsonNullable.>of(query); return this; } public ModelsUpdateFilterRequest putQueryItem(String key, Object queryItem) { - if (this.query == null) { - this.query = new HashMap<>(); + if (this.query == null || !this.query.isPresent()) { + this.query = JsonNullable.>of(new HashMap<>()); + } + try { + this.query.get().put(key, queryItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present } - this.query.put(key, queryItem); return this; } @@ -263,19 +303,27 @@ public ModelsUpdateFilterRequest putQueryItem(String key, Object queryItem) { * @return query */ @jakarta.annotation.Nullable - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + @JsonIgnore public Map getQuery() { - return query; + return query.orElse(null); } - @JsonProperty(value = JSON_PROPERTY_QUERY, required = false) @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setQuery(@jakarta.annotation.Nullable Map query) { + + public JsonNullable> getQuery_JsonNullable() { + return query; + } + + @JsonProperty(JSON_PROPERTY_QUERY) + public void setQuery_JsonNullable(JsonNullable> query) { this.query = query; } + public void setQuery(@jakarta.annotation.Nullable Map query) { + this.query = JsonNullable.>of(query); + } + /** * Return true if this models.UpdateFilterRequest object is equal to o. @@ -289,18 +337,29 @@ public boolean equals(Object o) { return false; } ModelsUpdateFilterRequest modelsUpdateFilterRequest = (ModelsUpdateFilterRequest) o; - return Objects.equals(this.body, modelsUpdateFilterRequest.body) && + return equalsNullable(this.body, modelsUpdateFilterRequest.body) && Objects.equals(this.enabledAt, modelsUpdateFilterRequest.enabledAt) && Objects.equals(this.eventType, modelsUpdateFilterRequest.eventType) && - Objects.equals(this.headers, modelsUpdateFilterRequest.headers) && + equalsNullable(this.headers, modelsUpdateFilterRequest.headers) && Objects.equals(this.isFlattened, modelsUpdateFilterRequest.isFlattened) && - Objects.equals(this.path, modelsUpdateFilterRequest.path) && - Objects.equals(this.query, modelsUpdateFilterRequest.query); + equalsNullable(this.path, modelsUpdateFilterRequest.path) && + equalsNullable(this.query, modelsUpdateFilterRequest.query); + } + + 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(body, enabledAt, eventType, headers, isFlattened, path, query); + return Objects.hash(hashCodeNullable(body), enabledAt, eventType, hashCodeNullable(headers), isFlattened, hashCodeNullable(path), hashCodeNullable(query)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override From cdccbe29fcec0979a94fb5180389d67d29fefdce Mon Sep 17 00:00:00 2001 From: Smart Mekiliuwa Date: Mon, 20 Jul 2026 12:10:00 +0100 Subject: [PATCH 2/2] fix: recreate jsonnullable maps holding null in put item helpers --- scripts/generate.sh | 7 +++++++ .../models/DatastoreDeliveryAttempt.java | 4 ++-- .../com/getconvoy/models/DatastoreEvent.java | 4 ++-- .../getconvoy/models/DatastoreFilterSchema.java | 8 ++++---- .../models/DatastoreMetaEventAttempt.java | 4 ++-- .../com/getconvoy/models/DatastoreMetadata.java | 2 +- .../getconvoy/models/GetProjects400Response.java | 2 +- .../getconvoy/models/ModelsBroadcastEvent.java | 4 ++-- .../models/ModelsBulkUpdateFilterRequest.java | 8 ++++---- .../com/getconvoy/models/ModelsCreateEvent.java | 4 ++-- .../getconvoy/models/ModelsCreateEventType.java | 2 +- .../models/ModelsCreateFilterRequest.java | 8 ++++---- .../com/getconvoy/models/ModelsDynamicEvent.java | 4 ++-- .../models/ModelsEventDeliveryResponse.java | 2 +- .../getconvoy/models/ModelsEventResponse.java | 4 ++-- .../models/ModelsEventTypeResponse.java | 2 +- src/main/java/com/getconvoy/models/ModelsFS.java | 8 ++++---- .../com/getconvoy/models/ModelsFanoutEvent.java | 4 ++-- .../getconvoy/models/ModelsFilterResponse.java | 16 ++++++++-------- .../getconvoy/models/ModelsFunctionRequest.java | 2 +- .../models/ModelsTestFilterRequestScopes.java | 8 ++++---- .../getconvoy/models/ModelsUpdateEventType.java | 2 +- .../models/ModelsUpdateFilterRequest.java | 8 ++++---- 23 files changed, 62 insertions(+), 55 deletions(-) diff --git a/scripts/generate.sh b/scripts/generate.sh index e433cb4..d8b051a 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -50,4 +50,11 @@ for pkg in api client models; do "src/main/java/com/getconvoy/$pkg/" done +# Post-process: the stock generator template only reinitializes a JsonNullable +# map when the wrapper is undefined. After setX(null) or deserializing JSON +# null the wrapper is present with a null map and put*Item NPEs on get().put(). +# Extend the guard to also recreate the map when the present value is null. +perl -pi -e 's/if \(this\.(\w+) == null \|\| !this\.\1\.isPresent\(\)\) \{/if (this.$1 == null || !this.$1.isPresent() || this.$1.get() == null) {/' \ + src/main/java/com/getconvoy/models/*.java + echo "Generated client synced into src/main/java/com/getconvoy/{api,client,models}" diff --git a/src/main/java/com/getconvoy/models/DatastoreDeliveryAttempt.java b/src/main/java/com/getconvoy/models/DatastoreDeliveryAttempt.java index 2c41b92..845044e 100644 --- a/src/main/java/com/getconvoy/models/DatastoreDeliveryAttempt.java +++ b/src/main/java/com/getconvoy/models/DatastoreDeliveryAttempt.java @@ -389,7 +389,7 @@ public DatastoreDeliveryAttempt requestHttpHeader(@jakarta.annotation.Nullable M } public DatastoreDeliveryAttempt putRequestHttpHeaderItem(String key, String requestHttpHeaderItem) { - if (this.requestHttpHeader == null || !this.requestHttpHeader.isPresent()) { + if (this.requestHttpHeader == null || !this.requestHttpHeader.isPresent() || this.requestHttpHeader.get() == null) { this.requestHttpHeader = JsonNullable.>of(new HashMap<>()); } try { @@ -521,7 +521,7 @@ public DatastoreDeliveryAttempt responseHttpHeader(@jakarta.annotation.Nullable } public DatastoreDeliveryAttempt putResponseHttpHeaderItem(String key, String responseHttpHeaderItem) { - if (this.responseHttpHeader == null || !this.responseHttpHeader.isPresent()) { + if (this.responseHttpHeader == null || !this.responseHttpHeader.isPresent() || this.responseHttpHeader.get() == null) { this.responseHttpHeader = JsonNullable.>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/DatastoreEvent.java b/src/main/java/com/getconvoy/models/DatastoreEvent.java index b15d427..bc9aa83 100644 --- a/src/main/java/com/getconvoy/models/DatastoreEvent.java +++ b/src/main/java/com/getconvoy/models/DatastoreEvent.java @@ -236,7 +236,7 @@ public DatastoreEvent data(@jakarta.annotation.Nullable Map data } public DatastoreEvent putDataItem(String key, Object dataItem) { - if (this.data == null || !this.data.isPresent()) { + if (this.data == null || !this.data.isPresent() || this.data.get() == null) { this.data = JsonNullable.>of(new HashMap<>()); } try { @@ -400,7 +400,7 @@ public DatastoreEvent headers(@jakarta.annotation.Nullable Map headersItem) { - if (this.headers == null || !this.headers.isPresent()) { + if (this.headers == null || !this.headers.isPresent() || this.headers.get() == null) { this.headers = JsonNullable.>>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java b/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java index ad0944d..21bd83d 100644 --- a/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java +++ b/src/main/java/com/getconvoy/models/DatastoreFilterSchema.java @@ -72,7 +72,7 @@ public DatastoreFilterSchema body(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -116,7 +116,7 @@ public DatastoreFilterSchema headers(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -184,7 +184,7 @@ public DatastoreFilterSchema path(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -228,7 +228,7 @@ public DatastoreFilterSchema query(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/DatastoreMetaEventAttempt.java b/src/main/java/com/getconvoy/models/DatastoreMetaEventAttempt.java index 5a1beef..8ceeb43 100644 --- a/src/main/java/com/getconvoy/models/DatastoreMetaEventAttempt.java +++ b/src/main/java/com/getconvoy/models/DatastoreMetaEventAttempt.java @@ -64,7 +64,7 @@ public DatastoreMetaEventAttempt requestHttpHeader(@jakarta.annotation.Nullable } public DatastoreMetaEventAttempt putRequestHttpHeaderItem(String key, String requestHttpHeaderItem) { - if (this.requestHttpHeader == null || !this.requestHttpHeader.isPresent()) { + if (this.requestHttpHeader == null || !this.requestHttpHeader.isPresent() || this.requestHttpHeader.get() == null) { this.requestHttpHeader = JsonNullable.>of(new HashMap<>()); } try { @@ -132,7 +132,7 @@ public DatastoreMetaEventAttempt responseHttpHeader(@jakarta.annotation.Nullable } public DatastoreMetaEventAttempt putResponseHttpHeaderItem(String key, String responseHttpHeaderItem) { - if (this.responseHttpHeader == null || !this.responseHttpHeader.isPresent()) { + if (this.responseHttpHeader == null || !this.responseHttpHeader.isPresent() || this.responseHttpHeader.get() == null) { this.responseHttpHeader = JsonNullable.>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/DatastoreMetadata.java b/src/main/java/com/getconvoy/models/DatastoreMetadata.java index 12bb6b3..b362321 100644 --- a/src/main/java/com/getconvoy/models/DatastoreMetadata.java +++ b/src/main/java/com/getconvoy/models/DatastoreMetadata.java @@ -91,7 +91,7 @@ public DatastoreMetadata data(@jakarta.annotation.Nullable Map d } public DatastoreMetadata putDataItem(String key, Object dataItem) { - if (this.data == null || !this.data.isPresent()) { + if (this.data == null || !this.data.isPresent() || this.data.get() == null) { this.data = JsonNullable.>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/GetProjects400Response.java b/src/main/java/com/getconvoy/models/GetProjects400Response.java index d63ac01..44d4f5a 100644 --- a/src/main/java/com/getconvoy/models/GetProjects400Response.java +++ b/src/main/java/com/getconvoy/models/GetProjects400Response.java @@ -113,7 +113,7 @@ public GetProjects400Response data(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java b/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java index cd3e2e7..af3da89 100644 --- a/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java +++ b/src/main/java/com/getconvoy/models/ModelsBroadcastEvent.java @@ -98,7 +98,7 @@ public ModelsBroadcastEvent customHeaders(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -142,7 +142,7 @@ public ModelsBroadcastEvent data(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsBulkUpdateFilterRequest.java b/src/main/java/com/getconvoy/models/ModelsBulkUpdateFilterRequest.java index a8d2324..8ffb711 100644 --- a/src/main/java/com/getconvoy/models/ModelsBulkUpdateFilterRequest.java +++ b/src/main/java/com/getconvoy/models/ModelsBulkUpdateFilterRequest.java @@ -83,7 +83,7 @@ public ModelsBulkUpdateFilterRequest body(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -175,7 +175,7 @@ public ModelsBulkUpdateFilterRequest headers(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -219,7 +219,7 @@ public ModelsBulkUpdateFilterRequest path(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -263,7 +263,7 @@ public ModelsBulkUpdateFilterRequest query(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsCreateEvent.java b/src/main/java/com/getconvoy/models/ModelsCreateEvent.java index 16653f1..f7c45cc 100644 --- a/src/main/java/com/getconvoy/models/ModelsCreateEvent.java +++ b/src/main/java/com/getconvoy/models/ModelsCreateEvent.java @@ -103,7 +103,7 @@ public ModelsCreateEvent customHeaders(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -147,7 +147,7 @@ public ModelsCreateEvent data(@jakarta.annotation.Nullable Map d } public ModelsCreateEvent putDataItem(String key, Object dataItem) { - if (this.data == null || !this.data.isPresent()) { + if (this.data == null || !this.data.isPresent() || this.data.get() == null) { this.data = JsonNullable.>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsCreateEventType.java b/src/main/java/com/getconvoy/models/ModelsCreateEventType.java index 4949b57..153d4e9 100644 --- a/src/main/java/com/getconvoy/models/ModelsCreateEventType.java +++ b/src/main/java/com/getconvoy/models/ModelsCreateEventType.java @@ -118,7 +118,7 @@ public ModelsCreateEventType jsonSchema(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsCreateFilterRequest.java b/src/main/java/com/getconvoy/models/ModelsCreateFilterRequest.java index 00daeb4..004d42c 100644 --- a/src/main/java/com/getconvoy/models/ModelsCreateFilterRequest.java +++ b/src/main/java/com/getconvoy/models/ModelsCreateFilterRequest.java @@ -78,7 +78,7 @@ public ModelsCreateFilterRequest body(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -170,7 +170,7 @@ public ModelsCreateFilterRequest headers(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -214,7 +214,7 @@ public ModelsCreateFilterRequest path(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -258,7 +258,7 @@ public ModelsCreateFilterRequest query(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsDynamicEvent.java b/src/main/java/com/getconvoy/models/ModelsDynamicEvent.java index 0f5ae74..f0c5b62 100644 --- a/src/main/java/com/getconvoy/models/ModelsDynamicEvent.java +++ b/src/main/java/com/getconvoy/models/ModelsDynamicEvent.java @@ -86,7 +86,7 @@ public ModelsDynamicEvent customHeaders(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -130,7 +130,7 @@ public ModelsDynamicEvent data(@jakarta.annotation.Nullable Map } public ModelsDynamicEvent putDataItem(String key, Object dataItem) { - if (this.data == null || !this.data.isPresent()) { + if (this.data == null || !this.data.isPresent() || this.data.get() == null) { this.data = JsonNullable.>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsEventDeliveryResponse.java b/src/main/java/com/getconvoy/models/ModelsEventDeliveryResponse.java index 433e7b5..c3a29fc 100644 --- a/src/main/java/com/getconvoy/models/ModelsEventDeliveryResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsEventDeliveryResponse.java @@ -542,7 +542,7 @@ public ModelsEventDeliveryResponse headers(@jakarta.annotation.Nullable Map headersItem) { - if (this.headers == null || !this.headers.isPresent()) { + if (this.headers == null || !this.headers.isPresent() || this.headers.get() == null) { this.headers = JsonNullable.>>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsEventResponse.java b/src/main/java/com/getconvoy/models/ModelsEventResponse.java index 2ffe026..190e0e0 100644 --- a/src/main/java/com/getconvoy/models/ModelsEventResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsEventResponse.java @@ -236,7 +236,7 @@ public ModelsEventResponse data(@jakarta.annotation.Nullable Map } public ModelsEventResponse putDataItem(String key, Object dataItem) { - if (this.data == null || !this.data.isPresent()) { + if (this.data == null || !this.data.isPresent() || this.data.get() == null) { this.data = JsonNullable.>of(new HashMap<>()); } try { @@ -400,7 +400,7 @@ public ModelsEventResponse headers(@jakarta.annotation.Nullable Map headersItem) { - if (this.headers == null || !this.headers.isPresent()) { + if (this.headers == null || !this.headers.isPresent() || this.headers.get() == null) { this.headers = JsonNullable.>>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsEventTypeResponse.java b/src/main/java/com/getconvoy/models/ModelsEventTypeResponse.java index a8282e3..9b66d55 100644 --- a/src/main/java/com/getconvoy/models/ModelsEventTypeResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsEventTypeResponse.java @@ -159,7 +159,7 @@ public ModelsEventTypeResponse jsonSchema(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsFS.java b/src/main/java/com/getconvoy/models/ModelsFS.java index 3a3328e..aacc870 100644 --- a/src/main/java/com/getconvoy/models/ModelsFS.java +++ b/src/main/java/com/getconvoy/models/ModelsFS.java @@ -67,7 +67,7 @@ public ModelsFS body(@jakarta.annotation.Nullable Map body) { } public ModelsFS putBodyItem(String key, Object bodyItem) { - if (this.body == null || !this.body.isPresent()) { + if (this.body == null || !this.body.isPresent() || this.body.get() == null) { this.body = JsonNullable.>of(new HashMap<>()); } try { @@ -111,7 +111,7 @@ public ModelsFS headers(@jakarta.annotation.Nullable Map headers } public ModelsFS putHeadersItem(String key, Object headersItem) { - if (this.headers == null || !this.headers.isPresent()) { + if (this.headers == null || !this.headers.isPresent() || this.headers.get() == null) { this.headers = JsonNullable.>of(new HashMap<>()); } try { @@ -155,7 +155,7 @@ public ModelsFS path(@jakarta.annotation.Nullable Map path) { } public ModelsFS putPathItem(String key, Object pathItem) { - if (this.path == null || !this.path.isPresent()) { + if (this.path == null || !this.path.isPresent() || this.path.get() == null) { this.path = JsonNullable.>of(new HashMap<>()); } try { @@ -199,7 +199,7 @@ public ModelsFS query(@jakarta.annotation.Nullable Map query) { } public ModelsFS putQueryItem(String key, Object queryItem) { - if (this.query == null || !this.query.isPresent()) { + if (this.query == null || !this.query.isPresent() || this.query.get() == null) { this.query = JsonNullable.>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsFanoutEvent.java b/src/main/java/com/getconvoy/models/ModelsFanoutEvent.java index 400ea8b..ccda805 100644 --- a/src/main/java/com/getconvoy/models/ModelsFanoutEvent.java +++ b/src/main/java/com/getconvoy/models/ModelsFanoutEvent.java @@ -74,7 +74,7 @@ public ModelsFanoutEvent customHeaders(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -118,7 +118,7 @@ public ModelsFanoutEvent data(@jakarta.annotation.Nullable Map d } public ModelsFanoutEvent putDataItem(String key, Object dataItem) { - if (this.data == null || !this.data.isPresent()) { + if (this.data == null || !this.data.isPresent() || this.data.get() == null) { this.data = JsonNullable.>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsFilterResponse.java b/src/main/java/com/getconvoy/models/ModelsFilterResponse.java index 9326d0c..5268702 100644 --- a/src/main/java/com/getconvoy/models/ModelsFilterResponse.java +++ b/src/main/java/com/getconvoy/models/ModelsFilterResponse.java @@ -102,7 +102,7 @@ public ModelsFilterResponse body(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -202,7 +202,7 @@ public ModelsFilterResponse headers(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -246,7 +246,7 @@ public ModelsFilterResponse path(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -290,7 +290,7 @@ public ModelsFilterResponse query(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -334,7 +334,7 @@ public ModelsFilterResponse rawBody(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -378,7 +378,7 @@ public ModelsFilterResponse rawHeaders(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -422,7 +422,7 @@ public ModelsFilterResponse rawPath(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -466,7 +466,7 @@ public ModelsFilterResponse rawQuery(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsFunctionRequest.java b/src/main/java/com/getconvoy/models/ModelsFunctionRequest.java index cbcb2ea..351745d 100644 --- a/src/main/java/com/getconvoy/models/ModelsFunctionRequest.java +++ b/src/main/java/com/getconvoy/models/ModelsFunctionRequest.java @@ -89,7 +89,7 @@ public ModelsFunctionRequest payload(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsTestFilterRequestScopes.java b/src/main/java/com/getconvoy/models/ModelsTestFilterRequestScopes.java index 0031e7b..30b043e 100644 --- a/src/main/java/com/getconvoy/models/ModelsTestFilterRequestScopes.java +++ b/src/main/java/com/getconvoy/models/ModelsTestFilterRequestScopes.java @@ -103,7 +103,7 @@ public ModelsTestFilterRequestScopes header(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -147,7 +147,7 @@ public ModelsTestFilterRequestScopes headers(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -191,7 +191,7 @@ public ModelsTestFilterRequestScopes path(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -235,7 +235,7 @@ public ModelsTestFilterRequestScopes query(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java b/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java index 25701fb..f0affcf 100644 --- a/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java +++ b/src/main/java/com/getconvoy/models/ModelsUpdateEventType.java @@ -113,7 +113,7 @@ public ModelsUpdateEventType jsonSchema(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { diff --git a/src/main/java/com/getconvoy/models/ModelsUpdateFilterRequest.java b/src/main/java/com/getconvoy/models/ModelsUpdateFilterRequest.java index 22ad002..be1eecd 100644 --- a/src/main/java/com/getconvoy/models/ModelsUpdateFilterRequest.java +++ b/src/main/java/com/getconvoy/models/ModelsUpdateFilterRequest.java @@ -83,7 +83,7 @@ public ModelsUpdateFilterRequest body(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -175,7 +175,7 @@ public ModelsUpdateFilterRequest headers(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -243,7 +243,7 @@ public ModelsUpdateFilterRequest path(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try { @@ -287,7 +287,7 @@ public ModelsUpdateFilterRequest query(@jakarta.annotation.Nullable Map>of(new HashMap<>()); } try {