From 39a70e7aa46b4833e0264c6a3af0035999b14395 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 4 May 2026 16:38:39 +0000 Subject: [PATCH] Regenerate client from commit 9e7235f of spec repo --- .generator/schemas/v2/openapi.yaml | 115 +++++++ .../ListCostOCIConfigs.java | 24 ++ .../client/v2/api/CloudCostManagementApi.java | 110 ++++++ .../api/client/v2/model/OCIConfig.java | 209 ++++++++++++ .../client/v2/model/OCIConfigAttributes.java | 317 ++++++++++++++++++ .../api/client/v2/model/OCIConfigType.java | 53 +++ .../client/v2/model/OCIConfigsResponse.java | 154 +++++++++ .../v2/api/cloud_cost_management.feature | 6 + .../com/datadog/api/client/v2/api/undo.json | 6 + 9 files changed, 994 insertions(+) create mode 100644 examples/v2/cloud-cost-management/ListCostOCIConfigs.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OCIConfig.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OCIConfigAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OCIConfigType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/OCIConfigsResponse.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 93b41388a76..a96e17193b1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -45948,6 +45948,90 @@ components: - id - type type: object + OCIConfig: + description: OCI config. + properties: + attributes: + $ref: "#/components/schemas/OCIConfigAttributes" + id: + description: The ID of the OCI config. + example: "1" + type: string + type: + $ref: "#/components/schemas/OCIConfigType" + required: + - attributes + - id + - type + type: object + OCIConfigAttributes: + description: Attributes for an OCI config. + properties: + account_id: + description: The OCID of the OCI tenancy. + example: "ocid1.tenancy.oc1..example" + type: string + created_at: + description: The timestamp when the OCI config was created. + example: "2026-01-01T12:00:00Z" + type: string + error_messages: + description: The error messages for the OCI config. + items: + description: An error message string. + type: string + nullable: true + type: array + status: + description: The status of the OCI config. + example: "active" + type: string + status_updated_at: + description: The timestamp when the OCI config status was last updated. + example: "2026-01-01T12:00:00Z" + type: string + updated_at: + description: The timestamp when the OCI config was last updated. + example: "2026-01-01T12:00:00Z" + type: string + required: + - account_id + - created_at + - status + - status_updated_at + - updated_at + type: object + OCIConfigType: + default: oci_config + description: Type of OCI config. + enum: + - oci_config + example: oci_config + type: string + x-enum-varnames: + - OCI_CONFIG + OCIConfigsResponse: + description: List of OCI configs. + example: + data: + - attributes: + account_id: "ocid1.tenancy.oc1..example" + created_at: "2026-01-01T12:00:00Z" + error_messages: [] + status: active + status_updated_at: "2026-01-01T12:00:00Z" + updated_at: "2026-01-01T12:00:00Z" + id: "1" + type: oci_config + properties: + data: + description: An OCI config. + items: + $ref: "#/components/schemas/OCIConfig" + type: array + required: + - data + type: object ObservabilityPipeline: description: Top-level schema representing a pipeline. properties: @@ -93443,6 +93527,37 @@ paths: operator: OR permissions: - cloud_cost_management_write + /api/v2/cost/oci_config: + get: + description: List the OCI configs. + operationId: ListCostOCIConfigs + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/OCIConfigsResponse" + description: OK + "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 Cloud Cost Management OCI configs + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read /api/v2/cost_by_tag/active_billing_dimensions: get: description: |- diff --git a/examples/v2/cloud-cost-management/ListCostOCIConfigs.java b/examples/v2/cloud-cost-management/ListCostOCIConfigs.java new file mode 100644 index 00000000000..3d0a66c0e65 --- /dev/null +++ b/examples/v2/cloud-cost-management/ListCostOCIConfigs.java @@ -0,0 +1,24 @@ +// List Cloud Cost Management OCI configs 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.OCIConfigsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + OCIConfigsResponse result = apiInstance.listCostOCIConfigs(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling CloudCostManagementApi#listCostOCIConfigs"); + 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 df20c0615f1..7abd1e19f92 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 @@ -29,6 +29,7 @@ import com.datadog.api.client.v2.model.GCPUsageCostConfigResponse; import com.datadog.api.client.v2.model.GCPUsageCostConfigsResponse; import com.datadog.api.client.v2.model.GcpUcConfigResponse; +import com.datadog.api.client.v2.model.OCIConfigsResponse; import com.datadog.api.client.v2.model.ReorderRuleResourceArray; import com.datadog.api.client.v2.model.ReorderRulesetResourceArray; import com.datadog.api.client.v2.model.RulesValidateQueryRequest; @@ -3099,6 +3100,115 @@ public ApiResponse listCostGCPUsageCostConfigsWithH new GenericType() {}); } + /** + * List Cloud Cost Management OCI configs. + * + *

