From b0e59b6ff700967903fabe639f3f57251249843a Mon Sep 17 00:00:00 2001 From: Sherzod Karimov Date: Wed, 19 Jul 2023 13:15:06 -0400 Subject: [PATCH 1/2] handle {} and bool for additionalProperties --- .../src/generator/templates/modelSimple.j2 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.generator/src/generator/templates/modelSimple.j2 b/.generator/src/generator/templates/modelSimple.j2 index c8f2dfc96b1..d68e35fd009 100644 --- a/.generator/src/generator/templates/modelSimple.j2 +++ b/.generator/src/generator/templates/modelSimple.j2 @@ -26,7 +26,7 @@ public class {{ name }} {%- if model.get("x-generate-alias-as-model") %} extends public static final String JSON_PROPERTY_{{ attr|snake_case|upper }} = "{{ attr }}"; {%- if not isRequired and isNullable %} - {%- if "items" in schema or schema.additionalProperties is defined or (schema.type is not defined and "oneOf" not in schema) %} + {%- if "items" in schema or (schema.additionalProperties is defined and schema.additionalProperties is not false) or (schema.type is not defined and "oneOf" not in schema) %} private JsonNullable<{{ dataType }}> {{ variableName }} = JsonNullable.<{{ dataType }}>undefined(); {%- else %} private JsonNullable<{{ dataType }}> {{ variableName }} = JsonNullable.<{{ dataType }}>{%- if defaultValue != None %}of({{ defaultValue|format_value(schema=schema, default_value=True, type_=dataType) }}){%- else %}undefined(){%- endif%}; @@ -34,7 +34,7 @@ public class {{ name }} {%- if model.get("x-generate-alias-as-model") %} extends {%- else %} {%- if "items" in schema %} private {{ dataType }} {{ variableName }}{%- if isRequired %} = new ArrayList<>(){%- else %} = null{%- endif %}; - {%- elif schema.additionalProperties is defined or (not schema.get("type") and "oneOf" not in schema) %} + {%- elif (schema.additionalProperties is defined and schema.additionalProperties is not false) or (not schema.get("type") and "oneOf" not in schema) %} private {{ dataType }} {{ variableName }}{%- if isRequired %} = new {{ dataType }}(){%- else %} = null{%- endif %}; {%- else %} private {{ dataType }} {{ variableName }}{%- if defaultValue != None %} = {{ defaultValue|format_value(schema=schema, default_value=True, type_=dataType) }}{%- endif %}; @@ -211,7 +211,7 @@ public class {{ name }} {%- if model.get("x-generate-alias-as-model") %} extends {%- else %} @JsonProperty(JSON_PROPERTY_{{ attr|snake_case|upper }}) @JsonInclude( - {%- if schema.additionalProperties %}{%- if schema.additionalProperties.nullable %}content = JsonInclude.Include.ALWAYS,{%- endif %}{%- endif %} + {%- if schema.additionalProperties is defined and schema.additionalProperties is not false %}{%- if schema.additionalProperties.nullable %}content = JsonInclude.Include.ALWAYS,{%- endif %}{%- endif %} value = JsonInclude.Include.{%- if isRequired %}ALWAYS{%- else %}USE_DEFAULTS{%- endif %}) {%- endif %} public {{ dataType }} get{{ attr|camel_case|upperfirst }}() { @@ -233,7 +233,7 @@ public class {{ name }} {%- if model.get("x-generate-alias-as-model") %} extends {%- if not isRequired and isNullable %} @JsonProperty(JSON_PROPERTY_{{ attr|snake_case|upper }}) @JsonInclude( - {%- if schema.additionalProperties %}{%- if schema.additionalProperties.nullable %}content = JsonInclude.Include.ALWAYS,{%- endif %}{%- endif %} + {%- if schema.additionalProperties is defined and schema.additionalProperties is not false %}{%- if schema.additionalProperties.nullable %}content = JsonInclude.Include.ALWAYS,{%- endif %}{%- endif %} value = JsonInclude.Include.{%- if isRequired %}ALWAYS{%- else %}USE_DEFAULTS{%- endif %}) public JsonNullable<{{ dataType }}> get{{ attr|camel_case|upperfirst }}_JsonNullable() { return {{ variableName }}; @@ -259,7 +259,7 @@ public class {{ name }} {%- if model.get("x-generate-alias-as-model") %} extends } {%- endif %} {%- endfor %} - {%- if model.get("additionalProperties", True) %} + {%- if model.additionalProperties is not false %} {%- set additionalPropertiesDataType = model.get("additionalProperties", {})|simple_type or "Object" %} /** @@ -323,7 +323,7 @@ public class {{ name }} {%- if model.get("x-generate-alias-as-model") %} extends } {%- if model.properties is defined %} {{ name }} {{ name|variable_name }} = ({{ name }}) o; - return {%- for attr, schema in model.get("properties").items() %} Objects.equals(this.{{ attr|variable_name }}, {{ name|variable_name }}.{{ attr|variable_name }}){%- if loop.nextitem or model.get("additionalProperties", True) %} &&{%- endif %}{%- endfor %}{% if model.get("additionalProperties", True) %} Objects.equals(this.additionalProperties, {{ name|variable_name }}.additionalProperties){% endif %} + return {%- for attr, schema in model.get("properties").items() %} Objects.equals(this.{{ attr|variable_name }}, {{ name|variable_name }}.{{ attr|variable_name }}){%- if loop.nextitem or model.additionalProperties is not false %} &&{%- endif %}{%- endfor %}{% if model.additionalProperties is not false %} Objects.equals(this.additionalProperties, {{ name|variable_name }}.additionalProperties){% endif %} {%- if model.get("x-generate-alias-as-model") %} && super.equals(o){%- endif %}; {%- else %} @@ -335,8 +335,8 @@ public class {{ name }} {%- if model.get("x-generate-alias-as-model") %} extends @Override public int hashCode() { return Objects.hash({%- for attr, schema in model.get("properties", {}).items() %}{{ attr|variable_name }}{%- if loop.nextitem %}, {%- endif %}{%-endfor %} - {%- if model.get("additionalProperties", True) %}{%- if model.properties is defined %}, {%- endif %} additionalProperties{%- endif %} - {%- if model.get("x-generate-alias-as-model") %}{%- if model.properties is defined or model.get("additionalProperties", True) %}, {%- endif %}super.hashCode(){%- endif %}); + {%- if model.additionalProperties is not false %}{%- if model.properties is defined %}, {%- endif %} additionalProperties{%- endif %} + {%- if model.get("x-generate-alias-as-model") %}{%- if model.properties is defined or model.additionalProperties is not false %}, {%- endif %}super.hashCode(){%- endif %}); } @Override @@ -349,7 +349,7 @@ public class {{ name }} {%- if model.get("x-generate-alias-as-model") %} extends {%- for attr, schema in model.get("properties", {}).items() %} sb.append(" {{ attr|variable_name }}: ").append(toIndentedString({{ attr|variable_name }})).append("\n"); {%- endfor %} - {%- if model.get("additionalProperties", True) %} + {%- if model.additionalProperties is not false %} sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); From a1930dab72fd1323abb681543a85abe5859c7507 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 19 Jul 2023 17:18:28 +0000 Subject: [PATCH 2/2] pre-commit fixes --- .../v2/model/DetailedFindingAttributes.java | 4 +- .../v2/model/DowntimeMonitorIdentifierId.java | 59 +++++++++++++++++- .../model/DowntimeMonitorIdentifierTags.java | 59 +++++++++++++++++- ...imeScheduleOneTimeCreateUpdateRequest.java | 61 ++++++++++++++++++- ...ScheduleRecurrenceCreateUpdateRequest.java | 61 ++++++++++++++++++- .../client/v2/model/FindingAttributes.java | 4 +- .../api/client/v2/model/ListFindingsMeta.java | 2 +- .../client/v2/model/ListFindingsResponse.java | 2 +- .../model/MuteFindingRequestAttributes.java | 2 +- .../v2/model/MuteFindingRequestData.java | 2 +- .../model/MuteFindingResponseAttributes.java | 4 +- 11 files changed, 242 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/datadog/api/client/v2/model/DetailedFindingAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DetailedFindingAttributes.java index b62e9cde605..3a145927551 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DetailedFindingAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/DetailedFindingAttributes.java @@ -46,7 +46,7 @@ public class DetailedFindingAttributes { private String message; public static final String JSON_PROPERTY_MUTE = "mute"; - private FindingMute mute = null; + private FindingMute mute; public static final String JSON_PROPERTY_RESOURCE = "resource"; private String resource; @@ -61,7 +61,7 @@ public class DetailedFindingAttributes { private String resourceType; public static final String JSON_PROPERTY_RULE = "rule"; - private FindingRule rule = null; + private FindingRule rule; public static final String JSON_PROPERTY_STATUS = "status"; private FindingStatus status; diff --git a/src/main/java/com/datadog/api/client/v2/model/DowntimeMonitorIdentifierId.java b/src/main/java/com/datadog/api/client/v2/model/DowntimeMonitorIdentifierId.java index 9af93ff5903..76c70cc0ba9 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DowntimeMonitorIdentifierId.java +++ b/src/main/java/com/datadog/api/client/v2/model/DowntimeMonitorIdentifierId.java @@ -6,11 +6,15 @@ package com.datadog.api.client.v2.model; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; /** Object of the monitor identifier. */ @@ -50,6 +54,52 @@ public void setMonitorId(Long monitorId) { this.monitorId = monitorId; } + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DowntimeMonitorIdentifierId + */ + @JsonAnySetter + public DowntimeMonitorIdentifierId putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + /** Return true if this DowntimeMonitorIdentifierId object is equal to o. */ @Override public boolean equals(Object o) { @@ -60,12 +110,14 @@ public boolean equals(Object o) { return false; } DowntimeMonitorIdentifierId downtimeMonitorIdentifierId = (DowntimeMonitorIdentifierId) o; - return Objects.equals(this.monitorId, downtimeMonitorIdentifierId.monitorId); + return Objects.equals(this.monitorId, downtimeMonitorIdentifierId.monitorId) + && Objects.equals( + this.additionalProperties, downtimeMonitorIdentifierId.additionalProperties); } @Override public int hashCode() { - return Objects.hash(monitorId); + return Objects.hash(monitorId, additionalProperties); } @Override @@ -73,6 +125,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DowntimeMonitorIdentifierId {\n"); sb.append(" monitorId: ").append(toIndentedString(monitorId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/datadog/api/client/v2/model/DowntimeMonitorIdentifierTags.java b/src/main/java/com/datadog/api/client/v2/model/DowntimeMonitorIdentifierTags.java index 23237d14f2f..afc1b326b85 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DowntimeMonitorIdentifierTags.java +++ b/src/main/java/com/datadog/api/client/v2/model/DowntimeMonitorIdentifierTags.java @@ -6,13 +6,17 @@ package com.datadog.api.client.v2.model; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Objects; /** Object of the monitor tags. */ @@ -61,6 +65,52 @@ public void setMonitorTags(List monitorTags) { this.monitorTags = monitorTags; } + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DowntimeMonitorIdentifierTags + */ + @JsonAnySetter + public DowntimeMonitorIdentifierTags putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + /** Return true if this DowntimeMonitorIdentifierTags object is equal to o. */ @Override public boolean equals(Object o) { @@ -71,12 +121,14 @@ public boolean equals(Object o) { return false; } DowntimeMonitorIdentifierTags downtimeMonitorIdentifierTags = (DowntimeMonitorIdentifierTags) o; - return Objects.equals(this.monitorTags, downtimeMonitorIdentifierTags.monitorTags); + return Objects.equals(this.monitorTags, downtimeMonitorIdentifierTags.monitorTags) + && Objects.equals( + this.additionalProperties, downtimeMonitorIdentifierTags.additionalProperties); } @Override public int hashCode() { - return Objects.hash(monitorTags); + return Objects.hash(monitorTags, additionalProperties); } @Override @@ -84,6 +136,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DowntimeMonitorIdentifierTags {\n"); sb.append(" monitorTags: ").append(toIndentedString(monitorTags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/datadog/api/client/v2/model/DowntimeScheduleOneTimeCreateUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/DowntimeScheduleOneTimeCreateUpdateRequest.java index aa17d736de8..23c04acf3a3 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DowntimeScheduleOneTimeCreateUpdateRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/DowntimeScheduleOneTimeCreateUpdateRequest.java @@ -6,11 +6,15 @@ package com.datadog.api.client.v2.model; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; import org.openapitools.jackson.nullable.JsonNullable; @@ -93,6 +97,53 @@ public void setStart(OffsetDateTime start) { this.start = JsonNullable.of(start); } + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DowntimeScheduleOneTimeCreateUpdateRequest + */ + @JsonAnySetter + public DowntimeScheduleOneTimeCreateUpdateRequest putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + /** Return true if this DowntimeScheduleOneTimeCreateUpdateRequest object is equal to o. */ @Override public boolean equals(Object o) { @@ -105,12 +156,15 @@ public boolean equals(Object o) { DowntimeScheduleOneTimeCreateUpdateRequest downtimeScheduleOneTimeCreateUpdateRequest = (DowntimeScheduleOneTimeCreateUpdateRequest) o; return Objects.equals(this.end, downtimeScheduleOneTimeCreateUpdateRequest.end) - && Objects.equals(this.start, downtimeScheduleOneTimeCreateUpdateRequest.start); + && Objects.equals(this.start, downtimeScheduleOneTimeCreateUpdateRequest.start) + && Objects.equals( + this.additionalProperties, + downtimeScheduleOneTimeCreateUpdateRequest.additionalProperties); } @Override public int hashCode() { - return Objects.hash(end, start); + return Objects.hash(end, start, additionalProperties); } @Override @@ -119,6 +173,9 @@ public String toString() { sb.append("class DowntimeScheduleOneTimeCreateUpdateRequest {\n"); sb.append(" end: ").append(toIndentedString(end)).append("\n"); sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/datadog/api/client/v2/model/DowntimeScheduleRecurrenceCreateUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/DowntimeScheduleRecurrenceCreateUpdateRequest.java index ff0bcba6344..d8afc54f90d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DowntimeScheduleRecurrenceCreateUpdateRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/DowntimeScheduleRecurrenceCreateUpdateRequest.java @@ -6,11 +6,15 @@ package com.datadog.api.client.v2.model; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; import java.util.Objects; import org.openapitools.jackson.nullable.JsonNullable; @@ -126,6 +130,53 @@ public void setStart(String start) { this.start = JsonNullable.of(start); } + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DowntimeScheduleRecurrenceCreateUpdateRequest + */ + @JsonAnySetter + public DowntimeScheduleRecurrenceCreateUpdateRequest putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + /** Return true if this DowntimeScheduleRecurrenceCreateUpdateRequest object is equal to o. */ @Override public boolean equals(Object o) { @@ -139,12 +190,15 @@ public boolean equals(Object o) { (DowntimeScheduleRecurrenceCreateUpdateRequest) o; return Objects.equals(this.duration, downtimeScheduleRecurrenceCreateUpdateRequest.duration) && Objects.equals(this.rrule, downtimeScheduleRecurrenceCreateUpdateRequest.rrule) - && Objects.equals(this.start, downtimeScheduleRecurrenceCreateUpdateRequest.start); + && Objects.equals(this.start, downtimeScheduleRecurrenceCreateUpdateRequest.start) + && Objects.equals( + this.additionalProperties, + downtimeScheduleRecurrenceCreateUpdateRequest.additionalProperties); } @Override public int hashCode() { - return Objects.hash(duration, rrule, start); + return Objects.hash(duration, rrule, start, additionalProperties); } @Override @@ -154,6 +208,9 @@ public String toString() { sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); sb.append(" rrule: ").append(toIndentedString(rrule)).append("\n"); sb.append(" start: ").append(toIndentedString(start)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append("}"); return sb.toString(); } diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FindingAttributes.java index ca52375c611..4a07ae51efd 100644 --- a/src/main/java/com/datadog/api/client/v2/model/FindingAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/FindingAttributes.java @@ -41,7 +41,7 @@ public class FindingAttributes { private Long evaluationChangedAt; public static final String JSON_PROPERTY_MUTE = "mute"; - private FindingMute mute = null; + private FindingMute mute; public static final String JSON_PROPERTY_RESOURCE = "resource"; private String resource; @@ -53,7 +53,7 @@ public class FindingAttributes { private String resourceType; public static final String JSON_PROPERTY_RULE = "rule"; - private FindingRule rule = null; + private FindingRule rule; public static final String JSON_PROPERTY_STATUS = "status"; private FindingStatus status; diff --git a/src/main/java/com/datadog/api/client/v2/model/ListFindingsMeta.java b/src/main/java/com/datadog/api/client/v2/model/ListFindingsMeta.java index 91c6f5335f0..f07b129891e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ListFindingsMeta.java +++ b/src/main/java/com/datadog/api/client/v2/model/ListFindingsMeta.java @@ -22,7 +22,7 @@ public class ListFindingsMeta { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_PAGE = "page"; - private ListFindingsPage page = null; + private ListFindingsPage page; public static final String JSON_PROPERTY_SNAPSHOT_TIMESTAMP = "snapshot_timestamp"; private Long snapshotTimestamp; diff --git a/src/main/java/com/datadog/api/client/v2/model/ListFindingsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListFindingsResponse.java index dc695b439f6..8735af688a1 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ListFindingsResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/ListFindingsResponse.java @@ -32,7 +32,7 @@ public class ListFindingsResponse { private List data = new ArrayList<>(); public static final String JSON_PROPERTY_META = "meta"; - private ListFindingsMeta meta = new ListFindingsMeta(); + private ListFindingsMeta meta; public ListFindingsResponse() {} diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteFindingRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MuteFindingRequestAttributes.java index 4d1ef2d8ab0..cba7ff0f5de 100644 --- a/src/main/java/com/datadog/api/client/v2/model/MuteFindingRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/MuteFindingRequestAttributes.java @@ -20,7 +20,7 @@ public class MuteFindingRequestAttributes { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_MUTE = "mute"; - private MuteFindingRequestProperties mute = new MuteFindingRequestProperties(); + private MuteFindingRequestProperties mute; public MuteFindingRequestAttributes() {} diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteFindingRequestData.java b/src/main/java/com/datadog/api/client/v2/model/MuteFindingRequestData.java index e175c9e1b0a..7465a13ef52 100644 --- a/src/main/java/com/datadog/api/client/v2/model/MuteFindingRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/MuteFindingRequestData.java @@ -28,7 +28,7 @@ public class MuteFindingRequestData { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private MuteFindingRequestAttributes attributes = new MuteFindingRequestAttributes(); + private MuteFindingRequestAttributes attributes; public static final String JSON_PROPERTY_ID = "id"; private String id; diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteFindingResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MuteFindingResponseAttributes.java index 5edce4e8283..183e5f9563d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/MuteFindingResponseAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/MuteFindingResponseAttributes.java @@ -41,7 +41,7 @@ public class MuteFindingResponseAttributes { private Long evaluationChangedAt; public static final String JSON_PROPERTY_MUTE = "mute"; - private MuteFindingResponseProperties mute = null; + private MuteFindingResponseProperties mute; public static final String JSON_PROPERTY_RESOURCE = "resource"; private String resource; @@ -53,7 +53,7 @@ public class MuteFindingResponseAttributes { private String resourceType; public static final String JSON_PROPERTY_RULE = "rule"; - private FindingRule rule = null; + private FindingRule rule; public static final String JSON_PROPERTY_STATUS = "status"; private FindingStatus status;