diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a27042d9b8f..eb8fb19b9f3 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -7475,89 +7475,23 @@ components: properties: data: items: - $ref: '#/components/schemas/TableRowResourceIdentifier' + $ref: '#/components/schemas/BatchDeleteRowsRequestData' maxItems: 200 type: array required: - data type: object - BatchRowsQueryDataType: - default: reference-tables-batch-rows-query - description: Resource type identifier for batch queries of reference table rows. - enum: - - reference-tables-batch-rows-query - example: reference-tables-batch-rows-query - type: string - x-enum-varnames: - - REFERENCE_TABLES_BATCH_ROWS_QUERY - BatchRowsQueryRequest: - properties: - data: - $ref: '#/components/schemas/BatchRowsQueryRequestData' - type: object - BatchRowsQueryRequestData: - properties: - attributes: - $ref: '#/components/schemas/BatchRowsQueryRequestDataAttributes' - type: - $ref: '#/components/schemas/BatchRowsQueryDataType' - required: - - type - type: object - BatchRowsQueryRequestDataAttributes: - properties: - row_ids: - example: - - row_id_1 - - row_id_2 - items: - type: string - type: array - table_id: - example: 00000000-0000-0000-0000-000000000000 - type: string - required: - - row_ids - - table_id - type: object - BatchRowsQueryResponse: - example: - data: - id: 00000000-0000-0000-0000-000000000000 - relationships: - rows: - data: - - id: row_id_1 - type: row - - id: row_id_2 - type: row - type: reference-tables-batch-rows-query - properties: - data: - $ref: '#/components/schemas/BatchRowsQueryResponseData' - type: object - BatchRowsQueryResponseData: + BatchDeleteRowsRequestData: + description: Row resource containing a single row identifier for deletion. properties: id: + example: primary_key_value type: string - relationships: - $ref: '#/components/schemas/BatchRowsQueryResponseDataRelationships' type: - $ref: '#/components/schemas/BatchRowsQueryDataType' + $ref: '#/components/schemas/TableRowResourceDataType' required: - type - type: object - BatchRowsQueryResponseDataRelationships: - properties: - rows: - $ref: '#/components/schemas/BatchRowsQueryResponseDataRelationshipsRows' - type: object - BatchRowsQueryResponseDataRelationshipsRows: - properties: - data: - items: - $ref: '#/components/schemas/TableRowResourceIdentifier' - type: array + - id type: object BatchUpsertRowsRequestArray: description: The request body for creating or updating multiple rows into a @@ -21037,6 +20971,29 @@ components: type: string type: array type: object + DeploymentRuleOptionsFaultyDeploymentDetectionResponse: + additionalProperties: false + description: Faulty deployment detection options returned in deployment rule + responses. The `excluded_resources` field is always present, which allows + disambiguating this type from monitor options when both share a `duration` + field. + properties: + duration: + description: The duration for faulty deployment detection. + example: 3600 + format: int64 + type: integer + excluded_resources: + description: Resources to exclude from faulty deployment detection. + example: + - resource1 + - resource2 + items: + type: string + type: array + required: + - excluded_resources + type: object DeploymentRuleOptionsMonitor: additionalProperties: false description: Monitor options for deployment rules. @@ -21099,7 +21056,7 @@ components: example: My deployment rule type: string options: - $ref: '#/components/schemas/DeploymentRulesOptions' + $ref: '#/components/schemas/DeploymentRulesOptionsResponse' type: $ref: '#/components/schemas/DeploymentRuleResponseDataAttributesType' updated_at: @@ -21164,11 +21121,18 @@ components: - id type: object DeploymentRulesOptions: - description: Options for deployment rule response representing either faulty + description: Options for deployment rule requests representing either faulty deployment detection or monitor options. oneOf: - $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetection' - $ref: '#/components/schemas/DeploymentRuleOptionsMonitor' + DeploymentRulesOptionsResponse: + description: Options returned in deployment rule responses representing either + faulty deployment detection or monitor options. Faulty deployment detection + responses always include `excluded_resources`, making the two variants unambiguous. + oneOf: + - $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetectionResponse' + - $ref: '#/components/schemas/DeploymentRuleOptionsMonitor' DetachCaseRequest: description: Request for detaching security findings from their case. properties: @@ -67019,18 +66983,6 @@ components: type: string x-enum-varnames: - ROW - TableRowResourceIdentifier: - description: Row resource containing a single row identifier. - properties: - id: - example: primary_key_value - type: string - type: - $ref: '#/components/schemas/TableRowResourceDataType' - required: - - type - - id - type: object TagsEventAttribute: description: Array of tags associated with your event. example: @@ -96466,57 +96418,6 @@ paths: operator: OR permissions: - timeseries_query - /api/v2/reference-tables/queries/batch-rows: - post: - description: Batch query reference table rows by their primary key values. Returns - only found rows in the included array. - operationId: BatchRowsQuery - requestBody: - content: - application/json: - examples: - happy_path: - summary: Batch query reference table rows by their primary key values. - value: - data: - attributes: - row_ids: - - row_id_1 - - row_id_2 - table_id: 00000000-0000-0000-0000-000000000000 - type: reference-tables-batch-rows-query - schema: - $ref: '#/components/schemas/BatchRowsQueryRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BatchRowsQueryResponse' - description: Successfully retrieved rows. Some or all requested rows were - found. Response includes found rows in the included section. - '400': - $ref: '#/components/responses/BadRequestResponse' - '403': - $ref: '#/components/responses/ForbiddenResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Internal Server Error - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] - summary: Batch rows query - tags: - - Reference Tables /api/v2/reference-tables/tables: get: description: List all reference tables in this organization. diff --git a/examples/v2/reference-tables/BatchRowsQuery.java b/examples/v2/reference-tables/BatchRowsQuery.java deleted file mode 100644 index 191ca8d2da2..00000000000 --- a/examples/v2/reference-tables/BatchRowsQuery.java +++ /dev/null @@ -1,41 +0,0 @@ -// Batch rows query returns "Successfully retrieved rows. Some or all requested rows were found. -// Response includes found -// rows in the included section." response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.ReferenceTablesApi; -import com.datadog.api.client.v2.model.BatchRowsQueryDataType; -import com.datadog.api.client.v2.model.BatchRowsQueryRequest; -import com.datadog.api.client.v2.model.BatchRowsQueryRequestData; -import com.datadog.api.client.v2.model.BatchRowsQueryRequestDataAttributes; -import com.datadog.api.client.v2.model.BatchRowsQueryResponse; -import java.util.Arrays; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient); - - BatchRowsQueryRequest body = - new BatchRowsQueryRequest() - .data( - new BatchRowsQueryRequestData() - .attributes( - new BatchRowsQueryRequestDataAttributes() - .rowIds(Arrays.asList("row_id_1", "row_id_2")) - .tableId("00000000-0000-0000-0000-000000000000")) - .type(BatchRowsQueryDataType.REFERENCE_TABLES_BATCH_ROWS_QUERY)); - - try { - BatchRowsQueryResponse result = apiInstance.batchRowsQuery(body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling ReferenceTablesApi#batchRowsQuery"); - 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/reference-tables/DeleteRows.java b/examples/v2/reference-tables/DeleteRows.java index cd1f3ae281f..55d2615ed0e 100644 --- a/examples/v2/reference-tables/DeleteRows.java +++ b/examples/v2/reference-tables/DeleteRows.java @@ -4,8 +4,8 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.ReferenceTablesApi; import com.datadog.api.client.v2.model.BatchDeleteRowsRequestArray; +import com.datadog.api.client.v2.model.BatchDeleteRowsRequestData; import com.datadog.api.client.v2.model.TableRowResourceDataType; -import com.datadog.api.client.v2.model.TableRowResourceIdentifier; import java.util.Collections; public class Example { @@ -17,7 +17,7 @@ public static void main(String[] args) { new BatchDeleteRowsRequestArray() .data( Collections.singletonList( - new TableRowResourceIdentifier() + new BatchDeleteRowsRequestData() .id("primary_key_value") .type(TableRowResourceDataType.ROW))); diff --git a/src/main/java/com/datadog/api/client/v2/api/ReferenceTablesApi.java b/src/main/java/com/datadog/api/client/v2/api/ReferenceTablesApi.java index 4008addc6f0..58b2be6ec88 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ReferenceTablesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ReferenceTablesApi.java @@ -5,8 +5,6 @@ import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.BatchDeleteRowsRequestArray; -import com.datadog.api.client.v2.model.BatchRowsQueryRequest; -import com.datadog.api.client.v2.model.BatchRowsQueryResponse; import com.datadog.api.client.v2.model.BatchUpsertRowsRequestArray; import com.datadog.api.client.v2.model.CreateTableRequest; import com.datadog.api.client.v2.model.CreateUploadRequest; @@ -55,140 +53,6 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } - /** - * Batch rows query. - * - *

