diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 150bd49be13c..832230d382b5 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -6152,6 +6152,16 @@ components: example: 15 format: int64 type: integer + tags: + description: A list of tags associated with the index. Tags must be in `key:value` + format. + example: + - team:backend + - env:production + items: + description: A single tag using the format `key:value`. + type: string + type: array required: - name - filter @@ -6239,6 +6249,16 @@ components: example: 15 format: int64 type: integer + tags: + description: A list of tags associated with the index. Tags must be in `key:value` + format. + example: + - team:backend + - env:production + items: + description: A single tag using the format `key:value`. + type: string + type: array required: - filter type: object diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 39f6901f1a8c..6cd7c2ab9efa 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -7197,7 +7197,10 @@ components: type: string type: description: The type of the object, must be `budget`. + example: '' type: string + required: + - type type: object BudgetArray: description: An array of budgets. @@ -7222,6 +7225,8 @@ components: items: $ref: '#/components/schemas/Budget' type: array + required: + - data type: object BudgetAttributes: description: The attributes of a budget. @@ -7241,9 +7246,8 @@ components: format: int64 type: integer entries: - description: The entries of the budget. items: - $ref: '#/components/schemas/BudgetEntry' + $ref: '#/components/schemas/BudgetWithEntriesDataAttributesEntriesItems' type: array metrics_query: description: The cost query used to track against the budget. @@ -7278,25 +7282,89 @@ components: example: 00000000-0a0a-0a0a-aaa0-00000000000a type: string type: object - BudgetEntry: - description: The entry of a budget. + BudgetValidationRequest: + example: + data: + attributes: + created_at: 1738258683590 + created_by: 00000000-0a0a-0a0a-aaa0-00000000000a + end_month: 202502 + entries: + - amount: 500 + month: 202501 + tag_filters: + - tag_key: service + tag_value: ec2 + - amount: 500 + month: 202502 + tag_filters: + - tag_key: service + tag_value: ec2 + metrics_query: aws.cost.amortized{service:ec2} by {service} + name: my budget + org_id: 123 + start_month: 202501 + total_amount: 1000 + updated_at: 1738258683590 + updated_by: 00000000-0a0a-0a0a-aaa0-00000000000a + id: '1' + type: budget properties: - amount: - description: The `amount` of the budget entry. - example: 500 - format: double - type: number - month: - description: The `month` of the budget entry. - example: 202501 - format: int64 - type: integer - tag_filters: - description: The `tag_filters` of the budget entry. + data: + $ref: '#/components/schemas/BudgetValidationRequestData' + type: object + BudgetValidationRequestData: + properties: + attributes: + $ref: '#/components/schemas/BudgetWithEntriesDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/BudgetWithEntriesDataType' + required: + - type + type: object + BudgetValidationResponse: + example: + data: + attributes: + errors: [] + valid: true + id: budget_validation + type: budget_validation + properties: + data: + $ref: '#/components/schemas/BudgetValidationResponseData' + type: object + BudgetValidationResponseData: + properties: + attributes: + $ref: '#/components/schemas/BudgetValidationResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/BudgetValidationResponseDataType' + required: + - type + type: object + BudgetValidationResponseDataAttributes: + properties: + errors: items: - $ref: '#/components/schemas/TagFilter' + type: string type: array + valid: + type: boolean type: object + BudgetValidationResponseDataType: + default: budget_validation + description: Budget validation resource type. + enum: + - budget_validation + example: budget_validation + type: string + x-enum-varnames: + - BUDGET_VALIDATION BudgetWithEntries: description: The definition of the `BudgetWithEntries` object. properties: @@ -7314,8 +7382,71 @@ components: type: string type: description: The type of the object, must be `budget`. + example: '' + type: string + type: object + BudgetWithEntriesDataAttributes: + properties: + created_at: + format: int64 + type: integer + created_by: + type: string + end_month: + format: int64 + type: integer + entries: + items: + $ref: '#/components/schemas/BudgetWithEntriesDataAttributesEntriesItems' + type: array + metrics_query: + type: string + name: + type: string + org_id: + format: int64 + type: integer + start_month: + format: int64 + type: integer + total_amount: + format: double + type: number + updated_at: + format: int64 + type: integer + updated_by: + type: string + type: object + BudgetWithEntriesDataAttributesEntriesItems: + properties: + amount: + format: double + type: number + month: + format: int64 + type: integer + tag_filters: + items: + $ref: '#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems' + type: array + type: object + BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems: + properties: + tag_key: + type: string + tag_value: type: string type: object + BudgetWithEntriesDataType: + default: budget + description: Budget resource type. + enum: + - budget + example: budget + type: string + x-enum-varnames: + - BUDGET BulkDeleteAppsDatastoreItemsRequest: description: Request to delete items from a datastore. properties: @@ -58500,18 +58631,6 @@ components: type: string x-enum-varnames: - ROW - TagFilter: - description: Tag filter for the budget's entries. - properties: - tag_key: - description: The key of the tag. - example: service - type: string - tag_value: - description: The value of the tag. - example: ec2 - type: string - type: object TagsEventAttribute: description: Array of tags associated with your event. example: @@ -70382,34 +70501,69 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - cloud_cost_management_write summary: Create or update a budget tags: - Cloud Cost Management + /api/v2/cost/budget/csv/validate: + post: + operationId: ValidateCsvBudget + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ValidationResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: [] + summary: Validate CSV budget + tags: + - Cloud Cost Management + /api/v2/cost/budget/validate: + post: + description: Validate a budget configuration without creating or modifying it + operationId: ValidateBudget + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/BudgetValidationRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BudgetValidationResponse' + description: OK + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Validate budget + tags: + - Cloud Cost Management /api/v2/cost/budget/{budget_id}: delete: - description: Delete a budget. + description: Delete a budget operationId: DeleteBudget parameters: - $ref: '#/components/parameters/BudgetID' responses: '204': description: No Content - '400': - $ref: '#/components/responses/BadRequestResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - cloud_cost_management_write - summary: Delete a budget + summary: Delete budget tags: - Cloud Cost Management get: - description: Get a budget. + description: Get a budget operationId: GetBudget parameters: - $ref: '#/components/parameters/BudgetID' @@ -70418,20 +70572,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/BudgetWithEntries' + $ref: '#/components/schemas/BudgetValidationRequest' description: OK - '400': - $ref: '#/components/responses/BadRequestResponse' - '404': - $ref: '#/components/responses/NotFoundResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - cloud_cost_management_read - summary: Get a budget + summary: Get budget tags: - Cloud Cost Management /api/v2/cost/budgets: @@ -70450,8 +70598,6 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: - - cloud_cost_management_read summary: List budgets tags: - Cloud Cost Management @@ -87218,9 +87364,6 @@ paths: operator: OR permissions: - appsec_vm_read - x-unstable: '**Note**: This endpoint is a private preview. - - If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' /api/v2/security/sboms/{asset_type}: get: description: Get a single SBOM related to an asset by its type and name. @@ -87293,9 +87436,6 @@ paths: operator: OR permissions: - appsec_vm_read - x-unstable: '**Note**: This endpoint is a private preview. - - If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' /api/v2/security/scanned-assets-metadata: get: description: "Get a list of security scanned assets metadata for an organization.\n\n### diff --git a/cassettes/features/v2/security_monitoring/Get-SBOM-returns-Not-found-asset-not-found-response.frozen b/cassettes/features/v2/security_monitoring/Get-SBOM-returns-Not-found-asset-not-found-response.frozen index f6aafe6e9e0b..1aad7fd1a1ce 100644 --- a/cassettes/features/v2/security_monitoring/Get-SBOM-returns-Not-found-asset-not-found-response.frozen +++ b/cassettes/features/v2/security_monitoring/Get-SBOM-returns-Not-found-asset-not-found-response.frozen @@ -1 +1 @@ -2025-02-10T11:40:12.098Z \ No newline at end of file +2026-01-20T09:40:32.938Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-SBOM-returns-Not-found-asset-not-found-response.yml b/cassettes/features/v2/security_monitoring/Get-SBOM-returns-Not-found-asset-not-found-response.yml index 4b5a5a42e749..64dc5899b058 100644 --- a/cassettes/features/v2/security_monitoring/Get-SBOM-returns-Not-found-asset-not-found-response.yml +++ b/cassettes/features/v2/security_monitoring/Get-SBOM-returns-Not-found-asset-not-found-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Mon, 10 Feb 2025 11:40:12 GMT +- recorded_at: Tue, 20 Jan 2026 09:40:32 GMT request: body: null headers: diff --git a/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.frozen b/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.frozen index 691734389915..8fc8312cb410 100644 --- a/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.frozen +++ b/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.frozen @@ -1 +1 @@ -2025-07-10T10:13:27.247Z \ No newline at end of file +2026-01-20T08:26:52.182Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.yml b/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.yml index 115f88725c8d..7ee5916f24db 100644 --- a/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.yml +++ b/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-Not-found-There-is-no-request-associated-with-the-provided-token-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 10 Jul 2025 10:13:27 GMT +- recorded_at: Tue, 20 Jan 2026 08:26:52 GMT request: body: null headers: diff --git a/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-OK-response.frozen index c142d99dc723..a502bb4f89af 100644 --- a/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-OK-response.frozen +++ b/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-OK-response.frozen @@ -1 +1 @@ -2025-07-10T10:11:37.540Z \ No newline at end of file +2026-01-20T08:27:19.760Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-OK-response.yml index 172f856bd4b8..d026cfef8cc2 100644 --- a/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-OK-response.yml +++ b/cassettes/features/v2/security_monitoring/List-assets-SBOMs-returns-OK-response.yml @@ -1,5 +1,5 @@ http_interactions: -- recorded_at: Thu, 10 Jul 2025 10:11:37 GMT +- recorded_at: Tue, 20 Jan 2026 08:27:19 GMT request: body: null headers: diff --git a/examples/v1/logs-indexes/CreateLogsIndex.rb b/examples/v1/logs-indexes/CreateLogsIndex.rb index 55b2c0b830bc..bde00c5338a0 100644 --- a/examples/v1/logs-indexes/CreateLogsIndex.rb +++ b/examples/v1/logs-indexes/CreateLogsIndex.rb @@ -25,5 +25,9 @@ name: "main", num_flex_logs_retention_days: 360, num_retention_days: 15, + tags: [ + "team:backend", + "env:production", + ], }) p api_instance.create_logs_index(body) diff --git a/examples/v1/logs-indexes/UpdateLogsIndex.rb b/examples/v1/logs-indexes/UpdateLogsIndex.rb index 22bc9fbef273..1e7a4e1ab9b1 100644 --- a/examples/v1/logs-indexes/UpdateLogsIndex.rb +++ b/examples/v1/logs-indexes/UpdateLogsIndex.rb @@ -25,5 +25,9 @@ }), num_flex_logs_retention_days: 360, num_retention_days: 15, + tags: [ + "team:backend", + "env:production", + ], }) p api_instance.update_logs_index("name", body) diff --git a/examples/v2/cloud-cost-management/DeleteBudget.rb b/examples/v2/cloud-cost-management/DeleteBudget.rb index 0ea7a147ea77..6b010335ea00 100644 --- a/examples/v2/cloud-cost-management/DeleteBudget.rb +++ b/examples/v2/cloud-cost-management/DeleteBudget.rb @@ -1,4 +1,4 @@ -# Delete a budget returns "No Content" response +# Delete budget returns "No Content" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new diff --git a/examples/v2/cloud-cost-management/GetBudget.rb b/examples/v2/cloud-cost-management/GetBudget.rb index c3d029881cd0..8ebc7596e369 100644 --- a/examples/v2/cloud-cost-management/GetBudget.rb +++ b/examples/v2/cloud-cost-management/GetBudget.rb @@ -1,4 +1,4 @@ -# Get a budget returns "OK" response +# Get budget returns "OK" response require "datadog_api_client" api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new diff --git a/examples/v2/cloud-cost-management/UpsertBudget.rb b/examples/v2/cloud-cost-management/UpsertBudget.rb index bef7464de4a9..3a8b26b52c74 100644 --- a/examples/v2/cloud-cost-management/UpsertBudget.rb +++ b/examples/v2/cloud-cost-management/UpsertBudget.rb @@ -10,14 +10,9 @@ created_by: "00000000-0a0a-0a0a-aaa0-00000000000a", end_month: 202502, entries: [ - DatadogAPIClient::V2::BudgetEntry.new({ - amount: 500, - month: 202501, + DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItems.new({ tag_filters: [ - DatadogAPIClient::V2::TagFilter.new({ - tag_key: "service", - tag_value: "ec2", - }), + DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.new({}), ], }), ], @@ -30,6 +25,7 @@ updated_by: "00000000-0a0a-0a0a-aaa0-00000000000a", }), id: "00000000-0a0a-0a0a-aaa0-00000000000a", + type: "", }), }) p api_instance.upsert_budget(body) diff --git a/examples/v2/cloud-cost-management/ValidateBudget.rb b/examples/v2/cloud-cost-management/ValidateBudget.rb new file mode 100644 index 000000000000..c7b935902f15 --- /dev/null +++ b/examples/v2/cloud-cost-management/ValidateBudget.rb @@ -0,0 +1,46 @@ +# Validate budget returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new + +body = DatadogAPIClient::V2::BudgetValidationRequest.new({ + data: DatadogAPIClient::V2::BudgetValidationRequestData.new({ + attributes: DatadogAPIClient::V2::BudgetWithEntriesDataAttributes.new({ + created_at: 1738258683590, + created_by: "00000000-0a0a-0a0a-aaa0-00000000000a", + end_month: 202502, + entries: [ + DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItems.new({ + amount: 500, + month: 202501, + tag_filters: [ + DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.new({ + tag_key: "service", + tag_value: "ec2", + }), + ], + }), + DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItems.new({ + amount: 500, + month: 202502, + tag_filters: [ + DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems.new({ + tag_key: "service", + tag_value: "ec2", + }), + ], + }), + ], + metrics_query: "aws.cost.amortized{service:ec2} by {service}", + name: "my budget", + org_id: 123, + start_month: 202501, + total_amount: 1000, + updated_at: 1738258683590, + updated_by: "00000000-0a0a-0a0a-aaa0-00000000000a", + }), + id: "1", + type: DatadogAPIClient::V2::BudgetWithEntriesDataType::BUDGET, + }), +}) +p api_instance.validate_budget(body) diff --git a/examples/v2/cloud-cost-management/ValidateCsvBudget.rb b/examples/v2/cloud-cost-management/ValidateCsvBudget.rb new file mode 100644 index 000000000000..dbb4e6d183f6 --- /dev/null +++ b/examples/v2/cloud-cost-management/ValidateCsvBudget.rb @@ -0,0 +1,5 @@ +# Validate CSV budget returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new +p api_instance.validate_csv_budget() diff --git a/examples/v2/security-monitoring/GetSBOM.rb b/examples/v2/security-monitoring/GetSBOM.rb index 71e66e401020..482d25f7da7c 100644 --- a/examples/v2/security-monitoring/GetSBOM.rb +++ b/examples/v2/security-monitoring/GetSBOM.rb @@ -1,8 +1,5 @@ # Get SBOM returns "OK" response require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.get_sbom".to_sym] = true -end api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new p api_instance.get_sbom(AssetType::REPOSITORY, "github.com/datadog/datadog-agent") diff --git a/examples/v2/security-monitoring/ListAssetsSBOMs.rb b/examples/v2/security-monitoring/ListAssetsSBOMs.rb index 42b96395ff88..d80cb4f294e6 100644 --- a/examples/v2/security-monitoring/ListAssetsSBOMs.rb +++ b/examples/v2/security-monitoring/ListAssetsSBOMs.rb @@ -1,9 +1,6 @@ # List assets SBOMs returns "OK" response require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.list_assets_sbo_ms".to_sym] = true -end api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new opts = { filter_package_name: "pandas", diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 6baf44d68412..df68c56f0b71 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1764,6 +1764,9 @@ "v2.UpsertBudget" => { "body" => "BudgetWithEntries", }, + "v2.ValidateBudget" => { + "body" => "BudgetValidationRequest", + }, "v2.DeleteBudget" => { "budget_id" => "String", }, diff --git a/features/v1/logs_indexes.feature b/features/v1/logs_indexes.feature index e94fea2c62f4..8277ce4ae244 100644 --- a/features/v1/logs_indexes.feature +++ b/features/v1/logs_indexes.feature @@ -11,21 +11,21 @@ Feature: Logs Indexes @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core Scenario: Create an index returns "Invalid Parameter Error" response Given new "CreateLogsIndex" request - And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15} + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]} When the request is sent Then the response status is 400 Invalid Parameter Error @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core Scenario: Create an index returns "OK" response Given new "CreateLogsIndex" request - And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15} + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/logs-backend @team:DataDog/logs-core Scenario: Create an index returns "Unprocessable Entity" response Given new "CreateLogsIndex" request - And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15} + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "name": "main", "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]} When the request is sent Then the response status is 422 Unprocessable Entity @@ -73,7 +73,7 @@ Feature: Logs Indexes Scenario: Update an index returns "Invalid Parameter Error" response Given new "UpdateLogsIndex" request And request contains "name" parameter from "REPLACE.ME" - And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15} + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]} When the request is sent Then the response status is 400 Invalid Parameter Error @@ -81,7 +81,7 @@ Feature: Logs Indexes Scenario: Update an index returns "OK" response Given new "UpdateLogsIndex" request And request contains "name" parameter from "REPLACE.ME" - And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15} + And body with value {"daily_limit": 300000000, "daily_limit_reset": {"reset_time": "14:00", "reset_utc_offset": "+02:00"}, "daily_limit_warning_threshold_percentage": 70, "disable_daily_limit": false, "exclusion_filters": [{"filter": {"query": "*", "sample_rate": 1.0}, "name": "payment"}], "filter": {"query": "source:python"}, "num_flex_logs_retention_days": 360, "num_retention_days": 15, "tags": ["team:backend", "env:production"]} When the request is sent Then the response status is 200 OK diff --git a/features/v2/cloud_cost_management.feature b/features/v2/cloud_cost_management.feature index d141b80f7ba8..66ccd680c236 100644 --- a/features/v2/cloud_cost_management.feature +++ b/features/v2/cloud_cost_management.feature @@ -70,21 +70,21 @@ Feature: Cloud Cost Management @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "Bad Request" response Given new "UpsertBudget" request - And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a"}} + And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "Not Found" response Given new "UpsertBudget" request - And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a"}} + And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/cloud-cost-management Scenario: Create or update a budget returns "OK" response Given new "UpsertBudget" request - And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a"}} + And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"tag_filters": [{}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "00000000-0a0a-0a0a-aaa0-00000000000a", "type": ""}} When the request is sent Then the response status is 200 OK @@ -189,7 +189,7 @@ Feature: Cloud Cost Management Then the response status is 400 Bad Request @generated @skip @team:DataDog/cloud-cost-management - Scenario: Delete a budget returns "No Content" response + Scenario: Delete budget returns "No Content" response Given new "DeleteBudget" request And request contains "budget_id" parameter from "REPLACE.ME" When the request is sent @@ -241,13 +241,6 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "gcp_uc_config" And the response "data.attributes.account_id" is equal to "123456_ABCDEF_123ABC" - @generated @skip @team:DataDog/cloud-cost-management - Scenario: Get a budget returns "Bad Request" response - Given new "GetBudget" request - And request contains "budget_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - @team:DataDog/cloud-cost-management Scenario: Get a budget returns "Not Found" response Given new "GetBudget" request @@ -255,13 +248,6 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/cloud-cost-management - Scenario: Get a budget returns "OK" response - Given new "GetBudget" request - And request contains "budget_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - @replay-only @team:DataDog/cloud-cost-management Scenario: Get a tag pipeline ruleset returns "OK" response Given new "GetTagPipelinesRuleset" request @@ -271,6 +257,13 @@ Feature: Cloud Cost Management And the response "data.type" is equal to "ruleset" And the response "data.attributes.name" is equal to "EVP Cost Tags" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get budget returns "OK" response + Given new "GetBudget" request + And request contains "budget_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Get cost AWS CUR config returns "OK" response Given new "GetCostAWSCURConfig" request @@ -476,6 +469,19 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Validate CSV budget returns "OK" response + Given new "ValidateCsvBudget" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Validate budget returns "OK" response + Given new "ValidateBudget" request + And body with value {"data": {"attributes": {"created_at": 1738258683590, "created_by": "00000000-0a0a-0a0a-aaa0-00000000000a", "end_month": 202502, "entries": [{"amount": 500, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}, {"amount": 500, "month": 202502, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}], "metrics_query": "aws.cost.amortized{service:ec2} by {service}", "name": "my budget", "org_id": 123, "start_month": 202501, "total_amount": 1000, "updated_at": 1738258683590, "updated_by": "00000000-0a0a-0a0a-aaa0-00000000000a"}, "id": "1", "type": "budget"}} + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Validate query returns "OK" response Given new "ValidateQuery" request diff --git a/features/v2/rum_audience_management.feature b/features/v2/rum_audience_management.feature index 040941e7d874..b358e9a34921 100644 --- a/features/v2/rum_audience_management.feature +++ b/features/v2/rum_audience_management.feature @@ -7,7 +7,7 @@ Feature: Rum Audience Management And a valid "appKeyAuth" key in the system And an instance of "RumAudienceManagement" API - @generated @skip @team:DataDog/audience-management-backend @team:DataDog/pana-ingestion + @generated @skip @team:DataDog/audience-management-backend @team:DataDog/product-analytics-ingestion Scenario: Create connection returns "Connection created successfully" response Given operation "CreateConnection" enabled And new "CreateConnection" request @@ -16,7 +16,7 @@ Feature: Rum Audience Management When the request is sent Then the response status is 201 Connection created successfully - @generated @skip @team:DataDog/audience-management-backend @team:DataDog/pana-ingestion + @generated @skip @team:DataDog/audience-management-backend @team:DataDog/product-analytics-ingestion Scenario: Delete connection returns "Connection deleted successfully" response Given operation "DeleteConnection" enabled And new "DeleteConnection" request @@ -25,7 +25,7 @@ Feature: Rum Audience Management When the request is sent Then the response status is 204 Connection deleted successfully - @generated @skip @team:DataDog/audience-management-backend @team:DataDog/pana-ingestion + @generated @skip @team:DataDog/audience-management-backend @team:DataDog/product-analytics-ingestion Scenario: Get account facet info returns "Successful response with facet information" response Given operation "GetAccountFacetInfo" enabled And new "GetAccountFacetInfo" request @@ -33,7 +33,7 @@ Feature: Rum Audience Management When the request is sent Then the response status is 200 Successful response with facet information - @generated @skip @team:DataDog/audience-management-backend @team:DataDog/pana-ingestion + @generated @skip @team:DataDog/audience-management-backend @team:DataDog/product-analytics-ingestion Scenario: Get mapping returns "Successful response with entity mapping configuration" response Given operation "GetMapping" enabled And new "GetMapping" request @@ -41,7 +41,7 @@ Feature: Rum Audience Management When the request is sent Then the response status is 200 Successful response with entity mapping configuration - @generated @skip @team:DataDog/audience-management-backend @team:DataDog/pana-ingestion + @generated @skip @team:DataDog/audience-management-backend @team:DataDog/product-analytics-ingestion Scenario: Get user facet info returns "Successful response with facet information" response Given operation "GetUserFacetInfo" enabled And new "GetUserFacetInfo" request @@ -49,7 +49,7 @@ Feature: Rum Audience Management When the request is sent Then the response status is 200 Successful response with facet information - @generated @skip @team:DataDog/audience-management-backend @team:DataDog/pana-ingestion + @generated @skip @team:DataDog/audience-management-backend @team:DataDog/product-analytics-ingestion Scenario: List connections returns "Successful response with list of connections" response Given operation "ListConnections" enabled And new "ListConnections" request @@ -57,7 +57,7 @@ Feature: Rum Audience Management When the request is sent Then the response status is 200 Successful response with list of connections - @generated @skip @team:DataDog/audience-management-backend @team:DataDog/pana-ingestion + @generated @skip @team:DataDog/audience-management-backend @team:DataDog/product-analytics-ingestion Scenario: Query accounts returns "Successful response with account data" response Given operation "QueryAccounts" enabled And new "QueryAccounts" request @@ -65,7 +65,7 @@ Feature: Rum Audience Management When the request is sent Then the response status is 200 Successful response with account data - @generated @skip @team:DataDog/audience-management-backend @team:DataDog/pana-ingestion + @generated @skip @team:DataDog/audience-management-backend @team:DataDog/product-analytics-ingestion Scenario: Query event filtered users returns "Successful response with filtered user data" response Given operation "QueryEventFilteredUsers" enabled And new "QueryEventFilteredUsers" request @@ -73,7 +73,7 @@ Feature: Rum Audience Management When the request is sent Then the response status is 200 Successful response with filtered user data - @generated @skip @team:DataDog/audience-management-backend @team:DataDog/pana-ingestion + @generated @skip @team:DataDog/audience-management-backend @team:DataDog/product-analytics-ingestion Scenario: Query users returns "Successful response with user data" response Given operation "QueryUsers" enabled And new "QueryUsers" request @@ -81,7 +81,7 @@ Feature: Rum Audience Management When the request is sent Then the response status is 200 Successful response with user data - @generated @skip @team:DataDog/audience-management-backend @team:DataDog/pana-ingestion + @generated @skip @team:DataDog/audience-management-backend @team:DataDog/product-analytics-ingestion Scenario: Update connection returns "Connection updated successfully" response Given operation "UpdateConnection" enabled And new "UpdateConnection" request diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 32722676fab8..1a620afb10ff 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -809,8 +809,7 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-vm Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response - Given operation "GetSBOM" enabled - And new "GetSBOM" request + Given new "GetSBOM" request And request contains "asset_type" parameter from "REPLACE.ME" And request contains "filter[asset_name]" parameter from "REPLACE.ME" When the request is sent @@ -818,8 +817,7 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-vm Scenario: Get SBOM returns "Not found: asset not found" response - Given operation "GetSBOM" enabled - And new "GetSBOM" request + Given new "GetSBOM" request And request contains "asset_type" parameter with value "Host" And request contains "filter[asset_name]" parameter with value "unknown-host" When the request is sent @@ -827,8 +825,7 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-vm Scenario: Get SBOM returns "OK" response - Given operation "GetSBOM" enabled - And new "GetSBOM" request + Given new "GetSBOM" request And request contains "asset_type" parameter with value "Repository" And request contains "filter[asset_name]" parameter with value "github.com/datadog/datadog-agent" When the request is sent @@ -1297,15 +1294,13 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "Bad request: The server cannot process the request due to invalid syntax in the request." response - Given operation "ListAssetsSBOMs" enabled - And new "ListAssetsSBOMs" request + Given new "ListAssetsSBOMs" request When the request is sent Then the response status is 400 Bad request: The server cannot process the request due to invalid syntax in the request. @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "Not found: There is no request associated with the provided token." response - Given operation "ListAssetsSBOMs" enabled - And new "ListAssetsSBOMs" request + Given new "ListAssetsSBOMs" request And request contains "page[token]" parameter with value "unknown" And request contains "page[number]" parameter with value 1 When the request is sent @@ -1313,15 +1308,13 @@ Feature: Security Monitoring @generated @skip @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "Not found: asset not found" response - Given operation "ListAssetsSBOMs" enabled - And new "ListAssetsSBOMs" request + Given new "ListAssetsSBOMs" request When the request is sent Then the response status is 404 Not found: asset not found @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "OK" response - Given operation "ListAssetsSBOMs" enabled - And new "ListAssetsSBOMs" request + Given new "ListAssetsSBOMs" request And request contains "filter[package_name]" parameter with value "pandas" And request contains "filter[asset_type]" parameter with value "Service" When the request is sent diff --git a/features/v2/undo.json b/features/v2/undo.json index bfcee722b4e8..192ad8f9f4c1 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1091,6 +1091,18 @@ "type": "unsafe" } }, + "ValidateCsvBudget": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "ValidateBudget": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "DeleteBudget": { "tag": "Cloud Cost Management", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index d94287927f32..ea83fc8d7341 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -215,12 +215,10 @@ def initialize "v2.delete_threat_hunting_job": false, "v2.get_finding": false, "v2.get_rule_version_history": false, - "v2.get_sbom": false, "v2.get_secrets_rules": false, "v2.get_security_monitoring_histsignal": false, "v2.get_security_monitoring_histsignals_by_job_id": false, "v2.get_threat_hunting_job": false, - "v2.list_assets_sbo_ms": false, "v2.list_findings": false, "v2.list_multiple_rulesets": false, "v2.list_scanned_assets_metadata": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 7c462f3abf52..0d9ba8f96c34 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1361,9 +1361,18 @@ def overrides "v2.budget" => "Budget", "v2.budget_array" => "BudgetArray", "v2.budget_attributes" => "BudgetAttributes", - "v2.budget_entry" => "BudgetEntry", + "v2.budget_validation_request" => "BudgetValidationRequest", + "v2.budget_validation_request_data" => "BudgetValidationRequestData", + "v2.budget_validation_response" => "BudgetValidationResponse", + "v2.budget_validation_response_data" => "BudgetValidationResponseData", + "v2.budget_validation_response_data_attributes" => "BudgetValidationResponseDataAttributes", + "v2.budget_validation_response_data_type" => "BudgetValidationResponseDataType", "v2.budget_with_entries" => "BudgetWithEntries", "v2.budget_with_entries_data" => "BudgetWithEntriesData", + "v2.budget_with_entries_data_attributes" => "BudgetWithEntriesDataAttributes", + "v2.budget_with_entries_data_attributes_entries_items" => "BudgetWithEntriesDataAttributesEntriesItems", + "v2.budget_with_entries_data_attributes_entries_items_tag_filters_items" => "BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems", + "v2.budget_with_entries_data_type" => "BudgetWithEntriesDataType", "v2.bulk_delete_apps_datastore_items_request" => "BulkDeleteAppsDatastoreItemsRequest", "v2.bulk_delete_apps_datastore_items_request_data" => "BulkDeleteAppsDatastoreItemsRequestData", "v2.bulk_delete_apps_datastore_items_request_data_attributes" => "BulkDeleteAppsDatastoreItemsRequestDataAttributes", @@ -4623,7 +4632,6 @@ def overrides "v2.table_row_resource_data" => "TableRowResourceData", "v2.table_row_resource_data_attributes" => "TableRowResourceDataAttributes", "v2.table_row_resource_data_type" => "TableRowResourceDataType", - "v2.tag_filter" => "TagFilter", "v2.team" => "Team", "v2.team_attributes" => "TeamAttributes", "v2.team_connection" => "TeamConnection", diff --git a/lib/datadog_api_client/v1/models/logs_index.rb b/lib/datadog_api_client/v1/models/logs_index.rb index 3c360443dadf..aa72bcc5cccc 100644 --- a/lib/datadog_api_client/v1/models/logs_index.rb +++ b/lib/datadog_api_client/v1/models/logs_index.rb @@ -55,6 +55,9 @@ class LogsIndex # The available values depend on retention plans specified in your organization's contract/subscriptions. attr_accessor :num_retention_days + # A list of tags associated with the index. Tags must be in `key:value` format. + attr_accessor :tags + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -69,7 +72,8 @@ def self.attribute_map :'is_rate_limited' => :'is_rate_limited', :'name' => :'name', :'num_flex_logs_retention_days' => :'num_flex_logs_retention_days', - :'num_retention_days' => :'num_retention_days' + :'num_retention_days' => :'num_retention_days', + :'tags' => :'tags' } end @@ -85,7 +89,8 @@ def self.openapi_types :'is_rate_limited' => :'Boolean', :'name' => :'String', :'num_flex_logs_retention_days' => :'Integer', - :'num_retention_days' => :'Integer' + :'num_retention_days' => :'Integer', + :'tags' => :'Array' } end @@ -144,6 +149,12 @@ def initialize(attributes = {}) if attributes.key?(:'num_retention_days') self.num_retention_days = attributes[:'num_retention_days'] end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end end # Check to see if the all the properties in the model are valid @@ -225,6 +236,7 @@ def ==(o) name == o.name && num_flex_logs_retention_days == o.num_flex_logs_retention_days && num_retention_days == o.num_retention_days && + tags == o.tags && additional_properties == o.additional_properties end @@ -232,7 +244,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, exclusion_filters, filter, is_rate_limited, name, num_flex_logs_retention_days, num_retention_days, additional_properties].hash + [daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, exclusion_filters, filter, is_rate_limited, name, num_flex_logs_retention_days, num_retention_days, tags, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/logs_index_update_request.rb b/lib/datadog_api_client/v1/models/logs_index_update_request.rb index a093aa89859e..534812e4fd3b 100644 --- a/lib/datadog_api_client/v1/models/logs_index_update_request.rb +++ b/lib/datadog_api_client/v1/models/logs_index_update_request.rb @@ -57,6 +57,9 @@ class LogsIndexUpdateRequest # **Note**: Changing this value affects all logs already in this index. It may also affect billing. attr_accessor :num_retention_days + # A list of tags associated with the index. Tags must be in `key:value` format. + attr_accessor :tags + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -70,7 +73,8 @@ def self.attribute_map :'exclusion_filters' => :'exclusion_filters', :'filter' => :'filter', :'num_flex_logs_retention_days' => :'num_flex_logs_retention_days', - :'num_retention_days' => :'num_retention_days' + :'num_retention_days' => :'num_retention_days', + :'tags' => :'tags' } end @@ -85,7 +89,8 @@ def self.openapi_types :'exclusion_filters' => :'Array', :'filter' => :'LogsFilter', :'num_flex_logs_retention_days' => :'Integer', - :'num_retention_days' => :'Integer' + :'num_retention_days' => :'Integer', + :'tags' => :'Array' } end @@ -140,6 +145,12 @@ def initialize(attributes = {}) if attributes.key?(:'num_retention_days') self.num_retention_days = attributes[:'num_retention_days'] end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end end # Check to see if the all the properties in the model are valid @@ -209,6 +220,7 @@ def ==(o) filter == o.filter && num_flex_logs_retention_days == o.num_flex_logs_retention_days && num_retention_days == o.num_retention_days && + tags == o.tags && additional_properties == o.additional_properties end @@ -216,7 +228,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, disable_daily_limit, exclusion_filters, filter, num_flex_logs_retention_days, num_retention_days, additional_properties].hash + [daily_limit, daily_limit_reset, daily_limit_warning_threshold_percentage, disable_daily_limit, exclusion_filters, filter, num_flex_logs_retention_days, num_retention_days, tags, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb index 0f5790f6bf3c..1fa95f4b860e 100644 --- a/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb +++ b/lib/datadog_api_client/v2/api/cloud_cost_management_api.rb @@ -370,7 +370,7 @@ def create_tag_pipelines_ruleset_with_http_info(body, opts = {}) return data, status_code, headers end - # Delete a budget. + # Delete budget. # # @see #delete_budget_with_http_info def delete_budget(budget_id, opts = {}) @@ -378,9 +378,9 @@ def delete_budget(budget_id, opts = {}) nil end - # Delete a budget. + # Delete budget. # - # Delete a budget. + # Delete a budget # # @param budget_id [String] Budget id. # @param opts [Hash] the optional parameters @@ -415,7 +415,7 @@ def delete_budget_with_http_info(budget_id, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :delete_budget, @@ -825,7 +825,7 @@ def delete_tag_pipelines_ruleset_with_http_info(ruleset_id, opts = {}) return data, status_code, headers end - # Get a budget. + # Get budget. # # @see #get_budget_with_http_info def get_budget(budget_id, opts = {}) @@ -833,13 +833,13 @@ def get_budget(budget_id, opts = {}) data end - # Get a budget. + # Get budget. # - # Get a budget. + # Get a budget # # @param budget_id [String] Budget id. # @param opts [Hash] the optional parameters - # @return [Array<(BudgetWithEntries, Integer, Hash)>] BudgetWithEntries data, response status code and response headers + # @return [Array<(BudgetValidationRequest, Integer, Hash)>] BudgetValidationRequest data, response status code and response headers def get_budget_with_http_info(budget_id, opts = {}) if @api_client.config.debugging @@ -867,10 +867,10 @@ def get_budget_with_http_info(budget_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'BudgetWithEntries' + return_type = opts[:debug_return_type] || 'BudgetValidationRequest' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :get_budget, @@ -1320,7 +1320,7 @@ def list_budgets_with_http_info(opts = {}) return_type = opts[:debug_return_type] || 'BudgetArray' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :list_budgets, @@ -2335,7 +2335,7 @@ def upsert_budget_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] || 'BudgetWithEntries' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :upsert_budget, @@ -2355,6 +2355,130 @@ def upsert_budget_with_http_info(body, opts = {}) return data, status_code, headers end + # Validate budget. + # + # @see #validate_budget_with_http_info + def validate_budget(body, opts = {}) + data, _status_code, _headers = validate_budget_with_http_info(body, opts) + data + end + + # Validate budget. + # + # Validate a budget configuration without creating or modifying it + # + # @param body [BudgetValidationRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(BudgetValidationResponse, Integer, Hash)>] BudgetValidationResponse data, response status code and response headers + def validate_budget_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.validate_budget ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling CloudCostManagementAPI.validate_budget" + end + # resource path + local_var_path = '/api/v2/cost/budget/validate' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'BudgetValidationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :validate_budget, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#validate_budget\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Validate CSV budget. + # + # @see #validate_csv_budget_with_http_info + def validate_csv_budget(opts = {}) + data, _status_code, _headers = validate_csv_budget_with_http_info(opts) + data + end + + # Validate CSV budget. + # @param opts [Hash] the optional parameters + # @return [Array<(ValidationResponse, Integer, Hash)>] ValidationResponse data, response status code and response headers + def validate_csv_budget_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: CloudCostManagementAPI.validate_csv_budget ...' + end + # resource path + local_var_path = '/api/v2/cost/budget/csv/validate' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ValidationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :validate_csv_budget, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: CloudCostManagementAPI#validate_csv_budget\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Validate query. # # @see #validate_query_with_http_info diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 356fba373289..69ad106e6419 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -2327,12 +2327,6 @@ def get_sbom(asset_type, filter_asset_name, opts = {}) # @option opts [SBOMFormat] :ext_format The standard of the SBOM. # @return [Array<(GetSBOMResponse, Integer, Hash)>] GetSBOMResponse data, response status code and response headers def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_sbom".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_sbom") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_sbom")) - end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_sbom ...' @@ -3510,12 +3504,6 @@ def list_assets_sbo_ms(opts = {}) # @option opts [SBOMComponentLicenseType] :filter_license_type The software license type of the component that is a dependency of an asset. # @return [Array<(ListAssetsSBOMsResponse, Integer, Hash)>] ListAssetsSBOMsResponse data, response status code and response headers def list_assets_sbo_ms_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_assets_sbo_ms".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_assets_sbo_ms") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_assets_sbo_ms")) - end if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_assets_sbo_ms ...' diff --git a/lib/datadog_api_client/v2/models/budget.rb b/lib/datadog_api_client/v2/models/budget.rb index a88614711d3f..b86ef8f84d5b 100644 --- a/lib/datadog_api_client/v2/models/budget.rb +++ b/lib/datadog_api_client/v2/models/budget.rb @@ -28,7 +28,7 @@ class Budget attr_accessor :id # The type of the object, must be `budget`. - attr_accessor :type + attr_reader :type attr_accessor :additional_properties @@ -83,6 +83,24 @@ def initialize(attributes = {}) 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v2/models/budget_array.rb b/lib/datadog_api_client/v2/models/budget_array.rb index fdc797c56f7d..307ce335217b 100644 --- a/lib/datadog_api_client/v2/models/budget_array.rb +++ b/lib/datadog_api_client/v2/models/budget_array.rb @@ -22,7 +22,7 @@ class BudgetArray include BaseGenericModel # The `BudgetArray` `data`. - attr_accessor :data + attr_reader :data attr_accessor :additional_properties @@ -67,6 +67,24 @@ def initialize(attributes = {}) 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + # Returns the object in the form of hash, with additionalProperties support. # @return [Hash] Returns the object in the form of hash # @!visibility private diff --git a/lib/datadog_api_client/v2/models/budget_attributes.rb b/lib/datadog_api_client/v2/models/budget_attributes.rb index fd652f8d623a..f28e4aa9dbb1 100644 --- a/lib/datadog_api_client/v2/models/budget_attributes.rb +++ b/lib/datadog_api_client/v2/models/budget_attributes.rb @@ -30,7 +30,7 @@ class BudgetAttributes # The month when the budget ends. attr_accessor :end_month - # The entries of the budget. + # attr_accessor :entries # The cost query used to track against the budget. @@ -81,7 +81,7 @@ def self.openapi_types :'created_at' => :'Integer', :'created_by' => :'String', :'end_month' => :'Integer', - :'entries' => :'Array', + :'entries' => :'Array', :'metrics_query' => :'String', :'name' => :'String', :'org_id' => :'Integer', diff --git a/lib/datadog_api_client/v2/models/budget_validation_request.rb b/lib/datadog_api_client/v2/models/budget_validation_request.rb new file mode 100644 index 000000000000..afb50064b116 --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_validation_request.rb @@ -0,0 +1,105 @@ +=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 + # + class BudgetValidationRequest + include BaseGenericModel + + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'BudgetValidationRequestData' + } + 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::BudgetValidationRequest` 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?(:'data') + self.data = attributes[:'data'] + end + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/budget_validation_request_data.rb b/lib/datadog_api_client/v2/models/budget_validation_request_data.rb new file mode 100644 index 000000000000..8b649cc6fe3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_validation_request_data.rb @@ -0,0 +1,143 @@ +=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 + # + class BudgetValidationRequestData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # Budget resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'BudgetWithEntriesDataAttributes', + :'id' => :'String', + :'type' => :'BudgetWithEntriesDataType' + } + 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::BudgetValidationRequestData` 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?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/budget_validation_response.rb b/lib/datadog_api_client/v2/models/budget_validation_response.rb new file mode 100644 index 000000000000..850db2ba3369 --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_validation_response.rb @@ -0,0 +1,105 @@ +=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 + # + class BudgetValidationResponse + include BaseGenericModel + + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'BudgetValidationResponseData' + } + 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::BudgetValidationResponse` 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?(:'data') + self.data = attributes[:'data'] + end + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/budget_validation_response_data.rb b/lib/datadog_api_client/v2/models/budget_validation_response_data.rb new file mode 100644 index 000000000000..b64bc41f4930 --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_validation_response_data.rb @@ -0,0 +1,143 @@ +=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 + # + class BudgetValidationResponseData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # Budget validation resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'BudgetValidationResponseDataAttributes', + :'id' => :'String', + :'type' => :'BudgetValidationResponseDataType' + } + 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::BudgetValidationResponseData` 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?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/budget_validation_response_data_attributes.rb b/lib/datadog_api_client/v2/models/budget_validation_response_data_attributes.rb new file mode 100644 index 000000000000..035b35809245 --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_validation_response_data_attributes.rb @@ -0,0 +1,117 @@ +=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 + # + class BudgetValidationResponseDataAttributes + include BaseGenericModel + + # + attr_accessor :errors + + # + attr_accessor :valid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'errors' => :'errors', + :'valid' => :'valid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'errors' => :'Array', + :'valid' => :'Boolean' + } + 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::BudgetValidationResponseDataAttributes` 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?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + + if attributes.key?(:'valid') + self.valid = attributes[:'valid'] + end + 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 && + errors == o.errors && + valid == o.valid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [errors, valid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/budget_validation_response_data_type.rb b/lib/datadog_api_client/v2/models/budget_validation_response_data_type.rb new file mode 100644 index 000000000000..454b569fb8e0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_validation_response_data_type.rb @@ -0,0 +1,26 @@ +=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 + # Budget validation resource type. + class BudgetValidationResponseDataType + include BaseEnumModel + + BUDGET_VALIDATION = "budget_validation".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes.rb b/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes.rb new file mode 100644 index 000000000000..14104ca9091e --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes.rb @@ -0,0 +1,207 @@ +=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 + # + class BudgetWithEntriesDataAttributes + include BaseGenericModel + + # + attr_accessor :created_at + + # + attr_accessor :created_by + + # + attr_accessor :end_month + + # + attr_accessor :entries + + # + attr_accessor :metrics_query + + # + attr_accessor :name + + # + attr_accessor :org_id + + # + attr_accessor :start_month + + # + attr_accessor :total_amount + + # + attr_accessor :updated_at + + # + attr_accessor :updated_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'end_month' => :'end_month', + :'entries' => :'entries', + :'metrics_query' => :'metrics_query', + :'name' => :'name', + :'org_id' => :'org_id', + :'start_month' => :'start_month', + :'total_amount' => :'total_amount', + :'updated_at' => :'updated_at', + :'updated_by' => :'updated_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Integer', + :'created_by' => :'String', + :'end_month' => :'Integer', + :'entries' => :'Array', + :'metrics_query' => :'String', + :'name' => :'String', + :'org_id' => :'Integer', + :'start_month' => :'Integer', + :'total_amount' => :'Float', + :'updated_at' => :'Integer', + :'updated_by' => :'String' + } + 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::BudgetWithEntriesDataAttributes` 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?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'end_month') + self.end_month = attributes[:'end_month'] + end + + if attributes.key?(:'entries') + if (value = attributes[:'entries']).is_a?(Array) + self.entries = value + end + end + + if attributes.key?(:'metrics_query') + self.metrics_query = attributes[:'metrics_query'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'start_month') + self.start_month = attributes[:'start_month'] + end + + if attributes.key?(:'total_amount') + self.total_amount = attributes[:'total_amount'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_by') + self.updated_by = attributes[:'updated_by'] + end + 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 && + created_at == o.created_at && + created_by == o.created_by && + end_month == o.end_month && + entries == o.entries && + metrics_query == o.metrics_query && + name == o.name && + org_id == o.org_id && + start_month == o.start_month && + total_amount == o.total_amount && + updated_at == o.updated_at && + updated_by == o.updated_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, created_by, end_month, entries, metrics_query, name, org_id, start_month, total_amount, updated_at, updated_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/budget_entry.rb b/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items.rb similarity index 92% rename from lib/datadog_api_client/v2/models/budget_entry.rb rename to lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items.rb index b37449df7bbe..71bb2caa3f8c 100644 --- a/lib/datadog_api_client/v2/models/budget_entry.rb +++ b/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items.rb @@ -17,17 +17,17 @@ require 'time' module DatadogAPIClient::V2 - # The entry of a budget. - class BudgetEntry + # + class BudgetWithEntriesDataAttributesEntriesItems include BaseGenericModel - # The `amount` of the budget entry. + # attr_accessor :amount - # The `month` of the budget entry. + # attr_accessor :month - # The `tag_filters` of the budget entry. + # attr_accessor :tag_filters attr_accessor :additional_properties @@ -48,7 +48,7 @@ def self.openapi_types { :'amount' => :'Float', :'month' => :'Integer', - :'tag_filters' => :'Array' + :'tag_filters' => :'Array' } end @@ -57,7 +57,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::BudgetEntry` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItems` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/tag_filter.rb b/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items_tag_filters_items.rb similarity index 93% rename from lib/datadog_api_client/v2/models/tag_filter.rb rename to lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items_tag_filters_items.rb index 106a5d91265b..d57e8d58fcf1 100644 --- a/lib/datadog_api_client/v2/models/tag_filter.rb +++ b/lib/datadog_api_client/v2/models/budget_with_entries_data_attributes_entries_items_tag_filters_items.rb @@ -17,14 +17,14 @@ require 'time' module DatadogAPIClient::V2 - # Tag filter for the budget's entries. - class TagFilter + # + class BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems include BaseGenericModel - # The key of the tag. + # attr_accessor :tag_key - # The value of the tag. + # attr_accessor :tag_value attr_accessor :additional_properties @@ -52,7 +52,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::TagFilter` initialize method" + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems` initialize method" end self.additional_properties = {} diff --git a/lib/datadog_api_client/v2/models/budget_with_entries_data_type.rb b/lib/datadog_api_client/v2/models/budget_with_entries_data_type.rb new file mode 100644 index 000000000000..3be85c43a077 --- /dev/null +++ b/lib/datadog_api_client/v2/models/budget_with_entries_data_type.rb @@ -0,0 +1,26 @@ +=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 + # Budget resource type. + class BudgetWithEntriesDataType + include BaseEnumModel + + BUDGET = "budget".freeze + end +end