diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 050808b8c45b..a99a91edd885 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/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.frozen new file mode 100644 index 000000000000..ed9c47c8e2d6 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-02-04T16:26:04.110Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.yml new file mode 100644 index 000000000000..0c371d90b60d --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Create-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.yml @@ -0,0 +1,28 @@ +http_interactions: +- recorded_at: Wed, 04 Feb 2026 16:26:04 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/tags/enrichment + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.frozen b/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.frozen new file mode 100644 index 000000000000..3de83d426811 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-10-08T19:15:10.916Z \ No newline at end of file diff --git a/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.yml b/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.yml new file mode 100644 index 000000000000..fcbfc0cf1469 --- /dev/null +++ b/cassettes/features/v2/cloud_cost_management/Update-tag-pipeline-ruleset-with-if-tag-exists-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 08 Oct 2025 19:15:10 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/tags/enrichment/ee10c3ff-312f-464c-b4f6-46adaa6d00a1 + response: + body: + encoding: UTF-8 + string: '{"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 + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/cloud-cost-management/CreateTagPipelinesRuleset_1897535856.rb b/examples/v2/cloud-cost-management/CreateTagPipelinesRuleset_1897535856.rb new file mode 100644 index 000000000000..3bc3cce84103 --- /dev/null +++ b/examples/v2/cloud-cost-management/CreateTagPipelinesRuleset_1897535856.rb @@ -0,0 +1,32 @@ +# Create tag pipeline ruleset with if_tag_exists returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new + +body = DatadogAPIClient::V2::CreateRulesetRequest.new({ + data: DatadogAPIClient::V2::CreateRulesetRequestData.new({ + attributes: DatadogAPIClient::V2::CreateRulesetRequestDataAttributes.new({ + enabled: true, + rules: [ + DatadogAPIClient::V2::CreateRulesetRequestDataAttributesRulesItems.new({ + enabled: true, + mapping: nil, + name: "Add Cost Center Tag", + query: DatadogAPIClient::V2::CreateRulesetRequestDataAttributesRulesItemsQuery.new({ + addition: DatadogAPIClient::V2::CreateRulesetRequestDataAttributesRulesItemsQueryAddition.new({ + key: "cost_center", + value: "engineering", + }), + case_insensitivity: false, + if_tag_exists: DatadogAPIClient::V2::DataAttributesRulesItemsIfTagExists::REPLACE, + query: 'account_id:"123456789" AND service:"web-api"', + }), + reference_table: nil, + }), + ], + }), + id: "New Ruleset", + type: DatadogAPIClient::V2::CreateRulesetRequestDataType::CREATE_RULESET, + }), +}) +p api_instance.create_tag_pipelines_ruleset(body) diff --git a/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset.rb b/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset.rb index f3e4c36f07a3..e716348c4eff 100644 --- a/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset.rb +++ b/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset.rb @@ -11,7 +11,7 @@ rules: [ DatadogAPIClient::V2::UpdateRulesetRequestDataAttributesRulesItems.new({ enabled: true, - mapping: DatadogAPIClient::V2::UpdateRulesetRequestDataAttributesRulesItemsMapping.new({ + mapping: DatadogAPIClient::V2::DataAttributesRulesItemsMapping.new({ destination_key: "team_owner", if_not_exists: true, source_keys: [ diff --git a/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset_1964644735.rb b/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset_1964644735.rb new file mode 100644 index 000000000000..1719bb9dedf2 --- /dev/null +++ b/examples/v2/cloud-cost-management/UpdateTagPipelinesRuleset_1964644735.rb @@ -0,0 +1,32 @@ +# Update tag pipeline ruleset with if_tag_exists returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new + +body = DatadogAPIClient::V2::UpdateRulesetRequest.new({ + data: DatadogAPIClient::V2::UpdateRulesetRequestData.new({ + attributes: DatadogAPIClient::V2::UpdateRulesetRequestDataAttributes.new({ + enabled: true, + last_version: 3611102, + rules: [ + DatadogAPIClient::V2::UpdateRulesetRequestDataAttributesRulesItems.new({ + enabled: true, + mapping: DatadogAPIClient::V2::DataAttributesRulesItemsMapping.new({ + destination_key: "team_owner", + if_tag_exists: DatadogAPIClient::V2::DataAttributesRulesItemsIfTagExists::REPLACE, + source_keys: [ + "account_name", + "account_id", + ], + }), + name: "Account Name Mapping", + query: nil, + reference_table: nil, + }), + ], + }), + id: "New Ruleset", + type: DatadogAPIClient::V2::UpdateRulesetRequestDataType::UPDATE_RULESET, + }), +}) +p api_instance.update_tag_pipelines_ruleset("ee10c3ff-312f-464c-b4f6-46adaa6d00a1", body) diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index 66ccd680c236..312e05fb382e 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/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 diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index d2aeaff24d7b..b08dda1c9238 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1817,7 +1817,6 @@ def overrides "v2.create_ruleset_request_data" => "CreateRulesetRequestData", "v2.create_ruleset_request_data_attributes" => "CreateRulesetRequestDataAttributes", "v2.create_ruleset_request_data_attributes_rules_items" => "CreateRulesetRequestDataAttributesRulesItems", - "v2.create_ruleset_request_data_attributes_rules_items_mapping" => "CreateRulesetRequestDataAttributesRulesItemsMapping", "v2.create_ruleset_request_data_attributes_rules_items_query" => "CreateRulesetRequestDataAttributesRulesItemsQuery", "v2.create_ruleset_request_data_attributes_rules_items_query_addition" => "CreateRulesetRequestDataAttributesRulesItemsQueryAddition", "v2.create_ruleset_request_data_attributes_rules_items_reference_table" => "CreateRulesetRequestDataAttributesRulesItemsReferenceTable", @@ -1992,6 +1991,8 @@ def overrides "v2.dashboard_list_update_items_response" => "DashboardListUpdateItemsResponse", "v2.dashboard_trigger_wrapper" => "DashboardTriggerWrapper", "v2.dashboard_type" => "DashboardType", + "v2.data_attributes_rules_items_if_tag_exists" => "DataAttributesRulesItemsIfTagExists", + "v2.data_attributes_rules_items_mapping" => "DataAttributesRulesItemsMapping", "v2.database_monitoring_trigger_wrapper" => "DatabaseMonitoringTriggerWrapper", "v2.data_deletion_response_item" => "DataDeletionResponseItem", "v2.data_deletion_response_item_attributes" => "DataDeletionResponseItemAttributes", @@ -4044,7 +4045,6 @@ def overrides "v2.ruleset_resp_data_attributes_created" => "RulesetRespDataAttributesCreated", "v2.ruleset_resp_data_attributes_modified" => "RulesetRespDataAttributesModified", "v2.ruleset_resp_data_attributes_rules_items" => "RulesetRespDataAttributesRulesItems", - "v2.ruleset_resp_data_attributes_rules_items_mapping" => "RulesetRespDataAttributesRulesItemsMapping", "v2.ruleset_resp_data_attributes_rules_items_query" => "RulesetRespDataAttributesRulesItemsQuery", "v2.ruleset_resp_data_attributes_rules_items_query_addition" => "RulesetRespDataAttributesRulesItemsQueryAddition", "v2.ruleset_resp_data_attributes_rules_items_reference_table" => "RulesetRespDataAttributesRulesItemsReferenceTable", @@ -5059,7 +5059,6 @@ def overrides "v2.update_ruleset_request_data" => "UpdateRulesetRequestData", "v2.update_ruleset_request_data_attributes" => "UpdateRulesetRequestDataAttributes", "v2.update_ruleset_request_data_attributes_rules_items" => "UpdateRulesetRequestDataAttributesRulesItems", - "v2.update_ruleset_request_data_attributes_rules_items_mapping" => "UpdateRulesetRequestDataAttributesRulesItemsMapping", "v2.update_ruleset_request_data_attributes_rules_items_query" => "UpdateRulesetRequestDataAttributesRulesItemsQuery", "v2.update_ruleset_request_data_attributes_rules_items_query_addition" => "UpdateRulesetRequestDataAttributesRulesItemsQueryAddition", "v2.update_ruleset_request_data_attributes_rules_items_reference_table" => "UpdateRulesetRequestDataAttributesRulesItemsReferenceTable", diff --git a/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items.rb b/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items.rb index 66ff2ef9784d..5832b8013755 100644 --- a/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items.rb +++ b/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items.rb @@ -24,7 +24,7 @@ class CreateRulesetRequestDataAttributesRulesItems # The `items` `enabled`. attr_reader :enabled - # The definition of `CreateRulesetRequestDataAttributesRulesItemsMapping` object. + # The definition of `DataAttributesRulesItemsMapping` object. attr_accessor :mapping # The `items` `metadata`. @@ -59,7 +59,7 @@ def self.attribute_map def self.openapi_types { :'enabled' => :'Boolean', - :'mapping' => :'CreateRulesetRequestDataAttributesRulesItemsMapping', + :'mapping' => :'DataAttributesRulesItemsMapping', :'metadata' => :'Hash', :'name' => :'String', :'query' => :'CreateRulesetRequestDataAttributesRulesItemsQuery', diff --git a/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_mapping.rb b/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_mapping.rb deleted file mode 100644 index 324c9dd611b2..000000000000 --- a/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_mapping.rb +++ /dev/null @@ -1,167 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # The definition of `CreateRulesetRequestDataAttributesRulesItemsMapping` object. - class CreateRulesetRequestDataAttributesRulesItemsMapping - include BaseGenericModel - - # The `mapping` `destination_key`. - attr_reader :destination_key - - # The `mapping` `if_not_exists`. - attr_reader :if_not_exists - - # The `mapping` `source_keys`. - attr_reader :source_keys - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'destination_key' => :'destination_key', - :'if_not_exists' => :'if_not_exists', - :'source_keys' => :'source_keys' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'destination_key' => :'String', - :'if_not_exists' => :'Boolean', - :'source_keys' => :'Array' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateRulesetRequestDataAttributesRulesItemsMapping` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'destination_key') - self.destination_key = attributes[:'destination_key'] - end - - if attributes.key?(:'if_not_exists') - self.if_not_exists = attributes[:'if_not_exists'] - end - - if attributes.key?(:'source_keys') - if (value = attributes[:'source_keys']).is_a?(Array) - self.source_keys = value - end - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @destination_key.nil? - return false if @if_not_exists.nil? - return false if @source_keys.nil? - true - end - - # Custom attribute writer method with validation - # @param destination_key [Object] Object to be assigned - # @!visibility private - def destination_key=(destination_key) - if destination_key.nil? - fail ArgumentError, 'invalid value for "destination_key", destination_key cannot be nil.' - end - @destination_key = destination_key - end - - # Custom attribute writer method with validation - # @param if_not_exists [Object] Object to be assigned - # @!visibility private - def if_not_exists=(if_not_exists) - if if_not_exists.nil? - fail ArgumentError, 'invalid value for "if_not_exists", if_not_exists cannot be nil.' - end - @if_not_exists = if_not_exists - end - - # Custom attribute writer method with validation - # @param source_keys [Object] Object to be assigned - # @!visibility private - def source_keys=(source_keys) - if source_keys.nil? - fail ArgumentError, 'invalid value for "source_keys", source_keys cannot be nil.' - end - @source_keys = source_keys - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - destination_key == o.destination_key && - if_not_exists == o.if_not_exists && - source_keys == o.source_keys && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [destination_key, if_not_exists, source_keys, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_query.rb b/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_query.rb index 26ce1a32631e..44122e06ebe5 100644 --- a/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_query.rb +++ b/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_query.rb @@ -27,8 +27,11 @@ class CreateRulesetRequestDataAttributesRulesItemsQuery # The `query` `case_insensitivity`. attr_accessor :case_insensitivity - # The `query` `if_not_exists`. - attr_reader :if_not_exists + # Deprecated. Use `if_tag_exists` instead. The `query` `if_not_exists`. + attr_accessor :if_not_exists + + # The behavior when the tag already exists. + attr_accessor :if_tag_exists # The `query` `query`. attr_reader :query @@ -42,6 +45,7 @@ def self.attribute_map :'addition' => :'addition', :'case_insensitivity' => :'case_insensitivity', :'if_not_exists' => :'if_not_exists', + :'if_tag_exists' => :'if_tag_exists', :'query' => :'query' } end @@ -53,6 +57,7 @@ def self.openapi_types :'addition' => :'CreateRulesetRequestDataAttributesRulesItemsQueryAddition', :'case_insensitivity' => :'Boolean', :'if_not_exists' => :'Boolean', + :'if_tag_exists' => :'DataAttributesRulesItemsIfTagExists', :'query' => :'String' } end @@ -95,6 +100,10 @@ def initialize(attributes = {}) self.if_not_exists = attributes[:'if_not_exists'] end + if attributes.key?(:'if_tag_exists') + self.if_tag_exists = attributes[:'if_tag_exists'] + end + if attributes.key?(:'query') self.query = attributes[:'query'] end @@ -104,21 +113,10 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @if_not_exists.nil? return false if @query.nil? true end - # Custom attribute writer method with validation - # @param if_not_exists [Object] Object to be assigned - # @!visibility private - def if_not_exists=(if_not_exists) - if if_not_exists.nil? - fail ArgumentError, 'invalid value for "if_not_exists", if_not_exists cannot be nil.' - end - @if_not_exists = if_not_exists - end - # Custom attribute writer method with validation # @param query [Object] Object to be assigned # @!visibility private @@ -158,6 +156,7 @@ def ==(o) addition == o.addition && case_insensitivity == o.case_insensitivity && if_not_exists == o.if_not_exists && + if_tag_exists == o.if_tag_exists && query == o.query && additional_properties == o.additional_properties end @@ -166,7 +165,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [addition, case_insensitivity, if_not_exists, query, additional_properties].hash + [addition, case_insensitivity, if_not_exists, if_tag_exists, query, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_reference_table.rb b/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_reference_table.rb index 5dd736b6b0a3..426b2a4322fa 100644 --- a/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_reference_table.rb +++ b/lib/datadog_api_client/v2/models/create_ruleset_request_data_attributes_rules_items_reference_table.rb @@ -27,9 +27,12 @@ class CreateRulesetRequestDataAttributesRulesItemsReferenceTable # The `reference_table` `field_pairs`. attr_reader :field_pairs - # The `reference_table` `if_not_exists`. + # Deprecated. Use `if_tag_exists` instead. The `reference_table` `if_not_exists`. attr_accessor :if_not_exists + # The behavior when the tag already exists. + attr_accessor :if_tag_exists + # The `reference_table` `source_keys`. attr_reader :source_keys @@ -45,6 +48,7 @@ def self.attribute_map :'case_insensitivity' => :'case_insensitivity', :'field_pairs' => :'field_pairs', :'if_not_exists' => :'if_not_exists', + :'if_tag_exists' => :'if_tag_exists', :'source_keys' => :'source_keys', :'table_name' => :'table_name' } @@ -57,6 +61,7 @@ def self.openapi_types :'case_insensitivity' => :'Boolean', :'field_pairs' => :'Array', :'if_not_exists' => :'Boolean', + :'if_tag_exists' => :'DataAttributesRulesItemsIfTagExists', :'source_keys' => :'Array', :'table_name' => :'String' } @@ -94,6 +99,10 @@ def initialize(attributes = {}) self.if_not_exists = attributes[:'if_not_exists'] end + if attributes.key?(:'if_tag_exists') + self.if_tag_exists = attributes[:'if_tag_exists'] + end + if attributes.key?(:'source_keys') if (value = attributes[:'source_keys']).is_a?(Array) self.source_keys = value @@ -174,6 +183,7 @@ def ==(o) case_insensitivity == o.case_insensitivity && field_pairs == o.field_pairs && if_not_exists == o.if_not_exists && + if_tag_exists == o.if_tag_exists && source_keys == o.source_keys && table_name == o.table_name && additional_properties == o.additional_properties @@ -183,7 +193,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [case_insensitivity, field_pairs, if_not_exists, source_keys, table_name, additional_properties].hash + [case_insensitivity, field_pairs, if_not_exists, if_tag_exists, source_keys, table_name, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/data_attributes_rules_items_if_tag_exists.rb b/lib/datadog_api_client/v2/models/data_attributes_rules_items_if_tag_exists.rb new file mode 100644 index 000000000000..2dec4a36cc0a --- /dev/null +++ b/lib/datadog_api_client/v2/models/data_attributes_rules_items_if_tag_exists.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The behavior when the tag already exists. + class DataAttributesRulesItemsIfTagExists + include BaseEnumModel + + APPEND = "append".freeze + DO_NOT_APPLY = "do_not_apply".freeze + REPLACE = "replace".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_mapping.rb b/lib/datadog_api_client/v2/models/data_attributes_rules_items_mapping.rb similarity index 85% rename from lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_mapping.rb rename to lib/datadog_api_client/v2/models/data_attributes_rules_items_mapping.rb index 4fe9606ec4b6..c5d2ebf38f34 100644 --- a/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_mapping.rb +++ b/lib/datadog_api_client/v2/models/data_attributes_rules_items_mapping.rb @@ -17,15 +17,18 @@ require 'time' module DatadogAPIClient::V2 - # The definition of `RulesetRespDataAttributesRulesItemsMapping` object. - class RulesetRespDataAttributesRulesItemsMapping + # The definition of `DataAttributesRulesItemsMapping` object. + class DataAttributesRulesItemsMapping include BaseGenericModel # The `mapping` `destination_key`. attr_reader :destination_key - # The `mapping` `if_not_exists`. - attr_reader :if_not_exists + # Deprecated. Use `if_tag_exists` instead. The `mapping` `if_not_exists`. + attr_accessor :if_not_exists + + # The behavior when the tag already exists. + attr_accessor :if_tag_exists # The `mapping` `source_keys`. attr_reader :source_keys @@ -38,6 +41,7 @@ def self.attribute_map { :'destination_key' => :'destination_key', :'if_not_exists' => :'if_not_exists', + :'if_tag_exists' => :'if_tag_exists', :'source_keys' => :'source_keys' } end @@ -48,6 +52,7 @@ def self.openapi_types { :'destination_key' => :'String', :'if_not_exists' => :'Boolean', + :'if_tag_exists' => :'DataAttributesRulesItemsIfTagExists', :'source_keys' => :'Array' } end @@ -57,7 +62,7 @@ def self.openapi_types # @!visibility private def initialize(attributes = {}) if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::RulesetRespDataAttributesRulesItemsMapping` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DataAttributesRulesItemsMapping` initialize method" end self.additional_properties = {} @@ -78,6 +83,10 @@ def initialize(attributes = {}) self.if_not_exists = attributes[:'if_not_exists'] end + if attributes.key?(:'if_tag_exists') + self.if_tag_exists = attributes[:'if_tag_exists'] + end + if attributes.key?(:'source_keys') if (value = attributes[:'source_keys']).is_a?(Array) self.source_keys = value @@ -90,7 +99,6 @@ def initialize(attributes = {}) # @!visibility private def valid? return false if @destination_key.nil? - return false if @if_not_exists.nil? return false if @source_keys.nil? true end @@ -105,16 +113,6 @@ def destination_key=(destination_key) @destination_key = destination_key end - # Custom attribute writer method with validation - # @param if_not_exists [Object] Object to be assigned - # @!visibility private - def if_not_exists=(if_not_exists) - if if_not_exists.nil? - fail ArgumentError, 'invalid value for "if_not_exists", if_not_exists cannot be nil.' - end - @if_not_exists = if_not_exists - end - # Custom attribute writer method with validation # @param source_keys [Object] Object to be assigned # @!visibility private @@ -153,6 +151,7 @@ def ==(o) self.class == o.class && destination_key == o.destination_key && if_not_exists == o.if_not_exists && + if_tag_exists == o.if_tag_exists && source_keys == o.source_keys && additional_properties == o.additional_properties end @@ -161,7 +160,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [destination_key, if_not_exists, source_keys, additional_properties].hash + [destination_key, if_not_exists, if_tag_exists, source_keys, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items.rb b/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items.rb index acd70d4bbdeb..a785d364f3f6 100644 --- a/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items.rb +++ b/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items.rb @@ -24,7 +24,7 @@ class RulesetRespDataAttributesRulesItems # The `items` `enabled`. attr_reader :enabled - # The definition of `RulesetRespDataAttributesRulesItemsMapping` object. + # The definition of `DataAttributesRulesItemsMapping` object. attr_accessor :mapping # The `items` `metadata`. @@ -59,7 +59,7 @@ def self.attribute_map def self.openapi_types { :'enabled' => :'Boolean', - :'mapping' => :'RulesetRespDataAttributesRulesItemsMapping', + :'mapping' => :'DataAttributesRulesItemsMapping', :'metadata' => :'Hash', :'name' => :'String', :'query' => :'RulesetRespDataAttributesRulesItemsQuery', diff --git a/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_query.rb b/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_query.rb index 88dc95509a97..eb2399cd3c0f 100644 --- a/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_query.rb +++ b/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_query.rb @@ -27,8 +27,11 @@ class RulesetRespDataAttributesRulesItemsQuery # The `query` `case_insensitivity`. attr_accessor :case_insensitivity - # The `query` `if_not_exists`. - attr_reader :if_not_exists + # Deprecated. Use `if_tag_exists` instead. The `query` `if_not_exists`. + attr_accessor :if_not_exists + + # The behavior when the tag already exists. + attr_accessor :if_tag_exists # The `query` `query`. attr_reader :query @@ -42,6 +45,7 @@ def self.attribute_map :'addition' => :'addition', :'case_insensitivity' => :'case_insensitivity', :'if_not_exists' => :'if_not_exists', + :'if_tag_exists' => :'if_tag_exists', :'query' => :'query' } end @@ -53,6 +57,7 @@ def self.openapi_types :'addition' => :'RulesetRespDataAttributesRulesItemsQueryAddition', :'case_insensitivity' => :'Boolean', :'if_not_exists' => :'Boolean', + :'if_tag_exists' => :'DataAttributesRulesItemsIfTagExists', :'query' => :'String' } end @@ -95,6 +100,10 @@ def initialize(attributes = {}) self.if_not_exists = attributes[:'if_not_exists'] end + if attributes.key?(:'if_tag_exists') + self.if_tag_exists = attributes[:'if_tag_exists'] + end + if attributes.key?(:'query') self.query = attributes[:'query'] end @@ -104,21 +113,10 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @if_not_exists.nil? return false if @query.nil? true end - # Custom attribute writer method with validation - # @param if_not_exists [Object] Object to be assigned - # @!visibility private - def if_not_exists=(if_not_exists) - if if_not_exists.nil? - fail ArgumentError, 'invalid value for "if_not_exists", if_not_exists cannot be nil.' - end - @if_not_exists = if_not_exists - end - # Custom attribute writer method with validation # @param query [Object] Object to be assigned # @!visibility private @@ -158,6 +156,7 @@ def ==(o) addition == o.addition && case_insensitivity == o.case_insensitivity && if_not_exists == o.if_not_exists && + if_tag_exists == o.if_tag_exists && query == o.query && additional_properties == o.additional_properties end @@ -166,7 +165,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [addition, case_insensitivity, if_not_exists, query, additional_properties].hash + [addition, case_insensitivity, if_not_exists, if_tag_exists, query, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_reference_table.rb b/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_reference_table.rb index aa5cfbdccc83..59facc028c71 100644 --- a/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_reference_table.rb +++ b/lib/datadog_api_client/v2/models/ruleset_resp_data_attributes_rules_items_reference_table.rb @@ -27,9 +27,12 @@ class RulesetRespDataAttributesRulesItemsReferenceTable # The `reference_table` `field_pairs`. attr_reader :field_pairs - # The `reference_table` `if_not_exists`. + # Deprecated. Use `if_tag_exists` instead. The `reference_table` `if_not_exists`. attr_accessor :if_not_exists + # The behavior when the tag already exists. + attr_accessor :if_tag_exists + # The `reference_table` `source_keys`. attr_reader :source_keys @@ -45,6 +48,7 @@ def self.attribute_map :'case_insensitivity' => :'case_insensitivity', :'field_pairs' => :'field_pairs', :'if_not_exists' => :'if_not_exists', + :'if_tag_exists' => :'if_tag_exists', :'source_keys' => :'source_keys', :'table_name' => :'table_name' } @@ -57,6 +61,7 @@ def self.openapi_types :'case_insensitivity' => :'Boolean', :'field_pairs' => :'Array', :'if_not_exists' => :'Boolean', + :'if_tag_exists' => :'DataAttributesRulesItemsIfTagExists', :'source_keys' => :'Array', :'table_name' => :'String' } @@ -94,6 +99,10 @@ def initialize(attributes = {}) self.if_not_exists = attributes[:'if_not_exists'] end + if attributes.key?(:'if_tag_exists') + self.if_tag_exists = attributes[:'if_tag_exists'] + end + if attributes.key?(:'source_keys') if (value = attributes[:'source_keys']).is_a?(Array) self.source_keys = value @@ -174,6 +183,7 @@ def ==(o) case_insensitivity == o.case_insensitivity && field_pairs == o.field_pairs && if_not_exists == o.if_not_exists && + if_tag_exists == o.if_tag_exists && source_keys == o.source_keys && table_name == o.table_name && additional_properties == o.additional_properties @@ -183,7 +193,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [case_insensitivity, field_pairs, if_not_exists, source_keys, table_name, additional_properties].hash + [case_insensitivity, field_pairs, if_not_exists, if_tag_exists, source_keys, table_name, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items.rb b/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items.rb index 831b1228aa81..e074cc680033 100644 --- a/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items.rb +++ b/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items.rb @@ -24,7 +24,7 @@ class UpdateRulesetRequestDataAttributesRulesItems # The `items` `enabled`. attr_reader :enabled - # The definition of `UpdateRulesetRequestDataAttributesRulesItemsMapping` object. + # The definition of `DataAttributesRulesItemsMapping` object. attr_accessor :mapping # The `items` `metadata`. @@ -59,7 +59,7 @@ def self.attribute_map def self.openapi_types { :'enabled' => :'Boolean', - :'mapping' => :'UpdateRulesetRequestDataAttributesRulesItemsMapping', + :'mapping' => :'DataAttributesRulesItemsMapping', :'metadata' => :'Hash', :'name' => :'String', :'query' => :'UpdateRulesetRequestDataAttributesRulesItemsQuery', diff --git a/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_mapping.rb b/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_mapping.rb deleted file mode 100644 index 5e74cc22f75c..000000000000 --- a/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_mapping.rb +++ /dev/null @@ -1,167 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - 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 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # The definition of `UpdateRulesetRequestDataAttributesRulesItemsMapping` object. - class UpdateRulesetRequestDataAttributesRulesItemsMapping - include BaseGenericModel - - # The `mapping` `destination_key`. - attr_reader :destination_key - - # The `mapping` `if_not_exists`. - attr_reader :if_not_exists - - # The `mapping` `source_keys`. - attr_reader :source_keys - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'destination_key' => :'destination_key', - :'if_not_exists' => :'if_not_exists', - :'source_keys' => :'source_keys' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'destination_key' => :'String', - :'if_not_exists' => :'Boolean', - :'source_keys' => :'Array' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::UpdateRulesetRequestDataAttributesRulesItemsMapping` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'destination_key') - self.destination_key = attributes[:'destination_key'] - end - - if attributes.key?(:'if_not_exists') - self.if_not_exists = attributes[:'if_not_exists'] - end - - if attributes.key?(:'source_keys') - if (value = attributes[:'source_keys']).is_a?(Array) - self.source_keys = value - end - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @destination_key.nil? - return false if @if_not_exists.nil? - return false if @source_keys.nil? - true - end - - # Custom attribute writer method with validation - # @param destination_key [Object] Object to be assigned - # @!visibility private - def destination_key=(destination_key) - if destination_key.nil? - fail ArgumentError, 'invalid value for "destination_key", destination_key cannot be nil.' - end - @destination_key = destination_key - end - - # Custom attribute writer method with validation - # @param if_not_exists [Object] Object to be assigned - # @!visibility private - def if_not_exists=(if_not_exists) - if if_not_exists.nil? - fail ArgumentError, 'invalid value for "if_not_exists", if_not_exists cannot be nil.' - end - @if_not_exists = if_not_exists - end - - # Custom attribute writer method with validation - # @param source_keys [Object] Object to be assigned - # @!visibility private - def source_keys=(source_keys) - if source_keys.nil? - fail ArgumentError, 'invalid value for "source_keys", source_keys cannot be nil.' - end - @source_keys = source_keys - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - destination_key == o.destination_key && - if_not_exists == o.if_not_exists && - source_keys == o.source_keys && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [destination_key, if_not_exists, source_keys, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_query.rb b/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_query.rb index d00b3d2c3056..c6fe3e933546 100644 --- a/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_query.rb +++ b/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_query.rb @@ -27,8 +27,11 @@ class UpdateRulesetRequestDataAttributesRulesItemsQuery # The `query` `case_insensitivity`. attr_accessor :case_insensitivity - # The `query` `if_not_exists`. - attr_reader :if_not_exists + # Deprecated. Use `if_tag_exists` instead. The `query` `if_not_exists`. + attr_accessor :if_not_exists + + # The behavior when the tag already exists. + attr_accessor :if_tag_exists # The `query` `query`. attr_reader :query @@ -42,6 +45,7 @@ def self.attribute_map :'addition' => :'addition', :'case_insensitivity' => :'case_insensitivity', :'if_not_exists' => :'if_not_exists', + :'if_tag_exists' => :'if_tag_exists', :'query' => :'query' } end @@ -53,6 +57,7 @@ def self.openapi_types :'addition' => :'UpdateRulesetRequestDataAttributesRulesItemsQueryAddition', :'case_insensitivity' => :'Boolean', :'if_not_exists' => :'Boolean', + :'if_tag_exists' => :'DataAttributesRulesItemsIfTagExists', :'query' => :'String' } end @@ -95,6 +100,10 @@ def initialize(attributes = {}) self.if_not_exists = attributes[:'if_not_exists'] end + if attributes.key?(:'if_tag_exists') + self.if_tag_exists = attributes[:'if_tag_exists'] + end + if attributes.key?(:'query') self.query = attributes[:'query'] end @@ -104,21 +113,10 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @if_not_exists.nil? return false if @query.nil? true end - # Custom attribute writer method with validation - # @param if_not_exists [Object] Object to be assigned - # @!visibility private - def if_not_exists=(if_not_exists) - if if_not_exists.nil? - fail ArgumentError, 'invalid value for "if_not_exists", if_not_exists cannot be nil.' - end - @if_not_exists = if_not_exists - end - # Custom attribute writer method with validation # @param query [Object] Object to be assigned # @!visibility private @@ -158,6 +156,7 @@ def ==(o) addition == o.addition && case_insensitivity == o.case_insensitivity && if_not_exists == o.if_not_exists && + if_tag_exists == o.if_tag_exists && query == o.query && additional_properties == o.additional_properties end @@ -166,7 +165,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [addition, case_insensitivity, if_not_exists, query, additional_properties].hash + [addition, case_insensitivity, if_not_exists, if_tag_exists, query, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_reference_table.rb b/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_reference_table.rb index ff56a52c119a..d267abb659f5 100644 --- a/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_reference_table.rb +++ b/lib/datadog_api_client/v2/models/update_ruleset_request_data_attributes_rules_items_reference_table.rb @@ -27,9 +27,12 @@ class UpdateRulesetRequestDataAttributesRulesItemsReferenceTable # The `reference_table` `field_pairs`. attr_reader :field_pairs - # The `reference_table` `if_not_exists`. + # Deprecated. Use `if_tag_exists` instead. The `reference_table` `if_not_exists`. attr_accessor :if_not_exists + # The behavior when the tag already exists. + attr_accessor :if_tag_exists + # The `reference_table` `source_keys`. attr_reader :source_keys @@ -45,6 +48,7 @@ def self.attribute_map :'case_insensitivity' => :'case_insensitivity', :'field_pairs' => :'field_pairs', :'if_not_exists' => :'if_not_exists', + :'if_tag_exists' => :'if_tag_exists', :'source_keys' => :'source_keys', :'table_name' => :'table_name' } @@ -57,6 +61,7 @@ def self.openapi_types :'case_insensitivity' => :'Boolean', :'field_pairs' => :'Array', :'if_not_exists' => :'Boolean', + :'if_tag_exists' => :'DataAttributesRulesItemsIfTagExists', :'source_keys' => :'Array', :'table_name' => :'String' } @@ -94,6 +99,10 @@ def initialize(attributes = {}) self.if_not_exists = attributes[:'if_not_exists'] end + if attributes.key?(:'if_tag_exists') + self.if_tag_exists = attributes[:'if_tag_exists'] + end + if attributes.key?(:'source_keys') if (value = attributes[:'source_keys']).is_a?(Array) self.source_keys = value @@ -174,6 +183,7 @@ def ==(o) case_insensitivity == o.case_insensitivity && field_pairs == o.field_pairs && if_not_exists == o.if_not_exists && + if_tag_exists == o.if_tag_exists && source_keys == o.source_keys && table_name == o.table_name && additional_properties == o.additional_properties @@ -183,7 +193,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [case_insensitivity, field_pairs, if_not_exists, source_keys, table_name, additional_properties].hash + [case_insensitivity, field_pairs, if_not_exists, if_tag_exists, source_keys, table_name, additional_properties].hash end end end