See {@link #listCostOCIConfigsWithHttpInfo}. + * + * @return OCIConfigsResponse + * @throws ApiException if fails to make API call + */ + public OCIConfigsResponse listCostOCIConfigs() throws ApiException { + return listCostOCIConfigsWithHttpInfo().getData(); + } + + /** + * List Cloud Cost Management OCI configs. + * + *

See {@link #listCostOCIConfigsWithHttpInfoAsync}. + * + * @return CompletableFuture<OCIConfigsResponse> + */ + public CompletableFuture listCostOCIConfigsAsync() { + return listCostOCIConfigsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List the OCI configs. + * + * @return ApiResponse<OCIConfigsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listCostOCIConfigsWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cost/oci_config"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostOCIConfigs", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List Cloud Cost Management OCI configs. + * + *

See {@link #listCostOCIConfigsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<OCIConfigsResponse>> + */ + public CompletableFuture> listCostOCIConfigsWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/cost/oci_config"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.listCostOCIConfigs", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } 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 custom allocation rules. * diff --git a/src/main/java/com/datadog/api/client/v2/model/OCIConfig.java b/src/main/java/com/datadog/api/client/v2/model/OCIConfig.java new file mode 100644 index 00000000000..bd3e883a705 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OCIConfig.java @@ -0,0 +1,209 @@ +/* + * 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; + +/** OCI config. */ +@JsonPropertyOrder({ + OCIConfig.JSON_PROPERTY_ATTRIBUTES, + OCIConfig.JSON_PROPERTY_ID, + OCIConfig.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OCIConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private OCIConfigAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private OCIConfigType type = OCIConfigType.OCI_CONFIG; + + public OCIConfig() {} + + @JsonCreator + public OCIConfig( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + OCIConfigAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) OCIConfigType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public OCIConfig attributes(OCIConfigAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for an OCI config. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OCIConfigAttributes getAttributes() { + return attributes; + } + + public void setAttributes(OCIConfigAttributes attributes) { + this.attributes = attributes; + } + + public OCIConfig id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the OCI config. + * + * @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 OCIConfig type(OCIConfigType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of OCI config. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OCIConfigType getType() { + return type; + } + + public void setType(OCIConfigType 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 OCIConfig + */ + @JsonAnySetter + public OCIConfig 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 OCIConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OCIConfig ociConfig = (OCIConfig) o; + return Objects.equals(this.attributes, ociConfig.attributes) + && Objects.equals(this.id, ociConfig.id) + && Objects.equals(this.type, ociConfig.type) + && Objects.equals(this.additionalProperties, ociConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OCIConfig {\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/OCIConfigAttributes.java b/src/main/java/com/datadog/api/client/v2/model/OCIConfigAttributes.java new file mode 100644 index 00000000000..7ec0a251a3e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OCIConfigAttributes.java @@ -0,0 +1,317 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Attributes for an OCI config. */ +@JsonPropertyOrder({ + OCIConfigAttributes.JSON_PROPERTY_ACCOUNT_ID, + OCIConfigAttributes.JSON_PROPERTY_CREATED_AT, + OCIConfigAttributes.JSON_PROPERTY_ERROR_MESSAGES, + OCIConfigAttributes.JSON_PROPERTY_STATUS, + OCIConfigAttributes.JSON_PROPERTY_STATUS_UPDATED_AT, + OCIConfigAttributes.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OCIConfigAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private String createdAt; + + public static final String JSON_PROPERTY_ERROR_MESSAGES = "error_messages"; + private JsonNullable> errorMessages = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_STATUS_UPDATED_AT = "status_updated_at"; + private String statusUpdatedAt; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private String updatedAt; + + public OCIConfigAttributes() {} + + @JsonCreator + public OCIConfigAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ACCOUNT_ID) String accountId, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) String createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS_UPDATED_AT) + String statusUpdatedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_UPDATED_AT) String updatedAt) { + this.accountId = accountId; + this.createdAt = createdAt; + this.status = status; + this.statusUpdatedAt = statusUpdatedAt; + this.updatedAt = updatedAt; + } + + public OCIConfigAttributes accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The OCID of the OCI tenancy. + * + * @return accountId + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public OCIConfigAttributes createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The timestamp when the OCI config was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public OCIConfigAttributes errorMessages(List errorMessages) { + this.errorMessages = JsonNullable.>of(errorMessages); + return this; + } + + public OCIConfigAttributes addErrorMessagesItem(String errorMessagesItem) { + if (this.errorMessages == null || !this.errorMessages.isPresent()) { + this.errorMessages = JsonNullable.>of(new ArrayList<>()); + } + try { + this.errorMessages.get().add(errorMessagesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * The error messages for the OCI config. + * + * @return errorMessages + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getErrorMessages() { + return errorMessages.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getErrorMessages_JsonNullable() { + return errorMessages; + } + + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGES) + public void setErrorMessages_JsonNullable(JsonNullable> errorMessages) { + this.errorMessages = errorMessages; + } + + public void setErrorMessages(List errorMessages) { + this.errorMessages = JsonNullable.>of(errorMessages); + } + + public OCIConfigAttributes status(String status) { + this.status = status; + return this; + } + + /** + * The status of the OCI config. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public OCIConfigAttributes statusUpdatedAt(String statusUpdatedAt) { + this.statusUpdatedAt = statusUpdatedAt; + return this; + } + + /** + * The timestamp when the OCI config status was last updated. + * + * @return statusUpdatedAt + */ + @JsonProperty(JSON_PROPERTY_STATUS_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatusUpdatedAt() { + return statusUpdatedAt; + } + + public void setStatusUpdatedAt(String statusUpdatedAt) { + this.statusUpdatedAt = statusUpdatedAt; + } + + public OCIConfigAttributes updatedAt(String updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The timestamp when the OCI config was last updated. + * + * @return updatedAt + */ + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(String updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * 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 OCIConfigAttributes + */ + @JsonAnySetter + public OCIConfigAttributes 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 OCIConfigAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OCIConfigAttributes ociConfigAttributes = (OCIConfigAttributes) o; + return Objects.equals(this.accountId, ociConfigAttributes.accountId) + && Objects.equals(this.createdAt, ociConfigAttributes.createdAt) + && Objects.equals(this.errorMessages, ociConfigAttributes.errorMessages) + && Objects.equals(this.status, ociConfigAttributes.status) + && Objects.equals(this.statusUpdatedAt, ociConfigAttributes.statusUpdatedAt) + && Objects.equals(this.updatedAt, ociConfigAttributes.updatedAt) + && Objects.equals(this.additionalProperties, ociConfigAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + accountId, + createdAt, + errorMessages, + status, + statusUpdatedAt, + updatedAt, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OCIConfigAttributes {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" errorMessages: ").append(toIndentedString(errorMessages)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" statusUpdatedAt: ").append(toIndentedString(statusUpdatedAt)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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/OCIConfigType.java b/src/main/java/com/datadog/api/client/v2/model/OCIConfigType.java new file mode 100644 index 00000000000..6960b3a0931 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OCIConfigType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of OCI config. */ +@JsonSerialize(using = OCIConfigType.OCIConfigTypeSerializer.class) +public class OCIConfigType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("oci_config")); + + public static final OCIConfigType OCI_CONFIG = new OCIConfigType("oci_config"); + + OCIConfigType(String value) { + super(value, allowedValues); + } + + public static class OCIConfigTypeSerializer extends StdSerializer { + public OCIConfigTypeSerializer(Class t) { + super(t); + } + + public OCIConfigTypeSerializer() { + this(null); + } + + @Override + public void serialize(OCIConfigType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static OCIConfigType fromValue(String value) { + return new OCIConfigType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/OCIConfigsResponse.java b/src/main/java/com/datadog/api/client/v2/model/OCIConfigsResponse.java new file mode 100644 index 00000000000..09ba95b797e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/OCIConfigsResponse.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** List of OCI configs. */ +@JsonPropertyOrder({OCIConfigsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class OCIConfigsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public OCIConfigsResponse() {} + + @JsonCreator + public OCIConfigsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public OCIConfigsResponse data(List data) { + this.data = data; + for (OCIConfig item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public OCIConfigsResponse addDataItem(OCIConfig dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * An OCI config. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + 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 OCIConfigsResponse + */ + @JsonAnySetter + public OCIConfigsResponse 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 OCIConfigsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OCIConfigsResponse ociConfigsResponse = (OCIConfigsResponse) o; + return Objects.equals(this.data, ociConfigsResponse.data) + && Objects.equals(this.additionalProperties, ociConfigsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OCIConfigsResponse {\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/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 312e05fb382..c5fc0adc05d 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 @@ -313,6 +313,12 @@ Feature: Cloud Cost Management Then the response status is 200 OK And the response "data[0].attributes.configs[0].export_name" is equal to "test_export_name" + @generated @skip @team:DataDog/cloud-cost-management + Scenario: List Cloud Cost Management OCI configs returns "OK" response + Given new "ListCostOCIConfigs" request + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: List Custom Costs Files returns "OK" response Given new "ListCustomCostsFiles" 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 4d694af5be3..21d7896f03b 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 @@ -1458,6 +1458,12 @@ "type": "idempotent" } }, + "ListCostOCIConfigs": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "GetActiveBillingDimensions": { "tag": "Usage Metering", "undo": {