From faf5e052bc8fe8b8787eddc18bee3591742d4955 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 16 Jan 2026 20:54:27 +0000 Subject: [PATCH] Regenerate client from commit ad3e472 of spec repo --- .generator/schemas/v2/openapi.yaml | 248 ++++++++++++++ ...urns-AWS-CCM-Config-object-response.frozen | 1 + ...returns-AWS-CCM-Config-object-response.yml | 43 +++ ...CM-config-returns-Conflict-response.frozen | 1 + ...S-CCM-config-returns-Conflict-response.yml | 48 +++ ...M-config-returns-Not-Found-response.frozen | 1 + ...-CCM-config-returns-Not-Found-response.yml | 25 ++ ...-config-returns-No-Content-response.frozen | 1 + ...CCM-config-returns-No-Content-response.yml | 18 ++ ...M-config-returns-Not-Found-response.frozen | 1 + ...-CCM-config-returns-Not-Found-response.yml | 21 ++ ...urns-AWS-CCM-Config-object-response.frozen | 1 + ...returns-AWS-CCM-Config-object-response.yml | 20 ++ ...M-config-returns-Not-Found-response.frozen | 1 + ...-CCM-config-returns-Not-Found-response.yml | 21 ++ ...urns-AWS-CCM-Config-object-response.frozen | 1 + ...returns-AWS-CCM-Config-object-response.yml | 24 ++ ...M-config-returns-Not-Found-response.frozen | 1 + ...-CCM-config-returns-Not-Found-response.yml | 25 ++ .../CreateAWSAccountCCMConfig.rb | 24 ++ .../DeleteAWSAccountCCMConfig.rb | 5 + .../aws-integration/GetAWSAccountCCMConfig.rb | 5 + .../UpdateAWSAccountCCMConfig.rb | 24 ++ features/scenarios_model_mapping.rb | 14 + features/v2/aws_integration.feature | 72 +++++ features/v2/undo.json | 26 ++ lib/datadog_api_client/configuration.rb | 4 + lib/datadog_api_client/inflector.rb | 9 + .../v2/api/aws_integration_api.rb | 302 ++++++++++++++++++ .../v2/models/aws_ccm_config.rb | 125 ++++++++ .../v2/models/aws_ccm_config_request.rb | 123 +++++++ .../aws_ccm_config_request_attributes.rb | 123 +++++++ .../v2/models/aws_ccm_config_request_data.rb | 144 +++++++++ .../v2/models/aws_ccm_config_response.rb | 123 +++++++ .../aws_ccm_config_response_attributes.rb | 107 +++++++ .../v2/models/aws_ccm_config_response_data.rb | 146 +++++++++ .../v2/models/aws_ccm_config_type.rb | 26 ++ .../v2/models/data_export_config.rb | 207 ++++++++++++ 38 files changed, 2111 insertions(+) create mode 100644 cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Conflict-response.frozen create mode 100644 cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Conflict-response.yml create mode 100644 cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-No-Content-response.frozen create mode 100644 cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-No-Content-response.yml create mode 100644 cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen create mode 100644 cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml create mode 100644 cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-Not-Found-response.yml create mode 100644 examples/v2/aws-integration/CreateAWSAccountCCMConfig.rb create mode 100644 examples/v2/aws-integration/DeleteAWSAccountCCMConfig.rb create mode 100644 examples/v2/aws-integration/GetAWSAccountCCMConfig.rb create mode 100644 examples/v2/aws-integration/UpdateAWSAccountCCMConfig.rb create mode 100644 lib/datadog_api_client/v2/models/aws_ccm_config.rb create mode 100644 lib/datadog_api_client/v2/models/aws_ccm_config_request.rb create mode 100644 lib/datadog_api_client/v2/models/aws_ccm_config_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/aws_ccm_config_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/aws_ccm_config_response.rb create mode 100644 lib/datadog_api_client/v2/models/aws_ccm_config_response_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/aws_ccm_config_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/aws_ccm_config_type.rb create mode 100644 lib/datadog_api_client/v2/models/data_export_config.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f11972d91d04..266b9924aec8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1761,6 +1761,82 @@ components: required: - role_name type: object + AWSCcmConfig: + description: AWS Cloud Cost Management config. + properties: + data_export_configs: + description: List of data export configurations for Cost and Usage Reports. + items: + $ref: '#/components/schemas/DataExportConfig' + type: array + required: + - data_export_configs + type: object + AWSCcmConfigRequest: + description: AWS CCM Config Create/Update Request body. + properties: + data: + $ref: '#/components/schemas/AWSCcmConfigRequestData' + required: + - data + type: object + AWSCcmConfigRequestAttributes: + description: AWS CCM Config attributes for Create/Update requests. + properties: + ccm_config: + $ref: '#/components/schemas/AWSCcmConfig' + required: + - ccm_config + type: object + AWSCcmConfigRequestData: + description: AWS CCM Config Create/Update Request data. + properties: + attributes: + $ref: '#/components/schemas/AWSCcmConfigRequestAttributes' + type: + $ref: '#/components/schemas/AWSCcmConfigType' + required: + - attributes + - type + type: object + AWSCcmConfigResponse: + description: AWS CCM Config response body. + properties: + data: + $ref: '#/components/schemas/AWSCcmConfigResponseData' + required: + - data + type: object + AWSCcmConfigResponseAttributes: + description: AWS CCM Config response attributes. + properties: + data_export_configs: + description: List of data export configurations for Cost and Usage Reports. + items: + $ref: '#/components/schemas/DataExportConfig' + type: array + type: object + AWSCcmConfigResponseData: + description: AWS CCM Config response data. + properties: + attributes: + $ref: '#/components/schemas/AWSCcmConfigResponseAttributes' + id: + $ref: '#/components/schemas/AWSAccountConfigID' + type: + $ref: '#/components/schemas/AWSCcmConfigType' + required: + - type + type: object + AWSCcmConfigType: + default: ccm_config + description: AWS CCM Config resource type. + enum: + - ccm_config + example: ccm_config + type: string + x-enum-varnames: + - CCM_CONFIG AWSCredentials: description: The definition of `AWSCredentials` object. oneOf: @@ -16811,6 +16887,37 @@ components: example: canceled type: string type: object + DataExportConfig: + description: AWS Cost and Usage Report data export configuration. + properties: + bucket_name: + description: Name of the S3 bucket where the Cost and Usage Report is stored. + example: billing + type: string + bucket_region: + description: AWS region of the S3 bucket. + example: us-east-1 + type: string + report_name: + description: Name of the Cost and Usage Report. + example: cost-and-usage-report + type: string + report_prefix: + description: S3 prefix where the Cost and Usage Report is stored. + example: reports + type: string + report_type: + description: Type of the Cost and Usage Report. Currently only `CUR2.0` + is supported. + example: CUR2.0 + type: string + required: + - report_name + - report_prefix + - report_type + - bucket_name + - bucket_region + type: object DataRelationshipsTeams: description: Associates teams with this schedule in a data structure. properties: @@ -72421,6 +72528,147 @@ paths: operator: OR permissions: - aws_configuration_edit + /api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config: + delete: + description: 'Delete the Cloud Cost Management config for an AWS Account Integration + Config using Cost and Usage Report + + (CUR) 2.0 by config ID.' + operationId: DeleteAWSAccountCCMConfig + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + responses: + '204': + description: No Content + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete AWS CCM config + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_edit + x-unstable: '**Note**: This endpoint is in preview and may be subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: 'Get the Cloud Cost Management config for an AWS Account Integration + Config using Cost and Usage Report + + (CUR) 2.0 by config ID.' + operationId: GetAWSAccountCCMConfig + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCcmConfigResponse' + description: AWS CCM Config object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Get AWS CCM config + tags: + - AWS Integration + x-permission: + operator: OR + permissions: + - aws_configuration_read + x-unstable: '**Note**: This endpoint is in preview and may be subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: 'Update the Cloud Cost Management config for an AWS Account Integration + Config using Cost and Usage Report + + (CUR) 2.0 by config ID.' + operationId: UpdateAWSAccountCCMConfig + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCcmConfigRequest' + description: Update a Cloud Cost Management config for an AWS Account Integration + Config. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCcmConfigResponse' + description: AWS CCM Config object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update AWS CCM config + tags: + - AWS Integration + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - aws_configuration_edit + x-unstable: '**Note**: This endpoint is in preview and may be subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: 'Create the Cloud Cost Management config for an AWS Account Integration + Config using Cost and Usage Report + + (CUR) 2.0 by config ID.' + operationId: CreateAWSAccountCCMConfig + parameters: + - $ref: '#/components/parameters/AWSAccountConfigIDPathParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCcmConfigRequest' + description: Create a Cloud Cost Management config for an AWS Account Integration + Config. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AWSCcmConfigResponse' + description: AWS CCM Config object + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create AWS CCM config + tags: + - AWS Integration + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - aws_configuration_edit + x-unstable: '**Note**: This endpoint is in preview and may be subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/integration/aws/available_namespaces: get: description: Get a list of available AWS CloudWatch namespaces that can send diff --git a/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen new file mode 100644 index 000000000000..32645b853c72 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen @@ -0,0 +1 @@ +2026-01-16T20:44:39.348Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml new file mode 100644 index 000000000000..19c587ae31d2 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml @@ -0,0 +1,43 @@ +http_interactions: +- recorded_at: Fri, 16 Jan 2026 20:44:39 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing","bucket_region":"us-east-1","report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"873c7e78-8915-4c7a-a3a7-33a57adf54f4","type":"ccm_config","attributes":{"data_export_configs":[{"report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0","bucket_name":"billing","bucket_region":"us-east-1"}]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 16 Jan 2026 20:44:39 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/%7Baws_account_config_id%7D/ccm_config + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Invalid Parameter","detail":"invalid + parameter \"aws_account_config_id\" in \"path\"; expected type \"uuid\""}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Conflict-response.frozen b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Conflict-response.frozen new file mode 100644 index 000000000000..ae624ab0aeec --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Conflict-response.frozen @@ -0,0 +1 @@ +2026-01-16T20:03:18.352Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Conflict-response.yml b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Conflict-response.yml new file mode 100644 index 000000000000..b1a5805edbca --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Conflict-response.yml @@ -0,0 +1,48 @@ +http_interactions: +- recorded_at: Fri, 16 Jan 2026 20:03:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing","bucket_region":"us-east-1","report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"409","title":"Account already exists","detail":"CCM + config already exists for this account"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +- recorded_at: Fri, 16 Jan 2026 20:03:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing","bucket_region":"us-east-1","report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"409","title":"Account already exists","detail":"CCM + config already exists for this account"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..2238a807c173 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-01-16T20:07:40.872Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Not-Found-response.yml new file mode 100644 index 000000000000..923ad9481a46 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Create-AWS-CCM-config-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Fri, 16 Jan 2026 20:07:40 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing","bucket_region":"us-east-1","report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-No-Content-response.frozen b/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-No-Content-response.frozen new file mode 100644 index 000000000000..aaabc02a4fcc --- /dev/null +++ b/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2026-01-16T20:07:47.631Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-No-Content-response.yml b/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-No-Content-response.yml new file mode 100644 index 000000000000..5f4fc7f44c9d --- /dev/null +++ b/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-No-Content-response.yml @@ -0,0 +1,18 @@ +http_interactions: +- recorded_at: Fri, 16 Jan 2026 20:07:47 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..17bc20d65e76 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-01-16T20:07:54.863Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-Not-Found-response.yml new file mode 100644 index 000000000000..437d97dcfb80 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Delete-AWS-CCM-config-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Fri, 16 Jan 2026 20:07:54 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen b/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen new file mode 100644 index 000000000000..e134643ca472 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen @@ -0,0 +1 @@ +2026-01-16T20:08:01.626Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml b/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml new file mode 100644 index 000000000000..09fd501e0d46 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Fri, 16 Jan 2026 20:08:01 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"873c7e78-8915-4c7a-a3a7-33a57adf54f4","type":"ccm_config","attributes":{"data_export_configs":[{"report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0","bucket_name":"billing","bucket_region":"us-east-1"}]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..5ef74d7aee63 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-01-16T20:08:08.924Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-Not-Found-response.yml new file mode 100644 index 000000000000..b4dc9a03cdbb --- /dev/null +++ b/cassettes/features/v2/aws_integration/Get-AWS-CCM-config-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Fri, 16 Jan 2026 20:08:08 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen b/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen new file mode 100644 index 000000000000..abdd8059a4fd --- /dev/null +++ b/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-AWS-CCM-Config-object-response.frozen @@ -0,0 +1 @@ +2026-01-16T20:08:15.964Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml b/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml new file mode 100644 index 000000000000..3bac364fc74d --- /dev/null +++ b/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-AWS-CCM-Config-object-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Fri, 16 Jan 2026 20:08:15 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing-updated","bucket_region":"us-west-2","report_name":"cost-report-updated","report_prefix":"reports-updated","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"873c7e78-8915-4c7a-a3a7-33a57adf54f4","type":"ccm_config","attributes":{"data_export_configs":[{"report_name":"cost-report-updated","report_prefix":"reports-updated","report_type":"CUR2.0","bucket_name":"billing-updated","bucket_region":"us-west-2"}]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-Not-Found-response.frozen b/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..a07b797a12c6 --- /dev/null +++ b/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-01-16T20:08:22.705Z \ No newline at end of file diff --git a/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-Not-Found-response.yml b/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-Not-Found-response.yml new file mode 100644 index 000000000000..c5d4ec3d815b --- /dev/null +++ b/cassettes/features/v2/aws_integration/Update-AWS-CCM-config-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Fri, 16 Jan 2026 20:08:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"ccm_config":{"data_export_configs":[{"bucket_name":"billing","bucket_region":"us-east-1","report_name":"cost-and-usage-report","report_prefix":"reports","report_type":"CUR2.0"}]}},"type":"ccm_config"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://frog.datadoghq.com/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Account not found","detail":"AWS + account with provided id is not integrated"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/examples/v2/aws-integration/CreateAWSAccountCCMConfig.rb b/examples/v2/aws-integration/CreateAWSAccountCCMConfig.rb new file mode 100644 index 000000000000..a3ea2b8484f6 --- /dev/null +++ b/examples/v2/aws-integration/CreateAWSAccountCCMConfig.rb @@ -0,0 +1,24 @@ +# Create AWS CCM config returns "AWS CCM Config object" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new + +body = DatadogAPIClient::V2::AWSCcmConfigRequest.new({ + data: DatadogAPIClient::V2::AWSCcmConfigRequestData.new({ + attributes: DatadogAPIClient::V2::AWSCcmConfigRequestAttributes.new({ + ccm_config: DatadogAPIClient::V2::AWSCcmConfig.new({ + data_export_configs: [ + DatadogAPIClient::V2::DataExportConfig.new({ + bucket_name: "billing", + bucket_region: "us-east-1", + report_name: "cost-and-usage-report", + report_prefix: "reports", + report_type: "CUR2.0", + }), + ], + }), + }), + type: DatadogAPIClient::V2::AWSCcmConfigType::CCM_CONFIG, + }), +}) +p api_instance.create_aws_account_ccm_config("873c7e78-8915-4c7a-a3a7-33a57adf54f4", body) diff --git a/examples/v2/aws-integration/DeleteAWSAccountCCMConfig.rb b/examples/v2/aws-integration/DeleteAWSAccountCCMConfig.rb new file mode 100644 index 000000000000..6824398f0dff --- /dev/null +++ b/examples/v2/aws-integration/DeleteAWSAccountCCMConfig.rb @@ -0,0 +1,5 @@ +# Delete AWS CCM config returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +api_instance.delete_aws_account_ccm_config("873c7e78-8915-4c7a-a3a7-33a57adf54f4") diff --git a/examples/v2/aws-integration/GetAWSAccountCCMConfig.rb b/examples/v2/aws-integration/GetAWSAccountCCMConfig.rb new file mode 100644 index 000000000000..79247013bd5a --- /dev/null +++ b/examples/v2/aws-integration/GetAWSAccountCCMConfig.rb @@ -0,0 +1,5 @@ +# Get AWS CCM config returns "AWS CCM Config object" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new +p api_instance.get_aws_account_ccm_config("873c7e78-8915-4c7a-a3a7-33a57adf54f4") diff --git a/examples/v2/aws-integration/UpdateAWSAccountCCMConfig.rb b/examples/v2/aws-integration/UpdateAWSAccountCCMConfig.rb new file mode 100644 index 000000000000..38f66d09a174 --- /dev/null +++ b/examples/v2/aws-integration/UpdateAWSAccountCCMConfig.rb @@ -0,0 +1,24 @@ +# Update AWS CCM config returns "AWS CCM Config object" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::AWSIntegrationAPI.new + +body = DatadogAPIClient::V2::AWSCcmConfigRequest.new({ + data: DatadogAPIClient::V2::AWSCcmConfigRequestData.new({ + attributes: DatadogAPIClient::V2::AWSCcmConfigRequestAttributes.new({ + ccm_config: DatadogAPIClient::V2::AWSCcmConfig.new({ + data_export_configs: [ + DatadogAPIClient::V2::DataExportConfig.new({ + bucket_name: "billing-updated", + bucket_region: "us-west-2", + report_name: "cost-report-updated", + report_prefix: "reports-updated", + report_type: "CUR2.0", + }), + ], + }), + }), + type: DatadogAPIClient::V2::AWSCcmConfigType::CCM_CONFIG, + }), +}) +p api_instance.update_aws_account_ccm_config("873c7e78-8915-4c7a-a3a7-33a57adf54f4", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 909e6202543f..aa98c7e8cdb7 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2219,6 +2219,20 @@ "aws_account_config_id" => "String", "body" => "AWSAccountUpdateRequest", }, + "v2.DeleteAWSAccountCCMConfig" => { + "aws_account_config_id" => "String", + }, + "v2.GetAWSAccountCCMConfig" => { + "aws_account_config_id" => "String", + }, + "v2.UpdateAWSAccountCCMConfig" => { + "aws_account_config_id" => "String", + "body" => "AWSCcmConfigRequest", + }, + "v2.CreateAWSAccountCCMConfig" => { + "aws_account_config_id" => "String", + "body" => "AWSCcmConfigRequest", + }, "v2.DeleteAWSEventBridgeSource" => { "body" => "AWSEventBridgeDeleteRequest", }, diff --git a/features/v2/aws_integration.feature b/features/v2/aws_integration.feature index 30ded64d73f1..b13e9d8c08f7 100644 --- a/features/v2/aws_integration.feature +++ b/features/v2/aws_integration.feature @@ -9,6 +9,34 @@ Feature: AWS Integration And a valid "appKeyAuth" key in the system And an instance of "AWSIntegration" API + @team:DataDog/aws-integrations + Scenario: Create AWS CCM config returns "AWS CCM Config object" response + Given new "CreateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter with value "873c7e78-8915-4c7a-a3a7-33a57adf54f4" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + When the request is sent + Then the response status is 200 AWS CCM Config object + + @team:DataDog/aws-integrations + Scenario: Create AWS CCM config returns "Conflict" response + Given new "CreateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter with value "873c7e78-8915-4c7a-a3a7-33a57adf54f4" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + And new "CreateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter with value "873c7e78-8915-4c7a-a3a7-33a57adf54f4" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + When the request is sent + And the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aws-integrations + Scenario: Create AWS CCM config returns "Not Found" response + Given new "CreateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/aws-integrations Scenario: Create an AWS account returns "AWS Account object" response Given new "CreateAWSAccount" request @@ -59,6 +87,20 @@ Feature: AWS Integration When the request is sent Then the response status is 409 Conflict + @team:DataDog/aws-integrations + Scenario: Delete AWS CCM config returns "No Content" response + Given new "DeleteAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter with value "873c7e78-8915-4c7a-a3a7-33a57adf54f4" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/aws-integrations + Scenario: Delete AWS CCM config returns "Not Found" response + Given new "DeleteAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/aws-integrations Scenario: Delete an AWS integration returns "Bad Request" response Given new "DeleteAWSAccount" request @@ -108,6 +150,20 @@ Feature: AWS Integration When the request is sent Then the response status is 200 AWS External ID object + @team:DataDog/aws-integrations + Scenario: Get AWS CCM config returns "AWS CCM Config object" response + Given new "GetAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter with value "873c7e78-8915-4c7a-a3a7-33a57adf54f4" + When the request is sent + Then the response status is 200 AWS CCM Config object + + @team:DataDog/aws-integrations + Scenario: Get AWS CCM config returns "Not Found" response + Given new "GetAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/aws-integrations Scenario: Get AWS integration IAM permissions returns "AWS IAM Permissions object" response Given new "GetAWSIntegrationIAMPermissions" request @@ -190,6 +246,22 @@ Feature: AWS Integration When the request is sent Then the response status is 200 AWS Namespaces List object + @team:DataDog/aws-integrations + Scenario: Update AWS CCM config returns "AWS CCM Config object" response + Given new "UpdateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter with value "873c7e78-8915-4c7a-a3a7-33a57adf54f4" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing-updated", "bucket_region": "us-west-2", "report_name": "cost-report-updated", "report_prefix": "reports-updated", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + When the request is sent + Then the response status is 200 AWS CCM Config object + + @team:DataDog/aws-integrations + Scenario: Update AWS CCM config returns "Not Found" response + Given new "UpdateAWSAccountCCMConfig" request + And request contains "aws_account_config_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"attributes": {"ccm_config": {"data_export_configs": [{"bucket_name": "billing", "bucket_region": "us-east-1", "report_name": "cost-and-usage-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}}, "type": "ccm_config"}} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/aws-integrations Scenario: Update an AWS integration returns "AWS Account object" response Given there is a valid "aws_account_v2" in the system diff --git a/features/v2/undo.json b/features/v2/undo.json index 421fd8933730..db38229e6158 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1894,6 +1894,32 @@ "type": "idempotent" } }, + "DeleteAWSAccountCCMConfig": { + "tag": "AWS Integration", + "undo": { + "type": "idempotent" + } + }, + "GetAWSAccountCCMConfig": { + "tag": "AWS Integration", + "undo": { + "type": "safe" + } + }, + "UpdateAWSAccountCCMConfig": { + "tag": "AWS Integration", + "undo": { + "type": "idempotent" + } + }, + "CreateAWSAccountCCMConfig": { + "tag": "AWS Integration", + "undo": { + "operationId": "DeleteAWSAccountCCMConfig", + "parameters": [], + "type": "unsafe" + } + }, "ListAWSNamespaces": { "tag": "AWS Integration", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index cdd2bdf2c018..3c731e54d75d 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -283,6 +283,10 @@ def initialize "v2.update_incident_notification_template": false, "v2.update_incident_todo": false, "v2.update_incident_type": false, + "v2.create_aws_account_ccm_config": false, + "v2.delete_aws_account_ccm_config": false, + "v2.get_aws_account_ccm_config": false, + "v2.update_aws_account_ccm_config": false, "v2.add_role_to_restriction_query": false, "v2.create_restriction_query": false, "v2.delete_restriction_query": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 5cfdf83ee17c..dc7c5c21c1aa 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1222,6 +1222,14 @@ def overrides "v2.aws_auth_config" => "AWSAuthConfig", "v2.aws_auth_config_keys" => "AWSAuthConfigKeys", "v2.aws_auth_config_role" => "AWSAuthConfigRole", + "v2.aws_ccm_config" => "AWSCcmConfig", + "v2.aws_ccm_config_request" => "AWSCcmConfigRequest", + "v2.aws_ccm_config_request_attributes" => "AWSCcmConfigRequestAttributes", + "v2.aws_ccm_config_request_data" => "AWSCcmConfigRequestData", + "v2.aws_ccm_config_response" => "AWSCcmConfigResponse", + "v2.aws_ccm_config_response_attributes" => "AWSCcmConfigResponseAttributes", + "v2.aws_ccm_config_response_data" => "AWSCcmConfigResponseData", + "v2.aws_ccm_config_type" => "AWSCcmConfigType", "v2.aws_credentials" => "AWSCredentials", "v2.aws_credentials_update" => "AWSCredentialsUpdate", "v2.aws_cur_config" => "AwsCURConfig", @@ -1924,6 +1932,7 @@ def overrides "v2.datadog_integration" => "DatadogIntegration", "v2.datadog_integration_type" => "DatadogIntegrationType", "v2.datadog_integration_update" => "DatadogIntegrationUpdate", + "v2.data_export_config" => "DataExportConfig", "v2.data_relationships_teams" => "DataRelationshipsTeams", "v2.data_relationships_teams_data_items" => "DataRelationshipsTeamsDataItems", "v2.data_relationships_teams_data_items_type" => "DataRelationshipsTeamsDataItemsType", diff --git a/lib/datadog_api_client/v2/api/aws_integration_api.rb b/lib/datadog_api_client/v2/api/aws_integration_api.rb index 67ef07d29eac..461de897313f 100644 --- a/lib/datadog_api_client/v2/api/aws_integration_api.rb +++ b/lib/datadog_api_client/v2/api/aws_integration_api.rb @@ -90,6 +90,85 @@ def create_aws_account_with_http_info(body, opts = {}) return data, status_code, headers end + # Create AWS CCM config. + # + # @see #create_aws_account_ccm_config_with_http_info + def create_aws_account_ccm_config(aws_account_config_id, body, opts = {}) + data, _status_code, _headers = create_aws_account_ccm_config_with_http_info(aws_account_config_id, body, opts) + data + end + + # Create AWS CCM config. + # + # Create the Cloud Cost Management config for an AWS Account Integration Config using Cost and Usage Report + # (CUR) 2.0 by config ID. + # + # @param aws_account_config_id [String] Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) endpoint and query by AWS Account ID. + # @param body [AWSCcmConfigRequest] Create a Cloud Cost Management config for an AWS Account Integration Config. + # @param opts [Hash] the optional parameters + # @return [Array<(AWSCcmConfigResponse, Integer, Hash)>] AWSCcmConfigResponse data, response status code and response headers + def create_aws_account_ccm_config_with_http_info(aws_account_config_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_aws_account_ccm_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_aws_account_ccm_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_aws_account_ccm_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.create_aws_account_ccm_config ...' + end + # verify the required parameter 'aws_account_config_id' is set + if @api_client.config.client_side_validation && aws_account_config_id.nil? + fail ArgumentError, "Missing the required parameter 'aws_account_config_id' when calling AWSIntegrationAPI.create_aws_account_ccm_config" + 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 AWSIntegrationAPI.create_aws_account_ccm_config" + end + # resource path + local_var_path = '/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config'.sub('{aws_account_config_id}', CGI.escape(aws_account_config_id.to_s).gsub('%2F', '/')) + + # 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] || 'AWSCcmConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_aws_account_ccm_config, + :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: AWSIntegrationAPI#create_aws_account_ccm_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an Amazon EventBridge source. # # @see #create_aws_event_bridge_source_with_http_info @@ -282,6 +361,78 @@ def delete_aws_account_with_http_info(aws_account_config_id, opts = {}) return data, status_code, headers end + # Delete AWS CCM config. + # + # @see #delete_aws_account_ccm_config_with_http_info + def delete_aws_account_ccm_config(aws_account_config_id, opts = {}) + delete_aws_account_ccm_config_with_http_info(aws_account_config_id, opts) + nil + end + + # Delete AWS CCM config. + # + # Delete the Cloud Cost Management config for an AWS Account Integration Config using Cost and Usage Report + # (CUR) 2.0 by config ID. + # + # @param aws_account_config_id [String] Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) endpoint and query by AWS Account ID. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_aws_account_ccm_config_with_http_info(aws_account_config_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_aws_account_ccm_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_aws_account_ccm_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_aws_account_ccm_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.delete_aws_account_ccm_config ...' + end + # verify the required parameter 'aws_account_config_id' is set + if @api_client.config.client_side_validation && aws_account_config_id.nil? + fail ArgumentError, "Missing the required parameter 'aws_account_config_id' when calling AWSIntegrationAPI.delete_aws_account_ccm_config" + end + # resource path + local_var_path = '/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config'.sub('{aws_account_config_id}', CGI.escape(aws_account_config_id.to_s).gsub('%2F', '/')) + + # 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(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_aws_account_ccm_config, + :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::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#delete_aws_account_ccm_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete an Amazon EventBridge source. # # @see #delete_aws_event_bridge_source_with_http_info @@ -414,6 +565,78 @@ def get_aws_account_with_http_info(aws_account_config_id, opts = {}) return data, status_code, headers end + # Get AWS CCM config. + # + # @see #get_aws_account_ccm_config_with_http_info + def get_aws_account_ccm_config(aws_account_config_id, opts = {}) + data, _status_code, _headers = get_aws_account_ccm_config_with_http_info(aws_account_config_id, opts) + data + end + + # Get AWS CCM config. + # + # Get the Cloud Cost Management config for an AWS Account Integration Config using Cost and Usage Report + # (CUR) 2.0 by config ID. + # + # @param aws_account_config_id [String] Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) endpoint and query by AWS Account ID. + # @param opts [Hash] the optional parameters + # @return [Array<(AWSCcmConfigResponse, Integer, Hash)>] AWSCcmConfigResponse data, response status code and response headers + def get_aws_account_ccm_config_with_http_info(aws_account_config_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_aws_account_ccm_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_aws_account_ccm_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_aws_account_ccm_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.get_aws_account_ccm_config ...' + end + # verify the required parameter 'aws_account_config_id' is set + if @api_client.config.client_side_validation && aws_account_config_id.nil? + fail ArgumentError, "Missing the required parameter 'aws_account_config_id' when calling AWSIntegrationAPI.get_aws_account_ccm_config" + end + # resource path + local_var_path = '/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config'.sub('{aws_account_config_id}', CGI.escape(aws_account_config_id.to_s).gsub('%2F', '/')) + + # 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] || 'AWSCcmConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_aws_account_ccm_config, + :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::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#get_aws_account_ccm_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get AWS integration IAM permissions. # # @see #get_aws_integration_iam_permissions_with_http_info @@ -847,5 +1070,84 @@ def update_aws_account_with_http_info(aws_account_config_id, body, opts = {}) end return data, status_code, headers end + + # Update AWS CCM config. + # + # @see #update_aws_account_ccm_config_with_http_info + def update_aws_account_ccm_config(aws_account_config_id, body, opts = {}) + data, _status_code, _headers = update_aws_account_ccm_config_with_http_info(aws_account_config_id, body, opts) + data + end + + # Update AWS CCM config. + # + # Update the Cloud Cost Management config for an AWS Account Integration Config using Cost and Usage Report + # (CUR) 2.0 by config ID. + # + # @param aws_account_config_id [String] Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, use the [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) endpoint and query by AWS Account ID. + # @param body [AWSCcmConfigRequest] Update a Cloud Cost Management config for an AWS Account Integration Config. + # @param opts [Hash] the optional parameters + # @return [Array<(AWSCcmConfigResponse, Integer, Hash)>] AWSCcmConfigResponse data, response status code and response headers + def update_aws_account_ccm_config_with_http_info(aws_account_config_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_aws_account_ccm_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_aws_account_ccm_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_aws_account_ccm_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AWSIntegrationAPI.update_aws_account_ccm_config ...' + end + # verify the required parameter 'aws_account_config_id' is set + if @api_client.config.client_side_validation && aws_account_config_id.nil? + fail ArgumentError, "Missing the required parameter 'aws_account_config_id' when calling AWSIntegrationAPI.update_aws_account_ccm_config" + 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 AWSIntegrationAPI.update_aws_account_ccm_config" + end + # resource path + local_var_path = '/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config'.sub('{aws_account_config_id}', CGI.escape(aws_account_config_id.to_s).gsub('%2F', '/')) + + # 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] || 'AWSCcmConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_aws_account_ccm_config, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AWSIntegrationAPI#update_aws_account_ccm_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/aws_ccm_config.rb b/lib/datadog_api_client/v2/models/aws_ccm_config.rb new file mode 100644 index 000000000000..7795805a932b --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_ccm_config.rb @@ -0,0 +1,125 @@ +=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 + # AWS Cloud Cost Management config. + class AWSCcmConfig + include BaseGenericModel + + # List of data export configurations for Cost and Usage Reports. + attr_reader :data_export_configs + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_export_configs' => :'data_export_configs' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_export_configs' => :'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::AWSCcmConfig` 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_export_configs') + if (value = attributes[:'data_export_configs']).is_a?(Array) + self.data_export_configs = 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 @data_export_configs.nil? + true + end + + # Custom attribute writer method with validation + # @param data_export_configs [Object] Object to be assigned + # @!visibility private + def data_export_configs=(data_export_configs) + if data_export_configs.nil? + fail ArgumentError, 'invalid value for "data_export_configs", data_export_configs cannot be nil.' + end + @data_export_configs = data_export_configs + 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_export_configs == o.data_export_configs && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_export_configs, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_ccm_config_request.rb b/lib/datadog_api_client/v2/models/aws_ccm_config_request.rb new file mode 100644 index 000000000000..469bf6c91339 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_ccm_config_request.rb @@ -0,0 +1,123 @@ +=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 + # AWS CCM Config Create/Update Request body. + class AWSCcmConfigRequest + include BaseGenericModel + + # AWS CCM Config Create/Update Request data. + attr_reader :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' => :'AWSCcmConfigRequestData' + } + 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::AWSCcmConfigRequest` 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 + + # 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 + 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/aws_ccm_config_request_attributes.rb b/lib/datadog_api_client/v2/models/aws_ccm_config_request_attributes.rb new file mode 100644 index 000000000000..e8d7cf05cc7d --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_ccm_config_request_attributes.rb @@ -0,0 +1,123 @@ +=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 + # AWS CCM Config attributes for Create/Update requests. + class AWSCcmConfigRequestAttributes + include BaseGenericModel + + # AWS Cloud Cost Management config. + attr_reader :ccm_config + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ccm_config' => :'ccm_config' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ccm_config' => :'AWSCcmConfig' + } + 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::AWSCcmConfigRequestAttributes` 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?(:'ccm_config') + self.ccm_config = attributes[:'ccm_config'] + 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 @ccm_config.nil? + true + end + + # Custom attribute writer method with validation + # @param ccm_config [Object] Object to be assigned + # @!visibility private + def ccm_config=(ccm_config) + if ccm_config.nil? + fail ArgumentError, 'invalid value for "ccm_config", ccm_config cannot be nil.' + end + @ccm_config = ccm_config + 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 && + ccm_config == o.ccm_config && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ccm_config, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_ccm_config_request_data.rb b/lib/datadog_api_client/v2/models/aws_ccm_config_request_data.rb new file mode 100644 index 000000000000..7c4acff82ab6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_ccm_config_request_data.rb @@ -0,0 +1,144 @@ +=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 + # AWS CCM Config Create/Update Request data. + class AWSCcmConfigRequestData + include BaseGenericModel + + # AWS CCM Config attributes for Create/Update requests. + attr_reader :attributes + + # AWS CCM Config 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AWSCcmConfigRequestAttributes', + :'type' => :'AWSCcmConfigType' + } + 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::AWSCcmConfigRequestData` 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?(:'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 @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + 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 && + 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, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_ccm_config_response.rb b/lib/datadog_api_client/v2/models/aws_ccm_config_response.rb new file mode 100644 index 000000000000..9ebde33c97e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_ccm_config_response.rb @@ -0,0 +1,123 @@ +=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 + # AWS CCM Config response body. + class AWSCcmConfigResponse + include BaseGenericModel + + # AWS CCM Config response data. + attr_reader :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' => :'AWSCcmConfigResponseData' + } + 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::AWSCcmConfigResponse` 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 + + # 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 + 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/aws_ccm_config_response_attributes.rb b/lib/datadog_api_client/v2/models/aws_ccm_config_response_attributes.rb new file mode 100644 index 000000000000..220db3106298 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_ccm_config_response_attributes.rb @@ -0,0 +1,107 @@ +=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 + # AWS CCM Config response attributes. + class AWSCcmConfigResponseAttributes + include BaseGenericModel + + # List of data export configurations for Cost and Usage Reports. + attr_accessor :data_export_configs + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data_export_configs' => :'data_export_configs' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data_export_configs' => :'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::AWSCcmConfigResponseAttributes` 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_export_configs') + if (value = attributes[:'data_export_configs']).is_a?(Array) + self.data_export_configs = value + end + 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_export_configs == o.data_export_configs && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data_export_configs, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/aws_ccm_config_response_data.rb b/lib/datadog_api_client/v2/models/aws_ccm_config_response_data.rb new file mode 100644 index 000000000000..27e24a377f4b --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_ccm_config_response_data.rb @@ -0,0 +1,146 @@ +=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 + # AWS CCM Config response data. + class AWSCcmConfigResponseData + include BaseGenericModel + + # AWS CCM Config response attributes. + attr_accessor :attributes + + # Unique Datadog ID of the AWS Account Integration Config. + # To get the config ID for an account, use the + # [List all AWS integrations](https://docs.datadoghq.com/api/latest/aws-integration/#list-all-aws-integrations) + # endpoint and query by AWS Account ID. + attr_accessor :id + + # AWS CCM Config 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' => :'AWSCcmConfigResponseAttributes', + :'id' => :'String', + :'type' => :'AWSCcmConfigType' + } + 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::AWSCcmConfigResponseData` 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/aws_ccm_config_type.rb b/lib/datadog_api_client/v2/models/aws_ccm_config_type.rb new file mode 100644 index 000000000000..c871f01288a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/aws_ccm_config_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 + # AWS CCM Config resource type. + class AWSCcmConfigType + include BaseEnumModel + + CCM_CONFIG = "ccm_config".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/data_export_config.rb b/lib/datadog_api_client/v2/models/data_export_config.rb new file mode 100644 index 000000000000..a0d1f279efbe --- /dev/null +++ b/lib/datadog_api_client/v2/models/data_export_config.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 + # AWS Cost and Usage Report data export configuration. + class DataExportConfig + include BaseGenericModel + + # Name of the S3 bucket where the Cost and Usage Report is stored. + attr_reader :bucket_name + + # AWS region of the S3 bucket. + attr_reader :bucket_region + + # Name of the Cost and Usage Report. + attr_reader :report_name + + # S3 prefix where the Cost and Usage Report is stored. + attr_reader :report_prefix + + # Type of the Cost and Usage Report. Currently only `CUR2.0` is supported. + attr_reader :report_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'bucket_name' => :'bucket_name', + :'bucket_region' => :'bucket_region', + :'report_name' => :'report_name', + :'report_prefix' => :'report_prefix', + :'report_type' => :'report_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'bucket_name' => :'String', + :'bucket_region' => :'String', + :'report_name' => :'String', + :'report_prefix' => :'String', + :'report_type' => :'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::DataExportConfig` 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?(:'bucket_name') + self.bucket_name = attributes[:'bucket_name'] + end + + if attributes.key?(:'bucket_region') + self.bucket_region = attributes[:'bucket_region'] + end + + if attributes.key?(:'report_name') + self.report_name = attributes[:'report_name'] + end + + if attributes.key?(:'report_prefix') + self.report_prefix = attributes[:'report_prefix'] + end + + if attributes.key?(:'report_type') + self.report_type = attributes[:'report_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 @bucket_name.nil? + return false if @bucket_region.nil? + return false if @report_name.nil? + return false if @report_prefix.nil? + return false if @report_type.nil? + true + end + + # Custom attribute writer method with validation + # @param bucket_name [Object] Object to be assigned + # @!visibility private + def bucket_name=(bucket_name) + if bucket_name.nil? + fail ArgumentError, 'invalid value for "bucket_name", bucket_name cannot be nil.' + end + @bucket_name = bucket_name + end + + # Custom attribute writer method with validation + # @param bucket_region [Object] Object to be assigned + # @!visibility private + def bucket_region=(bucket_region) + if bucket_region.nil? + fail ArgumentError, 'invalid value for "bucket_region", bucket_region cannot be nil.' + end + @bucket_region = bucket_region + end + + # Custom attribute writer method with validation + # @param report_name [Object] Object to be assigned + # @!visibility private + def report_name=(report_name) + if report_name.nil? + fail ArgumentError, 'invalid value for "report_name", report_name cannot be nil.' + end + @report_name = report_name + end + + # Custom attribute writer method with validation + # @param report_prefix [Object] Object to be assigned + # @!visibility private + def report_prefix=(report_prefix) + if report_prefix.nil? + fail ArgumentError, 'invalid value for "report_prefix", report_prefix cannot be nil.' + end + @report_prefix = report_prefix + end + + # Custom attribute writer method with validation + # @param report_type [Object] Object to be assigned + # @!visibility private + def report_type=(report_type) + if report_type.nil? + fail ArgumentError, 'invalid value for "report_type", report_type cannot be nil.' + end + @report_type = report_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 && + bucket_name == o.bucket_name && + bucket_region == o.bucket_region && + report_name == o.report_name && + report_prefix == o.report_prefix && + report_type == o.report_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [bucket_name, bucket_region, report_name, report_prefix, report_type, additional_properties].hash + end + end +end