See {@link #batchRowsQueryWithHttpInfo}. - * - * @param body (required) - * @return BatchRowsQueryResponse - * @throws ApiException if fails to make API call - */ - public BatchRowsQueryResponse batchRowsQuery(BatchRowsQueryRequest body) throws ApiException { - return batchRowsQueryWithHttpInfo(body).getData(); - } - - /** - * Batch rows query. - * - *

See {@link #batchRowsQueryWithHttpInfoAsync}. - * - * @param body (required) - * @return CompletableFuture<BatchRowsQueryResponse> - */ - public CompletableFuture batchRowsQueryAsync(BatchRowsQueryRequest body) { - return batchRowsQueryWithHttpInfoAsync(body) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Batch query reference table rows by their primary key values. Returns only found rows in the - * included array. - * - * @param body (required) - * @return ApiResponse<BatchRowsQueryResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 Successfully retrieved rows. Some or all requested rows were found. Response includes found rows in the included section. -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
500 Internal Server Error -
- */ - public ApiResponse batchRowsQueryWithHttpInfo(BatchRowsQueryRequest body) - throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException( - 400, "Missing the required parameter 'body' when calling batchRowsQuery"); - } - // create path and map variables - String localVarPath = "/api/v2/reference-tables/queries/batch-rows"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.ReferenceTablesApi.batchRowsQuery", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); - return apiClient.invokeAPI( - "POST", - builder, - localVarHeaderParams, - new String[] {"application/json"}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Batch rows query. - * - *

See {@link #batchRowsQueryWithHttpInfo}. - * - * @param body (required) - * @return CompletableFuture<ApiResponse<BatchRowsQueryResponse>> - */ - public CompletableFuture> batchRowsQueryWithHttpInfoAsync( - BatchRowsQueryRequest body) { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'body' when calling batchRowsQuery")); - return result; - } - // create path and map variables - String localVarPath = "/api/v2/reference-tables/queries/batch-rows"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.ReferenceTablesApi.batchRowsQuery", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); - } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; - } - return apiClient.invokeAPIAsync( - "POST", - builder, - localVarHeaderParams, - new String[] {"application/json"}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - /** * Create reference table. * diff --git a/src/main/java/com/datadog/api/client/v2/model/BatchDeleteRowsRequestArray.java b/src/main/java/com/datadog/api/client/v2/model/BatchDeleteRowsRequestArray.java index 68c7e5a0222..530204fc198 100644 --- a/src/main/java/com/datadog/api/client/v2/model/BatchDeleteRowsRequestArray.java +++ b/src/main/java/com/datadog/api/client/v2/model/BatchDeleteRowsRequestArray.java @@ -26,26 +26,26 @@ public class BatchDeleteRowsRequestArray { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private List data = new ArrayList<>(); + private List data = new ArrayList<>(); public BatchDeleteRowsRequestArray() {} @JsonCreator public BatchDeleteRowsRequestArray( @JsonProperty(required = true, value = JSON_PROPERTY_DATA) - List data) { + List data) { this.data = data; } - public BatchDeleteRowsRequestArray data(List data) { + public BatchDeleteRowsRequestArray data(List data) { this.data = data; - for (TableRowResourceIdentifier item : data) { + for (BatchDeleteRowsRequestData item : data) { this.unparsed |= item.unparsed; } return this; } - public BatchDeleteRowsRequestArray addDataItem(TableRowResourceIdentifier dataItem) { + public BatchDeleteRowsRequestArray addDataItem(BatchDeleteRowsRequestData dataItem) { this.data.add(dataItem); this.unparsed |= dataItem.unparsed; return this; @@ -58,11 +58,11 @@ public BatchDeleteRowsRequestArray addDataItem(TableRowResourceIdentifier dataIt */ @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getData() { + public List getData() { return data; } - public void setData(List data) { + public void setData(List data) { this.data = data; } diff --git a/src/main/java/com/datadog/api/client/v2/model/TableRowResourceIdentifier.java b/src/main/java/com/datadog/api/client/v2/model/BatchDeleteRowsRequestData.java similarity index 82% rename from src/main/java/com/datadog/api/client/v2/model/TableRowResourceIdentifier.java rename to src/main/java/com/datadog/api/client/v2/model/BatchDeleteRowsRequestData.java index 0fe6b76719a..41a4270f1ef 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TableRowResourceIdentifier.java +++ b/src/main/java/com/datadog/api/client/v2/model/BatchDeleteRowsRequestData.java @@ -17,14 +17,14 @@ import java.util.Map; import java.util.Objects; -/** Row resource containing a single row identifier. */ +/** Row resource containing a single row identifier for deletion. */ @JsonPropertyOrder({ - TableRowResourceIdentifier.JSON_PROPERTY_ID, - TableRowResourceIdentifier.JSON_PROPERTY_TYPE + BatchDeleteRowsRequestData.JSON_PROPERTY_ID, + BatchDeleteRowsRequestData.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TableRowResourceIdentifier { +public class BatchDeleteRowsRequestData { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ID = "id"; private String id; @@ -32,10 +32,10 @@ public class TableRowResourceIdentifier { public static final String JSON_PROPERTY_TYPE = "type"; private TableRowResourceDataType type = TableRowResourceDataType.ROW; - public TableRowResourceIdentifier() {} + public BatchDeleteRowsRequestData() {} @JsonCreator - public TableRowResourceIdentifier( + public BatchDeleteRowsRequestData( @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TableRowResourceDataType type) { this.id = id; @@ -43,7 +43,7 @@ public TableRowResourceIdentifier( this.unparsed |= !type.isValid(); } - public TableRowResourceIdentifier id(String id) { + public BatchDeleteRowsRequestData id(String id) { this.id = id; return this; } @@ -63,7 +63,7 @@ public void setId(String id) { this.id = id; } - public TableRowResourceIdentifier type(TableRowResourceDataType type) { + public BatchDeleteRowsRequestData type(TableRowResourceDataType type) { this.type = type; this.unparsed |= !type.isValid(); return this; @@ -99,10 +99,10 @@ public void setType(TableRowResourceDataType type) { * * @param key The arbitrary key to set * @param value The associated value - * @return TableRowResourceIdentifier + * @return BatchDeleteRowsRequestData */ @JsonAnySetter - public TableRowResourceIdentifier putAdditionalProperty(String key, Object value) { + public BatchDeleteRowsRequestData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -133,7 +133,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this TableRowResourceIdentifier object is equal to o. */ + /** Return true if this BatchDeleteRowsRequestData object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -142,11 +142,11 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TableRowResourceIdentifier tableRowResourceIdentifier = (TableRowResourceIdentifier) o; - return Objects.equals(this.id, tableRowResourceIdentifier.id) - && Objects.equals(this.type, tableRowResourceIdentifier.type) + BatchDeleteRowsRequestData batchDeleteRowsRequestData = (BatchDeleteRowsRequestData) o; + return Objects.equals(this.id, batchDeleteRowsRequestData.id) + && Objects.equals(this.type, batchDeleteRowsRequestData.type) && Objects.equals( - this.additionalProperties, tableRowResourceIdentifier.additionalProperties); + this.additionalProperties, batchDeleteRowsRequestData.additionalProperties); } @Override @@ -157,7 +157,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TableRowResourceIdentifier {\n"); + sb.append("class BatchDeleteRowsRequestData {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryDataType.java b/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryDataType.java deleted file mode 100644 index cfd7332a984..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryDataType.java +++ /dev/null @@ -1,57 +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.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; - -/** Resource type identifier for batch queries of reference table rows. */ -@JsonSerialize(using = BatchRowsQueryDataType.BatchRowsQueryDataTypeSerializer.class) -public class BatchRowsQueryDataType extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("reference-tables-batch-rows-query")); - - public static final BatchRowsQueryDataType REFERENCE_TABLES_BATCH_ROWS_QUERY = - new BatchRowsQueryDataType("reference-tables-batch-rows-query"); - - BatchRowsQueryDataType(String value) { - super(value, allowedValues); - } - - public static class BatchRowsQueryDataTypeSerializer - extends StdSerializer { - public BatchRowsQueryDataTypeSerializer(Class t) { - super(t); - } - - public BatchRowsQueryDataTypeSerializer() { - this(null); - } - - @Override - public void serialize( - BatchRowsQueryDataType value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static BatchRowsQueryDataType fromValue(String value) { - return new BatchRowsQueryDataType(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryRequest.java b/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryRequest.java deleted file mode 100644 index 8791984f8d9..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryRequest.java +++ /dev/null @@ -1,136 +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; - -/** */ -@JsonPropertyOrder({BatchRowsQueryRequest.JSON_PROPERTY_DATA}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class BatchRowsQueryRequest { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_DATA = "data"; - private BatchRowsQueryRequestData data; - - public BatchRowsQueryRequest data(BatchRowsQueryRequestData data) { - this.data = data; - this.unparsed |= data.unparsed; - return this; - } - - /** - * Getdata - * - * @return data - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BatchRowsQueryRequestData getData() { - return data; - } - - public void setData(BatchRowsQueryRequestData data) { - this.data = data; - } - - /** - * 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 BatchRowsQueryRequest - */ - @JsonAnySetter - public BatchRowsQueryRequest 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 BatchRowsQueryRequest object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchRowsQueryRequest batchRowsQueryRequest = (BatchRowsQueryRequest) o; - return Objects.equals(this.data, batchRowsQueryRequest.data) - && Objects.equals(this.additionalProperties, batchRowsQueryRequest.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(data, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchRowsQueryRequest {\n"); - sb.append(" data: ").append(toIndentedString(data)).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/BatchRowsQueryRequestData.java b/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryRequestData.java deleted file mode 100644 index e0127626788..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryRequestData.java +++ /dev/null @@ -1,179 +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.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** */ -@JsonPropertyOrder({ - BatchRowsQueryRequestData.JSON_PROPERTY_ATTRIBUTES, - BatchRowsQueryRequestData.JSON_PROPERTY_TYPE -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class BatchRowsQueryRequestData { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private BatchRowsQueryRequestDataAttributes attributes; - - public static final String JSON_PROPERTY_TYPE = "type"; - private BatchRowsQueryDataType type = BatchRowsQueryDataType.REFERENCE_TABLES_BATCH_ROWS_QUERY; - - public BatchRowsQueryRequestData() {} - - @JsonCreator - public BatchRowsQueryRequestData( - @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) BatchRowsQueryDataType type) { - this.type = type; - this.unparsed |= !type.isValid(); - } - - public BatchRowsQueryRequestData attributes(BatchRowsQueryRequestDataAttributes attributes) { - this.attributes = attributes; - this.unparsed |= attributes.unparsed; - return this; - } - - /** - * Getattributes - * - * @return attributes - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTRIBUTES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BatchRowsQueryRequestDataAttributes getAttributes() { - return attributes; - } - - public void setAttributes(BatchRowsQueryRequestDataAttributes attributes) { - this.attributes = attributes; - } - - public BatchRowsQueryRequestData type(BatchRowsQueryDataType type) { - this.type = type; - this.unparsed |= !type.isValid(); - return this; - } - - /** - * Resource type identifier for batch queries of reference table rows. - * - * @return type - */ - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BatchRowsQueryDataType getType() { - return type; - } - - public void setType(BatchRowsQueryDataType type) { - if (!type.isValid()) { - this.unparsed = true; - } - this.type = type; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return BatchRowsQueryRequestData - */ - @JsonAnySetter - public BatchRowsQueryRequestData 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 BatchRowsQueryRequestData object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchRowsQueryRequestData batchRowsQueryRequestData = (BatchRowsQueryRequestData) o; - return Objects.equals(this.attributes, batchRowsQueryRequestData.attributes) - && Objects.equals(this.type, batchRowsQueryRequestData.type) - && Objects.equals( - this.additionalProperties, batchRowsQueryRequestData.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(attributes, type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchRowsQueryRequestData {\n"); - sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryRequestDataAttributes.java deleted file mode 100644 index c7315bf4043..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryRequestDataAttributes.java +++ /dev/null @@ -1,182 +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.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** */ -@JsonPropertyOrder({ - BatchRowsQueryRequestDataAttributes.JSON_PROPERTY_ROW_IDS, - BatchRowsQueryRequestDataAttributes.JSON_PROPERTY_TABLE_ID -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class BatchRowsQueryRequestDataAttributes { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ROW_IDS = "row_ids"; - private List rowIds = new ArrayList<>(); - - public static final String JSON_PROPERTY_TABLE_ID = "table_id"; - private String tableId; - - public BatchRowsQueryRequestDataAttributes() {} - - @JsonCreator - public BatchRowsQueryRequestDataAttributes( - @JsonProperty(required = true, value = JSON_PROPERTY_ROW_IDS) List rowIds, - @JsonProperty(required = true, value = JSON_PROPERTY_TABLE_ID) String tableId) { - this.rowIds = rowIds; - this.tableId = tableId; - } - - public BatchRowsQueryRequestDataAttributes rowIds(List rowIds) { - this.rowIds = rowIds; - return this; - } - - public BatchRowsQueryRequestDataAttributes addRowIdsItem(String rowIdsItem) { - this.rowIds.add(rowIdsItem); - return this; - } - - /** - * GetrowIds - * - * @return rowIds - */ - @JsonProperty(JSON_PROPERTY_ROW_IDS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getRowIds() { - return rowIds; - } - - public void setRowIds(List rowIds) { - this.rowIds = rowIds; - } - - public BatchRowsQueryRequestDataAttributes tableId(String tableId) { - this.tableId = tableId; - return this; - } - - /** - * GettableId - * - * @return tableId - */ - @JsonProperty(JSON_PROPERTY_TABLE_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getTableId() { - return tableId; - } - - public void setTableId(String tableId) { - this.tableId = tableId; - } - - /** - * 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 BatchRowsQueryRequestDataAttributes - */ - @JsonAnySetter - public BatchRowsQueryRequestDataAttributes 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 BatchRowsQueryRequestDataAttributes object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchRowsQueryRequestDataAttributes batchRowsQueryRequestDataAttributes = - (BatchRowsQueryRequestDataAttributes) o; - return Objects.equals(this.rowIds, batchRowsQueryRequestDataAttributes.rowIds) - && Objects.equals(this.tableId, batchRowsQueryRequestDataAttributes.tableId) - && Objects.equals( - this.additionalProperties, batchRowsQueryRequestDataAttributes.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(rowIds, tableId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchRowsQueryRequestDataAttributes {\n"); - sb.append(" rowIds: ").append(toIndentedString(rowIds)).append("\n"); - sb.append(" tableId: ").append(toIndentedString(tableId)).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/BatchRowsQueryResponse.java b/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryResponse.java deleted file mode 100644 index 87b72699a19..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryResponse.java +++ /dev/null @@ -1,136 +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; - -/** */ -@JsonPropertyOrder({BatchRowsQueryResponse.JSON_PROPERTY_DATA}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class BatchRowsQueryResponse { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_DATA = "data"; - private BatchRowsQueryResponseData data; - - public BatchRowsQueryResponse data(BatchRowsQueryResponseData data) { - this.data = data; - this.unparsed |= data.unparsed; - return this; - } - - /** - * Getdata - * - * @return data - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BatchRowsQueryResponseData getData() { - return data; - } - - public void setData(BatchRowsQueryResponseData data) { - this.data = data; - } - - /** - * 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 BatchRowsQueryResponse - */ - @JsonAnySetter - public BatchRowsQueryResponse 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 BatchRowsQueryResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchRowsQueryResponse batchRowsQueryResponse = (BatchRowsQueryResponse) o; - return Objects.equals(this.data, batchRowsQueryResponse.data) - && Objects.equals(this.additionalProperties, batchRowsQueryResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(data, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchRowsQueryResponse {\n"); - sb.append(" data: ").append(toIndentedString(data)).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/BatchRowsQueryResponseData.java b/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryResponseData.java deleted file mode 100644 index 85802def1d4..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryResponseData.java +++ /dev/null @@ -1,207 +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.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** */ -@JsonPropertyOrder({ - BatchRowsQueryResponseData.JSON_PROPERTY_ID, - BatchRowsQueryResponseData.JSON_PROPERTY_RELATIONSHIPS, - BatchRowsQueryResponseData.JSON_PROPERTY_TYPE -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class BatchRowsQueryResponseData { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; - private BatchRowsQueryResponseDataRelationships relationships; - - public static final String JSON_PROPERTY_TYPE = "type"; - private BatchRowsQueryDataType type = BatchRowsQueryDataType.REFERENCE_TABLES_BATCH_ROWS_QUERY; - - public BatchRowsQueryResponseData() {} - - @JsonCreator - public BatchRowsQueryResponseData( - @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) BatchRowsQueryDataType type) { - this.type = type; - this.unparsed |= !type.isValid(); - } - - public BatchRowsQueryResponseData id(String id) { - this.id = id; - return this; - } - - /** - * Getid - * - * @return id - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public BatchRowsQueryResponseData relationships( - BatchRowsQueryResponseDataRelationships relationships) { - this.relationships = relationships; - this.unparsed |= relationships.unparsed; - return this; - } - - /** - * Getrelationships - * - * @return relationships - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BatchRowsQueryResponseDataRelationships getRelationships() { - return relationships; - } - - public void setRelationships(BatchRowsQueryResponseDataRelationships relationships) { - this.relationships = relationships; - } - - public BatchRowsQueryResponseData type(BatchRowsQueryDataType type) { - this.type = type; - this.unparsed |= !type.isValid(); - return this; - } - - /** - * Resource type identifier for batch queries of reference table rows. - * - * @return type - */ - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BatchRowsQueryDataType getType() { - return type; - } - - public void setType(BatchRowsQueryDataType type) { - if (!type.isValid()) { - this.unparsed = true; - } - this.type = type; - } - - /** - * A container for additional, undeclared properties. This is a holder for any undeclared - * properties as specified with the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. If the property - * does not already exist, create it otherwise replace it. - * - * @param key The arbitrary key to set - * @param value The associated value - * @return BatchRowsQueryResponseData - */ - @JsonAnySetter - public BatchRowsQueryResponseData 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 BatchRowsQueryResponseData object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchRowsQueryResponseData batchRowsQueryResponseData = (BatchRowsQueryResponseData) o; - return Objects.equals(this.id, batchRowsQueryResponseData.id) - && Objects.equals(this.relationships, batchRowsQueryResponseData.relationships) - && Objects.equals(this.type, batchRowsQueryResponseData.type) - && Objects.equals( - this.additionalProperties, batchRowsQueryResponseData.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(id, relationships, type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchRowsQueryResponseData {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" additionalProperties: ") - .append(toIndentedString(additionalProperties)) - .append("\n"); - sb.append('}'); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryResponseDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryResponseDataRelationships.java deleted file mode 100644 index c535d451cb0..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryResponseDataRelationships.java +++ /dev/null @@ -1,140 +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; - -/** */ -@JsonPropertyOrder({BatchRowsQueryResponseDataRelationships.JSON_PROPERTY_ROWS}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class BatchRowsQueryResponseDataRelationships { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ROWS = "rows"; - private BatchRowsQueryResponseDataRelationshipsRows rows; - - public BatchRowsQueryResponseDataRelationships rows( - BatchRowsQueryResponseDataRelationshipsRows rows) { - this.rows = rows; - this.unparsed |= rows.unparsed; - return this; - } - - /** - * Getrows - * - * @return rows - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ROWS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BatchRowsQueryResponseDataRelationshipsRows getRows() { - return rows; - } - - public void setRows(BatchRowsQueryResponseDataRelationshipsRows rows) { - this.rows = rows; - } - - /** - * 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 BatchRowsQueryResponseDataRelationships - */ - @JsonAnySetter - public BatchRowsQueryResponseDataRelationships 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 BatchRowsQueryResponseDataRelationships object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchRowsQueryResponseDataRelationships batchRowsQueryResponseDataRelationships = - (BatchRowsQueryResponseDataRelationships) o; - return Objects.equals(this.rows, batchRowsQueryResponseDataRelationships.rows) - && Objects.equals( - this.additionalProperties, - batchRowsQueryResponseDataRelationships.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(rows, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchRowsQueryResponseDataRelationships {\n"); - sb.append(" rows: ").append(toIndentedString(rows)).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/BatchRowsQueryResponseDataRelationshipsRows.java b/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryResponseDataRelationshipsRows.java deleted file mode 100644 index 7f8b924ab03..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/BatchRowsQueryResponseDataRelationshipsRows.java +++ /dev/null @@ -1,154 +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.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** */ -@JsonPropertyOrder({BatchRowsQueryResponseDataRelationshipsRows.JSON_PROPERTY_DATA}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class BatchRowsQueryResponseDataRelationshipsRows { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_DATA = "data"; - private List data = null; - - public BatchRowsQueryResponseDataRelationshipsRows data(List data) { - this.data = data; - for (TableRowResourceIdentifier item : data) { - this.unparsed |= item.unparsed; - } - return this; - } - - public BatchRowsQueryResponseDataRelationshipsRows addDataItem( - TableRowResourceIdentifier dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); - this.unparsed |= dataItem.unparsed; - return this; - } - - /** - * Getdata - * - * @return data - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } - - /** - * 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 BatchRowsQueryResponseDataRelationshipsRows - */ - @JsonAnySetter - public BatchRowsQueryResponseDataRelationshipsRows 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 BatchRowsQueryResponseDataRelationshipsRows object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BatchRowsQueryResponseDataRelationshipsRows batchRowsQueryResponseDataRelationshipsRows = - (BatchRowsQueryResponseDataRelationshipsRows) o; - return Objects.equals(this.data, batchRowsQueryResponseDataRelationshipsRows.data) - && Objects.equals( - this.additionalProperties, - batchRowsQueryResponseDataRelationshipsRows.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(data, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BatchRowsQueryResponseDataRelationshipsRows {\n"); - sb.append(" data: ").append(toIndentedString(data)).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/CreateDeploymentRuleParamsDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParamsDataAttributes.java index 14bb4bc93e2..70a694cd6fe 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParamsDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateDeploymentRuleParamsDataAttributes.java @@ -101,7 +101,7 @@ public CreateDeploymentRuleParamsDataAttributes options(DeploymentRulesOptions o } /** - * Options for deployment rule response representing either faulty deployment detection or monitor + * Options for deployment rule requests representing either faulty deployment detection or monitor * options. * * @return options diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleOptionsFaultyDeploymentDetectionResponse.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleOptionsFaultyDeploymentDetectionResponse.java new file mode 100644 index 00000000000..268e8676ce7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleOptionsFaultyDeploymentDetectionResponse.java @@ -0,0 +1,140 @@ +/* + * 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.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; + +/** + * Faulty deployment detection options returned in deployment rule responses. The + * excluded_resources field is always present, which allows disambiguating this type from + * monitor options when both share a duration field. + */ +@JsonPropertyOrder({ + DeploymentRuleOptionsFaultyDeploymentDetectionResponse.JSON_PROPERTY_DURATION, + DeploymentRuleOptionsFaultyDeploymentDetectionResponse.JSON_PROPERTY_EXCLUDED_RESOURCES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeploymentRuleOptionsFaultyDeploymentDetectionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DURATION = "duration"; + private Long duration; + + public static final String JSON_PROPERTY_EXCLUDED_RESOURCES = "excluded_resources"; + private List excludedResources = new ArrayList<>(); + + public DeploymentRuleOptionsFaultyDeploymentDetectionResponse() {} + + @JsonCreator + public DeploymentRuleOptionsFaultyDeploymentDetectionResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_EXCLUDED_RESOURCES) + List excludedResources) { + this.excludedResources = excludedResources; + } + + public DeploymentRuleOptionsFaultyDeploymentDetectionResponse duration(Long duration) { + this.duration = duration; + return this; + } + + /** + * The duration for faulty deployment detection. + * + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getDuration() { + return duration; + } + + public void setDuration(Long duration) { + this.duration = duration; + } + + public DeploymentRuleOptionsFaultyDeploymentDetectionResponse excludedResources( + List excludedResources) { + this.excludedResources = excludedResources; + return this; + } + + public DeploymentRuleOptionsFaultyDeploymentDetectionResponse addExcludedResourcesItem( + String excludedResourcesItem) { + this.excludedResources.add(excludedResourcesItem); + return this; + } + + /** + * Resources to exclude from faulty deployment detection. + * + * @return excludedResources + */ + @JsonProperty(JSON_PROPERTY_EXCLUDED_RESOURCES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getExcludedResources() { + return excludedResources; + } + + public void setExcludedResources(List excludedResources) { + this.excludedResources = excludedResources; + } + + /** + * Return true if this DeploymentRuleOptionsFaultyDeploymentDetectionResponse object is equal to + * o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeploymentRuleOptionsFaultyDeploymentDetectionResponse + deploymentRuleOptionsFaultyDeploymentDetectionResponse = + (DeploymentRuleOptionsFaultyDeploymentDetectionResponse) o; + return Objects.equals( + this.duration, deploymentRuleOptionsFaultyDeploymentDetectionResponse.duration) + && Objects.equals( + this.excludedResources, + deploymentRuleOptionsFaultyDeploymentDetectionResponse.excludedResources); + } + + @Override + public int hashCode() { + return Objects.hash(duration, excludedResources); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeploymentRuleOptionsFaultyDeploymentDetectionResponse {\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" excludedResources: ").append(toIndentedString(excludedResources)).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/DeploymentRuleResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributes.java index bf82bcbd45d..8f7b5c95e60 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRuleResponseDataAttributes.java @@ -50,7 +50,7 @@ public class DeploymentRuleResponseDataAttributes { private String name; public static final String JSON_PROPERTY_OPTIONS = "options"; - private DeploymentRulesOptions options; + private DeploymentRulesOptionsResponse options; public static final String JSON_PROPERTY_TYPE = "type"; private DeploymentRuleResponseDataAttributesType type; @@ -71,7 +71,8 @@ public DeploymentRuleResponseDataAttributes( @JsonProperty(required = true, value = JSON_PROPERTY_DRY_RUN) Boolean dryRun, @JsonProperty(required = true, value = JSON_PROPERTY_GATE_ID) String gateId, @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, - @JsonProperty(required = true, value = JSON_PROPERTY_OPTIONS) DeploymentRulesOptions options, + @JsonProperty(required = true, value = JSON_PROPERTY_OPTIONS) + DeploymentRulesOptionsResponse options, @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DeploymentRuleResponseDataAttributesType type) { this.createdAt = createdAt; @@ -188,25 +189,26 @@ public void setName(String name) { this.name = name; } - public DeploymentRuleResponseDataAttributes options(DeploymentRulesOptions options) { + public DeploymentRuleResponseDataAttributes options(DeploymentRulesOptionsResponse options) { this.options = options; this.unparsed |= options.unparsed; return this; } /** - * Options for deployment rule response representing either faulty deployment detection or monitor - * options. + * Options returned in deployment rule responses representing either faulty deployment detection + * or monitor options. Faulty deployment detection responses always include + * excluded_resources, making the two variants unambiguous. * * @return options */ @JsonProperty(JSON_PROPERTY_OPTIONS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public DeploymentRulesOptions getOptions() { + public DeploymentRulesOptionsResponse getOptions() { return options; } - public void setOptions(DeploymentRulesOptions options) { + public void setOptions(DeploymentRulesOptionsResponse options) { this.options = options; } diff --git a/src/main/java/com/datadog/api/client/v2/model/DeploymentRulesOptionsResponse.java b/src/main/java/com/datadog/api/client/v2/model/DeploymentRulesOptionsResponse.java new file mode 100644 index 00000000000..446e9c706c9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeploymentRulesOptionsResponse.java @@ -0,0 +1,307 @@ +/* + * 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.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 = DeploymentRulesOptionsResponse.DeploymentRulesOptionsResponseDeserializer.class) +@JsonSerialize( + using = DeploymentRulesOptionsResponse.DeploymentRulesOptionsResponseSerializer.class) +public class DeploymentRulesOptionsResponse extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(DeploymentRulesOptionsResponse.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class DeploymentRulesOptionsResponseSerializer + extends StdSerializer { + public DeploymentRulesOptionsResponseSerializer(Class t) { + super(t); + } + + public DeploymentRulesOptionsResponseSerializer() { + this(null); + } + + @Override + public void serialize( + DeploymentRulesOptionsResponse value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class DeploymentRulesOptionsResponseDeserializer + extends StdDeserializer { + public DeploymentRulesOptionsResponseDeserializer() { + this(DeploymentRulesOptionsResponse.class); + } + + public DeploymentRulesOptionsResponseDeserializer(Class vc) { + super(vc); + } + + @Override + public DeploymentRulesOptionsResponse 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 DeploymentRuleOptionsFaultyDeploymentDetectionResponse + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals(Integer.class) + || DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals(Long.class) + || DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals(Float.class) + || DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals(Double.class) + || DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals(Boolean.class) + || DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals(Integer.class) + || DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals( + Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals(Float.class) + || DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(DeploymentRuleOptionsFaultyDeploymentDetectionResponse.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 (!((DeploymentRuleOptionsFaultyDeploymentDetectionResponse) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'DeploymentRuleOptionsFaultyDeploymentDetectionResponse'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema" + + " 'DeploymentRuleOptionsFaultyDeploymentDetectionResponse'", + e); + } + + // deserialize DeploymentRuleOptionsMonitor + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (DeploymentRuleOptionsMonitor.class.equals(Integer.class) + || DeploymentRuleOptionsMonitor.class.equals(Long.class) + || DeploymentRuleOptionsMonitor.class.equals(Float.class) + || DeploymentRuleOptionsMonitor.class.equals(Double.class) + || DeploymentRuleOptionsMonitor.class.equals(Boolean.class) + || DeploymentRuleOptionsMonitor.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((DeploymentRuleOptionsMonitor.class.equals(Integer.class) + || DeploymentRuleOptionsMonitor.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((DeploymentRuleOptionsMonitor.class.equals(Float.class) + || DeploymentRuleOptionsMonitor.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (DeploymentRuleOptionsMonitor.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (DeploymentRuleOptionsMonitor.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(DeploymentRuleOptionsMonitor.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 (!((DeploymentRuleOptionsMonitor) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'DeploymentRuleOptionsMonitor'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'DeploymentRuleOptionsMonitor'", e); + } + + DeploymentRulesOptionsResponse ret = new DeploymentRulesOptionsResponse(); + 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 DeploymentRulesOptionsResponse getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "DeploymentRulesOptionsResponse cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public DeploymentRulesOptionsResponse() { + super("oneOf", Boolean.FALSE); + } + + public DeploymentRulesOptionsResponse(DeploymentRuleOptionsFaultyDeploymentDetectionResponse o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public DeploymentRulesOptionsResponse(DeploymentRuleOptionsMonitor o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "DeploymentRuleOptionsFaultyDeploymentDetectionResponse", + new GenericType() {}); + schemas.put("DeploymentRuleOptionsMonitor", new GenericType() {}); + JSON.registerDescendants( + DeploymentRulesOptionsResponse.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return DeploymentRulesOptionsResponse.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: DeploymentRuleOptionsFaultyDeploymentDetectionResponse, + * DeploymentRuleOptionsMonitor + * + *

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( + DeploymentRuleOptionsFaultyDeploymentDetectionResponse.class, + instance, + new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(DeploymentRuleOptionsMonitor.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 DeploymentRuleOptionsFaultyDeploymentDetectionResponse," + + " DeploymentRuleOptionsMonitor"); + } + + /** + * Get the actual instance, which can be the following: + * DeploymentRuleOptionsFaultyDeploymentDetectionResponse, DeploymentRuleOptionsMonitor + * + * @return The actual instance (DeploymentRuleOptionsFaultyDeploymentDetectionResponse, + * DeploymentRuleOptionsMonitor) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `DeploymentRuleOptionsFaultyDeploymentDetectionResponse`. If the + * actual instance is not `DeploymentRuleOptionsFaultyDeploymentDetectionResponse`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `DeploymentRuleOptionsFaultyDeploymentDetectionResponse` + * @throws ClassCastException if the instance is not + * `DeploymentRuleOptionsFaultyDeploymentDetectionResponse` + */ + public DeploymentRuleOptionsFaultyDeploymentDetectionResponse + getDeploymentRuleOptionsFaultyDeploymentDetectionResponse() throws ClassCastException { + return (DeploymentRuleOptionsFaultyDeploymentDetectionResponse) super.getActualInstance(); + } + + /** + * Get the actual instance of `DeploymentRuleOptionsMonitor`. If the actual instance is not + * `DeploymentRuleOptionsMonitor`, the ClassCastException will be thrown. + * + * @return The actual instance of `DeploymentRuleOptionsMonitor` + * @throws ClassCastException if the instance is not `DeploymentRuleOptionsMonitor` + */ + public DeploymentRuleOptionsMonitor getDeploymentRuleOptionsMonitor() throws ClassCastException { + return (DeploymentRuleOptionsMonitor) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParamsDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParamsDataAttributes.java index 7159bb00ecc..caac3c57d51 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParamsDataAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateDeploymentRuleParamsDataAttributes.java @@ -97,7 +97,7 @@ public UpdateDeploymentRuleParamsDataAttributes options(DeploymentRulesOptions o } /** - * Options for deployment rule response representing either faulty deployment detection or monitor + * Options for deployment rule requests representing either faulty deployment detection or monitor * options. * * @return options diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze index 63e0f66692d..106c0df9922 100644 --- a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze @@ -1 +1 @@ -2025-12-10T09:23:50.780Z \ No newline at end of file +2026-03-11T14:49:58.105Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json index e3637d640df..02e5519c0e6 100644 --- a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentrulereturnsokresponse1765358630\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentrulereturnsokresponse1773240598\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"24d967fe-1dec-4957-bf77-7eda18a65d47\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-10T09:23:50.813397Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentrulereturnsokresponse1765358630\",\"service\":\"my-service\",\"updated_at\":\"2025-12-10T09:23:50.813397Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"2f5dd6f5-d95a-484e-854d-deef73efb664\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2026-03-11T14:49:58.708133Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentrulereturnsokresponse1773240598\",\"service\":\"my-service\",\"updated_at\":\"2026-03-11T14:49:58.708133Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "92892c4c-9c44-828e-e567-a62a33c65db5" + "id": "1119e004-ecf4-3549-e331-fa26e52d5296" }, { "httpRequest": { @@ -37,12 +37,12 @@ }, "headers": {}, "method": "POST", - "path": "/api/v2/deployment_gates/24d967fe-1dec-4957-bf77-7eda18a65d47/rules", + "path": "/api/v2/deployment_gates/2f5dd6f5-d95a-484e-854d-deef73efb664/rules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"ebe85a93-a82d-49ec-8925-6d3d569012bb\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-10T09:23:50.871951Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"24d967fe-1dec-4957-bf77-7eda18a65d47\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-10T09:23:50.871951Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"cd2c3087-0e8b-4696-a8a1-7af14e218e46\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2026-03-11T14:49:59.023723Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"2f5dd6f5-d95a-484e-854d-deef73efb664\",\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2026-03-11T14:49:59.023723Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "a6096f20-df6f-977f-0a0c-05986e123041" + "id": "48b2035b-74e6-fdc1-2694-799fc9437d23" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/24d967fe-1dec-4957-bf77-7eda18a65d47/rules/ebe85a93-a82d-49ec-8925-6d3d569012bb", + "path": "/api/v2/deployment_gates/2f5dd6f5-d95a-484e-854d-deef73efb664/rules/cd2c3087-0e8b-4696-a8a1-7af14e218e46", "keepAlive": false, "secure": true }, @@ -78,13 +78,13 @@ "timeToLive": { "unlimited": true }, - "id": "1168ae44-d6cd-cdbd-a562-8c4385d3551f" + "id": "7f4732dd-48ab-b1cf-3832-0cc54fde12ae" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/24d967fe-1dec-4957-bf77-7eda18a65d47", + "path": "/api/v2/deployment_gates/2f5dd6f5-d95a-484e-854d-deef73efb664", "keepAlive": false, "secure": true }, @@ -99,6 +99,6 @@ "timeToLive": { "unlimited": true }, - "id": "43164807-eaa9-7682-b506-1adf0a1f3fe1" + "id": "25e624aa-5053-f03b-ca8c-e3bba844a872" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze index 3a24fa14046..96c9be060e0 100644 --- a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze @@ -1 +1 @@ -2025-12-10T09:23:51.998Z \ No newline at end of file +2026-03-11T14:49:59.730Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json index f628d8f04ed..f1c35047ab5 100644 --- a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentrulereturnsokresponse1765358631\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentrulereturnsokresponse1773240599\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"6177e46c-44dc-453d-8af8-8af86aa93c29\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-10T09:23:52.029575Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentrulereturnsokresponse1765358631\",\"service\":\"my-service\",\"updated_at\":\"2025-12-10T09:23:52.029575Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"90ad7166-3050-4215-8613-4d7c6b4dda91\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2026-03-11T14:49:59.951101Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentrulereturnsokresponse1773240599\",\"service\":\"my-service\",\"updated_at\":\"2026-03-11T14:49:59.951101Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "5a8b836c-5bac-769d-09a2-26f15b892174" + "id": "52c42513-80ce-34ea-03bd-2e68d9faeed1" }, { "httpRequest": { @@ -37,12 +37,12 @@ }, "headers": {}, "method": "POST", - "path": "/api/v2/deployment_gates/6177e46c-44dc-453d-8af8-8af86aa93c29/rules", + "path": "/api/v2/deployment_gates/90ad7166-3050-4215-8613-4d7c6b4dda91/rules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"38e32cd3-d245-49c1-85c5-b039ef868a18\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-10T09:23:52.079318Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"6177e46c-44dc-453d-8af8-8af86aa93c29\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-10T09:23:52.079318Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"734c6f92-ac07-42ea-afbb-84a1f5971b57\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2026-03-11T14:50:00.24535Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"90ad7166-3050-4215-8613-4d7c6b4dda91\",\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2026-03-11T14:50:00.24535Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "cbab2cf6-714d-4812-323a-ba60fbdde284" + "id": "9e5b9265-5ceb-5b2f-d529-b81368bf7295" }, { "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/deployment_gates/6177e46c-44dc-453d-8af8-8af86aa93c29/rules/38e32cd3-d245-49c1-85c5-b039ef868a18", + "path": "/api/v2/deployment_gates/90ad7166-3050-4215-8613-4d7c6b4dda91/rules/734c6f92-ac07-42ea-afbb-84a1f5971b57", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"38e32cd3-d245-49c1-85c5-b039ef868a18\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-10T09:23:52.079318Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"6177e46c-44dc-453d-8af8-8af86aa93c29\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-10T09:23:52.079318Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"734c6f92-ac07-42ea-afbb-84a1f5971b57\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2026-03-11T14:50:00.24535Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"90ad7166-3050-4215-8613-4d7c6b4dda91\",\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2026-03-11T14:50:00.24535Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -83,13 +83,13 @@ "timeToLive": { "unlimited": true }, - "id": "51579ab8-6f86-51fb-e286-a5194ecc35da" + "id": "c5d15a18-f288-0e68-47a2-5817f9fd5f50" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/6177e46c-44dc-453d-8af8-8af86aa93c29/rules/38e32cd3-d245-49c1-85c5-b039ef868a18", + "path": "/api/v2/deployment_gates/90ad7166-3050-4215-8613-4d7c6b4dda91/rules/734c6f92-ac07-42ea-afbb-84a1f5971b57", "keepAlive": false, "secure": true }, @@ -104,13 +104,13 @@ "timeToLive": { "unlimited": true }, - "id": "1c77bf1c-234d-46db-9690-f756de42ad13" + "id": "763a0a71-ff53-1ae5-a548-a83745537c64" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/6177e46c-44dc-453d-8af8-8af86aa93c29", + "path": "/api/v2/deployment_gates/90ad7166-3050-4215-8613-4d7c6b4dda91", "keepAlive": false, "secure": true }, @@ -125,6 +125,6 @@ "timeToLive": { "unlimited": true }, - "id": "4ffe6539-7452-6b7b-fdea-1f939ca6c842" + "id": "f4dc7210-41fd-c479-7288-3e1ab952d484" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze index aceddb95a6c..e74a02fe592 100644 --- a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze @@ -1 +1 @@ -2025-12-10T09:23:52.700Z \ No newline at end of file +2026-03-11T14:50:01.182Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json index 3297b791ce4..d83ab198054 100644 --- a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentrulereturnsokresponse1765358632\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentrulereturnsokresponse1773240601\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"3acb9ac2-abba-4579-8697-79493b221d41\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-10T09:23:52.735765Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentrulereturnsokresponse1765358632\",\"service\":\"my-service\",\"updated_at\":\"2025-12-10T09:23:52.735765Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"ad028916-c8f6-4489-bce4-f6216adfc63e\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2026-03-11T14:50:01.37369Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentrulereturnsokresponse1773240601\",\"service\":\"my-service\",\"updated_at\":\"2026-03-11T14:50:01.37369Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "145162f9-d6a7-5cd5-9467-fc55d184ba15" + "id": "cd06c94d-4052-259d-1129-3508524e6e17" }, { "httpRequest": { @@ -37,12 +37,12 @@ }, "headers": {}, "method": "POST", - "path": "/api/v2/deployment_gates/3acb9ac2-abba-4579-8697-79493b221d41/rules", + "path": "/api/v2/deployment_gates/ad028916-c8f6-4489-bce4-f6216adfc63e/rules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"ee04f24f-a980-4a28-a839-29911a632978\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-10T09:23:52.782282Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"3acb9ac2-abba-4579-8697-79493b221d41\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-10T09:23:52.782282Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"930a603b-c799-4749-a465-3a9b4beb7dfb\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2026-03-11T14:50:01.635616Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"ad028916-c8f6-4489-bce4-f6216adfc63e\",\"name\":\"My deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2026-03-11T14:50:01.635616Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,7 +57,7 @@ "timeToLive": { "unlimited": true }, - "id": "af285184-8e2e-cb60-1efa-5e586ac3acb9" + "id": "a750500e-ac5d-8423-0bb3-c7078d066e70" }, { "httpRequest": { @@ -67,12 +67,12 @@ }, "headers": {}, "method": "PUT", - "path": "/api/v2/deployment_gates/3acb9ac2-abba-4579-8697-79493b221d41/rules/ee04f24f-a980-4a28-a839-29911a632978", + "path": "/api/v2/deployment_gates/ad028916-c8f6-4489-bce4-f6216adfc63e/rules/930a603b-c799-4749-a465-3a9b4beb7dfb", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"ee04f24f-a980-4a28-a839-29911a632978\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-10T09:23:52.782282Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"3acb9ac2-abba-4579-8697-79493b221d41\",\"name\":\"Updated deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-10T09:23:52.843771Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"930a603b-c799-4749-a465-3a9b4beb7dfb\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2026-03-11T14:50:01.635616Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"ad028916-c8f6-4489-bce4-f6216adfc63e\",\"name\":\"Updated deployment rule\",\"options\":{\"excluded_resources\":[]},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2026-03-11T14:50:01.929612Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -87,13 +87,13 @@ "timeToLive": { "unlimited": true }, - "id": "8e74cbf3-c27b-5335-5cbf-770661a67aa9" + "id": "611544fc-1204-bd62-0ded-5a08710dcad9" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/3acb9ac2-abba-4579-8697-79493b221d41/rules/ee04f24f-a980-4a28-a839-29911a632978", + "path": "/api/v2/deployment_gates/ad028916-c8f6-4489-bce4-f6216adfc63e/rules/930a603b-c799-4749-a465-3a9b4beb7dfb", "keepAlive": false, "secure": true }, @@ -108,13 +108,13 @@ "timeToLive": { "unlimited": true }, - "id": "c8425d41-2083-3bc3-bf28-f3ad164ffc22" + "id": "bf43e431-a699-514b-5bf9-fb3a95681b1a" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/3acb9ac2-abba-4579-8697-79493b221d41", + "path": "/api/v2/deployment_gates/ad028916-c8f6-4489-bce4-f6216adfc63e", "keepAlive": false, "secure": true }, @@ -129,6 +129,6 @@ "timeToLive": { "unlimited": true }, - "id": "0da16de6-8d6d-7baf-f55b-b71f9e912045" + "id": "54fd4a89-1566-1086-0e15-9058b5448047" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/deployment_gates.feature b/src/test/resources/com/datadog/api/client/v2/api/deployment_gates.feature index cb0c5a1262d..7dc5575c56b 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/deployment_gates.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/deployment_gates.feature @@ -62,6 +62,7 @@ Feature: Deployment Gates And body with value {"data": {"attributes": {"dry_run": false, "name": "My deployment rule", "options": {"excluded_resources": []}, "type": "faulty_deployment_detection"}, "type": "deployment_rule"}} When the request is sent Then the response status is 200 OK + And the response "data.attributes.options.excluded_resources" is equal to [] @team:DataDog/ci-app-backend Scenario: Delete deployment gate returns "Bad Request" response @@ -206,6 +207,7 @@ Feature: Deployment Gates And request contains "id" parameter from "deployment_rule.data.id" When the request is sent Then the response status is 200 OK + And the response "data.attributes.options.excluded_resources" is equal to [] @generated @skip @team:DataDog/ci-app-backend Scenario: Get rules for a deployment gate returns "Bad request." response @@ -304,3 +306,4 @@ Feature: Deployment Gates And body with value {"data": {"attributes": {"dry_run": false, "name": "Updated deployment rule", "options": {"excluded_resources": []}}, "type": "deployment_rule"}} When the request is sent Then the response status is 200 OK + And the response "data.attributes.options.excluded_resources" is equal to [] diff --git a/src/test/resources/com/datadog/api/client/v2/api/reference_tables.feature b/src/test/resources/com/datadog/api/client/v2/api/reference_tables.feature index 0ba8738c6b9..db0f84a6e55 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/reference_tables.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/reference_tables.feature @@ -7,27 +7,6 @@ Feature: Reference Tables And a valid "appKeyAuth" key in the system And an instance of "ReferenceTables" API - @generated @skip @team:DataDog/redapl-experiences - Scenario: Batch rows query returns "Bad Request" response - Given new "BatchRowsQuery" request - And body with value {"data": {"attributes": {"row_ids": ["row_id_1", "row_id_2"], "table_id": "00000000-0000-0000-0000-000000000000"}, "type": "reference-tables-batch-rows-query"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/redapl-experiences - Scenario: Batch rows query returns "Not Found" response - Given new "BatchRowsQuery" request - And body with value {"data": {"attributes": {"row_ids": ["row_id_1", "row_id_2"], "table_id": "00000000-0000-0000-0000-000000000000"}, "type": "reference-tables-batch-rows-query"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/redapl-experiences - Scenario: Batch rows query returns "Successfully retrieved rows. Some or all requested rows were found. Response includes found rows in the included section." response - Given new "BatchRowsQuery" request - And body with value {"data": {"attributes": {"row_ids": ["row_id_1", "row_id_2"], "table_id": "00000000-0000-0000-0000-000000000000"}, "type": "reference-tables-batch-rows-query"}} - When the request is sent - Then the response status is 200 Successfully retrieved rows. Some or all requested rows were found. Response includes found rows in the included section. - @generated @skip @team:DataDog/redapl-experiences Scenario: Create reference table returns "Bad Request" response Given new "CreateReferenceTable" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index a04c9b283b9..e33094f9f8c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -3963,12 +3963,6 @@ "type": "idempotent" } }, - "BatchRowsQuery": { - "tag": "Reference Tables", - "undo": { - "type": "safe" - } - }, "ListTables": { "tag": "Reference Tables", "undo": {