diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 82b87c5b71c..eea8d903b4d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1496,6 +1496,8 @@ components: $ref: '#/components/schemas/AWSAccountPartition' aws_regions: $ref: '#/components/schemas/AWSRegions' + ccm_config: + $ref: '#/components/schemas/AWSCCMConfig' logs_config: $ref: '#/components/schemas/AWSLogsConfig' metrics_config: @@ -1561,6 +1563,8 @@ components: $ref: '#/components/schemas/AWSAccountPartition' aws_regions: $ref: '#/components/schemas/AWSRegions' + ccm_config: + $ref: '#/components/schemas/AWSCCMConfig' created_at: description: Timestamp of when the account integration was created. format: date-time @@ -1634,6 +1638,8 @@ components: $ref: '#/components/schemas/AWSAccountPartition' aws_regions: $ref: '#/components/schemas/AWSRegions' + ccm_config: + $ref: '#/components/schemas/AWSCCMConfig' logs_config: $ref: '#/components/schemas/AWSLogsConfig' metrics_config: @@ -1765,6 +1771,15 @@ 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 + type: object AWSCredentials: description: The definition of `AWSCredentials` object. oneOf: @@ -16354,6 +16369,30 @@ 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. + example: CUR2.0 + type: string + type: object DataRelationshipsTeams: description: Associates teams with this schedule in a data structure. properties: diff --git a/examples/v2/aws-integration/CreateAWSAccount.java b/examples/v2/aws-integration/CreateAWSAccount.java index 999b0112426..9dfb320dd2d 100644 --- a/examples/v2/aws-integration/CreateAWSAccount.java +++ b/examples/v2/aws-integration/CreateAWSAccount.java @@ -11,6 +11,7 @@ import com.datadog.api.client.v2.model.AWSAccountType; import com.datadog.api.client.v2.model.AWSAuthConfig; import com.datadog.api.client.v2.model.AWSAuthConfigKeys; +import com.datadog.api.client.v2.model.AWSCCMConfig; import com.datadog.api.client.v2.model.AWSLambdaForwarderConfig; import com.datadog.api.client.v2.model.AWSLambdaForwarderConfigLogSourceConfig; import com.datadog.api.client.v2.model.AWSLogSourceTagFilter; @@ -19,6 +20,7 @@ import com.datadog.api.client.v2.model.AWSNamespaceTagFilter; import com.datadog.api.client.v2.model.AWSResourcesConfig; import com.datadog.api.client.v2.model.AWSTracesConfig; +import com.datadog.api.client.v2.model.DataExportConfig; import java.util.Collections; public class Example { @@ -41,6 +43,16 @@ public static void main(String[] args) { "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"))) .awsAccountId("123456789012") .awsPartition(AWSAccountPartition.AWS) + .ccmConfig( + new AWSCCMConfig() + .dataExportConfigs( + Collections.singletonList( + new DataExportConfig() + .bucketName("my-bucket") + .bucketRegion("us-east-1") + .reportName("my-report") + .reportPrefix("reports") + .reportType("CUR2.0")))) .logsConfig( new AWSLogsConfig() .lambdaForwarder( diff --git a/examples/v2/aws-integration/CreateAWSAccount_1716720881.java b/examples/v2/aws-integration/CreateAWSAccount_1716720881.java index 7e6b2e8df3f..5bb1f787cf2 100644 --- a/examples/v2/aws-integration/CreateAWSAccount_1716720881.java +++ b/examples/v2/aws-integration/CreateAWSAccount_1716720881.java @@ -11,6 +11,7 @@ import com.datadog.api.client.v2.model.AWSAccountType; import com.datadog.api.client.v2.model.AWSAuthConfig; import com.datadog.api.client.v2.model.AWSAuthConfigRole; +import com.datadog.api.client.v2.model.AWSCCMConfig; import com.datadog.api.client.v2.model.AWSLambdaForwarderConfig; import com.datadog.api.client.v2.model.AWSLambdaForwarderConfigLogSourceConfig; import com.datadog.api.client.v2.model.AWSLogSourceTagFilter; @@ -19,6 +20,7 @@ import com.datadog.api.client.v2.model.AWSNamespaceTagFilter; import com.datadog.api.client.v2.model.AWSResourcesConfig; import com.datadog.api.client.v2.model.AWSTracesConfig; +import com.datadog.api.client.v2.model.DataExportConfig; import java.util.Collections; public class Example { @@ -38,6 +40,16 @@ public static void main(String[] args) { new AWSAuthConfigRole().roleName("DatadogIntegrationRole"))) .awsAccountId("123456789012") .awsPartition(AWSAccountPartition.AWS) + .ccmConfig( + new AWSCCMConfig() + .dataExportConfigs( + Collections.singletonList( + new DataExportConfig() + .bucketName("my-bucket") + .bucketRegion("us-east-1") + .reportName("my-report") + .reportPrefix("reports") + .reportType("CUR2.0")))) .logsConfig( new AWSLogsConfig() .lambdaForwarder( diff --git a/examples/v2/aws-integration/UpdateAWSAccount.java b/examples/v2/aws-integration/UpdateAWSAccount.java index 03ac7a3a4da..d738827b2cf 100644 --- a/examples/v2/aws-integration/UpdateAWSAccount.java +++ b/examples/v2/aws-integration/UpdateAWSAccount.java @@ -11,6 +11,7 @@ import com.datadog.api.client.v2.model.AWSAccountUpdateRequestData; import com.datadog.api.client.v2.model.AWSAuthConfig; import com.datadog.api.client.v2.model.AWSAuthConfigRole; +import com.datadog.api.client.v2.model.AWSCCMConfig; import com.datadog.api.client.v2.model.AWSLambdaForwarderConfig; import com.datadog.api.client.v2.model.AWSLambdaForwarderConfigLogSourceConfig; import com.datadog.api.client.v2.model.AWSLogSourceTagFilter; @@ -19,6 +20,7 @@ import com.datadog.api.client.v2.model.AWSNamespaceTagFilter; import com.datadog.api.client.v2.model.AWSResourcesConfig; import com.datadog.api.client.v2.model.AWSTracesConfig; +import com.datadog.api.client.v2.model.DataExportConfig; import java.util.Collections; public class Example { @@ -41,6 +43,16 @@ public static void main(String[] args) { new AWSAuthConfigRole().roleName("DatadogIntegrationRole"))) .awsAccountId("123456789012") .awsPartition(AWSAccountPartition.AWS) + .ccmConfig( + new AWSCCMConfig() + .dataExportConfigs( + Collections.singletonList( + new DataExportConfig() + .bucketName("updated-bucket") + .bucketRegion("us-west-2") + .reportName("updated-report") + .reportPrefix("cost-reports") + .reportType("CUR2.0")))) .logsConfig( new AWSLogsConfig() .lambdaForwarder( diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequestAttributes.java index 2bc951c4085..d756c5bedaf 100644 --- a/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountCreateRequestAttributes.java @@ -27,6 +27,7 @@ AWSAccountCreateRequestAttributes.JSON_PROPERTY_AWS_ACCOUNT_ID, AWSAccountCreateRequestAttributes.JSON_PROPERTY_AWS_PARTITION, AWSAccountCreateRequestAttributes.JSON_PROPERTY_AWS_REGIONS, + AWSAccountCreateRequestAttributes.JSON_PROPERTY_CCM_CONFIG, AWSAccountCreateRequestAttributes.JSON_PROPERTY_LOGS_CONFIG, AWSAccountCreateRequestAttributes.JSON_PROPERTY_METRICS_CONFIG, AWSAccountCreateRequestAttributes.JSON_PROPERTY_RESOURCES_CONFIG, @@ -51,6 +52,9 @@ public class AWSAccountCreateRequestAttributes { public static final String JSON_PROPERTY_AWS_REGIONS = "aws_regions"; private AWSRegions awsRegions; + public static final String JSON_PROPERTY_CCM_CONFIG = "ccm_config"; + private AWSCCMConfig ccmConfig; + public static final String JSON_PROPERTY_LOGS_CONFIG = "logs_config"; private AWSLogsConfig logsConfig; @@ -210,6 +214,28 @@ public void setAwsRegions(AWSRegions awsRegions) { this.awsRegions = awsRegions; } + public AWSAccountCreateRequestAttributes ccmConfig(AWSCCMConfig ccmConfig) { + this.ccmConfig = ccmConfig; + this.unparsed |= ccmConfig.unparsed; + return this; + } + + /** + * AWS Cloud Cost Management config. + * + * @return ccmConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCM_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSCCMConfig getCcmConfig() { + return ccmConfig; + } + + public void setCcmConfig(AWSCCMConfig ccmConfig) { + this.ccmConfig = ccmConfig; + } + public AWSAccountCreateRequestAttributes logsConfig(AWSLogsConfig logsConfig) { this.logsConfig = logsConfig; this.unparsed |= logsConfig.unparsed; @@ -360,6 +386,7 @@ public boolean equals(Object o) { && Objects.equals(this.awsAccountId, awsAccountCreateRequestAttributes.awsAccountId) && Objects.equals(this.awsPartition, awsAccountCreateRequestAttributes.awsPartition) && Objects.equals(this.awsRegions, awsAccountCreateRequestAttributes.awsRegions) + && Objects.equals(this.ccmConfig, awsAccountCreateRequestAttributes.ccmConfig) && Objects.equals(this.logsConfig, awsAccountCreateRequestAttributes.logsConfig) && Objects.equals(this.metricsConfig, awsAccountCreateRequestAttributes.metricsConfig) && Objects.equals(this.resourcesConfig, awsAccountCreateRequestAttributes.resourcesConfig) @@ -376,6 +403,7 @@ public int hashCode() { awsAccountId, awsPartition, awsRegions, + ccmConfig, logsConfig, metricsConfig, resourcesConfig, @@ -392,6 +420,7 @@ public String toString() { sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); sb.append(" awsPartition: ").append(toIndentedString(awsPartition)).append("\n"); sb.append(" awsRegions: ").append(toIndentedString(awsRegions)).append("\n"); + sb.append(" ccmConfig: ").append(toIndentedString(ccmConfig)).append("\n"); sb.append(" logsConfig: ").append(toIndentedString(logsConfig)).append("\n"); sb.append(" metricsConfig: ").append(toIndentedString(metricsConfig)).append("\n"); sb.append(" resourcesConfig: ").append(toIndentedString(resourcesConfig)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponseAttributes.java index 476d2af3851..090d3bb0ea0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponseAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountResponseAttributes.java @@ -28,6 +28,7 @@ AWSAccountResponseAttributes.JSON_PROPERTY_AWS_ACCOUNT_ID, AWSAccountResponseAttributes.JSON_PROPERTY_AWS_PARTITION, AWSAccountResponseAttributes.JSON_PROPERTY_AWS_REGIONS, + AWSAccountResponseAttributes.JSON_PROPERTY_CCM_CONFIG, AWSAccountResponseAttributes.JSON_PROPERTY_CREATED_AT, AWSAccountResponseAttributes.JSON_PROPERTY_LOGS_CONFIG, AWSAccountResponseAttributes.JSON_PROPERTY_METRICS_CONFIG, @@ -54,6 +55,9 @@ public class AWSAccountResponseAttributes { public static final String JSON_PROPERTY_AWS_REGIONS = "aws_regions"; private AWSRegions awsRegions; + public static final String JSON_PROPERTY_CCM_CONFIG = "ccm_config"; + private AWSCCMConfig ccmConfig; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; private OffsetDateTime createdAt; @@ -214,6 +218,28 @@ public void setAwsRegions(AWSRegions awsRegions) { this.awsRegions = awsRegions; } + public AWSAccountResponseAttributes ccmConfig(AWSCCMConfig ccmConfig) { + this.ccmConfig = ccmConfig; + this.unparsed |= ccmConfig.unparsed; + return this; + } + + /** + * AWS Cloud Cost Management config. + * + * @return ccmConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCM_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSCCMConfig getCcmConfig() { + return ccmConfig; + } + + public void setCcmConfig(AWSCCMConfig ccmConfig) { + this.ccmConfig = ccmConfig; + } + /** * Timestamp of when the account integration was created. * @@ -387,6 +413,7 @@ public boolean equals(Object o) { && Objects.equals(this.awsAccountId, awsAccountResponseAttributes.awsAccountId) && Objects.equals(this.awsPartition, awsAccountResponseAttributes.awsPartition) && Objects.equals(this.awsRegions, awsAccountResponseAttributes.awsRegions) + && Objects.equals(this.ccmConfig, awsAccountResponseAttributes.ccmConfig) && Objects.equals(this.createdAt, awsAccountResponseAttributes.createdAt) && Objects.equals(this.logsConfig, awsAccountResponseAttributes.logsConfig) && Objects.equals(this.metricsConfig, awsAccountResponseAttributes.metricsConfig) @@ -405,6 +432,7 @@ public int hashCode() { awsAccountId, awsPartition, awsRegions, + ccmConfig, createdAt, logsConfig, metricsConfig, @@ -423,6 +451,7 @@ public String toString() { sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); sb.append(" awsPartition: ").append(toIndentedString(awsPartition)).append("\n"); sb.append(" awsRegions: ").append(toIndentedString(awsRegions)).append("\n"); + sb.append(" ccmConfig: ").append(toIndentedString(ccmConfig)).append("\n"); sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); sb.append(" logsConfig: ").append(toIndentedString(logsConfig)).append("\n"); sb.append(" metricsConfig: ").append(toIndentedString(metricsConfig)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequestAttributes.java index 27f5277b252..2494e603c7b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/AWSAccountUpdateRequestAttributes.java @@ -27,6 +27,7 @@ AWSAccountUpdateRequestAttributes.JSON_PROPERTY_AWS_ACCOUNT_ID, AWSAccountUpdateRequestAttributes.JSON_PROPERTY_AWS_PARTITION, AWSAccountUpdateRequestAttributes.JSON_PROPERTY_AWS_REGIONS, + AWSAccountUpdateRequestAttributes.JSON_PROPERTY_CCM_CONFIG, AWSAccountUpdateRequestAttributes.JSON_PROPERTY_LOGS_CONFIG, AWSAccountUpdateRequestAttributes.JSON_PROPERTY_METRICS_CONFIG, AWSAccountUpdateRequestAttributes.JSON_PROPERTY_RESOURCES_CONFIG, @@ -51,6 +52,9 @@ public class AWSAccountUpdateRequestAttributes { public static final String JSON_PROPERTY_AWS_REGIONS = "aws_regions"; private AWSRegions awsRegions; + public static final String JSON_PROPERTY_CCM_CONFIG = "ccm_config"; + private AWSCCMConfig ccmConfig; + public static final String JSON_PROPERTY_LOGS_CONFIG = "logs_config"; private AWSLogsConfig logsConfig; @@ -205,6 +209,28 @@ public void setAwsRegions(AWSRegions awsRegions) { this.awsRegions = awsRegions; } + public AWSAccountUpdateRequestAttributes ccmConfig(AWSCCMConfig ccmConfig) { + this.ccmConfig = ccmConfig; + this.unparsed |= ccmConfig.unparsed; + return this; + } + + /** + * AWS Cloud Cost Management config. + * + * @return ccmConfig + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CCM_CONFIG) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AWSCCMConfig getCcmConfig() { + return ccmConfig; + } + + public void setCcmConfig(AWSCCMConfig ccmConfig) { + this.ccmConfig = ccmConfig; + } + public AWSAccountUpdateRequestAttributes logsConfig(AWSLogsConfig logsConfig) { this.logsConfig = logsConfig; this.unparsed |= logsConfig.unparsed; @@ -355,6 +381,7 @@ public boolean equals(Object o) { && Objects.equals(this.awsAccountId, awsAccountUpdateRequestAttributes.awsAccountId) && Objects.equals(this.awsPartition, awsAccountUpdateRequestAttributes.awsPartition) && Objects.equals(this.awsRegions, awsAccountUpdateRequestAttributes.awsRegions) + && Objects.equals(this.ccmConfig, awsAccountUpdateRequestAttributes.ccmConfig) && Objects.equals(this.logsConfig, awsAccountUpdateRequestAttributes.logsConfig) && Objects.equals(this.metricsConfig, awsAccountUpdateRequestAttributes.metricsConfig) && Objects.equals(this.resourcesConfig, awsAccountUpdateRequestAttributes.resourcesConfig) @@ -371,6 +398,7 @@ public int hashCode() { awsAccountId, awsPartition, awsRegions, + ccmConfig, logsConfig, metricsConfig, resourcesConfig, @@ -387,6 +415,7 @@ public String toString() { sb.append(" awsAccountId: ").append(toIndentedString(awsAccountId)).append("\n"); sb.append(" awsPartition: ").append(toIndentedString(awsPartition)).append("\n"); sb.append(" awsRegions: ").append(toIndentedString(awsRegions)).append("\n"); + sb.append(" ccmConfig: ").append(toIndentedString(ccmConfig)).append("\n"); sb.append(" logsConfig: ").append(toIndentedString(logsConfig)).append("\n"); sb.append(" metricsConfig: ").append(toIndentedString(metricsConfig)).append("\n"); sb.append(" resourcesConfig: ").append(toIndentedString(resourcesConfig)).append("\n"); 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..1f9283ab55c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AWSCCMConfig.java @@ -0,0 +1,149 @@ +/* + * 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 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 = null; + + public AWSCCMConfig dataExportConfigs(List dataExportConfigs) { + this.dataExportConfigs = dataExportConfigs; + for (DataExportConfig item : dataExportConfigs) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AWSCCMConfig 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 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/DataExportConfig.java b/src/main/java/com/datadog/api/client/v2/model/DataExportConfig.java new file mode 100644 index 00000000000..426300d17bb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DataExportConfig.java @@ -0,0 +1,246 @@ +/* + * 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.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 bucketName(String bucketName) { + this.bucketName = bucketName; + return this; + } + + /** + * Name of the S3 bucket where the Cost and Usage Report is stored. + * + * @return bucketName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUCKET_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BUCKET_REGION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPORT_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPORT_PREFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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. + * + * @return reportType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REPORT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + 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_an_AWS_account_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.freeze index b63a9ddbfcf..403f0e6375d 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.freeze @@ -1 +1 @@ -2025-08-06T17:41:40.185Z \ No newline at end of file +2025-12-10T17:32:09.613Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json index 83646ddb287..09eadab0099 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"ccm_config\":{\"data_export_configs\":[{\"bucket_name\":\"my-bucket\",\"bucket_region\":\"us-east-1\",\"report_name\":\"my-report\",\"report_prefix\":\"reports\",\"report_type\":\"CUR2.0\"}]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"4ee52a3f-d0e9-487b-bde9-cd1cbc0e4cb0\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"a4e4a6b4c2cf4638a58b1febc6b856e9\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_all\":true},\"created_at\":\"2025-08-06T17:41:41.111886478Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]}}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/SQS\",\"AWS/ElasticMapReduce\"]}},\"modified_at\":\"2025-08-06T17:41:41.111886478Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}}}", + "body": "{\"data\":{\"id\":\"de1a3b78-ed2e-4f50-9191-1879129d09ff\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"55d4a43935224fe09c096f96392f1ca1\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_all\":true},\"ccm_config\":{\"data_export_configs\":[{\"report_name\":\"my-report\",\"report_prefix\":\"reports\",\"report_type\":\"CUR2.0\",\"bucket_name\":\"my-bucket\",\"bucket_region\":\"us-east-1\"}]},\"created_at\":\"2025-12-10T17:32:11.003276673Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]}}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/SQS\",\"AWS/ElasticMapReduce\",\"AWS/Usage\"]}},\"modified_at\":\"2025-12-10T17:32:11.003276673Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "bf073e02-7e0b-dc8b-b075-82932236e50a" + "id": "85711057-8a40-68f3-5d5c-7e361822106d" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/integration/aws/accounts/4ee52a3f-d0e9-487b-bde9-cd1cbc0e4cb0", + "path": "/api/v2/integration/aws/accounts/de1a3b78-ed2e-4f50-9191-1879129d09ff", "keepAlive": false, "secure": true }, @@ -48,6 +48,6 @@ "timeToLive": { "unlimited": true }, - "id": "10233ece-4ccb-0550-1416-d7125b963fab" + "id": "282ea17f-e973-3056-46d8-b9582a92ab16" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.freeze index d0e249e860e..dfc78df9ae0 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.freeze @@ -1 +1 @@ -2025-08-06T17:41:41.364Z \ No newline at end of file +2025-12-10T17:32:36.829Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.json index 2c56c1d61b0..c8148cf7ee3 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.json +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_AWS_Account_object_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"access_key_id\":\"AKIAIOSFODNN7EXAMPLE\",\"secret_access_key\":\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"access_key_id\":\"AKIAIOSFODNN7EXAMPLE\",\"secret_access_key\":\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"ccm_config\":{\"data_export_configs\":[{\"bucket_name\":\"my-bucket\",\"bucket_region\":\"us-east-1\",\"report_name\":\"my-report\",\"report_prefix\":\"reports\",\"report_type\":\"CUR2.0\"}]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"c80e30d5-b3f9-45b1-85fc-bad652af206b\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"access_key_id\":\"AKIAIOSFODNN7EXAMPLE\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_all\":true},\"created_at\":\"2025-08-06T17:41:41.445076718Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]}}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/SQS\",\"AWS/ElasticMapReduce\"]}},\"modified_at\":\"2025-08-06T17:41:41.445076718Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}}}", + "body": "{\"data\":{\"id\":\"a7d72fb6-ec59-4eca-a905-805dd599d061\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"access_key_id\":\"AKIAIOSFODNN7EXAMPLE\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_all\":true},\"ccm_config\":{\"data_export_configs\":[{\"report_name\":\"my-report\",\"report_prefix\":\"reports\",\"report_type\":\"CUR2.0\",\"bucket_name\":\"my-bucket\",\"bucket_region\":\"us-east-1\"}]},\"created_at\":\"2025-12-10T17:32:37.014514664Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]}}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"exclude_only\":[\"AWS/SQS\",\"AWS/ElasticMapReduce\",\"AWS/Usage\"]}},\"modified_at\":\"2025-12-10T17:32:37.014514664Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[]}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "7b2c3c55-2cd8-a9d4-5571-b7b40aa8dd1d" + "id": "c2f8e9f4-0dcb-6d7a-0e2e-e91b598cfb26" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/integration/aws/accounts/c80e30d5-b3f9-45b1-85fc-bad652af206b", + "path": "/api/v2/integration/aws/accounts/a7d72fb6-ec59-4eca-a905-805dd599d061", "keepAlive": false, "secure": true }, @@ -48,6 +48,6 @@ "timeToLive": { "unlimited": true }, - "id": "e11e3159-2101-f5eb-04d1-3a4e4a693728" + "id": "cf82f989-591b-55cd-b4eb-1e40c6cc5ee9" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.freeze index abfd935a03f..2800bbe0aa2 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2025-08-06T17:41:41.716Z \ No newline at end of file +2025-12-10T17:34:11.261Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json index 18b4630494f..f757353e465 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws-invalid\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws-invalid\",\"ccm_config\":{\"data_export_configs\":[{\"bucket_name\":\"my-bucket\",\"bucket_region\":\"us-east-1\",\"report_name\":\"my-report\",\"report_prefix\":\"reports\",\"report_type\":\"CUR2.0\"}]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" }, "headers": {}, "method": "POST", @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "4af4c540-b0b7-dfa2-3215-4be9432617c6" + "id": "4732e743-da59-bab2-909e-23f0604c14d0" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json index c7a019ef829..22c7d6bcded 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json @@ -57,7 +57,7 @@ "timeToLive": { "unlimited": true }, - "id": "bf073e02-7e0b-dc8b-b075-82932236e50b" + "id": "bf073e02-7e0b-dc8b-b075-82932236e50a" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.freeze index 770d0364bdc..0acb432176a 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.freeze @@ -1 +1 @@ -2025-08-06T17:41:51.622Z \ No newline at end of file +2025-12-10T17:40:36.176Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json index e25ebe1df98..a1c5f20a353 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"ab6528e3-5dab-4375-ae47-4ce93d1216e2\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"36416390710445e7be511e1622ee4149\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2025-08-06T17:41:52.510132689Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]}}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2025-08-06T17:41:52.510132689Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "body": "{\"data\":{\"id\":\"0c2238ef-3b8e-4d25-85df-b18f96ac7031\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"a297178885da4934acf9eca79f3e7892\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2025-12-10T17:40:37.609564422Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]}}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2025-12-10T17:40:37.609564422Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -33,16 +33,16 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"ccm_config\":{\"data_export_configs\":[{\"bucket_name\":\"updated-bucket\",\"bucket_region\":\"us-west-2\",\"report_name\":\"updated-report\",\"report_prefix\":\"cost-reports\",\"report_type\":\"CUR2.0\"}]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" }, "headers": {}, "method": "PATCH", - "path": "/api/v2/integration/aws/accounts/ab6528e3-5dab-4375-ae47-4ce93d1216e2", + "path": "/api/v2/integration/aws/accounts/0c2238ef-3b8e-4d25-85df-b18f96ac7031", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"ab6528e3-5dab-4375-ae47-4ce93d1216e2\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"36416390710445e7be511e1622ee4149\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2025-08-06T17:41:52.510132Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]}}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2025-08-06T17:41:52.717094345Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "body": "{\"data\":{\"id\":\"0c2238ef-3b8e-4d25-85df-b18f96ac7031\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"a297178885da4934acf9eca79f3e7892\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"ccm_config\":{\"data_export_configs\":[{\"report_name\":\"updated-report\",\"report_prefix\":\"cost-reports\",\"report_type\":\"CUR2.0\",\"bucket_name\":\"updated-bucket\",\"bucket_region\":\"us-west-2\"}]},\"created_at\":\"2025-12-10T17:40:37.609564Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]}}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":true,\"collect_cloudwatch_alarms\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2025-12-10T17:40:37.867410688Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "a69d5860-fe24-1148-cea4-e8adb1035098" + "id": "ad8cbcb3-ddb1-f908-b208-15dcdfb4f3a0" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/integration/aws/accounts/ab6528e3-5dab-4375-ae47-4ce93d1216e2", + "path": "/api/v2/integration/aws/accounts/0c2238ef-3b8e-4d25-85df-b18f96ac7031", "keepAlive": false, "secure": true }, @@ -78,6 +78,6 @@ "timeToLive": { "unlimited": true }, - "id": "5cb7344d-e640-fe98-fa77-27d9f2426cd6" + "id": "1263683b-3cf2-a4fa-fed3-7a2ae810baf8" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.freeze index 2ad05fcd48b..e550a602216 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2025-08-06T17:41:53.059Z \ No newline at end of file +2025-12-10T17:42:50.556Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json index 5e43645a6a4..7497aa30db9 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"dff6d3ee-e90a-4df1-b0d7-6f4e1ed35acc\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"f3f5392d608c448ca4910d7adcefa849\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2025-08-06T17:41:54.148895503Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]}}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2025-08-06T17:41:54.148895503Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", + "body": "{\"data\":{\"id\":\"0c358c9f-84fd-4fe5-b0e9-722d787de213\",\"type\":\"account\",\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\",\"external_id\":\"84a9c55851ce4a01869c503e990d325b\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"aws_regions\":{\"include_only\":[\"us-east-1\"]},\"created_at\":\"2025-12-10T17:42:52.162655791Z\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"sources\":[\"s3\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]}}},\"metrics_config\":{\"enabled\":true,\"automute_enabled\":true,\"collect_custom_metrics\":false,\"collect_cloudwatch_alarms\":false,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}],\"namespace_filters\":{\"include_only\":[\"AWS/EC2\"]}},\"modified_at\":\"2025-12-10T17:42:52.162655791Z\",\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{\"xray_services\":{\"include_only\":[\"AWS/AppSync\"]}}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -33,16 +33,16 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"access_key_id\":\"AKIAIOSFODNN7EXAMPLE\",\"secret_access_key\":\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"access_key_id\":\"AKIAIOSFODNN7EXAMPLE\",\"secret_access_key\":\"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"ccm_config\":{\"data_export_configs\":[{\"bucket_name\":\"invalid-bucket\",\"bucket_region\":\"invalid-region\",\"report_name\":\"invalid-report\",\"report_prefix\":\"invalid\",\"report_type\":\"CUR2.0\"}]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" }, "headers": {}, "method": "PATCH", - "path": "/api/v2/integration/aws/accounts/dff6d3ee-e90a-4df1-b0d7-6f4e1ed35acc", + "path": "/api/v2/integration/aws/accounts/0c358c9f-84fd-4fe5-b0e9-722d787de213", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"cannot switch between role and key based auth\"}]}", + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"invalid value\",\"meta\":{\"ccm_config.data_export_configs[CUR2.0].bucket_region\":\"invalid bucket region: invalid-region\"}}]}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "64975dfc-c31f-e57d-c7a8-409a0d689b9a" + "id": "2f5e931f-13c8-46c4-a26a-a543d81601e8" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/integration/aws/accounts/dff6d3ee-e90a-4df1-b0d7-6f4e1ed35acc", + "path": "/api/v2/integration/aws/accounts/0c358c9f-84fd-4fe5-b0e9-722d787de213", "keepAlive": false, "secure": true }, @@ -78,6 +78,6 @@ "timeToLive": { "unlimited": true }, - "id": "3bf09f10-ca7a-5b67-0046-ddbad2f2b0a8" + "id": "aceef85d-e2d8-28f4-1815-c7fe383c8e66" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.freeze index 8c2f55ecb19..07ac47cd4ec 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.freeze @@ -1 +1 @@ -2025-08-06T17:41:54.735Z \ No newline at end of file +2025-12-10T17:43:13.852Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.json index 21b2febc64d..51b4d03a476 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.json +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Not_Found_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" + "json": "{\"data\":{\"attributes\":{\"account_tags\":[\"key:value\"],\"auth_config\":{\"role_name\":\"DatadogIntegrationRole\"},\"aws_account_id\":\"123456789012\",\"aws_partition\":\"aws\",\"ccm_config\":{\"data_export_configs\":[{\"bucket_name\":\"notfound-bucket\",\"bucket_region\":\"eu-west-1\",\"report_name\":\"notfound-report\",\"report_prefix\":\"notfound\",\"report_type\":\"CUR2.0\"}]},\"logs_config\":{\"lambda_forwarder\":{\"lambdas\":[\"arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder\"],\"log_source_config\":{\"tag_filters\":[{\"source\":\"s3\",\"tags\":[\"test:test\"]}]},\"sources\":[\"s3\"]}},\"metrics_config\":{\"automute_enabled\":true,\"collect_cloudwatch_alarms\":true,\"collect_custom_metrics\":true,\"enabled\":true,\"tag_filters\":[{\"namespace\":\"AWS/EC2\",\"tags\":[\"key:value\"]}]},\"resources_config\":{\"cloud_security_posture_management_collection\":false,\"extended_collection\":false},\"traces_config\":{}},\"type\":\"account\"}}" }, "headers": {}, "method": "PATCH", @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "76f11422-e248-3267-be36-aecd78d994d5" + "id": "bbf4b67f-032a-948e-b433-da8d6c34de3a" } ] \ 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..9e14d0824b3 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 @@ -12,21 +12,21 @@ Feature: AWS Integration @team:DataDog/aws-integrations Scenario: Create an AWS account returns "AWS Account object" response Given new "CreateAWSAccount" request - And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "ccm_config": {"data_export_configs": [{"bucket_name": "my-bucket", "bucket_region": "us-east-1", "report_name": "my-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}, "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} When the request is sent Then the response status is 200 AWS Account object @team:DataDog/aws-integrations Scenario: Create an AWS integration returns "AWS Account object" response Given new "CreateAWSAccount" request - And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "ccm_config": {"data_export_configs": [{"bucket_name": "my-bucket", "bucket_region": "us-east-1", "report_name": "my-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}, "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} When the request is sent Then the response status is 200 AWS Account object @team:DataDog/aws-integrations Scenario: Create an AWS integration returns "Bad Request" response Given new "CreateAWSAccount" request - And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws-invalid", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws-invalid", "ccm_config": {"data_export_configs": [{"bucket_name": "my-bucket", "bucket_region": "us-east-1", "report_name": "my-report", "report_prefix": "reports", "report_type": "CUR2.0"}]}, "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} When the request is sent Then the response status is 400 Bad Request @@ -195,7 +195,7 @@ Feature: AWS Integration Given there is a valid "aws_account_v2" in the system And new "UpdateAWSAccount" request And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" - And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "ccm_config": {"data_export_configs": [{"bucket_name": "updated-bucket", "bucket_region": "us-west-2", "report_name": "updated-report", "report_prefix": "cost-reports", "report_type": "CUR2.0"}]}, "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} When the request is sent Then the response status is 200 AWS Account object @@ -204,7 +204,7 @@ Feature: AWS Integration Given there is a valid "aws_account_v2" in the system And new "UpdateAWSAccount" request And request contains "aws_account_config_id" parameter from "aws_account_v2.data.id" - And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, "aws_account_id": "123456789012", "aws_partition": "aws", "ccm_config": {"data_export_configs": [{"bucket_name": "invalid-bucket", "bucket_region": "invalid-region", "report_name": "invalid-report", "report_prefix": "invalid", "report_type": "CUR2.0"}]}, "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} When the request is sent Then the response status is 400 Bad Request @@ -212,6 +212,6 @@ Feature: AWS Integration Scenario: Update an AWS integration returns "Not Found" response Given new "UpdateAWSAccount" request And request contains "aws_account_config_id" parameter with value "448169a8-251c-4344-abee-1c4edef39f7a" - And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} + And body with value {"data": {"attributes": {"account_tags": ["key:value"], "auth_config": {"role_name": "DatadogIntegrationRole"}, "aws_account_id": "123456789012", "aws_partition": "aws", "ccm_config": {"data_export_configs": [{"bucket_name": "notfound-bucket", "bucket_region": "eu-west-1", "report_name": "notfound-report", "report_prefix": "notfound", "report_type": "CUR2.0"}]}, "logs_config": {"lambda_forwarder": {"lambdas": ["arn:aws:lambda:us-east-1:123456789012:function:DatadogLambdaLogForwarder"], "log_source_config": {"tag_filters": [{"source": "s3", "tags": ["test:test"]}]}, "sources": ["s3"]}}, "metrics_config": {"automute_enabled": true, "collect_cloudwatch_alarms": true, "collect_custom_metrics": true, "enabled": true, "tag_filters": [{"namespace": "AWS/EC2", "tags": ["key:value"]}]}, "resources_config": {"cloud_security_posture_management_collection": false, "extended_collection": false}, "traces_config": {}}, "type": "account"}} When the request is sent Then the response status is 404 Not Found