From 4d1cf09ac8f5c3364905933d77cb49c744e9f4f9 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 30 Sep 2024 20:18:56 +0000 Subject: [PATCH] Regenerate client from commit 64b1c61a of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 1 - .generator/schemas/v2/openapi.yaml | 44 ---- .../CreateDashboard_1413226400.java | 112 ++++++++ .../CreateSecurityMonitoringRule.java | 11 +- .../client/v1/model/ToplistWidgetStacked.java | 6 +- .../SecurityMonitoringReferenceTable.java | 248 ------------------ .../SecurityMonitoringRuleUpdatePayload.java | 42 --- ...tyMonitoringStandardRuleCreatePayload.java | 43 --- ...SecurityMonitoringStandardRulePayload.java | 43 --- ...ecurityMonitoringStandardRuleResponse.java | 43 --- ...rityMonitoringStandardRuleTestPayload.java | 43 --- ...tacked_type_and_no_legend_specified.freeze | 1 + ..._stacked_type_and_no_legend_specified.json | 58 ++++ ..._detection_rule_returns_OK_response.freeze | 2 +- ..._a_detection_rule_returns_OK_response.json | 10 +- .../api/client/v1/api/dashboards.feature | 13 + .../client/v2/api/security_monitoring.feature | 3 +- 18 files changed, 198 insertions(+), 533 deletions(-) create mode 100644 examples/v1/dashboards/CreateDashboard_1413226400.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringReferenceTable.java create mode 100644 src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified.freeze create mode 100644 src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified.json diff --git a/.apigentools-info b/.apigentools-info index 8f6b751ac5e..f2488127c6b 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-30 19:44:25.543007", - "spec_repo_commit": "909e369c" + "regenerated": "2024-09-30 20:17:21.197466", + "spec_repo_commit": "64b1c61a" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-30 19:44:25.557128", - "spec_repo_commit": "909e369c" + "regenerated": "2024-09-30 20:17:21.212019", + "spec_repo_commit": "64b1c61a" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 6dd7512869d..491af91d2bc 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -17286,7 +17286,6 @@ components: $ref: '#/components/schemas/ToplistWidgetStackedType' required: - type - - legend type: object ToplistWidgetStackedType: default: stacked diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ce325fb6281..fc61f2c6e41 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -19089,25 +19089,6 @@ components: meta: $ref: '#/components/schemas/ResponseMetaAttributes' type: object - SecurityMonitoringReferenceTable: - description: Reference table for the rule. - properties: - checkPresence: - description: Whether to include or exclude the matched values. - type: boolean - columnName: - description: The name of the column in the reference table. - type: string - logFieldPath: - description: The field in the log to match against the reference table. - type: string - ruleQueryName: - description: The name of the rule query to apply the reference table to. - type: string - tableName: - description: The name of the reference table. - type: string - type: object SecurityMonitoringRuleCase: description: Case when signal is generated. properties: @@ -19613,11 +19594,6 @@ components: items: $ref: '#/components/schemas/SecurityMonitoringRuleQuery' type: array - referenceTables: - description: Reference tables for the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringReferenceTable' - type: array tags: description: Tags for generated signals. items: @@ -20322,11 +20298,6 @@ components: items: $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' type: array - referenceTables: - description: Reference tables for the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringReferenceTable' - type: array tags: description: Tags for generated signals. example: @@ -20394,11 +20365,6 @@ components: items: $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' type: array - referenceTables: - description: Reference tables for the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringReferenceTable' - type: array tags: description: Tags for generated signals. example: @@ -20539,11 +20505,6 @@ components: items: $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' type: array - referenceTables: - description: Reference tables for the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringReferenceTable' - type: array tags: description: Tags for generated signals. items: @@ -20608,11 +20569,6 @@ components: items: $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' type: array - referenceTables: - description: Reference tables for the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringReferenceTable' - type: array tags: description: Tags for generated signals. example: diff --git a/examples/v1/dashboards/CreateDashboard_1413226400.java b/examples/v1/dashboards/CreateDashboard_1413226400.java new file mode 100644 index 00000000000..60f8fe07720 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_1413226400.java @@ -0,0 +1,112 @@ +// Create a new dashboard with a toplist widget with stacked type and no legend specified + +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.FormulaAndFunctionMetricAggregation; +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.FormulaAndFunctionResponseFormat; +import com.datadog.api.client.v1.model.GroupType; +import com.datadog.api.client.v1.model.ToplistWidgetDefinition; +import com.datadog.api.client.v1.model.ToplistWidgetDefinitionType; +import com.datadog.api.client.v1.model.ToplistWidgetDisplay; +import com.datadog.api.client.v1.model.ToplistWidgetRequest; +import com.datadog.api.client.v1.model.ToplistWidgetScaling; +import com.datadog.api.client.v1.model.ToplistWidgetStacked; +import com.datadog.api.client.v1.model.ToplistWidgetStackedType; +import com.datadog.api.client.v1.model.ToplistWidgetStyle; +import com.datadog.api.client.v1.model.Widget; +import com.datadog.api.client.v1.model.WidgetDefinition; +import com.datadog.api.client.v1.model.WidgetFormula; +import com.datadog.api.client.v1.model.WidgetGroupSort; +import com.datadog.api.client.v1.model.WidgetLayout; +import com.datadog.api.client.v1.model.WidgetLegacyLiveSpan; +import com.datadog.api.client.v1.model.WidgetSort; +import com.datadog.api.client.v1.model.WidgetSortBy; +import com.datadog.api.client.v1.model.WidgetSortOrderBy; +import com.datadog.api.client.v1.model.WidgetTextAlign; +import com.datadog.api.client.v1.model.WidgetTime; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + DashboardsApi apiInstance = new DashboardsApi(defaultClient); + + Dashboard body = + new Dashboard() + .title("Example-Dashboard") + .description("") + .widgets( + Collections.singletonList( + new Widget() + .layout(new WidgetLayout().x(0L).y(0L).width(47L).height(15L)) + .definition( + new WidgetDefinition( + new ToplistWidgetDefinition() + .title("") + .titleSize("16") + .titleAlign(WidgetTextAlign.LEFT) + .time(new WidgetTime(new WidgetLegacyLiveSpan())) + .style( + new ToplistWidgetStyle() + .display( + new ToplistWidgetDisplay( + new ToplistWidgetStacked() + .type(ToplistWidgetStackedType.STACKED))) + .scaling(ToplistWidgetScaling.RELATIVE) + .palette("dog_classic")) + .type(ToplistWidgetDefinitionType.TOPLIST) + .requests( + Collections.singletonList( + new ToplistWidgetRequest() + .queries( + Collections.singletonList( + new FormulaAndFunctionQueryDefinition( + new FormulaAndFunctionMetricQueryDefinition() + .dataSource( + FormulaAndFunctionMetricDataSource + .METRICS) + .name("query1") + .query( + "avg:system.cpu.user{*} by" + + " {service}") + .aggregator( + FormulaAndFunctionMetricAggregation + .AVG)))) + .formulas( + Collections.singletonList( + new WidgetFormula().formula("query1"))) + .sort( + new WidgetSortBy() + .count(10L) + .orderBy( + Collections.singletonList( + new WidgetSortOrderBy( + new WidgetGroupSort() + .type(GroupType.GROUP) + .name("service") + .order( + WidgetSort + .ASCENDING))))) + .responseFormat( + FormulaAndFunctionResponseFormat.SCALAR))))))) + .layoutType(DashboardLayoutType.FREE) + .isReadOnly(false); + + 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/examples/v2/security-monitoring/CreateSecurityMonitoringRule.java b/examples/v2/security-monitoring/CreateSecurityMonitoringRule.java index b4cda43503b..0aa5b13e01a 100644 --- a/examples/v2/security-monitoring/CreateSecurityMonitoringRule.java +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringRule.java @@ -3,7 +3,6 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.SecurityMonitoringApi; -import com.datadog.api.client.v2.model.SecurityMonitoringReferenceTable; import com.datadog.api.client.v2.model.SecurityMonitoringRuleCaseCreate; import com.datadog.api.client.v2.model.SecurityMonitoringRuleCreatePayload; import com.datadog.api.client.v2.model.SecurityMonitoringRuleEvaluationWindow; @@ -46,15 +45,7 @@ public static void main(String[] args) { .maxSignalDuration(SecurityMonitoringRuleMaxSignalDuration.ONE_DAY)) .message("Test rule") .isEnabled(true) - .type(SecurityMonitoringRuleTypeCreate.LOG_DETECTION) - .referenceTables( - Collections.singletonList( - new SecurityMonitoringReferenceTable() - .tableName("synthetics_test_reference_table_dont_delete") - .columnName("value") - .logFieldPath("testtag") - .checkPresence(true) - .ruleQueryName("a")))); + .type(SecurityMonitoringRuleTypeCreate.LOG_DETECTION)); try { SecurityMonitoringRuleResponse result = apiInstance.createSecurityMonitoringRule(body); diff --git a/src/main/java/com/datadog/api/client/v1/model/ToplistWidgetStacked.java b/src/main/java/com/datadog/api/client/v1/model/ToplistWidgetStacked.java index 58e853d9ca3..c449f26cec2 100644 --- a/src/main/java/com/datadog/api/client/v1/model/ToplistWidgetStacked.java +++ b/src/main/java/com/datadog/api/client/v1/model/ToplistWidgetStacked.java @@ -36,10 +36,7 @@ public ToplistWidgetStacked() {} @JsonCreator public ToplistWidgetStacked( - @JsonProperty(required = true, value = JSON_PROPERTY_LEGEND) ToplistWidgetLegend legend, @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) ToplistWidgetStackedType type) { - this.legend = legend; - this.unparsed |= !legend.isValid(); this.type = type; this.unparsed |= !type.isValid(); } @@ -55,8 +52,9 @@ public ToplistWidgetStacked legend(ToplistWidgetLegend legend) { * * @return legend */ + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_LEGEND) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public ToplistWidgetLegend getLegend() { return legend; } diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringReferenceTable.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringReferenceTable.java deleted file mode 100644 index 99a70ba64c5..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringReferenceTable.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * 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.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.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Reference table for the rule. */ -@JsonPropertyOrder({ - SecurityMonitoringReferenceTable.JSON_PROPERTY_CHECK_PRESENCE, - SecurityMonitoringReferenceTable.JSON_PROPERTY_COLUMN_NAME, - SecurityMonitoringReferenceTable.JSON_PROPERTY_LOG_FIELD_PATH, - SecurityMonitoringReferenceTable.JSON_PROPERTY_RULE_QUERY_NAME, - SecurityMonitoringReferenceTable.JSON_PROPERTY_TABLE_NAME -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class SecurityMonitoringReferenceTable { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_CHECK_PRESENCE = "checkPresence"; - private Boolean checkPresence; - - public static final String JSON_PROPERTY_COLUMN_NAME = "columnName"; - private String columnName; - - public static final String JSON_PROPERTY_LOG_FIELD_PATH = "logFieldPath"; - private String logFieldPath; - - public static final String JSON_PROPERTY_RULE_QUERY_NAME = "ruleQueryName"; - private String ruleQueryName; - - public static final String JSON_PROPERTY_TABLE_NAME = "tableName"; - private String tableName; - - public SecurityMonitoringReferenceTable checkPresence(Boolean checkPresence) { - this.checkPresence = checkPresence; - return this; - } - - /** - * Whether to include or exclude the matched values. - * - * @return checkPresence - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CHECK_PRESENCE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getCheckPresence() { - return checkPresence; - } - - public void setCheckPresence(Boolean checkPresence) { - this.checkPresence = checkPresence; - } - - public SecurityMonitoringReferenceTable columnName(String columnName) { - this.columnName = columnName; - return this; - } - - /** - * The name of the column in the reference table. - * - * @return columnName - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_COLUMN_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getColumnName() { - return columnName; - } - - public void setColumnName(String columnName) { - this.columnName = columnName; - } - - public SecurityMonitoringReferenceTable logFieldPath(String logFieldPath) { - this.logFieldPath = logFieldPath; - return this; - } - - /** - * The field in the log to match against the reference table. - * - * @return logFieldPath - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LOG_FIELD_PATH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLogFieldPath() { - return logFieldPath; - } - - public void setLogFieldPath(String logFieldPath) { - this.logFieldPath = logFieldPath; - } - - public SecurityMonitoringReferenceTable ruleQueryName(String ruleQueryName) { - this.ruleQueryName = ruleQueryName; - return this; - } - - /** - * The name of the rule query to apply the reference table to. - * - * @return ruleQueryName - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_RULE_QUERY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRuleQueryName() { - return ruleQueryName; - } - - public void setRuleQueryName(String ruleQueryName) { - this.ruleQueryName = ruleQueryName; - } - - public SecurityMonitoringReferenceTable tableName(String tableName) { - this.tableName = tableName; - return this; - } - - /** - * The name of the reference table. - * - * @return tableName - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TABLE_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTableName() { - return tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - /** - * 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 SecurityMonitoringReferenceTable - */ - @JsonAnySetter - public SecurityMonitoringReferenceTable 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 SecurityMonitoringReferenceTable object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SecurityMonitoringReferenceTable securityMonitoringReferenceTable = - (SecurityMonitoringReferenceTable) o; - return Objects.equals(this.checkPresence, securityMonitoringReferenceTable.checkPresence) - && Objects.equals(this.columnName, securityMonitoringReferenceTable.columnName) - && Objects.equals(this.logFieldPath, securityMonitoringReferenceTable.logFieldPath) - && Objects.equals(this.ruleQueryName, securityMonitoringReferenceTable.ruleQueryName) - && Objects.equals(this.tableName, securityMonitoringReferenceTable.tableName) - && Objects.equals( - this.additionalProperties, securityMonitoringReferenceTable.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - checkPresence, columnName, logFieldPath, ruleQueryName, tableName, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SecurityMonitoringReferenceTable {\n"); - sb.append(" checkPresence: ").append(toIndentedString(checkPresence)).append("\n"); - sb.append(" columnName: ").append(toIndentedString(columnName)).append("\n"); - sb.append(" logFieldPath: ").append(toIndentedString(logFieldPath)).append("\n"); - sb.append(" ruleQueryName: ").append(toIndentedString(ruleQueryName)).append("\n"); - sb.append(" tableName: ").append(toIndentedString(tableName)).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/v2/model/SecurityMonitoringRuleUpdatePayload.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleUpdatePayload.java index dc76281775b..8777f987249 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleUpdatePayload.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringRuleUpdatePayload.java @@ -29,7 +29,6 @@ SecurityMonitoringRuleUpdatePayload.JSON_PROPERTY_NAME, SecurityMonitoringRuleUpdatePayload.JSON_PROPERTY_OPTIONS, SecurityMonitoringRuleUpdatePayload.JSON_PROPERTY_QUERIES, - SecurityMonitoringRuleUpdatePayload.JSON_PROPERTY_REFERENCE_TABLES, SecurityMonitoringRuleUpdatePayload.JSON_PROPERTY_TAGS, SecurityMonitoringRuleUpdatePayload.JSON_PROPERTY_THIRD_PARTY_CASES, SecurityMonitoringRuleUpdatePayload.JSON_PROPERTY_VERSION @@ -65,9 +64,6 @@ public class SecurityMonitoringRuleUpdatePayload { public static final String JSON_PROPERTY_QUERIES = "queries"; private List queries = null; - public static final String JSON_PROPERTY_REFERENCE_TABLES = "referenceTables"; - private List referenceTables = null; - public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -308,41 +304,6 @@ public void setQueries(List queries) { this.queries = queries; } - public SecurityMonitoringRuleUpdatePayload referenceTables( - List referenceTables) { - this.referenceTables = referenceTables; - for (SecurityMonitoringReferenceTable item : referenceTables) { - this.unparsed |= item.unparsed; - } - return this; - } - - public SecurityMonitoringRuleUpdatePayload addReferenceTablesItem( - SecurityMonitoringReferenceTable referenceTablesItem) { - if (this.referenceTables == null) { - this.referenceTables = new ArrayList<>(); - } - this.referenceTables.add(referenceTablesItem); - this.unparsed |= referenceTablesItem.unparsed; - return this; - } - - /** - * Reference tables for the rule. - * - * @return referenceTables - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REFERENCE_TABLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getReferenceTables() { - return referenceTables; - } - - public void setReferenceTables(List referenceTables) { - this.referenceTables = referenceTables; - } - public SecurityMonitoringRuleUpdatePayload tags(List tags) { this.tags = tags; return this; @@ -497,7 +458,6 @@ public boolean equals(Object o) { && Objects.equals(this.name, securityMonitoringRuleUpdatePayload.name) && Objects.equals(this.options, securityMonitoringRuleUpdatePayload.options) && Objects.equals(this.queries, securityMonitoringRuleUpdatePayload.queries) - && Objects.equals(this.referenceTables, securityMonitoringRuleUpdatePayload.referenceTables) && Objects.equals(this.tags, securityMonitoringRuleUpdatePayload.tags) && Objects.equals(this.thirdPartyCases, securityMonitoringRuleUpdatePayload.thirdPartyCases) && Objects.equals(this.version, securityMonitoringRuleUpdatePayload.version) @@ -517,7 +477,6 @@ public int hashCode() { name, options, queries, - referenceTables, tags, thirdPartyCases, version, @@ -539,7 +498,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" queries: ").append(toIndentedString(queries)).append("\n"); - sb.append(" referenceTables: ").append(toIndentedString(referenceTables)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" thirdPartyCases: ").append(toIndentedString(thirdPartyCases)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleCreatePayload.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleCreatePayload.java index 6ec313caf52..982adc3aa11 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleCreatePayload.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleCreatePayload.java @@ -29,7 +29,6 @@ SecurityMonitoringStandardRuleCreatePayload.JSON_PROPERTY_NAME, SecurityMonitoringStandardRuleCreatePayload.JSON_PROPERTY_OPTIONS, SecurityMonitoringStandardRuleCreatePayload.JSON_PROPERTY_QUERIES, - SecurityMonitoringStandardRuleCreatePayload.JSON_PROPERTY_REFERENCE_TABLES, SecurityMonitoringStandardRuleCreatePayload.JSON_PROPERTY_TAGS, SecurityMonitoringStandardRuleCreatePayload.JSON_PROPERTY_THIRD_PARTY_CASES, SecurityMonitoringStandardRuleCreatePayload.JSON_PROPERTY_TYPE @@ -62,9 +61,6 @@ public class SecurityMonitoringStandardRuleCreatePayload { public static final String JSON_PROPERTY_QUERIES = "queries"; private List queries = new ArrayList<>(); - public static final String JSON_PROPERTY_REFERENCE_TABLES = "referenceTables"; - private List referenceTables = null; - public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -297,41 +293,6 @@ public void setQueries(List queries) { this.queries = queries; } - public SecurityMonitoringStandardRuleCreatePayload referenceTables( - List referenceTables) { - this.referenceTables = referenceTables; - for (SecurityMonitoringReferenceTable item : referenceTables) { - this.unparsed |= item.unparsed; - } - return this; - } - - public SecurityMonitoringStandardRuleCreatePayload addReferenceTablesItem( - SecurityMonitoringReferenceTable referenceTablesItem) { - if (this.referenceTables == null) { - this.referenceTables = new ArrayList<>(); - } - this.referenceTables.add(referenceTablesItem); - this.unparsed |= referenceTablesItem.unparsed; - return this; - } - - /** - * Reference tables for the rule. - * - * @return referenceTables - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REFERENCE_TABLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getReferenceTables() { - return referenceTables; - } - - public void setReferenceTables(List referenceTables) { - this.referenceTables = referenceTables; - } - public SecurityMonitoringStandardRuleCreatePayload tags(List tags) { this.tags = tags; return this; @@ -488,8 +449,6 @@ public boolean equals(Object o) { && Objects.equals(this.name, securityMonitoringStandardRuleCreatePayload.name) && Objects.equals(this.options, securityMonitoringStandardRuleCreatePayload.options) && Objects.equals(this.queries, securityMonitoringStandardRuleCreatePayload.queries) - && Objects.equals( - this.referenceTables, securityMonitoringStandardRuleCreatePayload.referenceTables) && Objects.equals(this.tags, securityMonitoringStandardRuleCreatePayload.tags) && Objects.equals( this.thirdPartyCases, securityMonitoringStandardRuleCreatePayload.thirdPartyCases) @@ -510,7 +469,6 @@ public int hashCode() { name, options, queries, - referenceTables, tags, thirdPartyCases, type, @@ -529,7 +487,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" queries: ").append(toIndentedString(queries)).append("\n"); - sb.append(" referenceTables: ").append(toIndentedString(referenceTables)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" thirdPartyCases: ").append(toIndentedString(thirdPartyCases)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRulePayload.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRulePayload.java index 783ac32541c..9466ad0dcfe 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRulePayload.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRulePayload.java @@ -29,7 +29,6 @@ SecurityMonitoringStandardRulePayload.JSON_PROPERTY_NAME, SecurityMonitoringStandardRulePayload.JSON_PROPERTY_OPTIONS, SecurityMonitoringStandardRulePayload.JSON_PROPERTY_QUERIES, - SecurityMonitoringStandardRulePayload.JSON_PROPERTY_REFERENCE_TABLES, SecurityMonitoringStandardRulePayload.JSON_PROPERTY_TAGS, SecurityMonitoringStandardRulePayload.JSON_PROPERTY_THIRD_PARTY_CASES, SecurityMonitoringStandardRulePayload.JSON_PROPERTY_TYPE @@ -62,9 +61,6 @@ public class SecurityMonitoringStandardRulePayload { public static final String JSON_PROPERTY_QUERIES = "queries"; private List queries = new ArrayList<>(); - public static final String JSON_PROPERTY_REFERENCE_TABLES = "referenceTables"; - private List referenceTables = null; - public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -294,41 +290,6 @@ public void setQueries(List queries) { this.queries = queries; } - public SecurityMonitoringStandardRulePayload referenceTables( - List referenceTables) { - this.referenceTables = referenceTables; - for (SecurityMonitoringReferenceTable item : referenceTables) { - this.unparsed |= item.unparsed; - } - return this; - } - - public SecurityMonitoringStandardRulePayload addReferenceTablesItem( - SecurityMonitoringReferenceTable referenceTablesItem) { - if (this.referenceTables == null) { - this.referenceTables = new ArrayList<>(); - } - this.referenceTables.add(referenceTablesItem); - this.unparsed |= referenceTablesItem.unparsed; - return this; - } - - /** - * Reference tables for the rule. - * - * @return referenceTables - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REFERENCE_TABLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getReferenceTables() { - return referenceTables; - } - - public void setReferenceTables(List referenceTables) { - this.referenceTables = referenceTables; - } - public SecurityMonitoringStandardRulePayload tags(List tags) { this.tags = tags; return this; @@ -484,8 +445,6 @@ public boolean equals(Object o) { && Objects.equals(this.name, securityMonitoringStandardRulePayload.name) && Objects.equals(this.options, securityMonitoringStandardRulePayload.options) && Objects.equals(this.queries, securityMonitoringStandardRulePayload.queries) - && Objects.equals( - this.referenceTables, securityMonitoringStandardRulePayload.referenceTables) && Objects.equals(this.tags, securityMonitoringStandardRulePayload.tags) && Objects.equals( this.thirdPartyCases, securityMonitoringStandardRulePayload.thirdPartyCases) @@ -505,7 +464,6 @@ public int hashCode() { name, options, queries, - referenceTables, tags, thirdPartyCases, type, @@ -524,7 +482,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" queries: ").append(toIndentedString(queries)).append("\n"); - sb.append(" referenceTables: ").append(toIndentedString(referenceTables)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" thirdPartyCases: ").append(toIndentedString(thirdPartyCases)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleResponse.java index 870df2636fd..05c1bad00b1 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleResponse.java @@ -36,7 +36,6 @@ SecurityMonitoringStandardRuleResponse.JSON_PROPERTY_NAME, SecurityMonitoringStandardRuleResponse.JSON_PROPERTY_OPTIONS, SecurityMonitoringStandardRuleResponse.JSON_PROPERTY_QUERIES, - SecurityMonitoringStandardRuleResponse.JSON_PROPERTY_REFERENCE_TABLES, SecurityMonitoringStandardRuleResponse.JSON_PROPERTY_TAGS, SecurityMonitoringStandardRuleResponse.JSON_PROPERTY_THIRD_PARTY_CASES, SecurityMonitoringStandardRuleResponse.JSON_PROPERTY_TYPE, @@ -95,9 +94,6 @@ public class SecurityMonitoringStandardRuleResponse { public static final String JSON_PROPERTY_QUERIES = "queries"; private List queries = null; - public static final String JSON_PROPERTY_REFERENCE_TABLES = "referenceTables"; - private List referenceTables = null; - public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -501,41 +497,6 @@ public void setQueries(List queries) { this.queries = queries; } - public SecurityMonitoringStandardRuleResponse referenceTables( - List referenceTables) { - this.referenceTables = referenceTables; - for (SecurityMonitoringReferenceTable item : referenceTables) { - this.unparsed |= item.unparsed; - } - return this; - } - - public SecurityMonitoringStandardRuleResponse addReferenceTablesItem( - SecurityMonitoringReferenceTable referenceTablesItem) { - if (this.referenceTables == null) { - this.referenceTables = new ArrayList<>(); - } - this.referenceTables.add(referenceTablesItem); - this.unparsed |= referenceTablesItem.unparsed; - return this; - } - - /** - * Reference tables for the rule. - * - * @return referenceTables - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REFERENCE_TABLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getReferenceTables() { - return referenceTables; - } - - public void setReferenceTables(List referenceTables) { - this.referenceTables = referenceTables; - } - public SecurityMonitoringStandardRuleResponse tags(List tags) { this.tags = tags; return this; @@ -745,8 +706,6 @@ public boolean equals(Object o) { && Objects.equals(this.name, securityMonitoringStandardRuleResponse.name) && Objects.equals(this.options, securityMonitoringStandardRuleResponse.options) && Objects.equals(this.queries, securityMonitoringStandardRuleResponse.queries) - && Objects.equals( - this.referenceTables, securityMonitoringStandardRuleResponse.referenceTables) && Objects.equals(this.tags, securityMonitoringStandardRuleResponse.tags) && Objects.equals( this.thirdPartyCases, securityMonitoringStandardRuleResponse.thirdPartyCases) @@ -777,7 +736,6 @@ public int hashCode() { name, options, queries, - referenceTables, tags, thirdPartyCases, type, @@ -808,7 +766,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" queries: ").append(toIndentedString(queries)).append("\n"); - sb.append(" referenceTables: ").append(toIndentedString(referenceTables)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" thirdPartyCases: ").append(toIndentedString(thirdPartyCases)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleTestPayload.java b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleTestPayload.java index e1854c8cdeb..04621b1fad4 100644 --- a/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleTestPayload.java +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityMonitoringStandardRuleTestPayload.java @@ -29,7 +29,6 @@ SecurityMonitoringStandardRuleTestPayload.JSON_PROPERTY_NAME, SecurityMonitoringStandardRuleTestPayload.JSON_PROPERTY_OPTIONS, SecurityMonitoringStandardRuleTestPayload.JSON_PROPERTY_QUERIES, - SecurityMonitoringStandardRuleTestPayload.JSON_PROPERTY_REFERENCE_TABLES, SecurityMonitoringStandardRuleTestPayload.JSON_PROPERTY_TAGS, SecurityMonitoringStandardRuleTestPayload.JSON_PROPERTY_THIRD_PARTY_CASES, SecurityMonitoringStandardRuleTestPayload.JSON_PROPERTY_TYPE @@ -62,9 +61,6 @@ public class SecurityMonitoringStandardRuleTestPayload { public static final String JSON_PROPERTY_QUERIES = "queries"; private List queries = new ArrayList<>(); - public static final String JSON_PROPERTY_REFERENCE_TABLES = "referenceTables"; - private List referenceTables = null; - public static final String JSON_PROPERTY_TAGS = "tags"; private List tags = null; @@ -295,41 +291,6 @@ public void setQueries(List queries) { this.queries = queries; } - public SecurityMonitoringStandardRuleTestPayload referenceTables( - List referenceTables) { - this.referenceTables = referenceTables; - for (SecurityMonitoringReferenceTable item : referenceTables) { - this.unparsed |= item.unparsed; - } - return this; - } - - public SecurityMonitoringStandardRuleTestPayload addReferenceTablesItem( - SecurityMonitoringReferenceTable referenceTablesItem) { - if (this.referenceTables == null) { - this.referenceTables = new ArrayList<>(); - } - this.referenceTables.add(referenceTablesItem); - this.unparsed |= referenceTablesItem.unparsed; - return this; - } - - /** - * Reference tables for the rule. - * - * @return referenceTables - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REFERENCE_TABLES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getReferenceTables() { - return referenceTables; - } - - public void setReferenceTables(List referenceTables) { - this.referenceTables = referenceTables; - } - public SecurityMonitoringStandardRuleTestPayload tags(List tags) { this.tags = tags; return this; @@ -485,8 +446,6 @@ public boolean equals(Object o) { && Objects.equals(this.name, securityMonitoringStandardRuleTestPayload.name) && Objects.equals(this.options, securityMonitoringStandardRuleTestPayload.options) && Objects.equals(this.queries, securityMonitoringStandardRuleTestPayload.queries) - && Objects.equals( - this.referenceTables, securityMonitoringStandardRuleTestPayload.referenceTables) && Objects.equals(this.tags, securityMonitoringStandardRuleTestPayload.tags) && Objects.equals( this.thirdPartyCases, securityMonitoringStandardRuleTestPayload.thirdPartyCases) @@ -507,7 +466,6 @@ public int hashCode() { name, options, queries, - referenceTables, tags, thirdPartyCases, type, @@ -526,7 +484,6 @@ public String toString() { sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); sb.append(" queries: ").append(toIndentedString(queries)).append("\n"); - sb.append(" referenceTables: ").append(toIndentedString(referenceTables)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" thirdPartyCases: ").append(toIndentedString(thirdPartyCases)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified.freeze b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified.freeze new file mode 100644 index 00000000000..c40abfc0924 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified.freeze @@ -0,0 +1 @@ +2024-09-30T20:07:23.366Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified.json b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified.json new file mode 100644 index 00000000000..35a333647d7 --- /dev/null +++ b/src/test/resources/cassettes/features/v1/Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"description\":\"\",\"is_read_only\":false,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified-1727726843\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":10,\"order_by\":[{\"name\":\"service\",\"order\":\"asc\",\"type\":\"group\"}]}}],\"style\":{\"display\":{\"type\":\"stacked\"},\"palette\":\"dog_classic\",\"scaling\":\"relative\"},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"toplist\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v1/dashboard", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"id\":\"6mi-b8f-mty\",\"title\":\"Test-Create_a_new_dashboard_with_a_toplist_widget_with_stacked_type_and_no_legend_specified-1727726843\",\"description\":\"\",\"author_handle\":\"frog@datadoghq.com\",\"author_name\":null,\"layout_type\":\"free\",\"url\":\"/dashboard/6mi-b8f-mty/test-createanewdashboardwithatoplistwidgetwithstackedtypeandnolegendspecified-17\",\"is_read_only\":false,\"template_variables\":[],\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\"}],\"queries\":[{\"aggregator\":\"avg\",\"data_source\":\"metrics\",\"name\":\"query1\",\"query\":\"avg:system.cpu.user{*} by {service}\"}],\"response_format\":\"scalar\",\"sort\":{\"count\":10,\"order_by\":[{\"name\":\"service\",\"order\":\"asc\",\"type\":\"group\"}]}}],\"style\":{\"display\":{\"type\":\"stacked\"},\"palette\":\"dog_classic\",\"scaling\":\"relative\"},\"time\":{},\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"toplist\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0},\"id\":3930262956836651}],\"notify_list\":[],\"created_at\":\"2024-09-30T20:07:23.641078+00:00\",\"modified_at\":\"2024-09-30T20:07:23.641078+00:00\",\"experience_type\":\"default\",\"restricted_roles\":[]}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3a789182-0dd4-3c06-5c54-77a4b9c3c5f8" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v1/dashboard/6mi-b8f-mty", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"deleted_dashboard_id\":\"6mi-b8f-mty\"}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e35b33e8-8546-82d7-1a75-4ea4828ad74b" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_detection_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_detection_rule_returns_OK_response.freeze index 76923cce50c..701307e250d 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_detection_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_a_detection_rule_returns_OK_response.freeze @@ -1 +1 @@ -2024-09-11T18:14:46.491Z \ No newline at end of file +2024-05-10T16:34:28.650Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_detection_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_a_detection_rule_returns_OK_response.json index 4fe8e103ef2..2c389549063 100644 --- a/src/test/resources/cassettes/features/v2/Create_a_detection_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_a_detection_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1726078486\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"referenceTables\":[{\"checkPresence\":true,\"columnName\":\"value\",\"logFieldPath\":\"testtag\",\"ruleQueryName\":\"a\",\"tableName\":\"synthetics_test_reference_table_dont_delete\"}],\"tags\":[],\"type\":\"log_detection\"}" + "json": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1715358868\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"id\":\"5br-mto-gse\",\"version\":1,\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1726078486\",\"createdAt\":1726078486689,\"creationAuthorId\":1445416,\"isDefault\":false,\"isPartner\":false,\"isEnabled\":true,\"isBeta\":false,\"isDeleted\":false,\"isDeprecated\":false,\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"hasOptionalGroupByFields\":false,\"distinctFields\":[],\"aggregation\":\"count\",\"name\":\"\"}],\"options\":{\"keepAlive\":3600,\"maxSignalDuration\":86400,\"detectionMethod\":\"threshold\",\"evaluationWindow\":900},\"cases\":[{\"name\":\"\",\"status\":\"info\",\"notifications\":[],\"condition\":\"a > 0\"}],\"message\":\"Test rule\",\"tags\":[],\"hasExtendedTitle\":false,\"type\":\"log_detection\",\"filters\":[],\"referenceTables\":[{\"tableName\":\"synthetics_test_reference_table_dont_delete\",\"columnName\":\"value\",\"logFieldPath\":\"testtag\",\"checkPresence\":true,\"ruleQueryName\":\"a\"}]}\n", + "body": "{\"id\":\"oka-fqr-yqa\",\"version\":1,\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1715358868\",\"createdAt\":1715358869030,\"creationAuthorId\":1445416,\"isDefault\":false,\"isPartner\":false,\"isEnabled\":true,\"isDeleted\":false,\"isDeprecated\":false,\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"hasOptionalGroupByFields\":false,\"distinctFields\":[],\"aggregation\":\"count\",\"name\":\"\"}],\"options\":{\"keepAlive\":3600,\"maxSignalDuration\":86400,\"detectionMethod\":\"threshold\",\"evaluationWindow\":900},\"cases\":[{\"name\":\"\",\"status\":\"info\",\"notifications\":[],\"condition\":\"a > 0\"}],\"message\":\"Test rule\",\"tags\":[],\"hasExtendedTitle\":false,\"type\":\"log_detection\",\"filters\":[]}\n", "headers": { "Content-Type": [ "application/json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "f8352665-e30f-0244-9026-0f076be3c3ad" + "id": "8974582a-809b-b984-6681-70c6d78aa628" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/security_monitoring/rules/5br-mto-gse", + "path": "/api/v2/security_monitoring/rules/oka-fqr-yqa", "keepAlive": false, "secure": true }, @@ -48,6 +48,6 @@ "timeToLive": { "unlimited": true }, - "id": "6f7f32a6-451f-8497-3279-78c8caa8ef34" + "id": "d3f91398-44fe-094a-07db-3845650a283b" } ] \ No newline at end of file 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 de855fec2dd..6ecf109eb06 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 @@ -206,6 +206,19 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "group" And the response "widgets[0].definition.requests[0].sort.order_by[0].name" is equal to "service" + @team:DataDog/dashboards-backend + Scenario: Create a new dashboard with a toplist widget with stacked type and no legend specified + Given new "CreateDashboard" request + And body with value {"title":"{{ unique }}","description":"","widgets":[{"layout":{"x":0,"y":0,"width":47,"height":15},"definition":{"title":"","title_size":"16","title_align":"left","time":{},"style":{"display": {"type": "stacked"},"scaling": "relative","palette": "dog_classic"},"type":"toplist","requests":[{"queries":[{"data_source":"metrics","name":"query1","query":"avg:system.cpu.user{*} by {service}","aggregator":"avg"}],"formulas":[{"formula":"query1"}],"sort":{"count":10,"order_by":[{"type":"group","name":"service","order":"asc"}]},"response_format":"scalar"}]}}],"template_variables":[],"layout_type":"free","is_read_only":false,"notify_list":[]} + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "toplist" + And the response "widgets[0].definition.requests[0].sort.order_by[0].order" is equal to "asc" + And the response "widgets[0].definition.requests[0].sort.order_by[0].type" is equal to "group" + And the response "widgets[0].definition.requests[0].sort.order_by[0].name" is equal to "service" + And the response "widgets[0].definition.style.display.type" is equal to "stacked" + And the response "widgets[0].definition.style.display.legend" is equal to null + @team:DataDog/dashboards-backend Scenario: Create a new dashboard with alert_graph widget Given there is a valid "monitor" in the system diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index 27e45dd3c2b..dc66166540c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature @@ -123,13 +123,12 @@ Feature: Security Monitoring @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule returns "OK" response Given new "CreateSecurityMonitoringRule" request - And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection", "referenceTables":[{"tableName": "synthetics_test_reference_table_dont_delete", "columnName": "value", "logFieldPath":"testtag", "checkPresence":true, "ruleQueryName":"a"}]} + And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection"} When the request is sent Then the response status is 200 OK And the response "name" is equal to "{{ unique }}" And the response "type" is equal to "log_detection" And the response "message" is equal to "Test rule" - And the response "referenceTables" is equal to [{"tableName": "synthetics_test_reference_table_dont_delete", "columnName": "value", "logFieldPath":"testtag", "checkPresence":true, "ruleQueryName":"a"}] @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule with detection method 'third_party' returns "OK" response