From e79602a41391cf355bf4792c41637505fd893def Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 11 Nov 2026 23:36:45 +0000 Subject: [PATCH] Regenerate client from commit e0406ea of spec repo --- .generator/schemas/v1/openapi.yaml | 116 ++++++- .../dashboards/CreateDashboard_209524718.java | 145 +++++++++ .../api/client/v1/model/HeatgridColorBin.java | 31 +- .../client/v1/model/HeatgridLabelColumn.java | 65 +++- .../v1/model/HeatgridTextFormatMatch.java | 124 ++++++++ .../v1/model/HeatgridTextFormatMatchType.java | 68 ++++ .../v1/model/HeatgridTextFormatReplace.java | 290 ++++++++++++++++++ .../model/HeatgridTextFormatReplaceAll.java | 125 ++++++++ .../HeatgridTextFormatReplaceAllType.java | 57 ++++ .../HeatgridTextFormatReplaceSubstring.java | 154 ++++++++++ ...eatgridTextFormatReplaceSubstringType.java | 62 ++++ .../v1/model/HeatgridTextFormatRule.java | 127 ++++++++ .../v1/model/HeatgridWidgetDefinition.java | 2 +- .../api/client/v1/api/dashboards.feature | 15 + .../heatgrid_text_formats_widget.json | 48 +++ .../test-runner-data/manifest.json | 7 + ...h-bin-labels-and-formatted-row-labels.json | 100 ++++++ .../test-server-data/v1/dashboards.json | 134 +++++++- 18 files changed, 1648 insertions(+), 22 deletions(-) create mode 100644 examples/v1/dashboards/CreateDashboard_209524718.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatMatch.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatMatchType.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplace.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceAll.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceAllType.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceSubstring.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceSubstringType.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatRule.java create mode 100644 src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/heatgrid_text_formats_widget.json create mode 100644 src/test/resources/generated-test/test-runner-data/v1/dashboards/create-a-heatgrid-widget-with-bin-labels-and-formatted-row-labels.json diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 9ee2d06488a..49976b69bb3 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4612,10 +4612,14 @@ components: - $ref: "#/components/schemas/HeatgridThemeColors" HeatgridColorBin: additionalProperties: false - description: A color and optional lower threshold for a discrete bin. + description: A color, optional lower threshold, and optional label for a discrete bin. properties: color: $ref: "#/components/schemas/HeatgridColor" + label: + description: Name of the bin. + maxLength: 255 + type: string lower_bound: description: Inclusive lower bound. Omit for the first bin. format: double @@ -4749,12 +4753,15 @@ components: type: object HeatgridLabelColumn: additionalProperties: false - description: Configuration of the group label column. + description: Configuration of the group label column. Its width is sized automatically when omitted. properties: + text_formats: + description: Ordered string replacement rules for the group labels. + items: + $ref: "#/components/schemas/HeatgridTextFormatRule" + type: array width: $ref: "#/components/schemas/HeatgridLabelColumnWidth" - required: - - width type: object HeatgridLabelColumnWidth: description: Width of the label column. @@ -4880,6 +4887,107 @@ components: x-enum-varnames: - ASC - DESC + HeatgridTextFormatMatch: + additionalProperties: false + description: Match a group label against a string. + properties: + type: + $ref: "#/components/schemas/HeatgridTextFormatMatchType" + value: + description: String to compare with the group label. + example: "" + maxLength: 255 + type: string + required: + - type + - value + type: object + HeatgridTextFormatMatchType: + description: Comparison used to match a group label. + enum: + - is + - is_not + - contains + - does_not_contain + - starts_with + - ends_with + example: is + type: string + x-enum-varnames: + - IS + - IS_NOT + - CONTAINS + - DOES_NOT_CONTAIN + - STARTS_WITH + - ENDS_WITH + HeatgridTextFormatReplace: + description: Replace all or part of a matching group label. + oneOf: + - $ref: "#/components/schemas/HeatgridTextFormatReplaceAll" + - $ref: "#/components/schemas/HeatgridTextFormatReplaceSubstring" + HeatgridTextFormatReplaceAll: + additionalProperties: false + description: Replace the entire matching group label. + properties: + type: + $ref: "#/components/schemas/HeatgridTextFormatReplaceAllType" + with: + description: Replacement string. + example: "" + maxLength: 255 + type: string + required: + - type + - with + type: object + HeatgridTextFormatReplaceAllType: + description: Replace the entire matching group label. + enum: + - all + example: all + type: string + x-enum-varnames: + - ALL + HeatgridTextFormatReplaceSubstring: + additionalProperties: false + description: Replace a substring of the matching group label. + properties: + substring: + description: Substring to replace. + example: "" + maxLength: 255 + type: string + type: + $ref: "#/components/schemas/HeatgridTextFormatReplaceSubstringType" + with: + description: Replacement string. + example: "" + maxLength: 255 + type: string + required: + - type + - substring + - with + type: object + HeatgridTextFormatReplaceSubstringType: + description: Replace a substring of a matching group label. + enum: + - substring + example: substring + type: string + x-enum-varnames: + - SUBSTRING + HeatgridTextFormatRule: + additionalProperties: false + description: A rule for matching and optionally replacing a group label. + properties: + match: + $ref: "#/components/schemas/HeatgridTextFormatMatch" + replace: + $ref: "#/components/schemas/HeatgridTextFormatReplace" + required: + - match + type: object HeatgridThemeColors: description: Two color strings for the light and dark themes, in that order. example: ["#FFFFFF", "#000000"] diff --git a/examples/v1/dashboards/CreateDashboard_209524718.java b/examples/v1/dashboards/CreateDashboard_209524718.java new file mode 100644 index 00000000000..d2a50f87c61 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_209524718.java @@ -0,0 +1,145 @@ +// Create a heatgrid widget with bin labels and formatted row labels + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v1.api.DashboardsApi; +import com.datadog.api.client.v1.model.Dashboard; +import com.datadog.api.client.v1.model.DashboardLayoutType; +import com.datadog.api.client.v1.model.FormulaAndFunctionMetricDataSource; +import com.datadog.api.client.v1.model.FormulaAndFunctionMetricQueryDefinition; +import com.datadog.api.client.v1.model.FormulaAndFunctionQueryDefinition; +import com.datadog.api.client.v1.model.HeatgridColor; +import com.datadog.api.client.v1.model.HeatgridColorBin; +import com.datadog.api.client.v1.model.HeatgridColorConfig; +import com.datadog.api.client.v1.model.HeatgridCustomColorSource; +import com.datadog.api.client.v1.model.HeatgridDiscreteCustomColor; +import com.datadog.api.client.v1.model.HeatgridDiscreteMode; +import com.datadog.api.client.v1.model.HeatgridLabelColumn; +import com.datadog.api.client.v1.model.HeatgridNestingDisplay; +import com.datadog.api.client.v1.model.HeatgridSort; +import com.datadog.api.client.v1.model.HeatgridSortBy; +import com.datadog.api.client.v1.model.HeatgridSortByLabel; +import com.datadog.api.client.v1.model.HeatgridSortByLabelProperty; +import com.datadog.api.client.v1.model.HeatgridSortOrder; +import com.datadog.api.client.v1.model.HeatgridTextFormatMatch; +import com.datadog.api.client.v1.model.HeatgridTextFormatMatchType; +import com.datadog.api.client.v1.model.HeatgridTextFormatReplace; +import com.datadog.api.client.v1.model.HeatgridTextFormatReplaceAll; +import com.datadog.api.client.v1.model.HeatgridTextFormatReplaceAllType; +import com.datadog.api.client.v1.model.HeatgridTextFormatReplaceSubstring; +import com.datadog.api.client.v1.model.HeatgridTextFormatReplaceSubstringType; +import com.datadog.api.client.v1.model.HeatgridTextFormatRule; +import com.datadog.api.client.v1.model.HeatgridWidgetDefinition; +import com.datadog.api.client.v1.model.HeatgridWidgetDefinitionType; +import com.datadog.api.client.v1.model.HeatgridWidgetFormula; +import com.datadog.api.client.v1.model.HeatgridWidgetRequest; +import com.datadog.api.client.v1.model.HeatgridWidgetResponseFormat; +import com.datadog.api.client.v1.model.Widget; +import com.datadog.api.client.v1.model.WidgetDefinition; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + DashboardsApi apiInstance = new DashboardsApi(defaultClient); + + Dashboard body = + new Dashboard() + .title("Example-Dashboard") + .layoutType(DashboardLayoutType.ORDERED) + .widgets( + Collections.singletonList( + new Widget() + .definition( + new WidgetDefinition( + new HeatgridWidgetDefinition() + .type(HeatgridWidgetDefinitionType.HEATGRID) + .requests( + Collections.singletonList( + new HeatgridWidgetRequest() + .responseFormat( + HeatgridWidgetResponseFormat.TIMESERIES) + .queries( + Collections.singletonList( + new FormulaAndFunctionQueryDefinition( + new FormulaAndFunctionMetricQueryDefinition() + .dataSource( + FormulaAndFunctionMetricDataSource + .METRICS) + .name("query1") + .query( + "avg:system.cpu.user{*} by" + + " {host}")))) + .formulas( + Collections.singletonList( + new HeatgridWidgetFormula() + .formula("query1"))))) + .sort( + new HeatgridSort() + .nestingDisplay(HeatgridNestingDisplay.FLAT) + .sortBy( + new HeatgridSortBy( + new HeatgridSortByLabel() + .property(HeatgridSortByLabelProperty.LABEL) + .order(HeatgridSortOrder.ASC)))) + .color( + new HeatgridColorConfig( + new HeatgridDiscreteCustomColor() + .mode(HeatgridDiscreteMode.DISCRETE) + .source(HeatgridCustomColorSource.CUSTOM) + .bins( + Arrays.asList( + new HeatgridColorBin() + .color(new HeatgridColor("#00FF00")) + .label("Normal"), + new HeatgridColorBin() + .color(new HeatgridColor("#FF0000")) + .lowerBound(80.0) + .label("High"))))) + .labelColumn( + new HeatgridLabelColumn() + .textFormats( + Arrays.asList( + new HeatgridTextFormatRule() + .match( + new HeatgridTextFormatMatch() + .type( + HeatgridTextFormatMatchType + .STARTS_WITH) + .value("api-")) + .replace( + new HeatgridTextFormatReplace( + new HeatgridTextFormatReplaceSubstring() + .type( + HeatgridTextFormatReplaceSubstringType + .SUBSTRING) + .substring("api-") + .with(""))), + new HeatgridTextFormatRule() + .match( + new HeatgridTextFormatMatch() + .type( + HeatgridTextFormatMatchType.IS) + .value("unknown")) + .replace( + new HeatgridTextFormatReplace( + new HeatgridTextFormatReplaceAll() + .type( + HeatgridTextFormatReplaceAllType + .ALL) + .with("Other")))))))))); + + try { + Dashboard result = apiInstance.createDashboard(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DashboardsApi#createDashboard"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/HeatgridColorBin.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridColorBin.java index a1740d0d1ff..6bd3f4d5513 100644 --- a/src/main/java/com/datadog/api/client/v1/model/HeatgridColorBin.java +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridColorBin.java @@ -13,9 +13,10 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.Objects; -/** A color and optional lower threshold for a discrete bin. */ +/** A color, optional lower threshold, and optional label for a discrete bin. */ @JsonPropertyOrder({ HeatgridColorBin.JSON_PROPERTY_COLOR, + HeatgridColorBin.JSON_PROPERTY_LABEL, HeatgridColorBin.JSON_PROPERTY_LOWER_BOUND }) @jakarta.annotation.Generated( @@ -25,6 +26,9 @@ public class HeatgridColorBin { public static final String JSON_PROPERTY_COLOR = "color"; private HeatgridColor color; + public static final String JSON_PROPERTY_LABEL = "label"; + private String label; + public static final String JSON_PROPERTY_LOWER_BOUND = "lower_bound"; private Double lowerBound; @@ -61,6 +65,27 @@ public void setColor(HeatgridColor color) { } } + public HeatgridColorBin label(String label) { + this.label = label; + return this; + } + + /** + * Name of the bin. + * + * @return label + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LABEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + public HeatgridColorBin lowerBound(Double lowerBound) { this.lowerBound = lowerBound; return this; @@ -93,12 +118,13 @@ public boolean equals(Object o) { } HeatgridColorBin heatgridColorBin = (HeatgridColorBin) o; return Objects.equals(this.color, heatgridColorBin.color) + && Objects.equals(this.label, heatgridColorBin.label) && Objects.equals(this.lowerBound, heatgridColorBin.lowerBound); } @Override public int hashCode() { - return Objects.hash(color, lowerBound); + return Objects.hash(color, label, lowerBound); } @Override @@ -106,6 +132,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class HeatgridColorBin {\n"); sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" label: ").append(toIndentedString(label)).append("\n"); sb.append(" lowerBound: ").append(toIndentedString(lowerBound)).append("\n"); sb.append('}'); return sb.toString(); diff --git a/src/main/java/com/datadog/api/client/v1/model/HeatgridLabelColumn.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridLabelColumn.java index 0324674b89f..d42064fd836 100644 --- a/src/main/java/com/datadog/api/client/v1/model/HeatgridLabelColumn.java +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridLabelColumn.java @@ -6,29 +6,67 @@ package com.datadog.api.client.v1.model; -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.List; import java.util.Objects; -/** Configuration of the group label column. */ -@JsonPropertyOrder({HeatgridLabelColumn.JSON_PROPERTY_WIDTH}) +/** Configuration of the group label column. Its width is sized automatically when omitted. */ +@JsonPropertyOrder({ + HeatgridLabelColumn.JSON_PROPERTY_TEXT_FORMATS, + HeatgridLabelColumn.JSON_PROPERTY_WIDTH +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class HeatgridLabelColumn { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TEXT_FORMATS = "text_formats"; + private List textFormats = null; + public static final String JSON_PROPERTY_WIDTH = "width"; private HeatgridLabelColumnWidth width; - public HeatgridLabelColumn() {} + public HeatgridLabelColumn textFormats(List textFormats) { + this.textFormats = textFormats; + if (textFormats != null) { + for (HeatgridTextFormatRule item : textFormats) { + this.unparsed |= item.unparsed; + } + } + return this; + } - @JsonCreator - public HeatgridLabelColumn( - @JsonProperty(required = true, value = JSON_PROPERTY_WIDTH) HeatgridLabelColumnWidth width) { - this.width = width; - this.unparsed |= !width.isValid(); + public HeatgridLabelColumn addTextFormatsItem(HeatgridTextFormatRule textFormatsItem) { + if (this.textFormats == null) { + this.textFormats = new ArrayList<>(); + } + this.textFormats.add(textFormatsItem); + this.unparsed |= textFormatsItem.unparsed; + return this; + } + + /** + * Ordered string replacement rules for the group labels. + * + * @return textFormats + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT_FORMATS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTextFormats() { + return textFormats; + } + + public void setTextFormats(List textFormats) { + this.textFormats = textFormats; + if (textFormats != null) { + for (HeatgridTextFormatRule item : textFormats) { + this.unparsed |= item.unparsed; + } + } } public HeatgridLabelColumn width(HeatgridLabelColumnWidth width) { @@ -42,8 +80,9 @@ public HeatgridLabelColumn width(HeatgridLabelColumnWidth width) { * * @return width */ + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_WIDTH) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public HeatgridLabelColumnWidth getWidth() { return width; } @@ -65,18 +104,20 @@ public boolean equals(Object o) { return false; } HeatgridLabelColumn heatgridLabelColumn = (HeatgridLabelColumn) o; - return Objects.equals(this.width, heatgridLabelColumn.width); + return Objects.equals(this.textFormats, heatgridLabelColumn.textFormats) + && Objects.equals(this.width, heatgridLabelColumn.width); } @Override public int hashCode() { - return Objects.hash(width); + return Objects.hash(textFormats, width); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class HeatgridLabelColumn {\n"); + sb.append(" textFormats: ").append(toIndentedString(textFormats)).append("\n"); sb.append(" width: ").append(toIndentedString(width)).append("\n"); sb.append('}'); return sb.toString(); diff --git a/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatMatch.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatMatch.java new file mode 100644 index 00000000000..a1ce8136847 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatMatch.java @@ -0,0 +1,124 @@ +/* + * 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.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.Objects; + +/** Match a group label against a string. */ +@JsonPropertyOrder({ + HeatgridTextFormatMatch.JSON_PROPERTY_TYPE, + HeatgridTextFormatMatch.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class HeatgridTextFormatMatch { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private HeatgridTextFormatMatchType type; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + public HeatgridTextFormatMatch() {} + + @JsonCreator + public HeatgridTextFormatMatch( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) HeatgridTextFormatMatchType type, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) String value) { + this.type = type; + this.unparsed |= !type.isValid(); + this.value = value; + } + + public HeatgridTextFormatMatch type(HeatgridTextFormatMatchType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Comparison used to match a group label. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public HeatgridTextFormatMatchType getType() { + return type; + } + + public void setType(HeatgridTextFormatMatchType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public HeatgridTextFormatMatch value(String value) { + this.value = value; + return this; + } + + /** + * String to compare with the group label. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + /** Return true if this HeatgridTextFormatMatch object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HeatgridTextFormatMatch heatgridTextFormatMatch = (HeatgridTextFormatMatch) o; + return Objects.equals(this.type, heatgridTextFormatMatch.type) + && Objects.equals(this.value, heatgridTextFormatMatch.value); + } + + @Override + public int hashCode() { + return Objects.hash(type, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HeatgridTextFormatMatch {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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/HeatgridTextFormatMatchType.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatMatchType.java new file mode 100644 index 00000000000..d16a490c659 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatMatchType.java @@ -0,0 +1,68 @@ +/* + * 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; + +/** Comparison used to match a group label. */ +@JsonSerialize(using = HeatgridTextFormatMatchType.HeatgridTextFormatMatchTypeSerializer.class) +public class HeatgridTextFormatMatchType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "is", "is_not", "contains", "does_not_contain", "starts_with", "ends_with")); + + public static final HeatgridTextFormatMatchType IS = new HeatgridTextFormatMatchType("is"); + public static final HeatgridTextFormatMatchType IS_NOT = + new HeatgridTextFormatMatchType("is_not"); + public static final HeatgridTextFormatMatchType CONTAINS = + new HeatgridTextFormatMatchType("contains"); + public static final HeatgridTextFormatMatchType DOES_NOT_CONTAIN = + new HeatgridTextFormatMatchType("does_not_contain"); + public static final HeatgridTextFormatMatchType STARTS_WITH = + new HeatgridTextFormatMatchType("starts_with"); + public static final HeatgridTextFormatMatchType ENDS_WITH = + new HeatgridTextFormatMatchType("ends_with"); + + HeatgridTextFormatMatchType(String value) { + super(value, allowedValues); + } + + public static class HeatgridTextFormatMatchTypeSerializer + extends StdSerializer { + public HeatgridTextFormatMatchTypeSerializer(Class t) { + super(t); + } + + public HeatgridTextFormatMatchTypeSerializer() { + this(null); + } + + @Override + public void serialize( + HeatgridTextFormatMatchType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static HeatgridTextFormatMatchType fromValue(String value) { + return new HeatgridTextFormatMatchType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplace.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplace.java new file mode 100644 index 00000000000..3720e52d06e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplace.java @@ -0,0 +1,290 @@ +/* + * 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.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = HeatgridTextFormatReplace.HeatgridTextFormatReplaceDeserializer.class) +@JsonSerialize(using = HeatgridTextFormatReplace.HeatgridTextFormatReplaceSerializer.class) +public class HeatgridTextFormatReplace extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(HeatgridTextFormatReplace.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class HeatgridTextFormatReplaceSerializer + extends StdSerializer { + public HeatgridTextFormatReplaceSerializer(Class t) { + super(t); + } + + public HeatgridTextFormatReplaceSerializer() { + this(null); + } + + @Override + public void serialize( + HeatgridTextFormatReplace value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class HeatgridTextFormatReplaceDeserializer + extends StdDeserializer { + public HeatgridTextFormatReplaceDeserializer() { + this(HeatgridTextFormatReplace.class); + } + + public HeatgridTextFormatReplaceDeserializer(Class vc) { + super(vc); + } + + @Override + public HeatgridTextFormatReplace deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize HeatgridTextFormatReplaceAll + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (HeatgridTextFormatReplaceAll.class.equals(Integer.class) + || HeatgridTextFormatReplaceAll.class.equals(Long.class) + || HeatgridTextFormatReplaceAll.class.equals(Float.class) + || HeatgridTextFormatReplaceAll.class.equals(Double.class) + || HeatgridTextFormatReplaceAll.class.equals(Boolean.class) + || HeatgridTextFormatReplaceAll.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((HeatgridTextFormatReplaceAll.class.equals(Integer.class) + || HeatgridTextFormatReplaceAll.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((HeatgridTextFormatReplaceAll.class.equals(Float.class) + || HeatgridTextFormatReplaceAll.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (HeatgridTextFormatReplaceAll.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (HeatgridTextFormatReplaceAll.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(HeatgridTextFormatReplaceAll.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 (!((HeatgridTextFormatReplaceAll) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'HeatgridTextFormatReplaceAll'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'HeatgridTextFormatReplaceAll'", e); + } + + // deserialize HeatgridTextFormatReplaceSubstring + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (HeatgridTextFormatReplaceSubstring.class.equals(Integer.class) + || HeatgridTextFormatReplaceSubstring.class.equals(Long.class) + || HeatgridTextFormatReplaceSubstring.class.equals(Float.class) + || HeatgridTextFormatReplaceSubstring.class.equals(Double.class) + || HeatgridTextFormatReplaceSubstring.class.equals(Boolean.class) + || HeatgridTextFormatReplaceSubstring.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((HeatgridTextFormatReplaceSubstring.class.equals(Integer.class) + || HeatgridTextFormatReplaceSubstring.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((HeatgridTextFormatReplaceSubstring.class.equals(Float.class) + || HeatgridTextFormatReplaceSubstring.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (HeatgridTextFormatReplaceSubstring.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (HeatgridTextFormatReplaceSubstring.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(HeatgridTextFormatReplaceSubstring.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 (!((HeatgridTextFormatReplaceSubstring) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'HeatgridTextFormatReplaceSubstring'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'HeatgridTextFormatReplaceSubstring'", + e); + } + + HeatgridTextFormatReplace ret = new HeatgridTextFormatReplace(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public HeatgridTextFormatReplace getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "HeatgridTextFormatReplace cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public HeatgridTextFormatReplace() { + super("oneOf", Boolean.FALSE); + } + + public HeatgridTextFormatReplace(HeatgridTextFormatReplaceAll o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public HeatgridTextFormatReplace(HeatgridTextFormatReplaceSubstring o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("HeatgridTextFormatReplaceAll", new GenericType() {}); + schemas.put( + "HeatgridTextFormatReplaceSubstring", + new GenericType() {}); + JSON.registerDescendants(HeatgridTextFormatReplace.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return HeatgridTextFormatReplace.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: HeatgridTextFormatReplaceAll, + * HeatgridTextFormatReplaceSubstring + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(HeatgridTextFormatReplaceAll.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + HeatgridTextFormatReplaceSubstring.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be HeatgridTextFormatReplaceAll," + + " HeatgridTextFormatReplaceSubstring"); + } + + /** + * Get the actual instance, which can be the following: HeatgridTextFormatReplaceAll, + * HeatgridTextFormatReplaceSubstring + * + * @return The actual instance (HeatgridTextFormatReplaceAll, HeatgridTextFormatReplaceSubstring) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `HeatgridTextFormatReplaceAll`. If the actual instance is not + * `HeatgridTextFormatReplaceAll`, the ClassCastException will be thrown. + * + * @return The actual instance of `HeatgridTextFormatReplaceAll` + * @throws ClassCastException if the instance is not `HeatgridTextFormatReplaceAll` + */ + public HeatgridTextFormatReplaceAll getHeatgridTextFormatReplaceAll() throws ClassCastException { + return (HeatgridTextFormatReplaceAll) super.getActualInstance(); + } + + /** + * Get the actual instance of `HeatgridTextFormatReplaceSubstring`. If the actual instance is not + * `HeatgridTextFormatReplaceSubstring`, the ClassCastException will be thrown. + * + * @return The actual instance of `HeatgridTextFormatReplaceSubstring` + * @throws ClassCastException if the instance is not `HeatgridTextFormatReplaceSubstring` + */ + public HeatgridTextFormatReplaceSubstring getHeatgridTextFormatReplaceSubstring() + throws ClassCastException { + return (HeatgridTextFormatReplaceSubstring) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceAll.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceAll.java new file mode 100644 index 00000000000..1e165d06211 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceAll.java @@ -0,0 +1,125 @@ +/* + * 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.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.Objects; + +/** Replace the entire matching group label. */ +@JsonPropertyOrder({ + HeatgridTextFormatReplaceAll.JSON_PROPERTY_TYPE, + HeatgridTextFormatReplaceAll.JSON_PROPERTY_WITH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class HeatgridTextFormatReplaceAll { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TYPE = "type"; + private HeatgridTextFormatReplaceAllType type; + + public static final String JSON_PROPERTY_WITH = "with"; + private String with; + + public HeatgridTextFormatReplaceAll() {} + + @JsonCreator + public HeatgridTextFormatReplaceAll( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + HeatgridTextFormatReplaceAllType type, + @JsonProperty(required = true, value = JSON_PROPERTY_WITH) String with) { + this.type = type; + this.unparsed |= !type.isValid(); + this.with = with; + } + + public HeatgridTextFormatReplaceAll type(HeatgridTextFormatReplaceAllType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Replace the entire matching group label. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public HeatgridTextFormatReplaceAllType getType() { + return type; + } + + public void setType(HeatgridTextFormatReplaceAllType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public HeatgridTextFormatReplaceAll with(String with) { + this.with = with; + return this; + } + + /** + * Replacement string. + * + * @return with + */ + @JsonProperty(JSON_PROPERTY_WITH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getWith() { + return with; + } + + public void setWith(String with) { + this.with = with; + } + + /** Return true if this HeatgridTextFormatReplaceAll object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HeatgridTextFormatReplaceAll heatgridTextFormatReplaceAll = (HeatgridTextFormatReplaceAll) o; + return Objects.equals(this.type, heatgridTextFormatReplaceAll.type) + && Objects.equals(this.with, heatgridTextFormatReplaceAll.with); + } + + @Override + public int hashCode() { + return Objects.hash(type, with); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HeatgridTextFormatReplaceAll {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" with: ").append(toIndentedString(with)).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/HeatgridTextFormatReplaceAllType.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceAllType.java new file mode 100644 index 00000000000..6fb9e88e1c2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceAllType.java @@ -0,0 +1,57 @@ +/* + * 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; + +/** Replace the entire matching group label. */ +@JsonSerialize( + using = HeatgridTextFormatReplaceAllType.HeatgridTextFormatReplaceAllTypeSerializer.class) +public class HeatgridTextFormatReplaceAllType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("all")); + + public static final HeatgridTextFormatReplaceAllType ALL = + new HeatgridTextFormatReplaceAllType("all"); + + HeatgridTextFormatReplaceAllType(String value) { + super(value, allowedValues); + } + + public static class HeatgridTextFormatReplaceAllTypeSerializer + extends StdSerializer { + public HeatgridTextFormatReplaceAllTypeSerializer(Class t) { + super(t); + } + + public HeatgridTextFormatReplaceAllTypeSerializer() { + this(null); + } + + @Override + public void serialize( + HeatgridTextFormatReplaceAllType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static HeatgridTextFormatReplaceAllType fromValue(String value) { + return new HeatgridTextFormatReplaceAllType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceSubstring.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceSubstring.java new file mode 100644 index 00000000000..eeb25676c9c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceSubstring.java @@ -0,0 +1,154 @@ +/* + * 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.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.Objects; + +/** Replace a substring of the matching group label. */ +@JsonPropertyOrder({ + HeatgridTextFormatReplaceSubstring.JSON_PROPERTY_SUBSTRING, + HeatgridTextFormatReplaceSubstring.JSON_PROPERTY_TYPE, + HeatgridTextFormatReplaceSubstring.JSON_PROPERTY_WITH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class HeatgridTextFormatReplaceSubstring { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SUBSTRING = "substring"; + private String substring; + + public static final String JSON_PROPERTY_TYPE = "type"; + private HeatgridTextFormatReplaceSubstringType type; + + public static final String JSON_PROPERTY_WITH = "with"; + private String with; + + public HeatgridTextFormatReplaceSubstring() {} + + @JsonCreator + public HeatgridTextFormatReplaceSubstring( + @JsonProperty(required = true, value = JSON_PROPERTY_SUBSTRING) String substring, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + HeatgridTextFormatReplaceSubstringType type, + @JsonProperty(required = true, value = JSON_PROPERTY_WITH) String with) { + this.substring = substring; + this.type = type; + this.unparsed |= !type.isValid(); + this.with = with; + } + + public HeatgridTextFormatReplaceSubstring substring(String substring) { + this.substring = substring; + return this; + } + + /** + * Substring to replace. + * + * @return substring + */ + @JsonProperty(JSON_PROPERTY_SUBSTRING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSubstring() { + return substring; + } + + public void setSubstring(String substring) { + this.substring = substring; + } + + public HeatgridTextFormatReplaceSubstring type(HeatgridTextFormatReplaceSubstringType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Replace a substring of a matching group label. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public HeatgridTextFormatReplaceSubstringType getType() { + return type; + } + + public void setType(HeatgridTextFormatReplaceSubstringType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public HeatgridTextFormatReplaceSubstring with(String with) { + this.with = with; + return this; + } + + /** + * Replacement string. + * + * @return with + */ + @JsonProperty(JSON_PROPERTY_WITH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getWith() { + return with; + } + + public void setWith(String with) { + this.with = with; + } + + /** Return true if this HeatgridTextFormatReplaceSubstring object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HeatgridTextFormatReplaceSubstring heatgridTextFormatReplaceSubstring = + (HeatgridTextFormatReplaceSubstring) o; + return Objects.equals(this.substring, heatgridTextFormatReplaceSubstring.substring) + && Objects.equals(this.type, heatgridTextFormatReplaceSubstring.type) + && Objects.equals(this.with, heatgridTextFormatReplaceSubstring.with); + } + + @Override + public int hashCode() { + return Objects.hash(substring, type, with); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HeatgridTextFormatReplaceSubstring {\n"); + sb.append(" substring: ").append(toIndentedString(substring)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" with: ").append(toIndentedString(with)).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/HeatgridTextFormatReplaceSubstringType.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceSubstringType.java new file mode 100644 index 00000000000..defee53801f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatReplaceSubstringType.java @@ -0,0 +1,62 @@ +/* + * 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; + +/** Replace a substring of a matching group label. */ +@JsonSerialize( + using = + HeatgridTextFormatReplaceSubstringType.HeatgridTextFormatReplaceSubstringTypeSerializer + .class) +public class HeatgridTextFormatReplaceSubstringType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("substring")); + + public static final HeatgridTextFormatReplaceSubstringType SUBSTRING = + new HeatgridTextFormatReplaceSubstringType("substring"); + + HeatgridTextFormatReplaceSubstringType(String value) { + super(value, allowedValues); + } + + public static class HeatgridTextFormatReplaceSubstringTypeSerializer + extends StdSerializer { + public HeatgridTextFormatReplaceSubstringTypeSerializer( + Class t) { + super(t); + } + + public HeatgridTextFormatReplaceSubstringTypeSerializer() { + this(null); + } + + @Override + public void serialize( + HeatgridTextFormatReplaceSubstringType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static HeatgridTextFormatReplaceSubstringType fromValue(String value) { + return new HeatgridTextFormatReplaceSubstringType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatRule.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatRule.java new file mode 100644 index 00000000000..b0e612c6dee --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridTextFormatRule.java @@ -0,0 +1,127 @@ +/* + * 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.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.Objects; + +/** A rule for matching and optionally replacing a group label. */ +@JsonPropertyOrder({ + HeatgridTextFormatRule.JSON_PROPERTY_MATCH, + HeatgridTextFormatRule.JSON_PROPERTY_REPLACE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class HeatgridTextFormatRule { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MATCH = "match"; + private HeatgridTextFormatMatch match; + + public static final String JSON_PROPERTY_REPLACE = "replace"; + private HeatgridTextFormatReplace replace; + + public HeatgridTextFormatRule() {} + + @JsonCreator + public HeatgridTextFormatRule( + @JsonProperty(required = true, value = JSON_PROPERTY_MATCH) HeatgridTextFormatMatch match) { + this.match = match; + this.unparsed |= match.unparsed; + } + + public HeatgridTextFormatRule match(HeatgridTextFormatMatch match) { + this.match = match; + this.unparsed |= match.unparsed; + return this; + } + + /** + * Match a group label against a string. + * + * @return match + */ + @JsonProperty(JSON_PROPERTY_MATCH) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public HeatgridTextFormatMatch getMatch() { + return match; + } + + public void setMatch(HeatgridTextFormatMatch match) { + this.match = match; + if (match != null) { + this.unparsed |= match.unparsed; + } + } + + public HeatgridTextFormatRule replace(HeatgridTextFormatReplace replace) { + this.replace = replace; + this.unparsed |= replace.unparsed; + return this; + } + + /** + * Replace all or part of a matching group label. + * + * @return replace + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPLACE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public HeatgridTextFormatReplace getReplace() { + return replace; + } + + public void setReplace(HeatgridTextFormatReplace replace) { + this.replace = replace; + if (replace != null) { + this.unparsed |= replace.unparsed; + } + } + + /** Return true if this HeatgridTextFormatRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HeatgridTextFormatRule heatgridTextFormatRule = (HeatgridTextFormatRule) o; + return Objects.equals(this.match, heatgridTextFormatRule.match) + && Objects.equals(this.replace, heatgridTextFormatRule.replace); + } + + @Override + public int hashCode() { + return Objects.hash(match, replace); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HeatgridTextFormatRule {\n"); + sb.append(" match: ").append(toIndentedString(match)).append("\n"); + sb.append(" replace: ").append(toIndentedString(replace)).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/HeatgridWidgetDefinition.java b/src/main/java/com/datadog/api/client/v1/model/HeatgridWidgetDefinition.java index 4f7e037a52f..07020064874 100644 --- a/src/main/java/com/datadog/api/client/v1/model/HeatgridWidgetDefinition.java +++ b/src/main/java/com/datadog/api/client/v1/model/HeatgridWidgetDefinition.java @@ -182,7 +182,7 @@ public HeatgridWidgetDefinition labelColumn(HeatgridLabelColumn labelColumn) { } /** - * Configuration of the group label column. + * Configuration of the group label column. Its width is sized automatically when omitted. * * @return labelColumn */ diff --git a/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature b/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature index 311dff9a97a..22ebf82dcfd 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/dashboards.feature @@ -113,6 +113,21 @@ Feature: Dashboards And the response "widgets[0].definition.legend.show_caption" is equal to true And the response "widgets[0].definition.label_column.width" is equal to "m" + @team:ddoghq/dashboards-backend + Scenario: Create a heatgrid widget with bin labels and formatted row labels + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/heatgrid_text_formats_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.color.bins[0].label" is equal to "Normal" + And the response "widgets[0].definition.color.bins[1].label" is equal to "High" + And the response "widgets[0].definition.label_column" does not have field "width" + And the response "widgets[0].definition.label_column.text_formats[0].match.type" is equal to "starts_with" + And the response "widgets[0].definition.label_column.text_formats[0].replace.type" is equal to "substring" + And the response "widgets[0].definition.label_column.text_formats[0].replace.substring" is equal to "api-" + And the response "widgets[0].definition.label_column.text_formats[1].replace.type" is equal to "all" + And the response "widgets[0].definition.label_column.text_formats[1].replace.with" is equal to "Other" + @team:ddoghq/dashboards-backend Scenario: Create a heatgrid widget with custom discrete thresholds Given new "CreateDashboard" request diff --git a/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/heatgrid_text_formats_widget.json b/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/heatgrid_text_formats_widget.json new file mode 100644 index 00000000000..7b8acd2a2d2 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v1/api/dashboards_json_payload/heatgrid_text_formats_widget.json @@ -0,0 +1,48 @@ +{ + "title": "{{ unique }}", + "layout_type": "ordered", + "widgets": [ + { + "definition": { + "type": "heatgrid", + "requests": [ + { + "response_format": "timeseries", + "queries": [ + { + "data_source": "metrics", + "name": "query1", + "query": "avg:system.cpu.user{*} by {host}" + } + ], + "formulas": [{ "formula": "query1" }] + } + ], + "sort": { + "nesting_display": "flat", + "sort_by": { "property": "label", "order": "asc" } + }, + "color": { + "mode": "discrete", + "source": "custom", + "bins": [ + { "color": "#00FF00", "label": "Normal" }, + { "color": "#FF0000", "lower_bound": 80, "label": "High" } + ] + }, + "label_column": { + "text_formats": [ + { + "match": { "type": "starts_with", "value": "api-" }, + "replace": { "type": "substring", "substring": "api-", "with": "" } + }, + { + "match": { "type": "is", "value": "unknown" }, + "replace": { "type": "all", "with": "Other" } + } + ] + } + } + } + ] +} diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index 0ef418e5582..25afa7dc4cd 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -168,6 +168,13 @@ "scenario": "Create a heatgrid widget with a preset gradient", "version": "v1" }, + { + "feature": "Dashboards", + "feature_file": "../../com/datadog/api/client/v1/api/dashboards.feature", + "file": "v1/dashboards/create-a-heatgrid-widget-with-bin-labels-and-formatted-row-labels.json", + "scenario": "Create a heatgrid widget with bin labels and formatted row labels", + "version": "v1" + }, { "feature": "Dashboards", "feature_file": "../../com/datadog/api/client/v1/api/dashboards.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v1/dashboards/create-a-heatgrid-widget-with-bin-labels-and-formatted-row-labels.json b/src/test/resources/generated-test/test-runner-data/v1/dashboards/create-a-heatgrid-widget-with-bin-labels-and-formatted-row-labels.json new file mode 100644 index 00000000000..57b69d1b2ee --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v1/dashboards/create-a-heatgrid-widget-with-bin-labels-and-formatted-row-labels.json @@ -0,0 +1,100 @@ +{ + "api": "Dashboards", + "expected_status": 200, + "feature": "Dashboards", + "id": "v1/Dashboards/Create a heatgrid widget with bin labels and formatted row labels", + "operation_id": "CreateDashboard", + "request": { + "body": { + "schema": { + "format": null, + "ref": "Dashboard", + "type": "object" + }, + "source": "dashboards_json_payload/heatgrid_text_formats_widget.json", + "value": { + "layout_type": "ordered", + "title": "{{ unique }}", + "widgets": [ + { + "definition": { + "color": { + "bins": [ + { + "color": "#00FF00", + "label": "Normal" + }, + { + "color": "#FF0000", + "label": "High", + "lower_bound": 80 + } + ], + "mode": "discrete", + "source": "custom" + }, + "label_column": { + "text_formats": [ + { + "match": { + "type": "starts_with", + "value": "api-" + }, + "replace": { + "substring": "api-", + "type": "substring", + "with": "" + } + }, + { + "match": { + "type": "is", + "value": "unknown" + }, + "replace": { + "type": "all", + "with": "Other" + } + } + ] + }, + "requests": [ + { + "formulas": [ + { + "formula": "query1" + } + ], + "queries": [ + { + "data_source": "metrics", + "name": "query1", + "query": "avg:system.cpu.user{*} by {host}" + } + ], + "response_format": "timeseries" + } + ], + "sort": { + "nesting_display": "flat", + "sort_by": { + "order": "asc", + "property": "label" + } + }, + "type": "heatgrid" + } + } + ] + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v1/dashboard" + }, + "scenario": "Create a heatgrid widget with bin labels and formatted row labels", + "schema_version": 1, + "version": "v1" +} diff --git a/src/test/resources/generated-test/test-server-data/v1/dashboards.json b/src/test/resources/generated-test/test-server-data/v1/dashboards.json index c11782ed7a1..49729f2b376 100644 --- a/src/test/resources/generated-test/test-server-data/v1/dashboards.json +++ b/src/test/resources/generated-test/test-server-data/v1/dashboards.json @@ -849,7 +849,7 @@ "response": { "body": { "encoding": "text", - "value": "{\"id\":\"rws-u2c-xjn\",\"title\":\"Test-Create_a_heatgrid_widget_with_a_preset_gradient-1791492328\",\"description\":null,\"author_handle\":\"test@example.com\",\"author_name\":\"Test User\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/rws-u2c-xjn/test-createaheatgridwidgetwithapresetgradient-1791492328\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"color\":{\"mode\":\"gradient\",\"preset_name\":\"classic\",\"source\":\"preset\"},\"label_column\":{\"width\":\"m\"},\"legend\":{\"show_caption\":true},\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {host}\"}],\"response_format\":\"timeseries\"}],\"sort\":{\"nesting_display\":\"flat\",\"sort_by\":{\"aggregation\":\"avg\",\"order\":\"desc\",\"property\":\"value\"}},\"type\":\"heatgrid\"},\"id\":703699353428571}],\"notify_list\":null,\"created_at\":\"2026-10-08T20:45:28.947012+00:00\",\"modified_at\":\"2026-10-08T20:45:28.947012+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}" + "value": "{\"id\":\"rws-u2c-xjn\",\"title\":\"Test-Create_a_heatgrid_widget_with_a_preset_gradient-1791492328\",\"description\":null,\"author_handle\":\"test@example.com\",\"author_name\":\"Example Name\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/rws-u2c-xjn/test-createaheatgridwidgetwithapresetgradient-1791492328\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"color\":{\"mode\":\"gradient\",\"preset_name\":\"classic\",\"source\":\"preset\"},\"label_column\":{\"width\":\"m\"},\"legend\":{\"show_caption\":true},\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {host}\"}],\"response_format\":\"timeseries\"}],\"sort\":{\"nesting_display\":\"flat\",\"sort_by\":{\"aggregation\":\"avg\",\"order\":\"desc\",\"property\":\"value\"}},\"type\":\"heatgrid\"},\"id\":703699353428571}],\"notify_list\":null,\"created_at\":\"2026-10-08T20:45:28.947012+00:00\",\"modified_at\":\"2026-10-08T20:45:28.947012+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}" }, "headers": { "content-type": "application/json" @@ -885,6 +885,134 @@ "scenario": "Create a heatgrid widget with a preset gradient", "version": "v1" }, + { + "feature": "Dashboards", + "frozen_at": "2026-11-02T20:37:43.231Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "layout_type": "ordered", + "title": "Test-Create_a_heatgrid_widget_with_bin_labels_and_formatted_row_labels-1793651863", + "widgets": [ + { + "definition": { + "color": { + "bins": [ + { + "color": "#00FF00", + "label": "Normal" + }, + { + "color": "#FF0000", + "label": "High", + "lower_bound": 80 + } + ], + "mode": "discrete", + "source": "custom" + }, + "label_column": { + "text_formats": [ + { + "match": { + "type": "starts_with", + "value": "api-" + }, + "replace": { + "substring": "api-", + "type": "substring", + "with": "" + } + }, + { + "match": { + "type": "is", + "value": "unknown" + }, + "replace": { + "type": "all", + "with": "Other" + } + } + ] + }, + "requests": [ + { + "formulas": [ + { + "formula": "query1" + } + ], + "queries": [ + { + "data_source": "metrics", + "name": "query1", + "query": "avg:system.cpu.user{*} by {host}" + } + ], + "response_format": "timeseries" + } + ], + "sort": { + "nesting_display": "flat", + "sort_by": { + "order": "asc", + "property": "label" + } + }, + "type": "heatgrid" + } + } + ] + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v1/dashboard", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"id\":\"6tq-fme-ndk\",\"title\":\"Test-Create_a_heatgrid_widget_with_bin_labels_and_formatted_row_labels-1793651863\",\"description\":null,\"author_handle\":\"test@example.com\",\"author_name\":\"Example Name\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/6tq-fme-ndk/test-createaheatgridwidgetwithbinlabelsandformattedrowlabels-1793651863\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"color\":{\"bins\":[{\"color\":\"#00FF00\",\"label\":\"Normal\"},{\"color\":\"#FF0000\",\"label\":\"High\",\"lower_bound\":80}],\"mode\":\"discrete\",\"source\":\"custom\"},\"label_column\":{\"text_formats\":[{\"match\":{\"type\":\"starts_with\",\"value\":\"api-\"},\"replace\":{\"substring\":\"api-\",\"type\":\"substring\",\"with\":\"\"}},{\"match\":{\"type\":\"is\",\"value\":\"unknown\"},\"replace\":{\"type\":\"all\",\"with\":\"Other\"}}]},\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {host}\"}],\"response_format\":\"timeseries\"}],\"sort\":{\"nesting_display\":\"flat\",\"sort_by\":{\"order\":\"asc\",\"property\":\"label\"}},\"type\":\"heatgrid\"},\"id\":1095468656102212}],\"notify_list\":null,\"created_at\":\"2026-11-02T20:37:43.411584+00:00\",\"modified_at\":\"2026-11-02T20:37:43.411584+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v1/dashboard/6tq-fme-ndk", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"deleted_dashboard_id\":\"6tq-fme-ndk\"}" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "OK", + "status": 200 + } + } + ], + "scenario": "Create a heatgrid widget with bin labels and formatted row labels", + "version": "v1" + }, { "feature": "Dashboards", "frozen_at": "2026-10-08T20:45:29.961Z", @@ -956,7 +1084,7 @@ "response": { "body": { "encoding": "text", - "value": "{\"id\":\"6sq-avw-idr\",\"title\":\"Test-Create_a_heatgrid_widget_with_custom_discrete_thresholds-1791492329\",\"description\":null,\"author_handle\":\"test@example.com\",\"author_name\":\"Test User\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/6sq-avw-idr/test-createaheatgridwidgetwithcustomdiscretethresholds-1791492329\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"color\":{\"bins\":[{\"color\":\"#00FF00\"},{\"color\":\"#FF0000\",\"lower_bound\":80}],\"mode\":\"discrete\",\"source\":\"custom\"},\"label_column\":{\"width\":\"m\"},\"legend\":{\"show_caption\":true},\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {host}\"}],\"response_format\":\"timeseries\"}],\"sort\":{\"nesting_display\":\"flat\",\"sort_by\":{\"order\":\"asc\",\"property\":\"label\"}},\"type\":\"heatgrid\"},\"id\":4032652334995696}],\"notify_list\":null,\"created_at\":\"2026-10-08T20:45:30.208364+00:00\",\"modified_at\":\"2026-10-08T20:45:30.208364+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}" + "value": "{\"id\":\"6sq-avw-idr\",\"title\":\"Test-Create_a_heatgrid_widget_with_custom_discrete_thresholds-1791492329\",\"description\":null,\"author_handle\":\"test@example.com\",\"author_name\":\"Example Name\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/6sq-avw-idr/test-createaheatgridwidgetwithcustomdiscretethresholds-1791492329\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"color\":{\"bins\":[{\"color\":\"#00FF00\"},{\"color\":\"#FF0000\",\"lower_bound\":80}],\"mode\":\"discrete\",\"source\":\"custom\"},\"label_column\":{\"width\":\"m\"},\"legend\":{\"show_caption\":true},\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {host}\"}],\"response_format\":\"timeseries\"}],\"sort\":{\"nesting_display\":\"flat\",\"sort_by\":{\"order\":\"asc\",\"property\":\"label\"}},\"type\":\"heatgrid\"},\"id\":4032652334995696}],\"notify_list\":null,\"created_at\":\"2026-10-08T20:45:30.208364+00:00\",\"modified_at\":\"2026-10-08T20:45:30.208364+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}" }, "headers": { "content-type": "application/json" @@ -1068,7 +1196,7 @@ "response": { "body": { "encoding": "text", - "value": "{\"id\":\"p5v-36u-h29\",\"title\":\"Test-Create_a_heatgrid_widget_with_custom_gradient_colors_for_both_themes-1791492331\",\"description\":null,\"author_handle\":\"test@example.com\",\"author_name\":\"Test User\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/p5v-36u-h29/test-createaheatgridwidgetwithcustomgradientcolorsforboththemes-1791492331\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"color\":{\"mode\":\"gradient\",\"source\":\"custom\",\"stops\":[{\"color\":[\"#FFFFFF\",\"#000000\"],\"position\":0},{\"color\":\"#FF0000\",\"position\":100}]},\"label_column\":{\"width\":\"m\"},\"legend\":{\"show_caption\":true},\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {host}\"}],\"response_format\":\"timeseries\"}],\"sort\":{\"nesting_display\":\"flat\",\"sort_by\":{\"aggregation\":\"avg\",\"order\":\"desc\",\"property\":\"value\"}},\"type\":\"heatgrid\"},\"id\":4644010913884827}],\"notify_list\":null,\"created_at\":\"2026-10-08T20:45:31.439485+00:00\",\"modified_at\":\"2026-10-08T20:45:31.439485+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}" + "value": "{\"id\":\"p5v-36u-h29\",\"title\":\"Test-Create_a_heatgrid_widget_with_custom_gradient_colors_for_both_themes-1791492331\",\"description\":null,\"author_handle\":\"test@example.com\",\"author_name\":\"Example Name\",\"layout_type\":\"ordered\",\"url\":\"/dashboard/p5v-36u-h29/test-createaheatgridwidgetwithcustomgradientcolorsforboththemes-1791492331\",\"template_variables\":null,\"widgets\":[{\"definition\":{\"color\":{\"mode\":\"gradient\",\"source\":\"custom\",\"stops\":[{\"color\":[\"#FFFFFF\",\"#000000\"],\"position\":0},{\"color\":\"#FF0000\",\"position\":100}]},\"label_column\":{\"width\":\"m\"},\"legend\":{\"show_caption\":true},\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {host}\"}],\"response_format\":\"timeseries\"}],\"sort\":{\"nesting_display\":\"flat\",\"sort_by\":{\"aggregation\":\"avg\",\"order\":\"desc\",\"property\":\"value\"}},\"type\":\"heatgrid\"},\"id\":4644010913884827}],\"notify_list\":null,\"created_at\":\"2026-10-08T20:45:31.439485+00:00\",\"modified_at\":\"2026-10-08T20:45:31.439485+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}" }, "headers": { "content-type": "application/json"