diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f11972d91d0..266b9924aec 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/examples/v2/aws-integration/CreateAWSAccountCCMConfig.java b/examples/v2/aws-integration/CreateAWSAccountCCMConfig.java new file mode 100644 index 00000000000..ae172aa5cbe --- /dev/null +++ b/examples/v2/aws-integration/CreateAWSAccountCCMConfig.java @@ -0,0 +1,50 @@ +// Create AWS CCM config returns "AWS CCM Config object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSCcmConfig; +import com.datadog.api.client.v2.model.AWSCcmConfigRequest; +import com.datadog.api.client.v2.model.AWSCcmConfigRequestAttributes; +import com.datadog.api.client.v2.model.AWSCcmConfigRequestData; +import com.datadog.api.client.v2.model.AWSCcmConfigResponse; +import com.datadog.api.client.v2.model.AWSCcmConfigType; +import com.datadog.api.client.v2.model.DataExportConfig; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + AWSCcmConfigRequest body = + new AWSCcmConfigRequest() + .data( + new AWSCcmConfigRequestData() + .attributes( + new AWSCcmConfigRequestAttributes() + .ccmConfig( + new AWSCcmConfig() + .dataExportConfigs( + Collections.singletonList( + new DataExportConfig() + .bucketName("billing") + .bucketRegion("us-east-1") + .reportName("cost-and-usage-report") + .reportPrefix("reports") + .reportType("CUR2.0"))))) + .type(AWSCcmConfigType.CCM_CONFIG)); + + try { + AWSCcmConfigResponse result = + apiInstance.createAWSAccountCCMConfig("873c7e78-8915-4c7a-a3a7-33a57adf54f4", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#createAWSAccountCCMConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/aws-integration/DeleteAWSAccountCCMConfig.java b/examples/v2/aws-integration/DeleteAWSAccountCCMConfig.java new file mode 100644 index 00000000000..2cb2f685e9d --- /dev/null +++ b/examples/v2/aws-integration/DeleteAWSAccountCCMConfig.java @@ -0,0 +1,22 @@ +// Delete AWS CCM config returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + try { + apiInstance.deleteAWSAccountCCMConfig("873c7e78-8915-4c7a-a3a7-33a57adf54f4"); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#deleteAWSAccountCCMConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/aws-integration/GetAWSAccountCCMConfig.java b/examples/v2/aws-integration/GetAWSAccountCCMConfig.java new file mode 100644 index 00000000000..1e7437ff3c5 --- /dev/null +++ b/examples/v2/aws-integration/GetAWSAccountCCMConfig.java @@ -0,0 +1,25 @@ +// Get AWS CCM config returns "AWS CCM Config object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSCcmConfigResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + try { + AWSCcmConfigResponse result = + apiInstance.getAWSAccountCCMConfig("873c7e78-8915-4c7a-a3a7-33a57adf54f4"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#getAWSAccountCCMConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/aws-integration/UpdateAWSAccountCCMConfig.java b/examples/v2/aws-integration/UpdateAWSAccountCCMConfig.java new file mode 100644 index 00000000000..e05cde8d651 --- /dev/null +++ b/examples/v2/aws-integration/UpdateAWSAccountCCMConfig.java @@ -0,0 +1,50 @@ +// Update AWS CCM config returns "AWS CCM Config object" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AwsIntegrationApi; +import com.datadog.api.client.v2.model.AWSCcmConfig; +import com.datadog.api.client.v2.model.AWSCcmConfigRequest; +import com.datadog.api.client.v2.model.AWSCcmConfigRequestAttributes; +import com.datadog.api.client.v2.model.AWSCcmConfigRequestData; +import com.datadog.api.client.v2.model.AWSCcmConfigResponse; +import com.datadog.api.client.v2.model.AWSCcmConfigType; +import com.datadog.api.client.v2.model.DataExportConfig; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + AwsIntegrationApi apiInstance = new AwsIntegrationApi(defaultClient); + + AWSCcmConfigRequest body = + new AWSCcmConfigRequest() + .data( + new AWSCcmConfigRequestData() + .attributes( + new AWSCcmConfigRequestAttributes() + .ccmConfig( + new AWSCcmConfig() + .dataExportConfigs( + Collections.singletonList( + new DataExportConfig() + .bucketName("billing-updated") + .bucketRegion("us-west-2") + .reportName("cost-report-updated") + .reportPrefix("reports-updated") + .reportType("CUR2.0"))))) + .type(AWSCcmConfigType.CCM_CONFIG)); + + try { + AWSCcmConfigResponse result = + apiInstance.updateAWSAccountCCMConfig("873c7e78-8915-4c7a-a3a7-33a57adf54f4", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AwsIntegrationApi#updateAWSAccountCCMConfig"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 013c656b24d..6aa4c8b0a14 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -850,6 +850,10 @@ public class ApiClient { put("v2.updateIncidentNotificationTemplate", false); put("v2.updateIncidentTodo", false); put("v2.updateIncidentType", false); + put("v2.createAWSAccountCCMConfig", false); + put("v2.deleteAWSAccountCCMConfig", false); + put("v2.getAWSAccountCCMConfig", false); + put("v2.updateAWSAccountCCMConfig", false); put("v2.addRoleToRestrictionQuery", false); put("v2.createRestrictionQuery", false); put("v2.deleteRestrictionQuery", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/AwsIntegrationApi.java b/src/main/java/com/datadog/api/client/v2/api/AwsIntegrationApi.java index 7445c3c15d7..a7ecdf67eef 100644 --- a/src/main/java/com/datadog/api/client/v2/api/AwsIntegrationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/AwsIntegrationApi.java @@ -8,6 +8,8 @@ import com.datadog.api.client.v2.model.AWSAccountResponse; import com.datadog.api.client.v2.model.AWSAccountUpdateRequest; import com.datadog.api.client.v2.model.AWSAccountsResponse; +import com.datadog.api.client.v2.model.AWSCcmConfigRequest; +import com.datadog.api.client.v2.model.AWSCcmConfigResponse; import com.datadog.api.client.v2.model.AWSEventBridgeCreateRequest; import com.datadog.api.client.v2.model.AWSEventBridgeCreateResponse; import com.datadog.api.client.v2.model.AWSEventBridgeDeleteRequest; @@ -187,6 +189,206 @@ public CompletableFuture> createAWSAccountWithHt new GenericType() {}); } + /** + * Create AWS CCM config. + * + *

See {@link #createAWSAccountCCMConfigWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @param body Create a Cloud Cost Management config for an AWS Account Integration Config. + * (required) + * @return AWSCcmConfigResponse + * @throws ApiException if fails to make API call + */ + public AWSCcmConfigResponse createAWSAccountCCMConfig( + String awsAccountConfigId, AWSCcmConfigRequest body) throws ApiException { + return createAWSAccountCCMConfigWithHttpInfo(awsAccountConfigId, body).getData(); + } + + /** + * Create AWS CCM config. + * + *

See {@link #createAWSAccountCCMConfigWithHttpInfoAsync}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @param body Create a Cloud Cost Management config for an AWS Account Integration Config. + * (required) + * @return CompletableFuture<AWSCcmConfigResponse> + */ + public CompletableFuture createAWSAccountCCMConfigAsync( + String awsAccountConfigId, AWSCcmConfigRequest body) { + return createAWSAccountCCMConfigWithHttpInfoAsync(awsAccountConfigId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create the Cloud Cost Management config for an AWS Account Integration Config using Cost and + * Usage Report (CUR) 2.0 by config ID. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @param body Create a Cloud Cost Management config for an AWS Account Integration Config. + * (required) + * @return ApiResponse<AWSCcmConfigResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 AWS CCM Config object -
403 Forbidden -
404 Not Found -
409 Conflict -
429 Too many requests -
+ */ + public ApiResponse createAWSAccountCCMConfigWithHttpInfo( + String awsAccountConfigId, AWSCcmConfigRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createAWSAccountCCMConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'awsAccountConfigId' when calling" + + " createAWSAccountCCMConfig"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createAWSAccountCCMConfig"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.createAWSAccountCCMConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create AWS CCM config. + * + *

See {@link #createAWSAccountCCMConfigWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @param body Create a Cloud Cost Management config for an AWS Account Integration Config. + * (required) + * @return CompletableFuture<ApiResponse<AWSCcmConfigResponse>> + */ + public CompletableFuture> + createAWSAccountCCMConfigWithHttpInfoAsync( + String awsAccountConfigId, AWSCcmConfigRequest body) { + // Check if unstable operation is enabled + String operationId = "createAWSAccountCCMConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'awsAccountConfigId' when calling" + + " createAWSAccountCCMConfig")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createAWSAccountCCMConfig")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.createAWSAccountCCMConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create an Amazon EventBridge source. * @@ -591,6 +793,178 @@ public CompletableFuture> deleteAWSAccountWithHttpInfoAsync( null); } + /** + * Delete AWS CCM config. + * + *

See {@link #deleteAWSAccountCCMConfigWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @throws ApiException if fails to make API call + */ + public void deleteAWSAccountCCMConfig(String awsAccountConfigId) throws ApiException { + deleteAWSAccountCCMConfigWithHttpInfo(awsAccountConfigId); + } + + /** + * Delete AWS CCM config. + * + *

See {@link #deleteAWSAccountCCMConfigWithHttpInfoAsync}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteAWSAccountCCMConfigAsync(String awsAccountConfigId) { + return deleteAWSAccountCCMConfigWithHttpInfoAsync(awsAccountConfigId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete the Cloud Cost Management config for an AWS Account Integration Config using Cost and + * Usage Report (CUR) 2.0 by config ID. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteAWSAccountCCMConfigWithHttpInfo(String awsAccountConfigId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteAWSAccountCCMConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'awsAccountConfigId' when calling" + + " deleteAWSAccountCCMConfig"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.deleteAWSAccountCCMConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete AWS CCM config. + * + *

See {@link #deleteAWSAccountCCMConfigWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteAWSAccountCCMConfigWithHttpInfoAsync( + String awsAccountConfigId) { + // Check if unstable operation is enabled + String operationId = "deleteAWSAccountCCMConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'awsAccountConfigId' when calling" + + " deleteAWSAccountCCMConfig")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.deleteAWSAccountCCMConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Delete an Amazon EventBridge source. * @@ -627,37 +1001,186 @@ public CompletableFuture deleteAWSEventBridgeSourc /** * Delete an Amazon EventBridge source. * - * @param body Delete the Amazon EventBridge source with the given name, region, and associated - * AWS account. (required) - * @return ApiResponse<AWSEventBridgeDeleteResponse> + * @param body Delete the Amazon EventBridge source with the given name, region, and associated + * AWS account. (required) + * @return ApiResponse<AWSEventBridgeDeleteResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Amazon EventBridge source deleted. -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse deleteAWSEventBridgeSourceWithHttpInfo( + AWSEventBridgeDeleteRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling deleteAWSEventBridgeSource"); + } + // create path and map variables + String localVarPath = "/api/v2/integration/aws/event_bridge"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.deleteAWSEventBridgeSource", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete an Amazon EventBridge source. + * + *

See {@link #deleteAWSEventBridgeSourceWithHttpInfo}. + * + * @param body Delete the Amazon EventBridge source with the given name, region, and associated + * AWS account. (required) + * @return CompletableFuture<ApiResponse<AWSEventBridgeDeleteResponse>> + */ + public CompletableFuture> + deleteAWSEventBridgeSourceWithHttpInfoAsync(AWSEventBridgeDeleteRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling deleteAWSEventBridgeSource")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/integration/aws/event_bridge"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.deleteAWSEventBridgeSource", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get an AWS integration by config ID. + * + *

See {@link #getAWSAccountWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @return AWSAccountResponse + * @throws ApiException if fails to make API call + */ + public AWSAccountResponse getAWSAccount(String awsAccountConfigId) throws ApiException { + return getAWSAccountWithHttpInfo(awsAccountConfigId).getData(); + } + + /** + * Get an AWS integration by config ID. + * + *

See {@link #getAWSAccountWithHttpInfoAsync}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @return CompletableFuture<AWSAccountResponse> + */ + public CompletableFuture getAWSAccountAsync(String awsAccountConfigId) { + return getAWSAccountWithHttpInfoAsync(awsAccountConfigId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get an AWS Account Integration Config by config ID. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @return ApiResponse<AWSAccountResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * + * * *
Response details
Status Code Description Response Headers
200 Amazon EventBridge source deleted. -
200 AWS Account object -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteAWSEventBridgeSourceWithHttpInfo( - AWSEventBridgeDeleteRequest body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse getAWSAccountWithHttpInfo(String awsAccountConfigId) + throws ApiException { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling deleteAWSEventBridgeSource"); + 400, "Missing the required parameter 'awsAccountConfigId' when calling getAWSAccount"); } // create path and map variables - String localVarPath = "/api/v2/integration/aws/event_bridge"; + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.AwsIntegrationApi.deleteAWSEventBridgeSource", + "v2.AwsIntegrationApi.getAWSAccount", localVarPath, new ArrayList(), localVarHeaderParams, @@ -665,41 +1188,46 @@ public ApiResponse deleteAWSEventBridgeSourceWithH new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "DELETE", + "GET", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Delete an Amazon EventBridge source. + * Get an AWS integration by config ID. * - *

See {@link #deleteAWSEventBridgeSourceWithHttpInfo}. + *

See {@link #getAWSAccountWithHttpInfo}. * - * @param body Delete the Amazon EventBridge source with the given name, region, and associated - * AWS account. (required) - * @return CompletableFuture<ApiResponse<AWSEventBridgeDeleteResponse>> + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @return CompletableFuture<ApiResponse<AWSAccountResponse>> */ - public CompletableFuture> - deleteAWSEventBridgeSourceWithHttpInfoAsync(AWSEventBridgeDeleteRequest body) { - Object localVarPostBody = body; + public CompletableFuture> getAWSAccountWithHttpInfoAsync( + String awsAccountConfigId) { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling deleteAWSEventBridgeSource")); + "Missing the required parameter 'awsAccountConfigId' when calling getAWSAccount")); return result; } // create path and map variables - String localVarPath = "/api/v2/integration/aws/event_bridge"; + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); Map localVarHeaderParams = new HashMap(); @@ -707,7 +1235,7 @@ public ApiResponse deleteAWSEventBridgeSourceWithH try { builder = apiClient.createBuilder( - "v2.AwsIntegrationApi.deleteAWSEventBridgeSource", + "v2.AwsIntegrationApi.getAWSAccount", localVarPath, new ArrayList(), localVarHeaderParams, @@ -715,51 +1243,52 @@ public ApiResponse deleteAWSEventBridgeSourceWithH new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "GET", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get an AWS integration by config ID. + * Get AWS CCM config. * - *

See {@link #getAWSAccountWithHttpInfo}. + *

See {@link #getAWSAccountCCMConfigWithHttpInfo}. * * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the * config ID for an account, use the List * all AWS integrations endpoint and query by AWS Account ID. (required) - * @return AWSAccountResponse + * @return AWSCcmConfigResponse * @throws ApiException if fails to make API call */ - public AWSAccountResponse getAWSAccount(String awsAccountConfigId) throws ApiException { - return getAWSAccountWithHttpInfo(awsAccountConfigId).getData(); + public AWSCcmConfigResponse getAWSAccountCCMConfig(String awsAccountConfigId) + throws ApiException { + return getAWSAccountCCMConfigWithHttpInfo(awsAccountConfigId).getData(); } /** - * Get an AWS integration by config ID. + * Get AWS CCM config. * - *

See {@link #getAWSAccountWithHttpInfoAsync}. + *

See {@link #getAWSAccountCCMConfigWithHttpInfoAsync}. * * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the * config ID for an account, use the List * all AWS integrations endpoint and query by AWS Account ID. (required) - * @return CompletableFuture<AWSAccountResponse> + * @return CompletableFuture<AWSCcmConfigResponse> */ - public CompletableFuture getAWSAccountAsync(String awsAccountConfigId) { - return getAWSAccountWithHttpInfoAsync(awsAccountConfigId) + public CompletableFuture getAWSAccountCCMConfigAsync( + String awsAccountConfigId) { + return getAWSAccountCCMConfigWithHttpInfoAsync(awsAccountConfigId) .thenApply( response -> { return response.getData(); @@ -767,37 +1296,46 @@ public CompletableFuture getAWSAccountAsync(String awsAccoun } /** - * Get an AWS Account Integration Config by config ID. + * Get the Cloud Cost Management config for an AWS Account Integration Config using Cost and Usage + * Report (CUR) 2.0 by config ID. * * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the * config ID for an account, use the List * all AWS integrations endpoint and query by AWS Account ID. (required) - * @return ApiResponse<AWSAccountResponse> + * @return ApiResponse<AWSCcmConfigResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * * * * *
Response details
Status Code Description Response Headers
200 AWS Account object -
400 Bad Request -
200 AWS CCM Config object -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getAWSAccountWithHttpInfo(String awsAccountConfigId) - throws ApiException { + public ApiResponse getAWSAccountCCMConfigWithHttpInfo( + String awsAccountConfigId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getAWSAccountCCMConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = null; // verify the required parameter 'awsAccountConfigId' is set if (awsAccountConfigId == null) { throw new ApiException( - 400, "Missing the required parameter 'awsAccountConfigId' when calling getAWSAccount"); + 400, + "Missing the required parameter 'awsAccountConfigId' when calling" + + " getAWSAccountCCMConfig"); } // create path and map variables String localVarPath = - "/api/v2/integration/aws/accounts/{aws_account_config_id}" + "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config" .replaceAll( "\\{" + "aws_account_config_id" + "\\}", apiClient.escapeString(awsAccountConfigId.toString())); @@ -806,7 +1344,7 @@ public ApiResponse getAWSAccountWithHttpInfo(String awsAccou Invocation.Builder builder = apiClient.createBuilder( - "v2.AwsIntegrationApi.getAWSAccount", + "v2.AwsIntegrationApi.getAWSAccountCCMConfig", localVarPath, new ArrayList(), localVarHeaderParams, @@ -821,36 +1359,47 @@ public ApiResponse getAWSAccountWithHttpInfo(String awsAccou localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get an AWS integration by config ID. + * Get AWS CCM config. * - *

See {@link #getAWSAccountWithHttpInfo}. + *

See {@link #getAWSAccountCCMConfigWithHttpInfo}. * * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the * config ID for an account, use the List * all AWS integrations endpoint and query by AWS Account ID. (required) - * @return CompletableFuture<ApiResponse<AWSAccountResponse>> + * @return CompletableFuture<ApiResponse<AWSCcmConfigResponse>> */ - public CompletableFuture> getAWSAccountWithHttpInfoAsync( - String awsAccountConfigId) { + public CompletableFuture> + getAWSAccountCCMConfigWithHttpInfoAsync(String awsAccountConfigId) { + // Check if unstable operation is enabled + String operationId = "getAWSAccountCCMConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; // verify the required parameter 'awsAccountConfigId' is set if (awsAccountConfigId == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'awsAccountConfigId' when calling getAWSAccount")); + "Missing the required parameter 'awsAccountConfigId' when calling" + + " getAWSAccountCCMConfig")); return result; } // create path and map variables String localVarPath = - "/api/v2/integration/aws/accounts/{aws_account_config_id}" + "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config" .replaceAll( "\\{" + "aws_account_config_id" + "\\}", apiClient.escapeString(awsAccountConfigId.toString())); @@ -861,7 +1410,7 @@ public CompletableFuture> getAWSAccountWithHttpI try { builder = apiClient.createBuilder( - "v2.AwsIntegrationApi.getAWSAccount", + "v2.AwsIntegrationApi.getAWSAccountCCMConfig", localVarPath, new ArrayList(), localVarHeaderParams, @@ -869,7 +1418,7 @@ public CompletableFuture> getAWSAccountWithHttpI new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -881,7 +1430,7 @@ public CompletableFuture> getAWSAccountWithHttpI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -1787,4 +2336,203 @@ public CompletableFuture> updateAWSAccountWithHt false, new GenericType() {}); } + + /** + * Update AWS CCM config. + * + *

See {@link #updateAWSAccountCCMConfigWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @param body Update a Cloud Cost Management config for an AWS Account Integration Config. + * (required) + * @return AWSCcmConfigResponse + * @throws ApiException if fails to make API call + */ + public AWSCcmConfigResponse updateAWSAccountCCMConfig( + String awsAccountConfigId, AWSCcmConfigRequest body) throws ApiException { + return updateAWSAccountCCMConfigWithHttpInfo(awsAccountConfigId, body).getData(); + } + + /** + * Update AWS CCM config. + * + *

See {@link #updateAWSAccountCCMConfigWithHttpInfoAsync}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @param body Update a Cloud Cost Management config for an AWS Account Integration Config. + * (required) + * @return CompletableFuture<AWSCcmConfigResponse> + */ + public CompletableFuture updateAWSAccountCCMConfigAsync( + String awsAccountConfigId, AWSCcmConfigRequest body) { + return updateAWSAccountCCMConfigWithHttpInfoAsync(awsAccountConfigId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the Cloud Cost Management config for an AWS Account Integration Config using Cost and + * Usage Report (CUR) 2.0 by config ID. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @param body Update a Cloud Cost Management config for an AWS Account Integration Config. + * (required) + * @return ApiResponse<AWSCcmConfigResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 AWS CCM Config object -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateAWSAccountCCMConfigWithHttpInfo( + String awsAccountConfigId, AWSCcmConfigRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateAWSAccountCCMConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'awsAccountConfigId' when calling" + + " updateAWSAccountCCMConfig"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateAWSAccountCCMConfig"); + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.updateAWSAccountCCMConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update AWS CCM config. + * + *

See {@link #updateAWSAccountCCMConfigWithHttpInfo}. + * + * @param awsAccountConfigId Unique Datadog ID of the AWS Account Integration Config. To get the + * config ID for an account, use the List + * all AWS integrations endpoint and query by AWS Account ID. (required) + * @param body Update a Cloud Cost Management config for an AWS Account Integration Config. + * (required) + * @return CompletableFuture<ApiResponse<AWSCcmConfigResponse>> + */ + public CompletableFuture> + updateAWSAccountCCMConfigWithHttpInfoAsync( + String awsAccountConfigId, AWSCcmConfigRequest body) { + // Check if unstable operation is enabled + String operationId = "updateAWSAccountCCMConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'awsAccountConfigId' is set + if (awsAccountConfigId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'awsAccountConfigId' when calling" + + " updateAWSAccountCCMConfig")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateAWSAccountCCMConfig")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/integration/aws/accounts/{aws_account_config_id}/ccm_config" + .replaceAll( + "\\{" + "aws_account_config_id" + "\\}", + apiClient.escapeString(awsAccountConfigId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AwsIntegrationApi.updateAWSAccountCCMConfig", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfig.java b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfig.java new file mode 100644 index 00000000000..0296b41426d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfig.java @@ -0,0 +1,155 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AWS Cloud Cost Management config. */ +@JsonPropertyOrder({AWSCcmConfig.JSON_PROPERTY_DATA_EXPORT_CONFIGS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSCcmConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA_EXPORT_CONFIGS = "data_export_configs"; + private List dataExportConfigs = new ArrayList<>(); + + public AWSCcmConfig() {} + + @JsonCreator + public AWSCcmConfig( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_EXPORT_CONFIGS) + List dataExportConfigs) { + this.dataExportConfigs = dataExportConfigs; + } + + public AWSCcmConfig dataExportConfigs(List dataExportConfigs) { + this.dataExportConfigs = dataExportConfigs; + for (DataExportConfig item : dataExportConfigs) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AWSCcmConfig addDataExportConfigsItem(DataExportConfig dataExportConfigsItem) { + this.dataExportConfigs.add(dataExportConfigsItem); + this.unparsed |= dataExportConfigsItem.unparsed; + return this; + } + + /** + * List of data export configurations for Cost and Usage Reports. + * + * @return dataExportConfigs + */ + @JsonProperty(JSON_PROPERTY_DATA_EXPORT_CONFIGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getDataExportConfigs() { + return dataExportConfigs; + } + + public void setDataExportConfigs(List dataExportConfigs) { + this.dataExportConfigs = dataExportConfigs; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AWSCcmConfig + */ + @JsonAnySetter + public AWSCcmConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AWSCcmConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSCcmConfig awsCcmConfig = (AWSCcmConfig) o; + return Objects.equals(this.dataExportConfigs, awsCcmConfig.dataExportConfigs) + && Objects.equals(this.additionalProperties, awsCcmConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dataExportConfigs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSCcmConfig {\n"); + sb.append(" dataExportConfigs: ").append(toIndentedString(dataExportConfigs)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigRequest.java b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigRequest.java new file mode 100644 index 00000000000..a0d89804847 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** AWS CCM Config Create/Update Request body. */ +@JsonPropertyOrder({AWSCcmConfigRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSCcmConfigRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AWSCcmConfigRequestData data; + + public AWSCcmConfigRequest() {} + + @JsonCreator + public AWSCcmConfigRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AWSCcmConfigRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AWSCcmConfigRequest data(AWSCcmConfigRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AWS CCM Config Create/Update Request data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSCcmConfigRequestData getData() { + return data; + } + + public void setData(AWSCcmConfigRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AWSCcmConfigRequest + */ + @JsonAnySetter + public AWSCcmConfigRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AWSCcmConfigRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSCcmConfigRequest awsCcmConfigRequest = (AWSCcmConfigRequest) o; + return Objects.equals(this.data, awsCcmConfigRequest.data) + && Objects.equals(this.additionalProperties, awsCcmConfigRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSCcmConfigRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigRequestAttributes.java new file mode 100644 index 00000000000..2be974cafad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigRequestAttributes.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** AWS CCM Config attributes for Create/Update requests. */ +@JsonPropertyOrder({AWSCcmConfigRequestAttributes.JSON_PROPERTY_CCM_CONFIG}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSCcmConfigRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CCM_CONFIG = "ccm_config"; + private AWSCcmConfig ccmConfig; + + public AWSCcmConfigRequestAttributes() {} + + @JsonCreator + public AWSCcmConfigRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CCM_CONFIG) AWSCcmConfig ccmConfig) { + this.ccmConfig = ccmConfig; + this.unparsed |= ccmConfig.unparsed; + } + + public AWSCcmConfigRequestAttributes ccmConfig(AWSCcmConfig ccmConfig) { + this.ccmConfig = ccmConfig; + this.unparsed |= ccmConfig.unparsed; + return this; + } + + /** + * AWS Cloud Cost Management config. + * + * @return ccmConfig + */ + @JsonProperty(JSON_PROPERTY_CCM_CONFIG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSCcmConfig getCcmConfig() { + return ccmConfig; + } + + public void setCcmConfig(AWSCcmConfig ccmConfig) { + this.ccmConfig = ccmConfig; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AWSCcmConfigRequestAttributes + */ + @JsonAnySetter + public AWSCcmConfigRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AWSCcmConfigRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSCcmConfigRequestAttributes awsCcmConfigRequestAttributes = (AWSCcmConfigRequestAttributes) o; + return Objects.equals(this.ccmConfig, awsCcmConfigRequestAttributes.ccmConfig) + && Objects.equals( + this.additionalProperties, awsCcmConfigRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ccmConfig, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSCcmConfigRequestAttributes {\n"); + sb.append(" ccmConfig: ").append(toIndentedString(ccmConfig)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigRequestData.java b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigRequestData.java new file mode 100644 index 00000000000..2cd0d7638a2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigRequestData.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** AWS CCM Config Create/Update Request data. */ +@JsonPropertyOrder({ + AWSCcmConfigRequestData.JSON_PROPERTY_ATTRIBUTES, + AWSCcmConfigRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSCcmConfigRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AWSCcmConfigRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AWSCcmConfigType type = AWSCcmConfigType.CCM_CONFIG; + + public AWSCcmConfigRequestData() {} + + @JsonCreator + public AWSCcmConfigRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + AWSCcmConfigRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AWSCcmConfigType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AWSCcmConfigRequestData attributes(AWSCcmConfigRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * AWS CCM Config attributes for Create/Update requests. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSCcmConfigRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AWSCcmConfigRequestAttributes attributes) { + this.attributes = attributes; + } + + public AWSCcmConfigRequestData type(AWSCcmConfigType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * AWS CCM Config resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSCcmConfigType getType() { + return type; + } + + public void setType(AWSCcmConfigType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AWSCcmConfigRequestData + */ + @JsonAnySetter + public AWSCcmConfigRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AWSCcmConfigRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSCcmConfigRequestData awsCcmConfigRequestData = (AWSCcmConfigRequestData) o; + return Objects.equals(this.attributes, awsCcmConfigRequestData.attributes) + && Objects.equals(this.type, awsCcmConfigRequestData.type) + && Objects.equals(this.additionalProperties, awsCcmConfigRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSCcmConfigRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigResponse.java b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigResponse.java new file mode 100644 index 00000000000..bb278c38615 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigResponse.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** AWS CCM Config response body. */ +@JsonPropertyOrder({AWSCcmConfigResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSCcmConfigResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AWSCcmConfigResponseData data; + + public AWSCcmConfigResponse() {} + + @JsonCreator + public AWSCcmConfigResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AWSCcmConfigResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AWSCcmConfigResponse data(AWSCcmConfigResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * AWS CCM Config response data. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSCcmConfigResponseData getData() { + return data; + } + + public void setData(AWSCcmConfigResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AWSCcmConfigResponse + */ + @JsonAnySetter + public AWSCcmConfigResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AWSCcmConfigResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSCcmConfigResponse awsCcmConfigResponse = (AWSCcmConfigResponse) o; + return Objects.equals(this.data, awsCcmConfigResponse.data) + && Objects.equals(this.additionalProperties, awsCcmConfigResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSCcmConfigResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigResponseAttributes.java new file mode 100644 index 00000000000..7d77ba9a1bb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigResponseAttributes.java @@ -0,0 +1,153 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** AWS CCM Config response attributes. */ +@JsonPropertyOrder({AWSCcmConfigResponseAttributes.JSON_PROPERTY_DATA_EXPORT_CONFIGS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSCcmConfigResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA_EXPORT_CONFIGS = "data_export_configs"; + private List dataExportConfigs = null; + + public AWSCcmConfigResponseAttributes dataExportConfigs( + List dataExportConfigs) { + this.dataExportConfigs = dataExportConfigs; + for (DataExportConfig item : dataExportConfigs) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AWSCcmConfigResponseAttributes addDataExportConfigsItem( + DataExportConfig dataExportConfigsItem) { + if (this.dataExportConfigs == null) { + this.dataExportConfigs = new ArrayList<>(); + } + this.dataExportConfigs.add(dataExportConfigsItem); + this.unparsed |= dataExportConfigsItem.unparsed; + return this; + } + + /** + * List of data export configurations for Cost and Usage Reports. + * + * @return dataExportConfigs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA_EXPORT_CONFIGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDataExportConfigs() { + return dataExportConfigs; + } + + public void setDataExportConfigs(List dataExportConfigs) { + this.dataExportConfigs = dataExportConfigs; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AWSCcmConfigResponseAttributes + */ + @JsonAnySetter + public AWSCcmConfigResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AWSCcmConfigResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSCcmConfigResponseAttributes awsCcmConfigResponseAttributes = + (AWSCcmConfigResponseAttributes) o; + return Objects.equals(this.dataExportConfigs, awsCcmConfigResponseAttributes.dataExportConfigs) + && Objects.equals( + this.additionalProperties, awsCcmConfigResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dataExportConfigs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSCcmConfigResponseAttributes {\n"); + sb.append(" dataExportConfigs: ").append(toIndentedString(dataExportConfigs)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigResponseData.java b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigResponseData.java new file mode 100644 index 00000000000..7ddd2ad9d59 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigResponseData.java @@ -0,0 +1,208 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** AWS CCM Config response data. */ +@JsonPropertyOrder({ + AWSCcmConfigResponseData.JSON_PROPERTY_ATTRIBUTES, + AWSCcmConfigResponseData.JSON_PROPERTY_ID, + AWSCcmConfigResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AWSCcmConfigResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AWSCcmConfigResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AWSCcmConfigType type = AWSCcmConfigType.CCM_CONFIG; + + public AWSCcmConfigResponseData() {} + + @JsonCreator + public AWSCcmConfigResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AWSCcmConfigType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AWSCcmConfigResponseData attributes(AWSCcmConfigResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * AWS CCM Config response attributes. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSCcmConfigResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AWSCcmConfigResponseAttributes attributes) { + this.attributes = attributes; + } + + public AWSCcmConfigResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique Datadog ID of the AWS Account Integration Config. To get the config ID for an account, + * use the List + * all AWS integrations endpoint and query by AWS Account ID. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AWSCcmConfigResponseData type(AWSCcmConfigType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * AWS CCM Config resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AWSCcmConfigType getType() { + return type; + } + + public void setType(AWSCcmConfigType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AWSCcmConfigResponseData + */ + @JsonAnySetter + public AWSCcmConfigResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AWSCcmConfigResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSCcmConfigResponseData awsCcmConfigResponseData = (AWSCcmConfigResponseData) o; + return Objects.equals(this.attributes, awsCcmConfigResponseData.attributes) + && Objects.equals(this.id, awsCcmConfigResponseData.id) + && Objects.equals(this.type, awsCcmConfigResponseData.type) + && Objects.equals(this.additionalProperties, awsCcmConfigResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSCcmConfigResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigType.java b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigType.java new file mode 100644 index 00000000000..d41e58f3603 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSCcmConfigType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** AWS CCM Config resource type. */ +@JsonSerialize(using = AWSCcmConfigType.AWSCcmConfigTypeSerializer.class) +public class AWSCcmConfigType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("ccm_config")); + + public static final AWSCcmConfigType CCM_CONFIG = new AWSCcmConfigType("ccm_config"); + + AWSCcmConfigType(String value) { + super(value, allowedValues); + } + + public static class AWSCcmConfigTypeSerializer extends StdSerializer { + public AWSCcmConfigTypeSerializer(Class t) { + super(t); + } + + public AWSCcmConfigTypeSerializer() { + this(null); + } + + @Override + public void serialize(AWSCcmConfigType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AWSCcmConfigType fromValue(String value) { + return new AWSCcmConfigType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DataExportConfig.java b/src/main/java/com/datadog/api/client/v2/model/DataExportConfig.java new file mode 100644 index 00000000000..38df34b2022 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DataExportConfig.java @@ -0,0 +1,258 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** AWS Cost and Usage Report data export configuration. */ +@JsonPropertyOrder({ + DataExportConfig.JSON_PROPERTY_BUCKET_NAME, + DataExportConfig.JSON_PROPERTY_BUCKET_REGION, + DataExportConfig.JSON_PROPERTY_REPORT_NAME, + DataExportConfig.JSON_PROPERTY_REPORT_PREFIX, + DataExportConfig.JSON_PROPERTY_REPORT_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DataExportConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BUCKET_NAME = "bucket_name"; + private String bucketName; + + public static final String JSON_PROPERTY_BUCKET_REGION = "bucket_region"; + private String bucketRegion; + + public static final String JSON_PROPERTY_REPORT_NAME = "report_name"; + private String reportName; + + public static final String JSON_PROPERTY_REPORT_PREFIX = "report_prefix"; + private String reportPrefix; + + public static final String JSON_PROPERTY_REPORT_TYPE = "report_type"; + private String reportType; + + public DataExportConfig() {} + + @JsonCreator + public DataExportConfig( + @JsonProperty(required = true, value = JSON_PROPERTY_BUCKET_NAME) String bucketName, + @JsonProperty(required = true, value = JSON_PROPERTY_BUCKET_REGION) String bucketRegion, + @JsonProperty(required = true, value = JSON_PROPERTY_REPORT_NAME) String reportName, + @JsonProperty(required = true, value = JSON_PROPERTY_REPORT_PREFIX) String reportPrefix, + @JsonProperty(required = true, value = JSON_PROPERTY_REPORT_TYPE) String reportType) { + this.bucketName = bucketName; + this.bucketRegion = bucketRegion; + this.reportName = reportName; + this.reportPrefix = reportPrefix; + this.reportType = reportType; + } + + public DataExportConfig bucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + /** + * Name of the S3 bucket where the Cost and Usage Report is stored. + * + * @return bucketName + */ + @JsonProperty(JSON_PROPERTY_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public DataExportConfig bucketRegion(String bucketRegion) { + this.bucketRegion = bucketRegion; + return this; + } + + /** + * AWS region of the S3 bucket. + * + * @return bucketRegion + */ + @JsonProperty(JSON_PROPERTY_BUCKET_REGION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBucketRegion() { + return bucketRegion; + } + + public void setBucketRegion(String bucketRegion) { + this.bucketRegion = bucketRegion; + } + + public DataExportConfig reportName(String reportName) { + this.reportName = reportName; + return this; + } + + /** + * Name of the Cost and Usage Report. + * + * @return reportName + */ + @JsonProperty(JSON_PROPERTY_REPORT_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getReportName() { + return reportName; + } + + public void setReportName(String reportName) { + this.reportName = reportName; + } + + public DataExportConfig reportPrefix(String reportPrefix) { + this.reportPrefix = reportPrefix; + return this; + } + + /** + * S3 prefix where the Cost and Usage Report is stored. + * + * @return reportPrefix + */ + @JsonProperty(JSON_PROPERTY_REPORT_PREFIX) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getReportPrefix() { + return reportPrefix; + } + + public void setReportPrefix(String reportPrefix) { + this.reportPrefix = reportPrefix; + } + + public DataExportConfig reportType(String reportType) { + this.reportType = reportType; + return this; + } + + /** + * Type of the Cost and Usage Report. Currently only CUR2.0 is supported. + * + * @return reportType + */ + @JsonProperty(JSON_PROPERTY_REPORT_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getReportType() { + return reportType; + } + + public void setReportType(String reportType) { + this.reportType = reportType; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DataExportConfig + */ + @JsonAnySetter + public DataExportConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DataExportConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DataExportConfig dataExportConfig = (DataExportConfig) o; + return Objects.equals(this.bucketName, dataExportConfig.bucketName) + && Objects.equals(this.bucketRegion, dataExportConfig.bucketRegion) + && Objects.equals(this.reportName, dataExportConfig.reportName) + && Objects.equals(this.reportPrefix, dataExportConfig.reportPrefix) + && Objects.equals(this.reportType, dataExportConfig.reportType) + && Objects.equals(this.additionalProperties, dataExportConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + bucketName, bucketRegion, reportName, reportPrefix, reportType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DataExportConfig {\n"); + sb.append(" bucketName: ").append(toIndentedString(bucketName)).append("\n"); + sb.append(" bucketRegion: ").append(toIndentedString(bucketRegion)).append("\n"); + sb.append(" reportName: ").append(toIndentedString(reportName)).append("\n"); + sb.append(" reportPrefix: ").append(toIndentedString(reportPrefix)).append("\n"); + sb.append(" reportType: ").append(toIndentedString(reportType)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_AWS_CCM_Config_object_response.freeze b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_AWS_CCM_Config_object_response.freeze new file mode 100644 index 00000000000..32645b853c7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_AWS_CCM_Config_object_response.freeze @@ -0,0 +1 @@ +2026-01-16T20:44:39.348Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_AWS_CCM_Config_object_response.json b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_AWS_CCM_Config_object_response.json new file mode 100644 index 00000000000..436b3c42609 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_AWS_CCM_Config_object_response.json @@ -0,0 +1,58 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ffdcad94-880b-0e7c-65da-14719b629b3b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/%7Baws_account_config_id%7D/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5dd928e9-3d6e-4e03-5e0a-d156ff13127b" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Conflict_response.freeze b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Conflict_response.freeze new file mode 100644 index 00000000000..ae624ab0aee --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Conflict_response.freeze @@ -0,0 +1 @@ +2026-01-16T20:03:18.352Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Conflict_response.json b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Conflict_response.json new file mode 100644 index 00000000000..bed35b67032 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Conflict_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"409\",\"title\":\"Account already exists\",\"detail\":\"CCM config already exists for this account\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 409, + "reasonPhrase": "Conflict" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ffdcad94-880b-0e7c-65da-14719b629b39" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"409\",\"title\":\"Account already exists\",\"detail\":\"CCM config already exists for this account\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 409, + "reasonPhrase": "Conflict" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ffdcad94-880b-0e7c-65da-14719b629b3a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..2238a807c17 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-01-16T20:07:40.872Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Not_Found_response.json new file mode 100644 index 00000000000..359c45f1901 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_AWS_CCM_config_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c4927a92-dee3-e620-c713-dbf2080fc86a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_No_Content_response.freeze new file mode 100644 index 00000000000..aaabc02a4fc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2026-01-16T20:07:47.631Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_No_Content_response.json new file mode 100644 index 00000000000..ae45842490d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_No_Content_response.json @@ -0,0 +1,23 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "57afaeb2-1f71-cb5c-f96b-0bac55939815" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..17bc20d65e7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-01-16T20:07:54.863Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_Not_Found_response.json new file mode 100644 index 00000000000..cbe4992b82e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_AWS_CCM_config_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6bca88fa-0803-7113-5d05-5c5a7ba2fae7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_AWS_CCM_Config_object_response.freeze b/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_AWS_CCM_Config_object_response.freeze new file mode 100644 index 00000000000..e134643ca47 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_AWS_CCM_Config_object_response.freeze @@ -0,0 +1 @@ +2026-01-16T20:08:01.626Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_AWS_CCM_Config_object_response.json b/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_AWS_CCM_Config_object_response.json new file mode 100644 index 00000000000..c27544f6a7f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_AWS_CCM_Config_object_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1833c0e7-6e75-162e-115e-8a791f004d03" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..5ef74d7aee6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-01-16T20:08:08.924Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_Not_Found_response.json new file mode 100644 index 00000000000..889b158e55a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_AWS_CCM_config_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0787b042-d793-c939-739f-bf82923165ac" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_AWS_CCM_Config_object_response.freeze b/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_AWS_CCM_Config_object_response.freeze new file mode 100644 index 00000000000..abdd8059a4f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_AWS_CCM_Config_object_response.freeze @@ -0,0 +1 @@ +2026-01-16T20:08:15.964Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_AWS_CCM_Config_object_response.json b/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_AWS_CCM_Config_object_response.json new file mode 100644 index 00000000000..3164152c163 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_AWS_CCM_Config_object_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "PATCH", + "path": "/api/v2/integration/aws/accounts/873c7e78-8915-4c7a-a3a7-33a57adf54f4/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "42739e46-e452-1079-7039-0b9f25d757f1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..a07b797a12c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-01-16T20:08:22.705Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_Not_Found_response.json new file mode 100644 index 00000000000..e8da80facdb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_AWS_CCM_config_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "PATCH", + "path": "/api/v2/integration/aws/accounts/00000000-0000-0000-0000-000000000000/ccm_config", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Account not found\",\"detail\":\"AWS account with provided id is not integrated\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e3ad634f-8d20-d479-978e-d67eeed5c914" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/aws_integration.feature b/src/test/resources/com/datadog/api/client/v2/api/aws_integration.feature index 30ded64d73f..b13e9d8c08f 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/aws_integration.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 421fd893373..db38229e615 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -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": {