From 12fa6e4fbaa2659d0571a2bb084034951e4a294d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 13 Jul 2026 17:21:40 +0000 Subject: [PATCH] Regenerate client from commit 306edfe of spec repo --- .generator/schemas/v1/openapi.yaml | 43 ++++ .../v1/model/WidgetCalendarAlignedSpan.java | 238 ++++++++++++++++++ .../model/WidgetCalendarAlignedSpanType.java | 63 +++++ .../api/client/v1/model/WidgetLiveSpan.java | 8 +- .../api/client/v1/model/WidgetTime.java | 76 +++++- 5 files changed, 423 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v1/model/WidgetCalendarAlignedSpan.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/WidgetCalendarAlignedSpanType.java diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index b41f414fd36..b96c7babe92 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -27920,6 +27920,42 @@ components: WidgetBackgroundColor: description: "Background color of the widget. Supported values are `white`, `blue`, `purple`, `pink`, `orange`, `yellow`, `green`, `gray`, `vivid_blue`, `vivid_purple`, `vivid_pink`, `vivid_orange`, `vivid_yellow`, `vivid_green`, and `transparent`." type: string + WidgetCalendarAlignedSpan: + description: Used for calendar-aligned time spans, such as the current month or previous year. + properties: + hide_incomplete_cost_data: + description: Whether to hide incomplete cost data in the widget. + type: boolean + offset: + description: Number of completed periods before the current period. 0 represents the current period. + example: 1 + format: int64 + minimum: 0 + type: integer + timezone: + description: Time zone used to align the calendar period. + example: UTC + type: string + type: + $ref: "#/components/schemas/WidgetCalendarAlignedSpanType" + required: + - type + - offset + type: object + WidgetCalendarAlignedSpanType: + description: Calendar-aligned time span type. + enum: + - daily + - weekly + - monthly + - yearly + example: daily + type: string + x-enum-varnames: + - DAILY + - WEEKLY + - MONTHLY + - YEARLY WidgetChangeType: description: Show the absolute or the relative change. enum: @@ -28381,6 +28417,9 @@ components: - month_to_date - 1y - alert + - full_week + - full_month + - year_to_date example: 5m type: string x-enum-varnames: @@ -28401,6 +28440,9 @@ components: - MONTH_TO_DATE - PAST_ONE_YEAR - ALERT + - FULL_WEEK + - FULL_MONTH + - YEAR_TO_DATE WidgetLiveSpanUnit: description: Unit of the time span. enum: @@ -28784,6 +28826,7 @@ components: - $ref: "#/components/schemas/WidgetLegacyLiveSpan" - $ref: "#/components/schemas/WidgetNewLiveSpan" - $ref: "#/components/schemas/WidgetNewFixedSpan" + - $ref: "#/components/schemas/WidgetCalendarAlignedSpan" WidgetTimeWindows: description: Define a time window. enum: diff --git a/src/main/java/com/datadog/api/client/v1/model/WidgetCalendarAlignedSpan.java b/src/main/java/com/datadog/api/client/v1/model/WidgetCalendarAlignedSpan.java new file mode 100644 index 00000000000..5c7bab8df08 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/WidgetCalendarAlignedSpan.java @@ -0,0 +1,238 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.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; + +/** Used for calendar-aligned time spans, such as the current month or previous year. */ +@JsonPropertyOrder({ + WidgetCalendarAlignedSpan.JSON_PROPERTY_HIDE_INCOMPLETE_COST_DATA, + WidgetCalendarAlignedSpan.JSON_PROPERTY_OFFSET, + WidgetCalendarAlignedSpan.JSON_PROPERTY_TIMEZONE, + WidgetCalendarAlignedSpan.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetCalendarAlignedSpan { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HIDE_INCOMPLETE_COST_DATA = "hide_incomplete_cost_data"; + private Boolean hideIncompleteCostData; + + public static final String JSON_PROPERTY_OFFSET = "offset"; + private Long offset; + + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; + private String timezone; + + public static final String JSON_PROPERTY_TYPE = "type"; + private WidgetCalendarAlignedSpanType type; + + public WidgetCalendarAlignedSpan() {} + + @JsonCreator + public WidgetCalendarAlignedSpan( + @JsonProperty(required = true, value = JSON_PROPERTY_OFFSET) Long offset, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + WidgetCalendarAlignedSpanType type) { + this.offset = offset; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public WidgetCalendarAlignedSpan hideIncompleteCostData(Boolean hideIncompleteCostData) { + this.hideIncompleteCostData = hideIncompleteCostData; + return this; + } + + /** + * Whether to hide incomplete cost data in the widget. + * + * @return hideIncompleteCostData + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HIDE_INCOMPLETE_COST_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHideIncompleteCostData() { + return hideIncompleteCostData; + } + + public void setHideIncompleteCostData(Boolean hideIncompleteCostData) { + this.hideIncompleteCostData = hideIncompleteCostData; + } + + public WidgetCalendarAlignedSpan offset(Long offset) { + this.offset = offset; + return this; + } + + /** + * Number of completed periods before the current period. 0 represents the current period. + * minimum: 0 + * + * @return offset + */ + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getOffset() { + return offset; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public WidgetCalendarAlignedSpan timezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * Time zone used to align the calendar period. + * + * @return timezone + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMEZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + public WidgetCalendarAlignedSpan type(WidgetCalendarAlignedSpanType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Calendar-aligned time span type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WidgetCalendarAlignedSpanType getType() { + return type; + } + + public void setType(WidgetCalendarAlignedSpanType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 WidgetCalendarAlignedSpan + */ + @JsonAnySetter + public WidgetCalendarAlignedSpan 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 WidgetCalendarAlignedSpan object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetCalendarAlignedSpan widgetCalendarAlignedSpan = (WidgetCalendarAlignedSpan) o; + return Objects.equals( + this.hideIncompleteCostData, widgetCalendarAlignedSpan.hideIncompleteCostData) + && Objects.equals(this.offset, widgetCalendarAlignedSpan.offset) + && Objects.equals(this.timezone, widgetCalendarAlignedSpan.timezone) + && Objects.equals(this.type, widgetCalendarAlignedSpan.type) + && Objects.equals( + this.additionalProperties, widgetCalendarAlignedSpan.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(hideIncompleteCostData, offset, timezone, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetCalendarAlignedSpan {\n"); + sb.append(" hideIncompleteCostData: ") + .append(toIndentedString(hideIncompleteCostData)) + .append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/WidgetCalendarAlignedSpanType.java b/src/main/java/com/datadog/api/client/v1/model/WidgetCalendarAlignedSpanType.java new file mode 100644 index 00000000000..29615a57cae --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/WidgetCalendarAlignedSpanType.java @@ -0,0 +1,63 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v1.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Calendar-aligned time span type. */ +@JsonSerialize(using = WidgetCalendarAlignedSpanType.WidgetCalendarAlignedSpanTypeSerializer.class) +public class WidgetCalendarAlignedSpanType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("daily", "weekly", "monthly", "yearly")); + + public static final WidgetCalendarAlignedSpanType DAILY = + new WidgetCalendarAlignedSpanType("daily"); + public static final WidgetCalendarAlignedSpanType WEEKLY = + new WidgetCalendarAlignedSpanType("weekly"); + public static final WidgetCalendarAlignedSpanType MONTHLY = + new WidgetCalendarAlignedSpanType("monthly"); + public static final WidgetCalendarAlignedSpanType YEARLY = + new WidgetCalendarAlignedSpanType("yearly"); + + WidgetCalendarAlignedSpanType(String value) { + super(value, allowedValues); + } + + public static class WidgetCalendarAlignedSpanTypeSerializer + extends StdSerializer { + public WidgetCalendarAlignedSpanTypeSerializer(Class t) { + super(t); + } + + public WidgetCalendarAlignedSpanTypeSerializer() { + this(null); + } + + @Override + public void serialize( + WidgetCalendarAlignedSpanType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static WidgetCalendarAlignedSpanType fromValue(String value) { + return new WidgetCalendarAlignedSpanType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/WidgetLiveSpan.java b/src/main/java/com/datadog/api/client/v1/model/WidgetLiveSpan.java index 43f95022aa1..c54d5c985bc 100644 --- a/src/main/java/com/datadog/api/client/v1/model/WidgetLiveSpan.java +++ b/src/main/java/com/datadog/api/client/v1/model/WidgetLiveSpan.java @@ -41,7 +41,10 @@ public class WidgetLiveSpan extends ModelEnum { "week_to_date", "month_to_date", "1y", - "alert")); + "alert", + "full_week", + "full_month", + "year_to_date")); public static final WidgetLiveSpan PAST_ONE_MINUTE = new WidgetLiveSpan("1m"); public static final WidgetLiveSpan PAST_FIVE_MINUTES = new WidgetLiveSpan("5m"); @@ -60,6 +63,9 @@ public class WidgetLiveSpan extends ModelEnum { public static final WidgetLiveSpan MONTH_TO_DATE = new WidgetLiveSpan("month_to_date"); public static final WidgetLiveSpan PAST_ONE_YEAR = new WidgetLiveSpan("1y"); public static final WidgetLiveSpan ALERT = new WidgetLiveSpan("alert"); + public static final WidgetLiveSpan FULL_WEEK = new WidgetLiveSpan("full_week"); + public static final WidgetLiveSpan FULL_MONTH = new WidgetLiveSpan("full_month"); + public static final WidgetLiveSpan YEAR_TO_DATE = new WidgetLiveSpan("year_to_date"); WidgetLiveSpan(String value) { super(value, allowedValues); diff --git a/src/main/java/com/datadog/api/client/v1/model/WidgetTime.java b/src/main/java/com/datadog/api/client/v1/model/WidgetTime.java index fed3f037846..25f60f0d209 100644 --- a/src/main/java/com/datadog/api/client/v1/model/WidgetTime.java +++ b/src/main/java/com/datadog/api/client/v1/model/WidgetTime.java @@ -210,6 +210,51 @@ public WidgetTime deserialize(JsonParser jp, DeserializationContext ctxt) log.log(Level.FINER, "Input data does not match schema 'WidgetNewFixedSpan'", e); } + // deserialize WidgetCalendarAlignedSpan + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (WidgetCalendarAlignedSpan.class.equals(Integer.class) + || WidgetCalendarAlignedSpan.class.equals(Long.class) + || WidgetCalendarAlignedSpan.class.equals(Float.class) + || WidgetCalendarAlignedSpan.class.equals(Double.class) + || WidgetCalendarAlignedSpan.class.equals(Boolean.class) + || WidgetCalendarAlignedSpan.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((WidgetCalendarAlignedSpan.class.equals(Integer.class) + || WidgetCalendarAlignedSpan.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((WidgetCalendarAlignedSpan.class.equals(Float.class) + || WidgetCalendarAlignedSpan.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (WidgetCalendarAlignedSpan.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (WidgetCalendarAlignedSpan.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(WidgetCalendarAlignedSpan.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((WidgetCalendarAlignedSpan) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'WidgetCalendarAlignedSpan'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'WidgetCalendarAlignedSpan'", e); + } + WidgetTime ret = new WidgetTime(); if (match == 1) { ret.setActualInstance(deserialized); @@ -253,10 +298,16 @@ public WidgetTime(WidgetNewFixedSpan o) { setActualInstance(o); } + public WidgetTime(WidgetCalendarAlignedSpan o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put("WidgetLegacyLiveSpan", new GenericType() {}); schemas.put("WidgetNewLiveSpan", new GenericType() {}); schemas.put("WidgetNewFixedSpan", new GenericType() {}); + schemas.put("WidgetCalendarAlignedSpan", new GenericType() {}); JSON.registerDescendants(WidgetTime.class, Collections.unmodifiableMap(schemas)); } @@ -267,7 +318,8 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: WidgetLegacyLiveSpan, WidgetNewLiveSpan, WidgetNewFixedSpan + * against the oneOf child schemas: WidgetLegacyLiveSpan, WidgetNewLiveSpan, WidgetNewFixedSpan, + * WidgetCalendarAlignedSpan * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -286,6 +338,10 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf(WidgetCalendarAlignedSpan.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { super.setActualInstance(instance); @@ -293,14 +349,15 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( "Invalid instance type. Must be WidgetLegacyLiveSpan, WidgetNewLiveSpan," - + " WidgetNewFixedSpan"); + + " WidgetNewFixedSpan, WidgetCalendarAlignedSpan"); } /** * Get the actual instance, which can be the following: WidgetLegacyLiveSpan, WidgetNewLiveSpan, - * WidgetNewFixedSpan + * WidgetNewFixedSpan, WidgetCalendarAlignedSpan * - * @return The actual instance (WidgetLegacyLiveSpan, WidgetNewLiveSpan, WidgetNewFixedSpan) + * @return The actual instance (WidgetLegacyLiveSpan, WidgetNewLiveSpan, WidgetNewFixedSpan, + * WidgetCalendarAlignedSpan) */ @Override public Object getActualInstance() { @@ -339,4 +396,15 @@ public WidgetNewLiveSpan getWidgetNewLiveSpan() throws ClassCastException { public WidgetNewFixedSpan getWidgetNewFixedSpan() throws ClassCastException { return (WidgetNewFixedSpan) super.getActualInstance(); } + + /** + * Get the actual instance of `WidgetCalendarAlignedSpan`. If the actual instance is not + * `WidgetCalendarAlignedSpan`, the ClassCastException will be thrown. + * + * @return The actual instance of `WidgetCalendarAlignedSpan` + * @throws ClassCastException if the instance is not `WidgetCalendarAlignedSpan` + */ + public WidgetCalendarAlignedSpan getWidgetCalendarAlignedSpan() throws ClassCastException { + return (WidgetCalendarAlignedSpan) super.getActualInstance(); + } }