diff --git a/.apigentools-info b/.apigentools-info index c80490df53f..e933497cebf 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-31 16:03:59.333672", - "spec_repo_commit": "a11da7b5" + "regenerated": "2024-10-31 16:41:33.862946", + "spec_repo_commit": "63c441b2" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-31 16:03:59.352181", - "spec_repo_commit": "a11da7b5" + "regenerated": "2024-10-31 16:41:33.881242", + "spec_repo_commit": "63c441b2" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 61de273a3d9..7b467d1950e 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -976,49 +976,6 @@ components: type: string x-enum-varnames: - API_KEYS - AWSRelatedAccount: - description: AWS related account. - properties: - attributes: - $ref: '#/components/schemas/AWSRelatedAccountAttributes' - id: - description: The AWS account ID. - example: '123456789123' - type: string - type: - $ref: '#/components/schemas/AWSRelatedAccountType' - required: - - id - - type - type: object - AWSRelatedAccountAttributes: - description: Attributes for an AWS related account. - properties: - has_datadog_integration: - description: Whether or not the AWS account has a Datadog integration. - type: boolean - name: - description: The name of the AWS account. - type: string - type: object - AWSRelatedAccountType: - default: aws_account - description: Type of AWS related account. - enum: - - aws_account - example: aws_account - type: string - x-enum-varnames: - - AWS_ACCOUNT - AWSRelatedAccountsResponse: - description: List of AWS related accounts. - properties: - data: - description: An AWS related account. - items: - $ref: '#/components/schemas/AWSRelatedAccount' - type: array - type: object ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -28974,53 +28931,6 @@ paths: operator: OR permissions: - cloud_cost_management_write - /api/v2/cost/aws_related_accounts: - get: - deprecated: true - description: List the AWS accounts in an organization by calling 'organizations:ListAccounts' - from the specified management account. - operationId: ListAWSRelatedAccounts - parameters: - - description: The ID of the management account to filter by. - example: '123456789123' - in: query - name: filter[management_account_id] - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/AWSRelatedAccountsResponse' - description: OK - '400': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Bad Request - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/APIErrorResponse' - description: Forbidden - '429': - $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - cloud_cost_management_read - summary: List related AWS accounts - tags: - - Cloud Cost Management - x-permission: - operator: OR - permissions: - - cloud_cost_management_read /api/v2/cost/azure_uc_config: get: description: List the Azure configs. diff --git a/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.java b/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.java deleted file mode 100644 index 2bb25392bb5..00000000000 --- a/examples/v2/cloud-cost-management/ListAWSRelatedAccounts.java +++ /dev/null @@ -1,24 +0,0 @@ -// List related AWS accounts returns "OK" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.CloudCostManagementApi; -import com.datadog.api.client.v2.model.AWSRelatedAccountsResponse; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); - - try { - AWSRelatedAccountsResponse result = apiInstance.listAWSRelatedAccounts("123456789123"); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling CloudCostManagementApi#listAWSRelatedAccounts"); - 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/v2/api/CloudCostManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java index a8d4e64a493..8a1a698e909 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java @@ -4,7 +4,6 @@ import com.datadog.api.client.ApiException; import com.datadog.api.client.ApiResponse; import com.datadog.api.client.Pair; -import com.datadog.api.client.v2.model.AWSRelatedAccountsResponse; import com.datadog.api.client.v2.model.AwsCURConfigPatchRequest; import com.datadog.api.client.v2.model.AwsCURConfigPostRequest; import com.datadog.api.client.v2.model.AwsCURConfigResponse; @@ -982,161 +981,6 @@ public ApiResponse getCustomCostsFileWithHttpInfo(St new GenericType() {}); } - /** - * List related AWS accounts. - * - *

