From 131e08eb0f330af5c93da1e892c5a32d062408ed Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 5 Feb 2026 19:38:20 +0000 Subject: [PATCH] Regenerate client from commit 20779a6 of spec repo --- .generator/schemas/v2/openapi.yaml | 178 ++++++-------- .../CreateTagPipelinesRuleset_1897535856.java | 63 +++++ .../UpdateTagPipelinesRuleset.java | 4 +- .../UpdateTagPipelinesRuleset_1964644735.java | 59 +++++ ...ulesetRequestDataAttributesRulesItems.java | 22 +- ...tRequestDataAttributesRulesItemsQuery.java | 47 +++- ...ataAttributesRulesItemsReferenceTable.java | 48 +++- .../DataAttributesRulesItemsIfTagExists.java | 63 +++++ ...a => DataAttributesRulesItemsMapping.java} | 96 +++++--- .../RulesetRespDataAttributesRulesItems.java | 22 +- ...etRespDataAttributesRulesItemsMapping.java | 213 ----------------- ...esetRespDataAttributesRulesItemsQuery.java | 46 +++- ...ataAttributesRulesItemsReferenceTable.java | 47 +++- ...ulesetRequestDataAttributesRulesItems.java | 22 +- ...equestDataAttributesRulesItemsMapping.java | 219 ------------------ ...tRequestDataAttributesRulesItemsQuery.java | 47 +++- ...ataAttributesRulesItemsReferenceTable.java | 48 +++- ...h_if_tag_exists_returns_OK_response.freeze | 1 + ...ith_if_tag_exists_returns_OK_response.json | 32 +++ ...h_if_tag_exists_returns_OK_response.freeze | 1 + ...ith_if_tag_exists_returns_OK_response.json | 32 +++ .../v2/api/cloud_cost_management.feature | 17 ++ 22 files changed, 700 insertions(+), 627 deletions(-) create mode 100644 examples/v2/cloud-cost-management/CreateTagPipelinesRuleset_1897535856.java create mode 100644 examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset_1964644735.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DataAttributesRulesItemsIfTagExists.java rename src/main/java/com/datadog/api/client/v2/model/{CreateRulesetRequestDataAttributesRulesItemsMapping.java => DataAttributesRulesItemsMapping.java} (64%) delete mode 100644 src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsMapping.java delete mode 100644 src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsMapping.java create mode 100644 src/test/resources/cassettes/features/v2/Create_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Create_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Update_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Update_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 050808b8c45..a99a91edd88 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -14407,7 +14407,7 @@ components: key: cost_center value: engineering case_insensitivity: false - if_not_exists: true + if_tag_exists: do_not_apply query: account_id:"123456789" AND service:"web-api" reference_table: null id: New Ruleset @@ -14452,7 +14452,7 @@ components: example: false type: boolean mapping: - $ref: '#/components/schemas/CreateRulesetRequestDataAttributesRulesItemsMapping' + $ref: '#/components/schemas/DataAttributesRulesItemsMapping' metadata: $ref: '#/components/schemas/RulesetItemMetadata' name: @@ -14467,31 +14467,6 @@ components: - enabled - name type: object - CreateRulesetRequestDataAttributesRulesItemsMapping: - description: The definition of `CreateRulesetRequestDataAttributesRulesItemsMapping` - object. - nullable: true - properties: - destination_key: - description: The `mapping` `destination_key`. - example: '' - type: string - if_not_exists: - description: The `mapping` `if_not_exists`. - example: false - type: boolean - source_keys: - description: The `mapping` `source_keys`. - example: - - '' - items: - type: string - type: array - required: - - destination_key - - if_not_exists - - source_keys - type: object CreateRulesetRequestDataAttributesRulesItemsQuery: description: The definition of `CreateRulesetRequestDataAttributesRulesItemsQuery` object. @@ -14503,16 +14478,17 @@ components: description: The `query` `case_insensitivity`. type: boolean if_not_exists: - description: The `query` `if_not_exists`. - example: false + deprecated: true + description: Deprecated. Use `if_tag_exists` instead. The `query` `if_not_exists`. type: boolean + if_tag_exists: + $ref: '#/components/schemas/DataAttributesRulesItemsIfTagExists' query: description: The `query` `query`. example: '' type: string required: - addition - - if_not_exists - query type: object CreateRulesetRequestDataAttributesRulesItemsQueryAddition: @@ -14546,8 +14522,12 @@ components: $ref: '#/components/schemas/CreateRulesetRequestDataAttributesRulesItemsReferenceTableFieldPairsItems' type: array if_not_exists: - description: The `reference_table` `if_not_exists`. + deprecated: true + description: Deprecated. Use `if_tag_exists` instead. The `reference_table` + `if_not_exists`. type: boolean + if_tag_exists: + $ref: '#/components/schemas/DataAttributesRulesItemsIfTagExists' source_keys: description: The `reference_table` `source_keys`. example: @@ -18252,6 +18232,42 @@ components: - INTEGRATION_SCREENBOARD - INTEGRATION_TIMEBOARD - HOST_TIMEBOARD + DataAttributesRulesItemsIfTagExists: + description: The behavior when the tag already exists. + enum: + - append + - do_not_apply + - replace + type: string + x-enum-varnames: + - APPEND + - DO_NOT_APPLY + - REPLACE + DataAttributesRulesItemsMapping: + description: The definition of `DataAttributesRulesItemsMapping` object. + nullable: true + properties: + destination_key: + description: The `mapping` `destination_key`. + example: '' + type: string + if_not_exists: + deprecated: true + description: Deprecated. Use `if_tag_exists` instead. The `mapping` `if_not_exists`. + type: boolean + if_tag_exists: + $ref: '#/components/schemas/DataAttributesRulesItemsIfTagExists' + source_keys: + description: The `mapping` `source_keys`. + example: + - '' + items: + type: string + type: array + required: + - destination_key + - source_keys + type: object DataDeletionResponseItem: description: The created data deletion request information. properties: @@ -49786,13 +49802,13 @@ components: key: abc value: ww case_insensitivity: false - if_not_exists: true + if_tag_exists: do_not_apply query: billingcurrency:"USD" AND account_name:"SZA96462" AND billingcurrency:"USD" reference_table: null - enabled: true mapping: destination_key: h - if_not_exists: true + if_tag_exists: do_not_apply source_keys: - accountname - accountownerid @@ -49812,7 +49828,7 @@ components: output_key: status - input_column: status_description output_key: dess - if_not_exists: false + if_tag_exists: append source_keys: - http_status - status_description @@ -49845,13 +49861,13 @@ components: key: environment value: production case_insensitivity: false - if_not_exists: true + if_tag_exists: do_not_apply query: billingcurrency:"USD" AND account_name:"prod-account" reference_table: null - enabled: true mapping: destination_key: team_owner - if_not_exists: true + if_tag_exists: do_not_apply source_keys: - account_name - service @@ -49871,7 +49887,7 @@ components: output_key: status - input_column: status_description output_key: dess - if_not_exists: false + if_tag_exists: append source_keys: - http_status - status_description @@ -49896,7 +49912,7 @@ components: key: cost_center value: engineering case_insensitivity: true - if_not_exists: true + if_tag_exists: do_not_apply query: account_name:"dev-*" reference_table: null version: 1 @@ -50007,7 +50023,7 @@ components: example: false type: boolean mapping: - $ref: '#/components/schemas/RulesetRespDataAttributesRulesItemsMapping' + $ref: '#/components/schemas/DataAttributesRulesItemsMapping' metadata: $ref: '#/components/schemas/RulesetItemMetadata' name: @@ -50022,31 +50038,6 @@ components: - enabled - name type: object - RulesetRespDataAttributesRulesItemsMapping: - description: The definition of `RulesetRespDataAttributesRulesItemsMapping` - object. - nullable: true - properties: - destination_key: - description: The `mapping` `destination_key`. - example: '' - type: string - if_not_exists: - description: The `mapping` `if_not_exists`. - example: false - type: boolean - source_keys: - description: The `mapping` `source_keys`. - example: - - '' - items: - type: string - type: array - required: - - destination_key - - if_not_exists - - source_keys - type: object RulesetRespDataAttributesRulesItemsQuery: description: The definition of `RulesetRespDataAttributesRulesItemsQuery` object. nullable: true @@ -50057,16 +50048,17 @@ components: description: The `query` `case_insensitivity`. type: boolean if_not_exists: - description: The `query` `if_not_exists`. - example: false + deprecated: true + description: Deprecated. Use `if_tag_exists` instead. The `query` `if_not_exists`. type: boolean + if_tag_exists: + $ref: '#/components/schemas/DataAttributesRulesItemsIfTagExists' query: description: The `query` `query`. example: '' type: string required: - addition - - if_not_exists - query type: object RulesetRespDataAttributesRulesItemsQueryAddition: @@ -50100,8 +50092,12 @@ components: $ref: '#/components/schemas/RulesetRespDataAttributesRulesItemsReferenceTableFieldPairsItems' type: array if_not_exists: - description: The `reference_table` `if_not_exists`. + deprecated: true + description: Deprecated. Use `if_tag_exists` instead. The `reference_table` + `if_not_exists`. type: boolean + if_tag_exists: + $ref: '#/components/schemas/DataAttributesRulesItemsIfTagExists' source_keys: description: The `reference_table` `source_keys`. example: @@ -65004,13 +65000,13 @@ components: key: cost_center value: engineering case_insensitivity: false - if_not_exists: true + if_tag_exists: do_not_apply query: account_id:"123456789" AND service:"web-api" reference_table: null - enabled: true mapping: destination_key: team_owner - if_not_exists: true + if_tag_exists: do_not_apply source_keys: - account_name - account_id @@ -65030,7 +65026,7 @@ components: output_key: status - input_column: status_description output_key: dess - if_not_exists: false + if_tag_exists: append source_keys: - http_status - status_description @@ -65082,7 +65078,7 @@ components: example: false type: boolean mapping: - $ref: '#/components/schemas/UpdateRulesetRequestDataAttributesRulesItemsMapping' + $ref: '#/components/schemas/DataAttributesRulesItemsMapping' metadata: $ref: '#/components/schemas/RulesetItemMetadata' name: @@ -65097,31 +65093,6 @@ components: - enabled - name type: object - UpdateRulesetRequestDataAttributesRulesItemsMapping: - description: The definition of `UpdateRulesetRequestDataAttributesRulesItemsMapping` - object. - nullable: true - properties: - destination_key: - description: The `mapping` `destination_key`. - example: '' - type: string - if_not_exists: - description: The `mapping` `if_not_exists`. - example: false - type: boolean - source_keys: - description: The `mapping` `source_keys`. - example: - - '' - items: - type: string - type: array - required: - - destination_key - - if_not_exists - - source_keys - type: object UpdateRulesetRequestDataAttributesRulesItemsQuery: description: The definition of `UpdateRulesetRequestDataAttributesRulesItemsQuery` object. @@ -65133,16 +65104,17 @@ components: description: The `query` `case_insensitivity`. type: boolean if_not_exists: - description: The `query` `if_not_exists`. - example: false + deprecated: true + description: Deprecated. Use `if_tag_exists` instead. The `query` `if_not_exists`. type: boolean + if_tag_exists: + $ref: '#/components/schemas/DataAttributesRulesItemsIfTagExists' query: description: The `query` `query`. example: '' type: string required: - addition - - if_not_exists - query type: object UpdateRulesetRequestDataAttributesRulesItemsQueryAddition: @@ -65176,8 +65148,12 @@ components: $ref: '#/components/schemas/UpdateRulesetRequestDataAttributesRulesItemsReferenceTableFieldPairsItems' type: array if_not_exists: - description: The `reference_table` `if_not_exists`. + deprecated: true + description: Deprecated. Use `if_tag_exists` instead. The `reference_table` + `if_not_exists`. type: boolean + if_tag_exists: + $ref: '#/components/schemas/DataAttributesRulesItemsIfTagExists' source_keys: description: The `reference_table` `source_keys`. example: diff --git a/examples/v2/cloud-cost-management/CreateTagPipelinesRuleset_1897535856.java b/examples/v2/cloud-cost-management/CreateTagPipelinesRuleset_1897535856.java new file mode 100644 index 00000000000..4c96d5f09a3 --- /dev/null +++ b/examples/v2/cloud-cost-management/CreateTagPipelinesRuleset_1897535856.java @@ -0,0 +1,63 @@ +// Create tag pipeline ruleset with if_tag_exists returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CreateRulesetRequest; +import com.datadog.api.client.v2.model.CreateRulesetRequestData; +import com.datadog.api.client.v2.model.CreateRulesetRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateRulesetRequestDataAttributesRulesItems; +import com.datadog.api.client.v2.model.CreateRulesetRequestDataAttributesRulesItemsQuery; +import com.datadog.api.client.v2.model.CreateRulesetRequestDataAttributesRulesItemsQueryAddition; +import com.datadog.api.client.v2.model.CreateRulesetRequestDataType; +import com.datadog.api.client.v2.model.DataAttributesRulesItemsIfTagExists; +import com.datadog.api.client.v2.model.RulesetResp; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + CreateRulesetRequest body = + new CreateRulesetRequest() + .data( + new CreateRulesetRequestData() + .attributes( + new CreateRulesetRequestDataAttributes() + .enabled(true) + .rules( + Collections.singletonList( + new CreateRulesetRequestDataAttributesRulesItems() + .enabled(true) + .mapping(null) + .name("Add Cost Center Tag") + .query( + new CreateRulesetRequestDataAttributesRulesItemsQuery() + .addition( + new CreateRulesetRequestDataAttributesRulesItemsQueryAddition() + .key("cost_center") + .value("engineering")) + .caseInsensitivity(false) + .ifTagExists( + DataAttributesRulesItemsIfTagExists.REPLACE) + .query( + """ +account_id:"123456789" AND service:"web-api" +""")) + .referenceTable(null)))) + .id("New Ruleset") + .type(CreateRulesetRequestDataType.CREATE_RULESET)); + + try { + RulesetResp result = apiInstance.createTagPipelinesRuleset(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#createTagPipelinesRuleset"); + 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/cloud-cost-management/UpdateTagPipelinesRuleset.java b/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset.java index 934be510385..2999a00dfb8 100644 --- a/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset.java +++ b/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset.java @@ -3,12 +3,12 @@ import com.datadog.api.client.ApiClient; import com.datadog.api.client.ApiException; import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.DataAttributesRulesItemsMapping; import com.datadog.api.client.v2.model.RulesetResp; import com.datadog.api.client.v2.model.UpdateRulesetRequest; import com.datadog.api.client.v2.model.UpdateRulesetRequestData; import com.datadog.api.client.v2.model.UpdateRulesetRequestDataAttributes; import com.datadog.api.client.v2.model.UpdateRulesetRequestDataAttributesRulesItems; -import com.datadog.api.client.v2.model.UpdateRulesetRequestDataAttributesRulesItemsMapping; import com.datadog.api.client.v2.model.UpdateRulesetRequestDataType; import java.util.Arrays; import java.util.Collections; @@ -31,7 +31,7 @@ public static void main(String[] args) { new UpdateRulesetRequestDataAttributesRulesItems() .enabled(true) .mapping( - new UpdateRulesetRequestDataAttributesRulesItemsMapping() + new DataAttributesRulesItemsMapping() .destinationKey("team_owner") .ifNotExists(true) .sourceKeys( diff --git a/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset_1964644735.java b/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset_1964644735.java new file mode 100644 index 00000000000..e49b62edbd5 --- /dev/null +++ b/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset_1964644735.java @@ -0,0 +1,59 @@ +// Update tag pipeline ruleset with if_tag_exists returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.DataAttributesRulesItemsIfTagExists; +import com.datadog.api.client.v2.model.DataAttributesRulesItemsMapping; +import com.datadog.api.client.v2.model.RulesetResp; +import com.datadog.api.client.v2.model.UpdateRulesetRequest; +import com.datadog.api.client.v2.model.UpdateRulesetRequestData; +import com.datadog.api.client.v2.model.UpdateRulesetRequestDataAttributes; +import com.datadog.api.client.v2.model.UpdateRulesetRequestDataAttributesRulesItems; +import com.datadog.api.client.v2.model.UpdateRulesetRequestDataType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + UpdateRulesetRequest body = + new UpdateRulesetRequest() + .data( + new UpdateRulesetRequestData() + .attributes( + new UpdateRulesetRequestDataAttributes() + .enabled(true) + .lastVersion(3611102L) + .rules( + Collections.singletonList( + new UpdateRulesetRequestDataAttributesRulesItems() + .enabled(true) + .mapping( + new DataAttributesRulesItemsMapping() + .destinationKey("team_owner") + .ifTagExists( + DataAttributesRulesItemsIfTagExists.REPLACE) + .sourceKeys( + Arrays.asList("account_name", "account_id"))) + .name("Account Name Mapping") + .query(null) + .referenceTable(null)))) + .id("New Ruleset") + .type(UpdateRulesetRequestDataType.UPDATE_RULESET)); + + try { + RulesetResp result = + apiInstance.updateTagPipelinesRuleset("ee10c3ff-312f-464c-b4f6-46adaa6d00a1", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#updateTagPipelinesRuleset"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItems.java b/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItems.java index 6872437291c..ceb0a1f306f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItems.java @@ -35,8 +35,8 @@ public class CreateRulesetRequestDataAttributesRulesItems { private Boolean enabled; public static final String JSON_PROPERTY_MAPPING = "mapping"; - private JsonNullable mapping = - JsonNullable.undefined(); + private JsonNullable mapping = + JsonNullable.undefined(); public static final String JSON_PROPERTY_METADATA = "metadata"; private JsonNullable> metadata = @@ -84,37 +84,35 @@ public void setEnabled(Boolean enabled) { } public CreateRulesetRequestDataAttributesRulesItems mapping( - CreateRulesetRequestDataAttributesRulesItemsMapping mapping) { - this.mapping = JsonNullable.of(mapping); + DataAttributesRulesItemsMapping mapping) { + this.mapping = JsonNullable.of(mapping); return this; } /** - * The definition of CreateRulesetRequestDataAttributesRulesItemsMapping object. + * The definition of DataAttributesRulesItemsMapping object. * * @return mapping */ @jakarta.annotation.Nullable @JsonIgnore - public CreateRulesetRequestDataAttributesRulesItemsMapping getMapping() { + public DataAttributesRulesItemsMapping getMapping() { return mapping.orElse(null); } @JsonProperty(JSON_PROPERTY_MAPPING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable - getMapping_JsonNullable() { + public JsonNullable getMapping_JsonNullable() { return mapping; } @JsonProperty(JSON_PROPERTY_MAPPING) - public void setMapping_JsonNullable( - JsonNullable mapping) { + public void setMapping_JsonNullable(JsonNullable mapping) { this.mapping = mapping; } - public void setMapping(CreateRulesetRequestDataAttributesRulesItemsMapping mapping) { - this.mapping = JsonNullable.of(mapping); + public void setMapping(DataAttributesRulesItemsMapping mapping) { + this.mapping = JsonNullable.of(mapping); } public CreateRulesetRequestDataAttributesRulesItems metadata(Map metadata) { diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsQuery.java b/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsQuery.java index eb10696fb86..8fcd61af0ea 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsQuery.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsQuery.java @@ -22,6 +22,7 @@ CreateRulesetRequestDataAttributesRulesItemsQuery.JSON_PROPERTY_ADDITION, CreateRulesetRequestDataAttributesRulesItemsQuery.JSON_PROPERTY_CASE_INSENSITIVITY, CreateRulesetRequestDataAttributesRulesItemsQuery.JSON_PROPERTY_IF_NOT_EXISTS, + CreateRulesetRequestDataAttributesRulesItemsQuery.JSON_PROPERTY_IF_TAG_EXISTS, CreateRulesetRequestDataAttributesRulesItemsQuery.JSON_PROPERTY_QUERY }) @jakarta.annotation.Generated( @@ -37,6 +38,9 @@ public class CreateRulesetRequestDataAttributesRulesItemsQuery { public static final String JSON_PROPERTY_IF_NOT_EXISTS = "if_not_exists"; private Boolean ifNotExists; + public static final String JSON_PROPERTY_IF_TAG_EXISTS = "if_tag_exists"; + private DataAttributesRulesItemsIfTagExists ifTagExists; + public static final String JSON_PROPERTY_QUERY = "query"; private String query; @@ -46,13 +50,11 @@ public CreateRulesetRequestDataAttributesRulesItemsQuery() {} public CreateRulesetRequestDataAttributesRulesItemsQuery( @JsonProperty(required = true, value = JSON_PROPERTY_ADDITION) CreateRulesetRequestDataAttributesRulesItemsQueryAddition addition, - @JsonProperty(required = true, value = JSON_PROPERTY_IF_NOT_EXISTS) Boolean ifNotExists, @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { this.addition = addition; if (addition != null) { this.unparsed |= addition.unparsed; } - this.ifNotExists = ifNotExists; this.query = query; } @@ -110,20 +112,51 @@ public CreateRulesetRequestDataAttributesRulesItemsQuery ifNotExists(Boolean ifN } /** - * The query if_not_exists. + * Deprecated. Use if_tag_exists instead. The query if_not_exists + * . * * @return ifNotExists + * @deprecated */ + @Deprecated + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_IF_NOT_EXISTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getIfNotExists() { return ifNotExists; } + @Deprecated public void setIfNotExists(Boolean ifNotExists) { this.ifNotExists = ifNotExists; } + public CreateRulesetRequestDataAttributesRulesItemsQuery ifTagExists( + DataAttributesRulesItemsIfTagExists ifTagExists) { + this.ifTagExists = ifTagExists; + this.unparsed |= !ifTagExists.isValid(); + return this; + } + + /** + * The behavior when the tag already exists. + * + * @return ifTagExists + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IF_TAG_EXISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DataAttributesRulesItemsIfTagExists getIfTagExists() { + return ifTagExists; + } + + public void setIfTagExists(DataAttributesRulesItemsIfTagExists ifTagExists) { + if (!ifTagExists.isValid()) { + this.unparsed = true; + } + this.ifTagExists = ifTagExists; + } + public CreateRulesetRequestDataAttributesRulesItemsQuery query(String query) { this.query = query; return this; @@ -209,6 +242,8 @@ public boolean equals(Object o) { createRulesetRequestDataAttributesRulesItemsQuery.caseInsensitivity) && Objects.equals( this.ifNotExists, createRulesetRequestDataAttributesRulesItemsQuery.ifNotExists) + && Objects.equals( + this.ifTagExists, createRulesetRequestDataAttributesRulesItemsQuery.ifTagExists) && Objects.equals(this.query, createRulesetRequestDataAttributesRulesItemsQuery.query) && Objects.equals( this.additionalProperties, @@ -217,7 +252,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(addition, caseInsensitivity, ifNotExists, query, additionalProperties); + return Objects.hash( + addition, caseInsensitivity, ifNotExists, ifTagExists, query, additionalProperties); } @Override @@ -227,6 +263,7 @@ public String toString() { sb.append(" addition: ").append(toIndentedString(addition)).append("\n"); sb.append(" caseInsensitivity: ").append(toIndentedString(caseInsensitivity)).append("\n"); sb.append(" ifNotExists: ").append(toIndentedString(ifNotExists)).append("\n"); + sb.append(" ifTagExists: ").append(toIndentedString(ifTagExists)).append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsReferenceTable.java b/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsReferenceTable.java index 7a015154f4d..de9aac6da87 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsReferenceTable.java +++ b/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsReferenceTable.java @@ -26,6 +26,7 @@ CreateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_CASE_INSENSITIVITY, CreateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_FIELD_PAIRS, CreateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_IF_NOT_EXISTS, + CreateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_IF_TAG_EXISTS, CreateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_SOURCE_KEYS, CreateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_TABLE_NAME }) @@ -43,6 +44,9 @@ public class CreateRulesetRequestDataAttributesRulesItemsReferenceTable { public static final String JSON_PROPERTY_IF_NOT_EXISTS = "if_not_exists"; private Boolean ifNotExists; + public static final String JSON_PROPERTY_IF_TAG_EXISTS = "if_tag_exists"; + private DataAttributesRulesItemsIfTagExists ifTagExists; + public static final String JSON_PROPERTY_SOURCE_KEYS = "source_keys"; private List sourceKeys = new ArrayList<>(); @@ -126,10 +130,13 @@ public CreateRulesetRequestDataAttributesRulesItemsReferenceTable ifNotExists( } /** - * The reference_table if_not_exists. + * Deprecated. Use if_tag_exists instead. The reference_table + * if_not_exists. * * @return ifNotExists + * @deprecated */ + @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_IF_NOT_EXISTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -137,10 +144,37 @@ public Boolean getIfNotExists() { return ifNotExists; } + @Deprecated public void setIfNotExists(Boolean ifNotExists) { this.ifNotExists = ifNotExists; } + public CreateRulesetRequestDataAttributesRulesItemsReferenceTable ifTagExists( + DataAttributesRulesItemsIfTagExists ifTagExists) { + this.ifTagExists = ifTagExists; + this.unparsed |= !ifTagExists.isValid(); + return this; + } + + /** + * The behavior when the tag already exists. + * + * @return ifTagExists + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IF_TAG_EXISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DataAttributesRulesItemsIfTagExists getIfTagExists() { + return ifTagExists; + } + + public void setIfTagExists(DataAttributesRulesItemsIfTagExists ifTagExists) { + if (!ifTagExists.isValid()) { + this.unparsed = true; + } + this.ifTagExists = ifTagExists; + } + public CreateRulesetRequestDataAttributesRulesItemsReferenceTable sourceKeys( List sourceKeys) { this.sourceKeys = sourceKeys; @@ -258,6 +292,9 @@ public boolean equals(Object o) { && Objects.equals( this.ifNotExists, createRulesetRequestDataAttributesRulesItemsReferenceTable.ifNotExists) + && Objects.equals( + this.ifTagExists, + createRulesetRequestDataAttributesRulesItemsReferenceTable.ifTagExists) && Objects.equals( this.sourceKeys, createRulesetRequestDataAttributesRulesItemsReferenceTable.sourceKeys) && Objects.equals( @@ -270,7 +307,13 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - caseInsensitivity, fieldPairs, ifNotExists, sourceKeys, tableName, additionalProperties); + caseInsensitivity, + fieldPairs, + ifNotExists, + ifTagExists, + sourceKeys, + tableName, + additionalProperties); } @Override @@ -280,6 +323,7 @@ public String toString() { sb.append(" caseInsensitivity: ").append(toIndentedString(caseInsensitivity)).append("\n"); sb.append(" fieldPairs: ").append(toIndentedString(fieldPairs)).append("\n"); sb.append(" ifNotExists: ").append(toIndentedString(ifNotExists)).append("\n"); + sb.append(" ifTagExists: ").append(toIndentedString(ifTagExists)).append("\n"); sb.append(" sourceKeys: ").append(toIndentedString(sourceKeys)).append("\n"); sb.append(" tableName: ").append(toIndentedString(tableName)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/DataAttributesRulesItemsIfTagExists.java b/src/main/java/com/datadog/api/client/v2/model/DataAttributesRulesItemsIfTagExists.java new file mode 100644 index 00000000000..7f2f8b24bb1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DataAttributesRulesItemsIfTagExists.java @@ -0,0 +1,63 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.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; + +/** The behavior when the tag already exists. */ +@JsonSerialize( + using = DataAttributesRulesItemsIfTagExists.DataAttributesRulesItemsIfTagExistsSerializer.class) +public class DataAttributesRulesItemsIfTagExists extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("append", "do_not_apply", "replace")); + + public static final DataAttributesRulesItemsIfTagExists APPEND = + new DataAttributesRulesItemsIfTagExists("append"); + public static final DataAttributesRulesItemsIfTagExists DO_NOT_APPLY = + new DataAttributesRulesItemsIfTagExists("do_not_apply"); + public static final DataAttributesRulesItemsIfTagExists REPLACE = + new DataAttributesRulesItemsIfTagExists("replace"); + + DataAttributesRulesItemsIfTagExists(String value) { + super(value, allowedValues); + } + + public static class DataAttributesRulesItemsIfTagExistsSerializer + extends StdSerializer { + public DataAttributesRulesItemsIfTagExistsSerializer( + Class t) { + super(t); + } + + public DataAttributesRulesItemsIfTagExistsSerializer() { + this(null); + } + + @Override + public void serialize( + DataAttributesRulesItemsIfTagExists value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DataAttributesRulesItemsIfTagExists fromValue(String value) { + return new DataAttributesRulesItemsIfTagExists(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsMapping.java b/src/main/java/com/datadog/api/client/v2/model/DataAttributesRulesItemsMapping.java similarity index 64% rename from src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsMapping.java rename to src/main/java/com/datadog/api/client/v2/model/DataAttributesRulesItemsMapping.java index 76763e40189..8d4dd25f287 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CreateRulesetRequestDataAttributesRulesItemsMapping.java +++ b/src/main/java/com/datadog/api/client/v2/model/DataAttributesRulesItemsMapping.java @@ -19,15 +19,16 @@ import java.util.Map; import java.util.Objects; -/** The definition of CreateRulesetRequestDataAttributesRulesItemsMapping object. */ +/** The definition of DataAttributesRulesItemsMapping object. */ @JsonPropertyOrder({ - CreateRulesetRequestDataAttributesRulesItemsMapping.JSON_PROPERTY_DESTINATION_KEY, - CreateRulesetRequestDataAttributesRulesItemsMapping.JSON_PROPERTY_IF_NOT_EXISTS, - CreateRulesetRequestDataAttributesRulesItemsMapping.JSON_PROPERTY_SOURCE_KEYS + DataAttributesRulesItemsMapping.JSON_PROPERTY_DESTINATION_KEY, + DataAttributesRulesItemsMapping.JSON_PROPERTY_IF_NOT_EXISTS, + DataAttributesRulesItemsMapping.JSON_PROPERTY_IF_TAG_EXISTS, + DataAttributesRulesItemsMapping.JSON_PROPERTY_SOURCE_KEYS }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class CreateRulesetRequestDataAttributesRulesItemsMapping { +public class DataAttributesRulesItemsMapping { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DESTINATION_KEY = "destination_key"; private String destinationKey; @@ -35,22 +36,23 @@ public class CreateRulesetRequestDataAttributesRulesItemsMapping { public static final String JSON_PROPERTY_IF_NOT_EXISTS = "if_not_exists"; private Boolean ifNotExists; + public static final String JSON_PROPERTY_IF_TAG_EXISTS = "if_tag_exists"; + private DataAttributesRulesItemsIfTagExists ifTagExists; + public static final String JSON_PROPERTY_SOURCE_KEYS = "source_keys"; private List sourceKeys = new ArrayList<>(); - public CreateRulesetRequestDataAttributesRulesItemsMapping() {} + public DataAttributesRulesItemsMapping() {} @JsonCreator - public CreateRulesetRequestDataAttributesRulesItemsMapping( + public DataAttributesRulesItemsMapping( @JsonProperty(required = true, value = JSON_PROPERTY_DESTINATION_KEY) String destinationKey, - @JsonProperty(required = true, value = JSON_PROPERTY_IF_NOT_EXISTS) Boolean ifNotExists, @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE_KEYS) List sourceKeys) { this.destinationKey = destinationKey; - this.ifNotExists = ifNotExists; this.sourceKeys = sourceKeys; } - public CreateRulesetRequestDataAttributesRulesItemsMapping destinationKey(String destinationKey) { + public DataAttributesRulesItemsMapping destinationKey(String destinationKey) { this.destinationKey = destinationKey; return this; } @@ -70,33 +72,63 @@ public void setDestinationKey(String destinationKey) { this.destinationKey = destinationKey; } - public CreateRulesetRequestDataAttributesRulesItemsMapping ifNotExists(Boolean ifNotExists) { + public DataAttributesRulesItemsMapping ifNotExists(Boolean ifNotExists) { this.ifNotExists = ifNotExists; return this; } /** - * The mapping if_not_exists. + * Deprecated. Use if_tag_exists instead. The mapping + * if_not_exists. * * @return ifNotExists + * @deprecated */ + @Deprecated + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_IF_NOT_EXISTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getIfNotExists() { return ifNotExists; } + @Deprecated public void setIfNotExists(Boolean ifNotExists) { this.ifNotExists = ifNotExists; } - public CreateRulesetRequestDataAttributesRulesItemsMapping sourceKeys(List sourceKeys) { + public DataAttributesRulesItemsMapping ifTagExists( + DataAttributesRulesItemsIfTagExists ifTagExists) { + this.ifTagExists = ifTagExists; + this.unparsed |= !ifTagExists.isValid(); + return this; + } + + /** + * The behavior when the tag already exists. + * + * @return ifTagExists + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IF_TAG_EXISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DataAttributesRulesItemsIfTagExists getIfTagExists() { + return ifTagExists; + } + + public void setIfTagExists(DataAttributesRulesItemsIfTagExists ifTagExists) { + if (!ifTagExists.isValid()) { + this.unparsed = true; + } + this.ifTagExists = ifTagExists; + } + + public DataAttributesRulesItemsMapping sourceKeys(List sourceKeys) { this.sourceKeys = sourceKeys; return this; } - public CreateRulesetRequestDataAttributesRulesItemsMapping addSourceKeysItem( - String sourceKeysItem) { + public DataAttributesRulesItemsMapping addSourceKeysItem(String sourceKeysItem) { this.sourceKeys.add(sourceKeysItem); return this; } @@ -128,11 +160,10 @@ public void setSourceKeys(List sourceKeys) { * * @param key The arbitrary key to set * @param value The associated value - * @return CreateRulesetRequestDataAttributesRulesItemsMapping + * @return DataAttributesRulesItemsMapping */ @JsonAnySetter - public CreateRulesetRequestDataAttributesRulesItemsMapping putAdditionalProperty( - String key, Object value) { + public DataAttributesRulesItemsMapping putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -163,9 +194,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** - * Return true if this CreateRulesetRequestDataAttributesRulesItemsMapping object is equal to o. - */ + /** Return true if this DataAttributesRulesItemsMapping object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -174,31 +203,28 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - CreateRulesetRequestDataAttributesRulesItemsMapping - createRulesetRequestDataAttributesRulesItemsMapping = - (CreateRulesetRequestDataAttributesRulesItemsMapping) o; - return Objects.equals( - this.destinationKey, createRulesetRequestDataAttributesRulesItemsMapping.destinationKey) - && Objects.equals( - this.ifNotExists, createRulesetRequestDataAttributesRulesItemsMapping.ifNotExists) - && Objects.equals( - this.sourceKeys, createRulesetRequestDataAttributesRulesItemsMapping.sourceKeys) + DataAttributesRulesItemsMapping dataAttributesRulesItemsMapping = + (DataAttributesRulesItemsMapping) o; + return Objects.equals(this.destinationKey, dataAttributesRulesItemsMapping.destinationKey) + && Objects.equals(this.ifNotExists, dataAttributesRulesItemsMapping.ifNotExists) + && Objects.equals(this.ifTagExists, dataAttributesRulesItemsMapping.ifTagExists) + && Objects.equals(this.sourceKeys, dataAttributesRulesItemsMapping.sourceKeys) && Objects.equals( - this.additionalProperties, - createRulesetRequestDataAttributesRulesItemsMapping.additionalProperties); + this.additionalProperties, dataAttributesRulesItemsMapping.additionalProperties); } @Override public int hashCode() { - return Objects.hash(destinationKey, ifNotExists, sourceKeys, additionalProperties); + return Objects.hash(destinationKey, ifNotExists, ifTagExists, sourceKeys, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class CreateRulesetRequestDataAttributesRulesItemsMapping {\n"); + sb.append("class DataAttributesRulesItemsMapping {\n"); sb.append(" destinationKey: ").append(toIndentedString(destinationKey)).append("\n"); sb.append(" ifNotExists: ").append(toIndentedString(ifNotExists)).append("\n"); + sb.append(" ifTagExists: ").append(toIndentedString(ifTagExists)).append("\n"); sb.append(" sourceKeys: ").append(toIndentedString(sourceKeys)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItems.java b/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItems.java index ef8eb0ebcf2..b4910d62c69 100644 --- a/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItems.java @@ -35,8 +35,8 @@ public class RulesetRespDataAttributesRulesItems { private Boolean enabled; public static final String JSON_PROPERTY_MAPPING = "mapping"; - private JsonNullable mapping = - JsonNullable.undefined(); + private JsonNullable mapping = + JsonNullable.undefined(); public static final String JSON_PROPERTY_METADATA = "metadata"; private JsonNullable> metadata = @@ -83,37 +83,35 @@ public void setEnabled(Boolean enabled) { this.enabled = enabled; } - public RulesetRespDataAttributesRulesItems mapping( - RulesetRespDataAttributesRulesItemsMapping mapping) { - this.mapping = JsonNullable.of(mapping); + public RulesetRespDataAttributesRulesItems mapping(DataAttributesRulesItemsMapping mapping) { + this.mapping = JsonNullable.of(mapping); return this; } /** - * The definition of RulesetRespDataAttributesRulesItemsMapping object. + * The definition of DataAttributesRulesItemsMapping object. * * @return mapping */ @jakarta.annotation.Nullable @JsonIgnore - public RulesetRespDataAttributesRulesItemsMapping getMapping() { + public DataAttributesRulesItemsMapping getMapping() { return mapping.orElse(null); } @JsonProperty(JSON_PROPERTY_MAPPING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable getMapping_JsonNullable() { + public JsonNullable getMapping_JsonNullable() { return mapping; } @JsonProperty(JSON_PROPERTY_MAPPING) - public void setMapping_JsonNullable( - JsonNullable mapping) { + public void setMapping_JsonNullable(JsonNullable mapping) { this.mapping = mapping; } - public void setMapping(RulesetRespDataAttributesRulesItemsMapping mapping) { - this.mapping = JsonNullable.of(mapping); + public void setMapping(DataAttributesRulesItemsMapping mapping) { + this.mapping = JsonNullable.of(mapping); } public RulesetRespDataAttributesRulesItems metadata(Map metadata) { diff --git a/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsMapping.java b/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsMapping.java deleted file mode 100644 index 69faa3ecdc1..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsMapping.java +++ /dev/null @@ -1,213 +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; - -/** The definition of RulesetRespDataAttributesRulesItemsMapping object. */ -@JsonPropertyOrder({ - RulesetRespDataAttributesRulesItemsMapping.JSON_PROPERTY_DESTINATION_KEY, - RulesetRespDataAttributesRulesItemsMapping.JSON_PROPERTY_IF_NOT_EXISTS, - RulesetRespDataAttributesRulesItemsMapping.JSON_PROPERTY_SOURCE_KEYS -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class RulesetRespDataAttributesRulesItemsMapping { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_DESTINATION_KEY = "destination_key"; - private String destinationKey; - - public static final String JSON_PROPERTY_IF_NOT_EXISTS = "if_not_exists"; - private Boolean ifNotExists; - - public static final String JSON_PROPERTY_SOURCE_KEYS = "source_keys"; - private List sourceKeys = new ArrayList<>(); - - public RulesetRespDataAttributesRulesItemsMapping() {} - - @JsonCreator - public RulesetRespDataAttributesRulesItemsMapping( - @JsonProperty(required = true, value = JSON_PROPERTY_DESTINATION_KEY) String destinationKey, - @JsonProperty(required = true, value = JSON_PROPERTY_IF_NOT_EXISTS) Boolean ifNotExists, - @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE_KEYS) List sourceKeys) { - this.destinationKey = destinationKey; - this.ifNotExists = ifNotExists; - this.sourceKeys = sourceKeys; - } - - public RulesetRespDataAttributesRulesItemsMapping destinationKey(String destinationKey) { - this.destinationKey = destinationKey; - return this; - } - - /** - * The mapping destination_key. - * - * @return destinationKey - */ - @JsonProperty(JSON_PROPERTY_DESTINATION_KEY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getDestinationKey() { - return destinationKey; - } - - public void setDestinationKey(String destinationKey) { - this.destinationKey = destinationKey; - } - - public RulesetRespDataAttributesRulesItemsMapping ifNotExists(Boolean ifNotExists) { - this.ifNotExists = ifNotExists; - return this; - } - - /** - * The mapping if_not_exists. - * - * @return ifNotExists - */ - @JsonProperty(JSON_PROPERTY_IF_NOT_EXISTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getIfNotExists() { - return ifNotExists; - } - - public void setIfNotExists(Boolean ifNotExists) { - this.ifNotExists = ifNotExists; - } - - public RulesetRespDataAttributesRulesItemsMapping sourceKeys(List sourceKeys) { - this.sourceKeys = sourceKeys; - return this; - } - - public RulesetRespDataAttributesRulesItemsMapping addSourceKeysItem(String sourceKeysItem) { - this.sourceKeys.add(sourceKeysItem); - return this; - } - - /** - * The mapping source_keys. - * - * @return sourceKeys - */ - @JsonProperty(JSON_PROPERTY_SOURCE_KEYS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSourceKeys() { - return sourceKeys; - } - - public void setSourceKeys(List sourceKeys) { - this.sourceKeys = sourceKeys; - } - - /** - * 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 RulesetRespDataAttributesRulesItemsMapping - */ - @JsonAnySetter - public RulesetRespDataAttributesRulesItemsMapping 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 RulesetRespDataAttributesRulesItemsMapping object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - RulesetRespDataAttributesRulesItemsMapping rulesetRespDataAttributesRulesItemsMapping = - (RulesetRespDataAttributesRulesItemsMapping) o; - return Objects.equals( - this.destinationKey, rulesetRespDataAttributesRulesItemsMapping.destinationKey) - && Objects.equals(this.ifNotExists, rulesetRespDataAttributesRulesItemsMapping.ifNotExists) - && Objects.equals(this.sourceKeys, rulesetRespDataAttributesRulesItemsMapping.sourceKeys) - && Objects.equals( - this.additionalProperties, - rulesetRespDataAttributesRulesItemsMapping.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(destinationKey, ifNotExists, sourceKeys, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class RulesetRespDataAttributesRulesItemsMapping {\n"); - sb.append(" destinationKey: ").append(toIndentedString(destinationKey)).append("\n"); - sb.append(" ifNotExists: ").append(toIndentedString(ifNotExists)).append("\n"); - sb.append(" sourceKeys: ").append(toIndentedString(sourceKeys)).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/RulesetRespDataAttributesRulesItemsQuery.java b/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsQuery.java index cefb089d159..93556da2a78 100644 --- a/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsQuery.java +++ b/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsQuery.java @@ -22,6 +22,7 @@ RulesetRespDataAttributesRulesItemsQuery.JSON_PROPERTY_ADDITION, RulesetRespDataAttributesRulesItemsQuery.JSON_PROPERTY_CASE_INSENSITIVITY, RulesetRespDataAttributesRulesItemsQuery.JSON_PROPERTY_IF_NOT_EXISTS, + RulesetRespDataAttributesRulesItemsQuery.JSON_PROPERTY_IF_TAG_EXISTS, RulesetRespDataAttributesRulesItemsQuery.JSON_PROPERTY_QUERY }) @jakarta.annotation.Generated( @@ -37,6 +38,9 @@ public class RulesetRespDataAttributesRulesItemsQuery { public static final String JSON_PROPERTY_IF_NOT_EXISTS = "if_not_exists"; private Boolean ifNotExists; + public static final String JSON_PROPERTY_IF_TAG_EXISTS = "if_tag_exists"; + private DataAttributesRulesItemsIfTagExists ifTagExists; + public static final String JSON_PROPERTY_QUERY = "query"; private String query; @@ -46,13 +50,11 @@ public RulesetRespDataAttributesRulesItemsQuery() {} public RulesetRespDataAttributesRulesItemsQuery( @JsonProperty(required = true, value = JSON_PROPERTY_ADDITION) RulesetRespDataAttributesRulesItemsQueryAddition addition, - @JsonProperty(required = true, value = JSON_PROPERTY_IF_NOT_EXISTS) Boolean ifNotExists, @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { this.addition = addition; if (addition != null) { this.unparsed |= addition.unparsed; } - this.ifNotExists = ifNotExists; this.query = query; } @@ -108,20 +110,51 @@ public RulesetRespDataAttributesRulesItemsQuery ifNotExists(Boolean ifNotExists) } /** - * The query if_not_exists. + * Deprecated. Use if_tag_exists instead. The query if_not_exists + * . * * @return ifNotExists + * @deprecated */ + @Deprecated + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_IF_NOT_EXISTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getIfNotExists() { return ifNotExists; } + @Deprecated public void setIfNotExists(Boolean ifNotExists) { this.ifNotExists = ifNotExists; } + public RulesetRespDataAttributesRulesItemsQuery ifTagExists( + DataAttributesRulesItemsIfTagExists ifTagExists) { + this.ifTagExists = ifTagExists; + this.unparsed |= !ifTagExists.isValid(); + return this; + } + + /** + * The behavior when the tag already exists. + * + * @return ifTagExists + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IF_TAG_EXISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DataAttributesRulesItemsIfTagExists getIfTagExists() { + return ifTagExists; + } + + public void setIfTagExists(DataAttributesRulesItemsIfTagExists ifTagExists) { + if (!ifTagExists.isValid()) { + this.unparsed = true; + } + this.ifTagExists = ifTagExists; + } + public RulesetRespDataAttributesRulesItemsQuery query(String query) { this.query = query; return this; @@ -203,6 +236,7 @@ public boolean equals(Object o) { && Objects.equals( this.caseInsensitivity, rulesetRespDataAttributesRulesItemsQuery.caseInsensitivity) && Objects.equals(this.ifNotExists, rulesetRespDataAttributesRulesItemsQuery.ifNotExists) + && Objects.equals(this.ifTagExists, rulesetRespDataAttributesRulesItemsQuery.ifTagExists) && Objects.equals(this.query, rulesetRespDataAttributesRulesItemsQuery.query) && Objects.equals( this.additionalProperties, @@ -211,7 +245,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(addition, caseInsensitivity, ifNotExists, query, additionalProperties); + return Objects.hash( + addition, caseInsensitivity, ifNotExists, ifTagExists, query, additionalProperties); } @Override @@ -221,6 +256,7 @@ public String toString() { sb.append(" addition: ").append(toIndentedString(addition)).append("\n"); sb.append(" caseInsensitivity: ").append(toIndentedString(caseInsensitivity)).append("\n"); sb.append(" ifNotExists: ").append(toIndentedString(ifNotExists)).append("\n"); + sb.append(" ifTagExists: ").append(toIndentedString(ifTagExists)).append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsReferenceTable.java b/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsReferenceTable.java index 92ec35fd453..6ceb63fbbad 100644 --- a/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsReferenceTable.java +++ b/src/main/java/com/datadog/api/client/v2/model/RulesetRespDataAttributesRulesItemsReferenceTable.java @@ -24,6 +24,7 @@ RulesetRespDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_CASE_INSENSITIVITY, RulesetRespDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_FIELD_PAIRS, RulesetRespDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_IF_NOT_EXISTS, + RulesetRespDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_IF_TAG_EXISTS, RulesetRespDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_SOURCE_KEYS, RulesetRespDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_TABLE_NAME }) @@ -41,6 +42,9 @@ public class RulesetRespDataAttributesRulesItemsReferenceTable { public static final String JSON_PROPERTY_IF_NOT_EXISTS = "if_not_exists"; private Boolean ifNotExists; + public static final String JSON_PROPERTY_IF_TAG_EXISTS = "if_tag_exists"; + private DataAttributesRulesItemsIfTagExists ifTagExists; + public static final String JSON_PROPERTY_SOURCE_KEYS = "source_keys"; private List sourceKeys = new ArrayList<>(); @@ -120,10 +124,13 @@ public RulesetRespDataAttributesRulesItemsReferenceTable ifNotExists(Boolean ifN } /** - * The reference_table if_not_exists. + * Deprecated. Use if_tag_exists instead. The reference_table + * if_not_exists. * * @return ifNotExists + * @deprecated */ + @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_IF_NOT_EXISTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -131,10 +138,37 @@ public Boolean getIfNotExists() { return ifNotExists; } + @Deprecated public void setIfNotExists(Boolean ifNotExists) { this.ifNotExists = ifNotExists; } + public RulesetRespDataAttributesRulesItemsReferenceTable ifTagExists( + DataAttributesRulesItemsIfTagExists ifTagExists) { + this.ifTagExists = ifTagExists; + this.unparsed |= !ifTagExists.isValid(); + return this; + } + + /** + * The behavior when the tag already exists. + * + * @return ifTagExists + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IF_TAG_EXISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DataAttributesRulesItemsIfTagExists getIfTagExists() { + return ifTagExists; + } + + public void setIfTagExists(DataAttributesRulesItemsIfTagExists ifTagExists) { + if (!ifTagExists.isValid()) { + this.unparsed = true; + } + this.ifTagExists = ifTagExists; + } + public RulesetRespDataAttributesRulesItemsReferenceTable sourceKeys(List sourceKeys) { this.sourceKeys = sourceKeys; return this; @@ -247,6 +281,8 @@ public boolean equals(Object o) { this.fieldPairs, rulesetRespDataAttributesRulesItemsReferenceTable.fieldPairs) && Objects.equals( this.ifNotExists, rulesetRespDataAttributesRulesItemsReferenceTable.ifNotExists) + && Objects.equals( + this.ifTagExists, rulesetRespDataAttributesRulesItemsReferenceTable.ifTagExists) && Objects.equals( this.sourceKeys, rulesetRespDataAttributesRulesItemsReferenceTable.sourceKeys) && Objects.equals( @@ -259,7 +295,13 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - caseInsensitivity, fieldPairs, ifNotExists, sourceKeys, tableName, additionalProperties); + caseInsensitivity, + fieldPairs, + ifNotExists, + ifTagExists, + sourceKeys, + tableName, + additionalProperties); } @Override @@ -269,6 +311,7 @@ public String toString() { sb.append(" caseInsensitivity: ").append(toIndentedString(caseInsensitivity)).append("\n"); sb.append(" fieldPairs: ").append(toIndentedString(fieldPairs)).append("\n"); sb.append(" ifNotExists: ").append(toIndentedString(ifNotExists)).append("\n"); + sb.append(" ifTagExists: ").append(toIndentedString(ifTagExists)).append("\n"); sb.append(" sourceKeys: ").append(toIndentedString(sourceKeys)).append("\n"); sb.append(" tableName: ").append(toIndentedString(tableName)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItems.java b/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItems.java index a7d70440dd5..ab1a3be3941 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItems.java @@ -35,8 +35,8 @@ public class UpdateRulesetRequestDataAttributesRulesItems { private Boolean enabled; public static final String JSON_PROPERTY_MAPPING = "mapping"; - private JsonNullable mapping = - JsonNullable.undefined(); + private JsonNullable mapping = + JsonNullable.undefined(); public static final String JSON_PROPERTY_METADATA = "metadata"; private JsonNullable> metadata = @@ -84,37 +84,35 @@ public void setEnabled(Boolean enabled) { } public UpdateRulesetRequestDataAttributesRulesItems mapping( - UpdateRulesetRequestDataAttributesRulesItemsMapping mapping) { - this.mapping = JsonNullable.of(mapping); + DataAttributesRulesItemsMapping mapping) { + this.mapping = JsonNullable.of(mapping); return this; } /** - * The definition of UpdateRulesetRequestDataAttributesRulesItemsMapping object. + * The definition of DataAttributesRulesItemsMapping object. * * @return mapping */ @jakarta.annotation.Nullable @JsonIgnore - public UpdateRulesetRequestDataAttributesRulesItemsMapping getMapping() { + public DataAttributesRulesItemsMapping getMapping() { return mapping.orElse(null); } @JsonProperty(JSON_PROPERTY_MAPPING) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public JsonNullable - getMapping_JsonNullable() { + public JsonNullable getMapping_JsonNullable() { return mapping; } @JsonProperty(JSON_PROPERTY_MAPPING) - public void setMapping_JsonNullable( - JsonNullable mapping) { + public void setMapping_JsonNullable(JsonNullable mapping) { this.mapping = mapping; } - public void setMapping(UpdateRulesetRequestDataAttributesRulesItemsMapping mapping) { - this.mapping = JsonNullable.of(mapping); + public void setMapping(DataAttributesRulesItemsMapping mapping) { + this.mapping = JsonNullable.of(mapping); } public UpdateRulesetRequestDataAttributesRulesItems metadata(Map metadata) { diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsMapping.java b/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsMapping.java deleted file mode 100644 index a8fd9da86b3..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsMapping.java +++ /dev/null @@ -1,219 +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; - -/** The definition of UpdateRulesetRequestDataAttributesRulesItemsMapping object. */ -@JsonPropertyOrder({ - UpdateRulesetRequestDataAttributesRulesItemsMapping.JSON_PROPERTY_DESTINATION_KEY, - UpdateRulesetRequestDataAttributesRulesItemsMapping.JSON_PROPERTY_IF_NOT_EXISTS, - UpdateRulesetRequestDataAttributesRulesItemsMapping.JSON_PROPERTY_SOURCE_KEYS -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class UpdateRulesetRequestDataAttributesRulesItemsMapping { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_DESTINATION_KEY = "destination_key"; - private String destinationKey; - - public static final String JSON_PROPERTY_IF_NOT_EXISTS = "if_not_exists"; - private Boolean ifNotExists; - - public static final String JSON_PROPERTY_SOURCE_KEYS = "source_keys"; - private List sourceKeys = new ArrayList<>(); - - public UpdateRulesetRequestDataAttributesRulesItemsMapping() {} - - @JsonCreator - public UpdateRulesetRequestDataAttributesRulesItemsMapping( - @JsonProperty(required = true, value = JSON_PROPERTY_DESTINATION_KEY) String destinationKey, - @JsonProperty(required = true, value = JSON_PROPERTY_IF_NOT_EXISTS) Boolean ifNotExists, - @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE_KEYS) List sourceKeys) { - this.destinationKey = destinationKey; - this.ifNotExists = ifNotExists; - this.sourceKeys = sourceKeys; - } - - public UpdateRulesetRequestDataAttributesRulesItemsMapping destinationKey(String destinationKey) { - this.destinationKey = destinationKey; - return this; - } - - /** - * The mapping destination_key. - * - * @return destinationKey - */ - @JsonProperty(JSON_PROPERTY_DESTINATION_KEY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getDestinationKey() { - return destinationKey; - } - - public void setDestinationKey(String destinationKey) { - this.destinationKey = destinationKey; - } - - public UpdateRulesetRequestDataAttributesRulesItemsMapping ifNotExists(Boolean ifNotExists) { - this.ifNotExists = ifNotExists; - return this; - } - - /** - * The mapping if_not_exists. - * - * @return ifNotExists - */ - @JsonProperty(JSON_PROPERTY_IF_NOT_EXISTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getIfNotExists() { - return ifNotExists; - } - - public void setIfNotExists(Boolean ifNotExists) { - this.ifNotExists = ifNotExists; - } - - public UpdateRulesetRequestDataAttributesRulesItemsMapping sourceKeys(List sourceKeys) { - this.sourceKeys = sourceKeys; - return this; - } - - public UpdateRulesetRequestDataAttributesRulesItemsMapping addSourceKeysItem( - String sourceKeysItem) { - this.sourceKeys.add(sourceKeysItem); - return this; - } - - /** - * The mapping source_keys. - * - * @return sourceKeys - */ - @JsonProperty(JSON_PROPERTY_SOURCE_KEYS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getSourceKeys() { - return sourceKeys; - } - - public void setSourceKeys(List sourceKeys) { - this.sourceKeys = sourceKeys; - } - - /** - * 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 UpdateRulesetRequestDataAttributesRulesItemsMapping - */ - @JsonAnySetter - public UpdateRulesetRequestDataAttributesRulesItemsMapping 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 UpdateRulesetRequestDataAttributesRulesItemsMapping object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - UpdateRulesetRequestDataAttributesRulesItemsMapping - updateRulesetRequestDataAttributesRulesItemsMapping = - (UpdateRulesetRequestDataAttributesRulesItemsMapping) o; - return Objects.equals( - this.destinationKey, updateRulesetRequestDataAttributesRulesItemsMapping.destinationKey) - && Objects.equals( - this.ifNotExists, updateRulesetRequestDataAttributesRulesItemsMapping.ifNotExists) - && Objects.equals( - this.sourceKeys, updateRulesetRequestDataAttributesRulesItemsMapping.sourceKeys) - && Objects.equals( - this.additionalProperties, - updateRulesetRequestDataAttributesRulesItemsMapping.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(destinationKey, ifNotExists, sourceKeys, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class UpdateRulesetRequestDataAttributesRulesItemsMapping {\n"); - sb.append(" destinationKey: ").append(toIndentedString(destinationKey)).append("\n"); - sb.append(" ifNotExists: ").append(toIndentedString(ifNotExists)).append("\n"); - sb.append(" sourceKeys: ").append(toIndentedString(sourceKeys)).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/UpdateRulesetRequestDataAttributesRulesItemsQuery.java b/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsQuery.java index bf8dfefb238..5c6f8c7a7f8 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsQuery.java +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsQuery.java @@ -22,6 +22,7 @@ UpdateRulesetRequestDataAttributesRulesItemsQuery.JSON_PROPERTY_ADDITION, UpdateRulesetRequestDataAttributesRulesItemsQuery.JSON_PROPERTY_CASE_INSENSITIVITY, UpdateRulesetRequestDataAttributesRulesItemsQuery.JSON_PROPERTY_IF_NOT_EXISTS, + UpdateRulesetRequestDataAttributesRulesItemsQuery.JSON_PROPERTY_IF_TAG_EXISTS, UpdateRulesetRequestDataAttributesRulesItemsQuery.JSON_PROPERTY_QUERY }) @jakarta.annotation.Generated( @@ -37,6 +38,9 @@ public class UpdateRulesetRequestDataAttributesRulesItemsQuery { public static final String JSON_PROPERTY_IF_NOT_EXISTS = "if_not_exists"; private Boolean ifNotExists; + public static final String JSON_PROPERTY_IF_TAG_EXISTS = "if_tag_exists"; + private DataAttributesRulesItemsIfTagExists ifTagExists; + public static final String JSON_PROPERTY_QUERY = "query"; private String query; @@ -46,13 +50,11 @@ public UpdateRulesetRequestDataAttributesRulesItemsQuery() {} public UpdateRulesetRequestDataAttributesRulesItemsQuery( @JsonProperty(required = true, value = JSON_PROPERTY_ADDITION) UpdateRulesetRequestDataAttributesRulesItemsQueryAddition addition, - @JsonProperty(required = true, value = JSON_PROPERTY_IF_NOT_EXISTS) Boolean ifNotExists, @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { this.addition = addition; if (addition != null) { this.unparsed |= addition.unparsed; } - this.ifNotExists = ifNotExists; this.query = query; } @@ -110,20 +112,51 @@ public UpdateRulesetRequestDataAttributesRulesItemsQuery ifNotExists(Boolean ifN } /** - * The query if_not_exists. + * Deprecated. Use if_tag_exists instead. The query if_not_exists + * . * * @return ifNotExists + * @deprecated */ + @Deprecated + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_IF_NOT_EXISTS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public Boolean getIfNotExists() { return ifNotExists; } + @Deprecated public void setIfNotExists(Boolean ifNotExists) { this.ifNotExists = ifNotExists; } + public UpdateRulesetRequestDataAttributesRulesItemsQuery ifTagExists( + DataAttributesRulesItemsIfTagExists ifTagExists) { + this.ifTagExists = ifTagExists; + this.unparsed |= !ifTagExists.isValid(); + return this; + } + + /** + * The behavior when the tag already exists. + * + * @return ifTagExists + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IF_TAG_EXISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DataAttributesRulesItemsIfTagExists getIfTagExists() { + return ifTagExists; + } + + public void setIfTagExists(DataAttributesRulesItemsIfTagExists ifTagExists) { + if (!ifTagExists.isValid()) { + this.unparsed = true; + } + this.ifTagExists = ifTagExists; + } + public UpdateRulesetRequestDataAttributesRulesItemsQuery query(String query) { this.query = query; return this; @@ -209,6 +242,8 @@ public boolean equals(Object o) { updateRulesetRequestDataAttributesRulesItemsQuery.caseInsensitivity) && Objects.equals( this.ifNotExists, updateRulesetRequestDataAttributesRulesItemsQuery.ifNotExists) + && Objects.equals( + this.ifTagExists, updateRulesetRequestDataAttributesRulesItemsQuery.ifTagExists) && Objects.equals(this.query, updateRulesetRequestDataAttributesRulesItemsQuery.query) && Objects.equals( this.additionalProperties, @@ -217,7 +252,8 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(addition, caseInsensitivity, ifNotExists, query, additionalProperties); + return Objects.hash( + addition, caseInsensitivity, ifNotExists, ifTagExists, query, additionalProperties); } @Override @@ -227,6 +263,7 @@ public String toString() { sb.append(" addition: ").append(toIndentedString(addition)).append("\n"); sb.append(" caseInsensitivity: ").append(toIndentedString(caseInsensitivity)).append("\n"); sb.append(" ifNotExists: ").append(toIndentedString(ifNotExists)).append("\n"); + sb.append(" ifTagExists: ").append(toIndentedString(ifTagExists)).append("\n"); sb.append(" query: ").append(toIndentedString(query)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsReferenceTable.java b/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsReferenceTable.java index bfe4bcb2daa..1f196e28ff2 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsReferenceTable.java +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateRulesetRequestDataAttributesRulesItemsReferenceTable.java @@ -26,6 +26,7 @@ UpdateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_CASE_INSENSITIVITY, UpdateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_FIELD_PAIRS, UpdateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_IF_NOT_EXISTS, + UpdateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_IF_TAG_EXISTS, UpdateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_SOURCE_KEYS, UpdateRulesetRequestDataAttributesRulesItemsReferenceTable.JSON_PROPERTY_TABLE_NAME }) @@ -43,6 +44,9 @@ public class UpdateRulesetRequestDataAttributesRulesItemsReferenceTable { public static final String JSON_PROPERTY_IF_NOT_EXISTS = "if_not_exists"; private Boolean ifNotExists; + public static final String JSON_PROPERTY_IF_TAG_EXISTS = "if_tag_exists"; + private DataAttributesRulesItemsIfTagExists ifTagExists; + public static final String JSON_PROPERTY_SOURCE_KEYS = "source_keys"; private List sourceKeys = new ArrayList<>(); @@ -126,10 +130,13 @@ public UpdateRulesetRequestDataAttributesRulesItemsReferenceTable ifNotExists( } /** - * The reference_table if_not_exists. + * Deprecated. Use if_tag_exists instead. The reference_table + * if_not_exists. * * @return ifNotExists + * @deprecated */ + @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_IF_NOT_EXISTS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -137,10 +144,37 @@ public Boolean getIfNotExists() { return ifNotExists; } + @Deprecated public void setIfNotExists(Boolean ifNotExists) { this.ifNotExists = ifNotExists; } + public UpdateRulesetRequestDataAttributesRulesItemsReferenceTable ifTagExists( + DataAttributesRulesItemsIfTagExists ifTagExists) { + this.ifTagExists = ifTagExists; + this.unparsed |= !ifTagExists.isValid(); + return this; + } + + /** + * The behavior when the tag already exists. + * + * @return ifTagExists + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IF_TAG_EXISTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DataAttributesRulesItemsIfTagExists getIfTagExists() { + return ifTagExists; + } + + public void setIfTagExists(DataAttributesRulesItemsIfTagExists ifTagExists) { + if (!ifTagExists.isValid()) { + this.unparsed = true; + } + this.ifTagExists = ifTagExists; + } + public UpdateRulesetRequestDataAttributesRulesItemsReferenceTable sourceKeys( List sourceKeys) { this.sourceKeys = sourceKeys; @@ -258,6 +292,9 @@ public boolean equals(Object o) { && Objects.equals( this.ifNotExists, updateRulesetRequestDataAttributesRulesItemsReferenceTable.ifNotExists) + && Objects.equals( + this.ifTagExists, + updateRulesetRequestDataAttributesRulesItemsReferenceTable.ifTagExists) && Objects.equals( this.sourceKeys, updateRulesetRequestDataAttributesRulesItemsReferenceTable.sourceKeys) && Objects.equals( @@ -270,7 +307,13 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - caseInsensitivity, fieldPairs, ifNotExists, sourceKeys, tableName, additionalProperties); + caseInsensitivity, + fieldPairs, + ifNotExists, + ifTagExists, + sourceKeys, + tableName, + additionalProperties); } @Override @@ -280,6 +323,7 @@ public String toString() { sb.append(" caseInsensitivity: ").append(toIndentedString(caseInsensitivity)).append("\n"); sb.append(" fieldPairs: ").append(toIndentedString(fieldPairs)).append("\n"); sb.append(" ifNotExists: ").append(toIndentedString(ifNotExists)).append("\n"); + sb.append(" ifTagExists: ").append(toIndentedString(ifTagExists)).append("\n"); sb.append(" sourceKeys: ").append(toIndentedString(sourceKeys)).append("\n"); sb.append(" tableName: ").append(toIndentedString(tableName)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/test/resources/cassettes/features/v2/Create_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.freeze new file mode 100644 index 00000000000..ed9c47c8e2d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-02-04T16:26:04.110Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.json new file mode 100644 index 00000000000..51f12b65b71 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"enabled\":true,\"rules\":[{\"enabled\":true,\"mapping\":null,\"name\":\"Add Cost Center Tag\",\"query\":{\"addition\":{\"key\":\"cost_center\",\"value\":\"engineering\"},\"case_insensitivity\":false,\"if_tag_exists\":\"replace\",\"query\":\"account_id:\\\"123456789\\\" AND service:\\\"web-api\\\"\"},\"reference_table\":null}]},\"id\":\"New Ruleset\",\"type\":\"create_ruleset\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/tags/enrichment", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ee10c3ff-312f-464c-b4f6-46adaa6d00a1\",\"type\":\"ruleset\",\"attributes\":{\"created\":{\"seconds\":1759947966,\"nanos\":679638000},\"enabled\":true,\"last_modified_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"modified\":{\"seconds\":1759947966,\"nanos\":679638000},\"name\":\"New Ruleset\",\"position\":1,\"rules\":[{\"name\":\"Add Cost Center Tag\",\"enabled\":true,\"query\":{\"query\":\"account_id:\\\"123456789\\\" AND service:\\\"web-api\\\"\",\"addition\":{\"key\":\"cost_center\",\"value\":\"engineering\"},\"if_tag_exists\":\"replace\",\"case_insensitivity\":false},\"mapping\":null,\"reference_table\":null,\"metadata\":null}],\"version\":3611102}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "35d726ec-cc2a-c61e-f34c-9ce0c9e9db6b" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.freeze new file mode 100644 index 00000000000..3de83d42681 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-10-08T19:15:10.916Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.json new file mode 100644 index 00000000000..923ae3fdf63 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_tag_pipeline_ruleset_with_if_tag_exists_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"enabled\":true,\"last_version\":3611102,\"rules\":[{\"enabled\":true,\"mapping\":{\"destination_key\":\"team_owner\",\"if_tag_exists\":\"replace\",\"source_keys\":[\"account_name\",\"account_id\"]},\"name\":\"Account Name Mapping\",\"query\":null,\"reference_table\":null}]},\"id\":\"New Ruleset\",\"type\":\"update_ruleset\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/tags/enrichment/ee10c3ff-312f-464c-b4f6-46adaa6d00a1", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ee10c3ff-312f-464c-b4f6-46adaa6d00a1\",\"type\":\"ruleset\",\"attributes\":{\"created\":{\"seconds\":1759950911,\"nanos\":31873000},\"enabled\":true,\"last_modified_user_uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"modified\":{\"seconds\":1759950911,\"nanos\":31873000},\"name\":\"New Ruleset\",\"position\":1,\"rules\":[{\"name\":\"Account Name Mapping\",\"enabled\":true,\"query\":null,\"mapping\":{\"source_keys\":[\"account_name\",\"account_id\"],\"destination_key\":\"team_owner\",\"if_tag_exists\":\"replace\"},\"reference_table\":null,\"metadata\":null}],\"version\":3611113}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9b94ac4e-1d52-3144-f8a8-bd0652a92284" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature index 66ccd680c23..312e05fb382 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature @@ -97,6 +97,15 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "ruleset" And the response "data.attributes.name" is equal to "New Ruleset" + @replay-only @team:DataDog/cloud-cost-management + Scenario: Create tag pipeline ruleset with if_tag_exists returns "OK" response + Given new "CreateTagPipelinesRuleset" request + And body with value {"data": {"attributes": {"enabled": true, "rules": [{"enabled": true, "mapping": null, "name": "Add Cost Center Tag", "query": {"addition": {"key": "cost_center", "value": "engineering"}, "case_insensitivity": false, "if_tag_exists": "replace", "query": "account_id:\"123456789\" AND service:\"web-api\""}, "reference_table": null}]}, "id": "New Ruleset", "type": "create_ruleset"}} + When the request is sent + Then the response status is 200 OK + And the response "data.type" is equal to "ruleset" + And the response "data.attributes.name" is equal to "New Ruleset" + @generated @skip @team:DataDog/cloud-cost-management Scenario: Delete Cloud Cost Management AWS CUR config returns "Bad Request" response Given new "DeleteCostAWSCURConfig" request @@ -447,6 +456,14 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management + Scenario: Update tag pipeline ruleset with if_tag_exists returns "OK" response + Given new "UpdateTagPipelinesRuleset" request + And request contains "ruleset_id" parameter with value "ee10c3ff-312f-464c-b4f6-46adaa6d00a1" + And body with value {"data": {"attributes": {"enabled": true, "last_version": 3611102, "rules": [{"enabled": true, "mapping": {"destination_key": "team_owner", "if_tag_exists": "replace", "source_keys": ["account_name", "account_id"]}, "name": "Account Name Mapping", "query": null, "reference_table": null}]}, "id": "New Ruleset", "type": "update_ruleset"}} + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Upload Custom Costs File returns "Accepted" response Given new "UploadCustomCostsFile" request