See {@link #listAWSRelatedAccountsWithHttpInfo}. - * - * @param filterManagementAccountId The ID of the management account to filter by. (required) - * @return AWSRelatedAccountsResponse - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public AWSRelatedAccountsResponse listAWSRelatedAccounts(String filterManagementAccountId) - throws ApiException { - return listAWSRelatedAccountsWithHttpInfo(filterManagementAccountId).getData(); - } - - /** - * List related AWS accounts. - * - *

See {@link #listAWSRelatedAccountsWithHttpInfoAsync}. - * - * @param filterManagementAccountId The ID of the management account to filter by. (required) - * @return CompletableFuture<AWSRelatedAccountsResponse> - * @deprecated - */ - @Deprecated - public CompletableFuture listAWSRelatedAccountsAsync( - String filterManagementAccountId) { - return listAWSRelatedAccountsWithHttpInfoAsync(filterManagementAccountId) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * List the AWS accounts in an organization by calling 'organizations:ListAccounts' from the - * specified management account. - * - * @param filterManagementAccountId The ID of the management account to filter by. (required) - * @return ApiResponse<AWSRelatedAccountsResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
- * - * @deprecated - */ - @Deprecated - public ApiResponse listAWSRelatedAccountsWithHttpInfo( - String filterManagementAccountId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'filterManagementAccountId' is set - if (filterManagementAccountId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'filterManagementAccountId' when calling" - + " listAWSRelatedAccounts"); - } - // create path and map variables - String localVarPath = "/api/v2/cost/aws_related_accounts"; - - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[management_account_id]", filterManagementAccountId)); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.CloudCostManagementApi.listAWSRelatedAccounts", - localVarPath, - localVarQueryParams, - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); - return apiClient.invokeAPI( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * List related AWS accounts. - * - *

See {@link #listAWSRelatedAccountsWithHttpInfo}. - * - * @param filterManagementAccountId The ID of the management account to filter by. (required) - * @return CompletableFuture<ApiResponse<AWSRelatedAccountsResponse>> - * @deprecated - */ - @Deprecated - public CompletableFuture> - listAWSRelatedAccountsWithHttpInfoAsync(String filterManagementAccountId) { - Object localVarPostBody = null; - - // verify the required parameter 'filterManagementAccountId' is set - if (filterManagementAccountId == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'filterManagementAccountId' when calling" - + " listAWSRelatedAccounts")); - return result; - } - // create path and map variables - String localVarPath = "/api/v2/cost/aws_related_accounts"; - - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[management_account_id]", filterManagementAccountId)); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.CloudCostManagementApi.listAWSRelatedAccounts", - localVarPath, - localVarQueryParams, - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); - } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; - } - return apiClient.invokeAPIAsync( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - /** * List Cloud Cost Management AWS CUR configs. * diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSRelatedAccount.java b/src/main/java/com/datadog/api/client/v2/model/AWSRelatedAccount.java deleted file mode 100644 index f6adece5c5c..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/AWSRelatedAccount.java +++ /dev/null @@ -1,206 +0,0 @@ -/* - * 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 related account. */ -@JsonPropertyOrder({ - AWSRelatedAccount.JSON_PROPERTY_ATTRIBUTES, - AWSRelatedAccount.JSON_PROPERTY_ID, - AWSRelatedAccount.JSON_PROPERTY_TYPE -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class AWSRelatedAccount { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private AWSRelatedAccountAttributes attributes; - - public static final String JSON_PROPERTY_ID = "id"; - private String id; - - public static final String JSON_PROPERTY_TYPE = "type"; - private AWSRelatedAccountType type = AWSRelatedAccountType.AWS_ACCOUNT; - - public AWSRelatedAccount() {} - - @JsonCreator - public AWSRelatedAccount( - @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, - @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AWSRelatedAccountType type) { - this.id = id; - this.type = type; - this.unparsed |= !type.isValid(); - } - - public AWSRelatedAccount attributes(AWSRelatedAccountAttributes attributes) { - this.attributes = attributes; - this.unparsed |= attributes.unparsed; - return this; - } - - /** - * Attributes for an AWS related account. - * - * @return attributes - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTRIBUTES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AWSRelatedAccountAttributes getAttributes() { - return attributes; - } - - public void setAttributes(AWSRelatedAccountAttributes attributes) { - this.attributes = attributes; - } - - public AWSRelatedAccount id(String id) { - this.id = id; - return this; - } - - /** - * The AWS account ID. - * - * @return id - */ - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public AWSRelatedAccount type(AWSRelatedAccountType type) { - this.type = type; - this.unparsed |= !type.isValid(); - return this; - } - - /** - * Type of AWS related account. - * - * @return type - */ - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public AWSRelatedAccountType getType() { - return type; - } - - public void setType(AWSRelatedAccountType 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 AWSRelatedAccount - */ - @JsonAnySetter - public AWSRelatedAccount 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 AWSRelatedAccount object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AWSRelatedAccount awsRelatedAccount = (AWSRelatedAccount) o; - return Objects.equals(this.attributes, awsRelatedAccount.attributes) - && Objects.equals(this.id, awsRelatedAccount.id) - && Objects.equals(this.type, awsRelatedAccount.type) - && Objects.equals(this.additionalProperties, awsRelatedAccount.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(attributes, id, type, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AWSRelatedAccount {\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/AWSRelatedAccountAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AWSRelatedAccountAttributes.java deleted file mode 100644 index ecc165eeca4..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/AWSRelatedAccountAttributes.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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; - -/** Attributes for an AWS related account. */ -@JsonPropertyOrder({ - AWSRelatedAccountAttributes.JSON_PROPERTY_HAS_DATADOG_INTEGRATION, - AWSRelatedAccountAttributes.JSON_PROPERTY_NAME -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class AWSRelatedAccountAttributes { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_HAS_DATADOG_INTEGRATION = "has_datadog_integration"; - private Boolean hasDatadogIntegration; - - public static final String JSON_PROPERTY_NAME = "name"; - private String name; - - public AWSRelatedAccountAttributes hasDatadogIntegration(Boolean hasDatadogIntegration) { - this.hasDatadogIntegration = hasDatadogIntegration; - return this; - } - - /** - * Whether or not the AWS account has a Datadog integration. - * - * @return hasDatadogIntegration - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HAS_DATADOG_INTEGRATION) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHasDatadogIntegration() { - return hasDatadogIntegration; - } - - public void setHasDatadogIntegration(Boolean hasDatadogIntegration) { - this.hasDatadogIntegration = hasDatadogIntegration; - } - - public AWSRelatedAccountAttributes name(String name) { - this.name = name; - return this; - } - - /** - * The name of the AWS account. - * - * @return name - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * 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 AWSRelatedAccountAttributes - */ - @JsonAnySetter - public AWSRelatedAccountAttributes 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 AWSRelatedAccountAttributes object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AWSRelatedAccountAttributes awsRelatedAccountAttributes = (AWSRelatedAccountAttributes) o; - return Objects.equals( - this.hasDatadogIntegration, awsRelatedAccountAttributes.hasDatadogIntegration) - && Objects.equals(this.name, awsRelatedAccountAttributes.name) - && Objects.equals( - this.additionalProperties, awsRelatedAccountAttributes.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(hasDatadogIntegration, name, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AWSRelatedAccountAttributes {\n"); - sb.append(" hasDatadogIntegration: ") - .append(toIndentedString(hasDatadogIntegration)) - .append("\n"); - sb.append(" name: ").append(toIndentedString(name)).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/AWSRelatedAccountType.java b/src/main/java/com/datadog/api/client/v2/model/AWSRelatedAccountType.java deleted file mode 100644 index e7332b3f57a..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/AWSRelatedAccountType.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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; - -/** Type of AWS related account. */ -@JsonSerialize(using = AWSRelatedAccountType.AWSRelatedAccountTypeSerializer.class) -public class AWSRelatedAccountType extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("aws_account")); - - public static final AWSRelatedAccountType AWS_ACCOUNT = new AWSRelatedAccountType("aws_account"); - - AWSRelatedAccountType(String value) { - super(value, allowedValues); - } - - public static class AWSRelatedAccountTypeSerializer extends StdSerializer { - public AWSRelatedAccountTypeSerializer(Class t) { - super(t); - } - - public AWSRelatedAccountTypeSerializer() { - this(null); - } - - @Override - public void serialize( - AWSRelatedAccountType value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static AWSRelatedAccountType fromValue(String value) { - return new AWSRelatedAccountType(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/AWSRelatedAccountsResponse.java b/src/main/java/com/datadog/api/client/v2/model/AWSRelatedAccountsResponse.java deleted file mode 100644 index c0406deee35..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/AWSRelatedAccountsResponse.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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; - -/** List of AWS related accounts. */ -@JsonPropertyOrder({AWSRelatedAccountsResponse.JSON_PROPERTY_DATA}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class AWSRelatedAccountsResponse { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_DATA = "data"; - private List data = null; - - public AWSRelatedAccountsResponse data(List data) { - this.data = data; - for (AWSRelatedAccount item : data) { - this.unparsed |= item.unparsed; - } - return this; - } - - public AWSRelatedAccountsResponse addDataItem(AWSRelatedAccount dataItem) { - if (this.data == null) { - this.data = new ArrayList<>(); - } - this.data.add(dataItem); - this.unparsed |= dataItem.unparsed; - return this; - } - - /** - * An AWS related account. - * - * @return data - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getData() { - return data; - } - - public void setData(List 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 AWSRelatedAccountsResponse - */ - @JsonAnySetter - public AWSRelatedAccountsResponse 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 AWSRelatedAccountsResponse object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AWSRelatedAccountsResponse awsRelatedAccountsResponse = (AWSRelatedAccountsResponse) o; - return Objects.equals(this.data, awsRelatedAccountsResponse.data) - && Objects.equals( - this.additionalProperties, awsRelatedAccountsResponse.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(data, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AWSRelatedAccountsResponse {\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/test/resources/cassettes/features/v2/List_related_AWS_accounts_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_related_AWS_accounts_returns_OK_response.freeze deleted file mode 100644 index fc911e03b7a..00000000000 --- a/src/test/resources/cassettes/features/v2/List_related_AWS_accounts_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2023-12-12T14:56:29.893Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_related_AWS_accounts_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_related_AWS_accounts_returns_OK_response.json deleted file mode 100644 index 0d307b740ab..00000000000 --- a/src/test/resources/cassettes/features/v2/List_related_AWS_accounts_returns_OK_response.json +++ /dev/null @@ -1,33 +0,0 @@ -[ - { - "httpRequest": { - "headers": {}, - "method": "GET", - "path": "/api/v2/cost/aws_related_accounts", - "queryStringParameters": { - "filter[management_account_id]": [ - "123456789123" - ] - }, - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "body": "{\"data\": [{\"type\": \"aws_account\", \"id\": \"000000000000\", \"attributes\": {\"name\": \"test_name\", \"has_datadog_integration\": false}}, {\"type\": \"aws_account\", \"id\": \"000000000000\", \"attributes\": {\"name\": \"test_name\", \"has_datadog_integration\": true}}, {\"type\": \"aws_account\", \"id\": \"000000000000\", \"attributes\": {\"name\": \"test_name\", \"has_datadog_integration\": false}}, {\"type\": \"aws_account\", \"id\": \"000000000000\", \"attributes\": {\"name\": \"test_name\", \"has_datadog_integration\": false}}, {\"type\": \"aws_account\", \"id\": \"000000000000\", \"attributes\": {\"name\": \"test_name\", \"has_datadog_integration\": true}}, {\"type\": \"aws_account\", \"id\": \"000000000000\", \"attributes\": {\"name\": \"test_name\", \"has_datadog_integration\": false}}, {\"type\": \"aws_account\", \"id\": \"000000000000\", \"attributes\": {\"name\": \"test_name\", \"has_datadog_integration\": false}}, {\"type\": \"aws_account\", \"id\": \"000000000000\", \"attributes\": {\"name\": \"test_name\", \"has_datadog_integration\": true}}, {\"type\": \"aws_account\", \"id\": \"000000000000\", \"attributes\": {\"name\": \"test_name\", \"has_datadog_integration\": false}}]}", - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "statusCode": 200, - "reasonPhrase": "OK" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "65a0c158-0c72-e648-fe63-b095c98bc385" - } -] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature index 7794b249d33..2b87e8fe98d 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/cloud_cost_management.feature @@ -148,21 +148,6 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK - @generated @skip @team:Datadog/cloud-cost-management - Scenario: List related AWS accounts returns "Bad Request" response - Given new "ListAWSRelatedAccounts" request - And request contains "filter[management_account_id]" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @replay-only @team:Datadog/cloud-cost-management - Scenario: List related AWS accounts returns "OK" response - Given new "ListAWSRelatedAccounts" request - And request contains "filter[management_account_id]" parameter with value "123456789123" - When the request is sent - Then the response status is 200 OK - And the response "data[0].attributes.name" is equal to "test_name" - @replay-only @team:Datadog/cloud-cost-management Scenario: Update Cloud Cost Management AWS CUR config returns "OK" response Given new "UpdateCostAWSCURConfig" request 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 0e2af9556a5..81c6a29e22c 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 @@ -414,12 +414,6 @@ "type": "idempotent" } }, - "ListAWSRelatedAccounts": { - "tag": "Cloud Cost Management", - "undo": { - "type": "safe" - } - }, "ListCostAzureUCConfigs": { "tag": "Cloud Cost Management", "undo": {