diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8a63ddc4ce8..7da95daebf5 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -21589,11 +21589,13 @@ components: description: The number of Normalized Capacity Units. example: 8 format: double + nullable: true type: number number_of_reservations: description: The number of reserved instances. example: 2 format: double + nullable: true type: number offering_class: description: The offering class of the Reserved Instance. @@ -21615,14 +21617,14 @@ components: description: The start date of the commitment. example: "2023-01-01T00:00:00Z" type: string - term_length: - description: The term length in years. - example: 1 - format: double - type: number + term_length_months: + description: The commitment term in whole months. Omitted when the term is unknown. + example: 12 + format: int64 + type: integer utilization: - description: The utilization percentage of the commitment. - example: 0.85 + description: The utilization percentage of the commitment, from 0 to 100. + example: 85.5 format: double type: number required: @@ -21656,11 +21658,13 @@ components: description: The number of Normalized Capacity Units. example: 8 format: double + nullable: true type: number number_of_reservations: description: The number of reserved instances. example: 2 format: double + nullable: true type: number purchase_option: description: The payment option for the Reserved Instance. @@ -21674,14 +21678,14 @@ components: description: The start date of the commitment. example: "2023-01-01T00:00:00Z" type: string - term_length: - description: The term length in years. - example: 1 - format: double - type: number + term_length_months: + description: The commitment term in whole months. Omitted when the term is unknown. + example: 12 + format: int64 + type: integer utilization: - description: The utilization percentage of the commitment. - example: 0.85 + description: The utilization percentage of the commitment, from 0 to 100. + example: 85.5 format: double type: number required: @@ -21718,11 +21722,13 @@ components: description: The number of Normalized Capacity Units. example: 8 format: double + nullable: true type: number number_of_reservations: description: The number of reserved instances. example: 2 format: double + nullable: true type: number purchase_option: description: The payment option for the Reserved Instance. @@ -21736,14 +21742,14 @@ components: description: The start date of the commitment. example: "2023-01-01T00:00:00Z" type: string - term_length: - description: The term length in years. - example: 1 - format: double - type: number + term_length_months: + description: The commitment term in whole months. Omitted when the term is unknown. + example: 12 + format: int64 + type: integer utilization: - description: The utilization percentage of the commitment. - example: 0.85 + description: The utilization percentage of the commitment, from 0 to 100. + example: 85.5 format: double type: number required: @@ -21769,10 +21775,18 @@ components: description: The expiration date of the commitment. example: "2025-12-31T00:00:00Z" type: string + instance_type_family: + description: The EC2 instance family covered by the Savings Plan. Only returned for EC2 Instance Savings Plans. + example: m5 + type: string purchase_option: description: The payment option for the Savings Plan. example: All Upfront type: string + region: + description: The AWS region covered by the Savings Plan. Only returned for EC2 Instance Savings Plans. + example: us-east-1 + type: string savings_plan_type: description: The Savings Plan type. example: ComputeSavingsPlans @@ -21781,14 +21795,14 @@ components: description: The start date of the commitment. example: "2023-01-01T00:00:00Z" type: string - term_length: - description: The term length in years. - example: 1 - format: double - type: number + term_length_months: + description: The commitment term in whole months. Omitted when the term is unknown. + example: 12 + format: int64 + type: integer utilization: - description: The utilization percentage of the commitment. - example: 0.85 + description: The utilization percentage of the commitment, from 0 to 100. + example: 85.5 format: double type: number required: @@ -21816,18 +21830,26 @@ components: description: The expiration date of the commitment. example: "2025-12-31T00:00:00Z" type: string + product: + description: The Azure Savings Plan product, `Compute` or `Database`, based on the product order name. Omitted when it cannot be classified. + example: Compute + type: string + savings_plan_type: + description: The Azure Savings Plan type. + example: Compute + type: string start_date: description: The start date of the commitment. example: "2023-01-01T00:00:00Z" type: string - term_length: - description: The term length in years. - example: 1 - format: double - type: number + term_length_months: + description: The commitment term in whole months. Omitted when the term is unknown. + example: 12 + format: int64 + type: integer utilization: - description: The utilization percentage of the commitment. - example: 0.85 + description: The utilization percentage of the commitment, from 0 to 100. + example: 85.5 format: double type: number required: @@ -21857,6 +21879,10 @@ components: description: The Azure meter sub-category for the reservation. example: D4s v3 type: string + product: + description: The Azure product of the reservation. Omitted when it cannot be classified. + example: VirtualMachines + type: string region: description: The Azure region of the Reserved Instance. example: eastus @@ -21867,14 +21893,14 @@ components: type: string status: $ref: "#/components/schemas/CommitmentsAzureVMRIStatus" - term_length: - description: The term length in years. - example: 1 - format: double - type: number + term_length_months: + description: The commitment term in whole months. Omitted when the term is unknown. + example: 12 + format: int64 + type: integer utilization: - description: The utilization percentage of the commitment. - example: 0.85 + description: The utilization percentage of the commitment, from 0 to 100. + example: 85.5 format: double type: number required: @@ -21952,17 +21978,56 @@ components: properties: committed_spend_unit: $ref: "#/components/schemas/CommitmentsUnit" + unused_cost_unavailable: + description: Set for Azure when the cost data lacks the unused cost of some commitments, as with exports scoped below the billing profile. Utilization is then overstated. + example: true + type: boolean type: object CommitmentsListResponse: description: Response containing a list of cloud commitment details. + properties: + data: + $ref: "#/components/schemas/CommitmentsListResponseData" + required: + - data + type: object + CommitmentsListResponseAttributes: + description: Attributes of a commitments list response. properties: commitments: $ref: "#/components/schemas/CommitmentsListItems" meta: $ref: "#/components/schemas/CommitmentsListMeta" + query_definition: + $ref: "#/components/schemas/CommitmentsQueryDefinition" required: - commitments type: object + CommitmentsListResponseData: + description: The commitments list resource. + properties: + attributes: + $ref: "#/components/schemas/CommitmentsListResponseAttributes" + id: + description: The identifier of the commitments list response. + example: commitments_list_response + type: string + type: + $ref: "#/components/schemas/CommitmentsListResponseType" + required: + - attributes + - id + - type + type: object + CommitmentsListResponseType: + default: commitments_list_response + description: Type of the commitments list response resource. + enum: + - commitments_list_response + example: commitments_list_response + type: string + x-enum-varnames: + - COMMITMENTS_LIST_RESPONSE CommitmentsOnDemandHotspotsScalarMeta: description: Metadata for the on-demand hot-spots scalar response. properties: @@ -21996,6 +22061,87 @@ components: x-enum-varnames: - AWS - AZURE + CommitmentsQueryDefinition: + description: The query behind the response's values, in the form dashboard and notebook widget requests take, so a client can graph them in a widget. Each formula's `id` names the response value it produces. + properties: + formulas: + $ref: "#/components/schemas/CommitmentsQueryDefinitionFormulas" + queries: + $ref: "#/components/schemas/CommitmentsQueryDefinitionQueries" + required: + - formulas + - queries + type: object + CommitmentsQueryDefinitionAggregator: + description: The reducer a scalar widget applies to the query. + enum: + - sum + - avg + - min + - max + example: sum + type: string + x-enum-varnames: + - SUM + - AVG + - MIN + - MAX + CommitmentsQueryDefinitionDataSource: + description: The data source of the query. + enum: + - cloud_cost + - metrics + example: cloud_cost + type: string + x-enum-varnames: + - CLOUD_COST + - METRICS + CommitmentsQueryDefinitionFormula: + description: A formula of a query definition. + properties: + formula: + description: The formula expression over the named queries. + example: used / (used + unused) * 100 + type: string + id: + description: The name of the response value the formula produces. + example: utilization + type: string + required: + - formula + - id + type: object + CommitmentsQueryDefinitionFormulas: + description: The formulas of a query definition. + items: + $ref: "#/components/schemas/CommitmentsQueryDefinitionFormula" + type: array + CommitmentsQueryDefinitionQueries: + description: The metric queries of a query definition. + items: + $ref: "#/components/schemas/CommitmentsQueryDefinitionQuery" + type: array + CommitmentsQueryDefinitionQuery: + description: A metric query of a query definition. + properties: + aggregator: + $ref: "#/components/schemas/CommitmentsQueryDefinitionAggregator" + data_source: + $ref: "#/components/schemas/CommitmentsQueryDefinitionDataSource" + name: + description: The name formulas use to reference the query. + example: used + type: string + query: + description: The metric query. + example: "sum:aws.cost.amortized{aws_cost_type:SavingsPlanCoveredUsage}.rollup(sum, daily)" + type: string + required: + - aggregator + - data_source + - name + - query + type: object CommitmentsSavingsScalarResponse: description: Response containing scalar savings metrics for cloud commitment programs. properties: @@ -161769,17 +161915,24 @@ paths: examples: default: value: - commitments: - - commitment_id: ri-0123456789abcdef0 - expiration_date: "2025-12-31T00:00:00Z" - instance_type: m5.xlarge - offering_class: standard - operating_system: Linux - purchase_option: All Upfront - region: us-east-1 - start_date: "2023-01-01T00:00:00Z" - term_length: 1 - utilization: 0.85 + data: + attributes: + commitments: + - availability_zone: us-east-1a + commitment_id: ri-0123456789abcdef0 + expiration_date: "2025-12-31T00:00:00Z" + instance_type: m5.xlarge + number_of_nfus: 4 + number_of_reservations: 1 + offering_class: standard + operating_system: Linux + purchase_option: All Upfront + region: us-east-1 + start_date: "2024-12-31T00:00:00Z" + term_length_months: 12 + utilization: 85.5 + id: commitments_list_response + type: commitments_list_response schema: $ref: "#/components/schemas/CommitmentsListResponse" description: OK diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.java b/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.java index c7199a53277..9c3c707c4b4 100644 --- a/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.java +++ b/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.java @@ -3,6 +3,8 @@ 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.api.CloudCostManagementApi.GetCommitmentsCommitmentListOptionalParameters; +import com.datadog.api.client.v2.model.CommitmentsCommitmentType; import com.datadog.api.client.v2.model.CommitmentsListResponse; import com.datadog.api.client.v2.model.CommitmentsProvider; @@ -16,7 +18,12 @@ public static void main(String[] args) { try { CommitmentsListResponse result = apiInstance.getCommitmentsCommitmentList( - CommitmentsProvider.AWS, "ec2", 1693526400000L, 1696118400000L); + CommitmentsProvider.AWS, + "ec2", + 1788220800000L, + 1790812799000L, + new GetCommitmentsCommitmentListOptionalParameters() + .commitmentType(CommitmentsCommitmentType.RESERVED_INSTANCES)); System.out.println(result); } catch (ApiException e) { System.err.println( diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsEC2RICommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsEC2RICommitment.java index 4e18c3397ac..78d52ebc90d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsEC2RICommitment.java +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsEC2RICommitment.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** AWS EC2 Reserved Instance commitment details. */ @JsonPropertyOrder({ @@ -30,7 +31,7 @@ CommitmentsAwsEC2RICommitment.JSON_PROPERTY_PURCHASE_OPTION, CommitmentsAwsEC2RICommitment.JSON_PROPERTY_REGION, CommitmentsAwsEC2RICommitment.JSON_PROPERTY_START_DATE, - CommitmentsAwsEC2RICommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_TERM_LENGTH_MONTHS, CommitmentsAwsEC2RICommitment.JSON_PROPERTY_UTILIZATION }) @jakarta.annotation.Generated( @@ -50,10 +51,10 @@ public class CommitmentsAwsEC2RICommitment { private String instanceType; public static final String JSON_PROPERTY_NUMBER_OF_NFUS = "number_of_nfus"; - private Double numberOfNfus; + private JsonNullable numberOfNfus = JsonNullable.undefined(); public static final String JSON_PROPERTY_NUMBER_OF_RESERVATIONS = "number_of_reservations"; - private Double numberOfReservations; + private JsonNullable numberOfReservations = JsonNullable.undefined(); public static final String JSON_PROPERTY_OFFERING_CLASS = "offering_class"; private String offeringClass; @@ -70,8 +71,8 @@ public class CommitmentsAwsEC2RICommitment { public static final String JSON_PROPERTY_START_DATE = "start_date"; private String startDate; - public static final String JSON_PROPERTY_TERM_LENGTH = "term_length"; - private Double termLength; + public static final String JSON_PROPERTY_TERM_LENGTH_MONTHS = "term_length_months"; + private Long termLengthMonths; public static final String JSON_PROPERTY_UTILIZATION = "utilization"; private Double utilization; @@ -177,7 +178,7 @@ public void setInstanceType(String instanceType) { } public CommitmentsAwsEC2RICommitment numberOfNfus(Double numberOfNfus) { - this.numberOfNfus = numberOfNfus; + this.numberOfNfus = JsonNullable.of(numberOfNfus); return this; } @@ -187,18 +188,28 @@ public CommitmentsAwsEC2RICommitment numberOfNfus(Double numberOfNfus) { * @return numberOfNfus */ @jakarta.annotation.Nullable + @JsonIgnore + public Double getNumberOfNfus() { + return numberOfNfus.orElse(null); + } + @JsonProperty(JSON_PROPERTY_NUMBER_OF_NFUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getNumberOfNfus() { + public JsonNullable getNumberOfNfus_JsonNullable() { return numberOfNfus; } - public void setNumberOfNfus(Double numberOfNfus) { + @JsonProperty(JSON_PROPERTY_NUMBER_OF_NFUS) + public void setNumberOfNfus_JsonNullable(JsonNullable numberOfNfus) { this.numberOfNfus = numberOfNfus; } + public void setNumberOfNfus(Double numberOfNfus) { + this.numberOfNfus = JsonNullable.of(numberOfNfus); + } + public CommitmentsAwsEC2RICommitment numberOfReservations(Double numberOfReservations) { - this.numberOfReservations = numberOfReservations; + this.numberOfReservations = JsonNullable.of(numberOfReservations); return this; } @@ -208,16 +219,26 @@ public CommitmentsAwsEC2RICommitment numberOfReservations(Double numberOfReserva * @return numberOfReservations */ @jakarta.annotation.Nullable + @JsonIgnore + public Double getNumberOfReservations() { + return numberOfReservations.orElse(null); + } + @JsonProperty(JSON_PROPERTY_NUMBER_OF_RESERVATIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getNumberOfReservations() { + public JsonNullable getNumberOfReservations_JsonNullable() { return numberOfReservations; } - public void setNumberOfReservations(Double numberOfReservations) { + @JsonProperty(JSON_PROPERTY_NUMBER_OF_RESERVATIONS) + public void setNumberOfReservations_JsonNullable(JsonNullable numberOfReservations) { this.numberOfReservations = numberOfReservations; } + public void setNumberOfReservations(Double numberOfReservations) { + this.numberOfReservations = JsonNullable.of(numberOfReservations); + } + public CommitmentsAwsEC2RICommitment offeringClass(String offeringClass) { this.offeringClass = offeringClass; return this; @@ -319,25 +340,25 @@ public void setStartDate(String startDate) { this.startDate = startDate; } - public CommitmentsAwsEC2RICommitment termLength(Double termLength) { - this.termLength = termLength; + public CommitmentsAwsEC2RICommitment termLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; return this; } /** - * The term length in years. + * The commitment term in whole months. Omitted when the term is unknown. * - * @return termLength + * @return termLengthMonths */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonProperty(JSON_PROPERTY_TERM_LENGTH_MONTHS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getTermLength() { - return termLength; + public Long getTermLengthMonths() { + return termLengthMonths; } - public void setTermLength(Double termLength) { - this.termLength = termLength; + public void setTermLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; } public CommitmentsAwsEC2RICommitment utilization(Double utilization) { @@ -346,7 +367,7 @@ public CommitmentsAwsEC2RICommitment utilization(Double utilization) { } /** - * The utilization percentage of the commitment. + * The utilization percentage of the commitment, from 0 to 100. * * @return utilization */ @@ -429,7 +450,7 @@ public boolean equals(Object o) { && Objects.equals(this.purchaseOption, commitmentsAwsEC2RiCommitment.purchaseOption) && Objects.equals(this.region, commitmentsAwsEC2RiCommitment.region) && Objects.equals(this.startDate, commitmentsAwsEC2RiCommitment.startDate) - && Objects.equals(this.termLength, commitmentsAwsEC2RiCommitment.termLength) + && Objects.equals(this.termLengthMonths, commitmentsAwsEC2RiCommitment.termLengthMonths) && Objects.equals(this.utilization, commitmentsAwsEC2RiCommitment.utilization) && Objects.equals( this.additionalProperties, commitmentsAwsEC2RiCommitment.additionalProperties); @@ -449,7 +470,7 @@ public int hashCode() { purchaseOption, region, startDate, - termLength, + termLengthMonths, utilization, additionalProperties); } @@ -471,7 +492,7 @@ public String toString() { sb.append(" purchaseOption: ").append(toIndentedString(purchaseOption)).append("\n"); sb.append(" region: ").append(toIndentedString(region)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); - sb.append(" termLength: ").append(toIndentedString(termLength)).append("\n"); + sb.append(" termLengthMonths: ").append(toIndentedString(termLengthMonths)).append("\n"); sb.append(" utilization: ").append(toIndentedString(utilization)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsElasticacheRICommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsElasticacheRICommitment.java index 6002e1df78f..7216372bb9c 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsElasticacheRICommitment.java +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsElasticacheRICommitment.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** AWS ElastiCache Reserved Instance commitment details. */ @JsonPropertyOrder({ @@ -28,7 +29,7 @@ CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_PURCHASE_OPTION, CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_REGION, CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_START_DATE, - CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_TERM_LENGTH_MONTHS, CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_UTILIZATION }) @jakarta.annotation.Generated( @@ -48,10 +49,10 @@ public class CommitmentsAwsElasticacheRICommitment { private String instanceType; public static final String JSON_PROPERTY_NUMBER_OF_NFUS = "number_of_nfus"; - private Double numberOfNfus; + private JsonNullable numberOfNfus = JsonNullable.undefined(); public static final String JSON_PROPERTY_NUMBER_OF_RESERVATIONS = "number_of_reservations"; - private Double numberOfReservations; + private JsonNullable numberOfReservations = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_OPTION = "purchase_option"; private String purchaseOption; @@ -62,8 +63,8 @@ public class CommitmentsAwsElasticacheRICommitment { public static final String JSON_PROPERTY_START_DATE = "start_date"; private String startDate; - public static final String JSON_PROPERTY_TERM_LENGTH = "term_length"; - private Double termLength; + public static final String JSON_PROPERTY_TERM_LENGTH_MONTHS = "term_length_months"; + private Long termLengthMonths; public static final String JSON_PROPERTY_UTILIZATION = "utilization"; private Double utilization; @@ -166,7 +167,7 @@ public void setInstanceType(String instanceType) { } public CommitmentsAwsElasticacheRICommitment numberOfNfus(Double numberOfNfus) { - this.numberOfNfus = numberOfNfus; + this.numberOfNfus = JsonNullable.of(numberOfNfus); return this; } @@ -176,18 +177,28 @@ public CommitmentsAwsElasticacheRICommitment numberOfNfus(Double numberOfNfus) { * @return numberOfNfus */ @jakarta.annotation.Nullable + @JsonIgnore + public Double getNumberOfNfus() { + return numberOfNfus.orElse(null); + } + @JsonProperty(JSON_PROPERTY_NUMBER_OF_NFUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getNumberOfNfus() { + public JsonNullable getNumberOfNfus_JsonNullable() { return numberOfNfus; } - public void setNumberOfNfus(Double numberOfNfus) { + @JsonProperty(JSON_PROPERTY_NUMBER_OF_NFUS) + public void setNumberOfNfus_JsonNullable(JsonNullable numberOfNfus) { this.numberOfNfus = numberOfNfus; } + public void setNumberOfNfus(Double numberOfNfus) { + this.numberOfNfus = JsonNullable.of(numberOfNfus); + } + public CommitmentsAwsElasticacheRICommitment numberOfReservations(Double numberOfReservations) { - this.numberOfReservations = numberOfReservations; + this.numberOfReservations = JsonNullable.of(numberOfReservations); return this; } @@ -197,16 +208,26 @@ public CommitmentsAwsElasticacheRICommitment numberOfReservations(Double numberO * @return numberOfReservations */ @jakarta.annotation.Nullable + @JsonIgnore + public Double getNumberOfReservations() { + return numberOfReservations.orElse(null); + } + @JsonProperty(JSON_PROPERTY_NUMBER_OF_RESERVATIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getNumberOfReservations() { + public JsonNullable getNumberOfReservations_JsonNullable() { return numberOfReservations; } - public void setNumberOfReservations(Double numberOfReservations) { + @JsonProperty(JSON_PROPERTY_NUMBER_OF_RESERVATIONS) + public void setNumberOfReservations_JsonNullable(JsonNullable numberOfReservations) { this.numberOfReservations = numberOfReservations; } + public void setNumberOfReservations(Double numberOfReservations) { + this.numberOfReservations = JsonNullable.of(numberOfReservations); + } + public CommitmentsAwsElasticacheRICommitment purchaseOption(String purchaseOption) { this.purchaseOption = purchaseOption; return this; @@ -268,25 +289,25 @@ public void setStartDate(String startDate) { this.startDate = startDate; } - public CommitmentsAwsElasticacheRICommitment termLength(Double termLength) { - this.termLength = termLength; + public CommitmentsAwsElasticacheRICommitment termLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; return this; } /** - * The term length in years. + * The commitment term in whole months. Omitted when the term is unknown. * - * @return termLength + * @return termLengthMonths */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonProperty(JSON_PROPERTY_TERM_LENGTH_MONTHS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getTermLength() { - return termLength; + public Long getTermLengthMonths() { + return termLengthMonths; } - public void setTermLength(Double termLength) { - this.termLength = termLength; + public void setTermLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; } public CommitmentsAwsElasticacheRICommitment utilization(Double utilization) { @@ -295,7 +316,7 @@ public CommitmentsAwsElasticacheRICommitment utilization(Double utilization) { } /** - * The utilization percentage of the commitment. + * The utilization percentage of the commitment, from 0 to 100. * * @return utilization */ @@ -377,7 +398,8 @@ public boolean equals(Object o) { && Objects.equals(this.purchaseOption, commitmentsAwsElasticacheRiCommitment.purchaseOption) && Objects.equals(this.region, commitmentsAwsElasticacheRiCommitment.region) && Objects.equals(this.startDate, commitmentsAwsElasticacheRiCommitment.startDate) - && Objects.equals(this.termLength, commitmentsAwsElasticacheRiCommitment.termLength) + && Objects.equals( + this.termLengthMonths, commitmentsAwsElasticacheRiCommitment.termLengthMonths) && Objects.equals(this.utilization, commitmentsAwsElasticacheRiCommitment.utilization) && Objects.equals( this.additionalProperties, commitmentsAwsElasticacheRiCommitment.additionalProperties); @@ -395,7 +417,7 @@ public int hashCode() { purchaseOption, region, startDate, - termLength, + termLengthMonths, utilization, additionalProperties); } @@ -415,7 +437,7 @@ public String toString() { sb.append(" purchaseOption: ").append(toIndentedString(purchaseOption)).append("\n"); sb.append(" region: ").append(toIndentedString(region)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); - sb.append(" termLength: ").append(toIndentedString(termLength)).append("\n"); + sb.append(" termLengthMonths: ").append(toIndentedString(termLengthMonths)).append("\n"); sb.append(" utilization: ").append(toIndentedString(utilization)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsRDSRICommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsRDSRICommitment.java index 07b7a52b03f..81473e49352 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsRDSRICommitment.java +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsRDSRICommitment.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** AWS RDS Reserved Instance commitment details. */ @JsonPropertyOrder({ @@ -29,7 +30,7 @@ CommitmentsAwsRDSRICommitment.JSON_PROPERTY_PURCHASE_OPTION, CommitmentsAwsRDSRICommitment.JSON_PROPERTY_REGION, CommitmentsAwsRDSRICommitment.JSON_PROPERTY_START_DATE, - CommitmentsAwsRDSRICommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_TERM_LENGTH_MONTHS, CommitmentsAwsRDSRICommitment.JSON_PROPERTY_UTILIZATION }) @jakarta.annotation.Generated( @@ -52,10 +53,10 @@ public class CommitmentsAwsRDSRICommitment { private Boolean isMultiAz; public static final String JSON_PROPERTY_NUMBER_OF_NFUS = "number_of_nfus"; - private Double numberOfNfus; + private JsonNullable numberOfNfus = JsonNullable.undefined(); public static final String JSON_PROPERTY_NUMBER_OF_RESERVATIONS = "number_of_reservations"; - private Double numberOfReservations; + private JsonNullable numberOfReservations = JsonNullable.undefined(); public static final String JSON_PROPERTY_PURCHASE_OPTION = "purchase_option"; private String purchaseOption; @@ -66,8 +67,8 @@ public class CommitmentsAwsRDSRICommitment { public static final String JSON_PROPERTY_START_DATE = "start_date"; private String startDate; - public static final String JSON_PROPERTY_TERM_LENGTH = "term_length"; - private Double termLength; + public static final String JSON_PROPERTY_TERM_LENGTH_MONTHS = "term_length_months"; + private Long termLengthMonths; public static final String JSON_PROPERTY_UTILIZATION = "utilization"; private Double utilization; @@ -191,7 +192,7 @@ public void setIsMultiAz(Boolean isMultiAz) { } public CommitmentsAwsRDSRICommitment numberOfNfus(Double numberOfNfus) { - this.numberOfNfus = numberOfNfus; + this.numberOfNfus = JsonNullable.of(numberOfNfus); return this; } @@ -201,18 +202,28 @@ public CommitmentsAwsRDSRICommitment numberOfNfus(Double numberOfNfus) { * @return numberOfNfus */ @jakarta.annotation.Nullable + @JsonIgnore + public Double getNumberOfNfus() { + return numberOfNfus.orElse(null); + } + @JsonProperty(JSON_PROPERTY_NUMBER_OF_NFUS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getNumberOfNfus() { + public JsonNullable getNumberOfNfus_JsonNullable() { return numberOfNfus; } - public void setNumberOfNfus(Double numberOfNfus) { + @JsonProperty(JSON_PROPERTY_NUMBER_OF_NFUS) + public void setNumberOfNfus_JsonNullable(JsonNullable numberOfNfus) { this.numberOfNfus = numberOfNfus; } + public void setNumberOfNfus(Double numberOfNfus) { + this.numberOfNfus = JsonNullable.of(numberOfNfus); + } + public CommitmentsAwsRDSRICommitment numberOfReservations(Double numberOfReservations) { - this.numberOfReservations = numberOfReservations; + this.numberOfReservations = JsonNullable.of(numberOfReservations); return this; } @@ -222,16 +233,26 @@ public CommitmentsAwsRDSRICommitment numberOfReservations(Double numberOfReserva * @return numberOfReservations */ @jakarta.annotation.Nullable + @JsonIgnore + public Double getNumberOfReservations() { + return numberOfReservations.orElse(null); + } + @JsonProperty(JSON_PROPERTY_NUMBER_OF_RESERVATIONS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getNumberOfReservations() { + public JsonNullable getNumberOfReservations_JsonNullable() { return numberOfReservations; } - public void setNumberOfReservations(Double numberOfReservations) { + @JsonProperty(JSON_PROPERTY_NUMBER_OF_RESERVATIONS) + public void setNumberOfReservations_JsonNullable(JsonNullable numberOfReservations) { this.numberOfReservations = numberOfReservations; } + public void setNumberOfReservations(Double numberOfReservations) { + this.numberOfReservations = JsonNullable.of(numberOfReservations); + } + public CommitmentsAwsRDSRICommitment purchaseOption(String purchaseOption) { this.purchaseOption = purchaseOption; return this; @@ -293,25 +314,25 @@ public void setStartDate(String startDate) { this.startDate = startDate; } - public CommitmentsAwsRDSRICommitment termLength(Double termLength) { - this.termLength = termLength; + public CommitmentsAwsRDSRICommitment termLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; return this; } /** - * The term length in years. + * The commitment term in whole months. Omitted when the term is unknown. * - * @return termLength + * @return termLengthMonths */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonProperty(JSON_PROPERTY_TERM_LENGTH_MONTHS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getTermLength() { - return termLength; + public Long getTermLengthMonths() { + return termLengthMonths; } - public void setTermLength(Double termLength) { - this.termLength = termLength; + public void setTermLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; } public CommitmentsAwsRDSRICommitment utilization(Double utilization) { @@ -320,7 +341,7 @@ public CommitmentsAwsRDSRICommitment utilization(Double utilization) { } /** - * The utilization percentage of the commitment. + * The utilization percentage of the commitment, from 0 to 100. * * @return utilization */ @@ -402,7 +423,7 @@ public boolean equals(Object o) { && Objects.equals(this.purchaseOption, commitmentsAwsRdsriCommitment.purchaseOption) && Objects.equals(this.region, commitmentsAwsRdsriCommitment.region) && Objects.equals(this.startDate, commitmentsAwsRdsriCommitment.startDate) - && Objects.equals(this.termLength, commitmentsAwsRdsriCommitment.termLength) + && Objects.equals(this.termLengthMonths, commitmentsAwsRdsriCommitment.termLengthMonths) && Objects.equals(this.utilization, commitmentsAwsRdsriCommitment.utilization) && Objects.equals( this.additionalProperties, commitmentsAwsRdsriCommitment.additionalProperties); @@ -421,7 +442,7 @@ public int hashCode() { purchaseOption, region, startDate, - termLength, + termLengthMonths, utilization, additionalProperties); } @@ -442,7 +463,7 @@ public String toString() { sb.append(" purchaseOption: ").append(toIndentedString(purchaseOption)).append("\n"); sb.append(" region: ").append(toIndentedString(region)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); - sb.append(" termLength: ").append(toIndentedString(termLength)).append("\n"); + sb.append(" termLengthMonths: ").append(toIndentedString(termLengthMonths)).append("\n"); sb.append(" utilization: ").append(toIndentedString(utilization)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsSPCommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsSPCommitment.java index b1eda2f1f8e..d0f250b6e61 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsSPCommitment.java +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsSPCommitment.java @@ -22,10 +22,12 @@ CommitmentsAwsSPCommitment.JSON_PROPERTY_COMMITMENT_ID, CommitmentsAwsSPCommitment.JSON_PROPERTY_COMMITTED_SPEND_PER_HOUR, CommitmentsAwsSPCommitment.JSON_PROPERTY_EXPIRATION_DATE, + CommitmentsAwsSPCommitment.JSON_PROPERTY_INSTANCE_TYPE_FAMILY, CommitmentsAwsSPCommitment.JSON_PROPERTY_PURCHASE_OPTION, + CommitmentsAwsSPCommitment.JSON_PROPERTY_REGION, CommitmentsAwsSPCommitment.JSON_PROPERTY_SAVINGS_PLAN_TYPE, CommitmentsAwsSPCommitment.JSON_PROPERTY_START_DATE, - CommitmentsAwsSPCommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAwsSPCommitment.JSON_PROPERTY_TERM_LENGTH_MONTHS, CommitmentsAwsSPCommitment.JSON_PROPERTY_UTILIZATION }) @jakarta.annotation.Generated( @@ -41,17 +43,23 @@ public class CommitmentsAwsSPCommitment { public static final String JSON_PROPERTY_EXPIRATION_DATE = "expiration_date"; private String expirationDate; + public static final String JSON_PROPERTY_INSTANCE_TYPE_FAMILY = "instance_type_family"; + private String instanceTypeFamily; + public static final String JSON_PROPERTY_PURCHASE_OPTION = "purchase_option"; private String purchaseOption; + public static final String JSON_PROPERTY_REGION = "region"; + private String region; + public static final String JSON_PROPERTY_SAVINGS_PLAN_TYPE = "savings_plan_type"; private String savingsPlanType; public static final String JSON_PROPERTY_START_DATE = "start_date"; private String startDate; - public static final String JSON_PROPERTY_TERM_LENGTH = "term_length"; - private Double termLength; + public static final String JSON_PROPERTY_TERM_LENGTH_MONTHS = "term_length_months"; + private Long termLengthMonths; public static final String JSON_PROPERTY_UTILIZATION = "utilization"; private Double utilization; @@ -131,6 +139,28 @@ public void setExpirationDate(String expirationDate) { this.expirationDate = expirationDate; } + public CommitmentsAwsSPCommitment instanceTypeFamily(String instanceTypeFamily) { + this.instanceTypeFamily = instanceTypeFamily; + return this; + } + + /** + * The EC2 instance family covered by the Savings Plan. Only returned for EC2 Instance Savings + * Plans. + * + * @return instanceTypeFamily + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSTANCE_TYPE_FAMILY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstanceTypeFamily() { + return instanceTypeFamily; + } + + public void setInstanceTypeFamily(String instanceTypeFamily) { + this.instanceTypeFamily = instanceTypeFamily; + } + public CommitmentsAwsSPCommitment purchaseOption(String purchaseOption) { this.purchaseOption = purchaseOption; return this; @@ -151,6 +181,27 @@ public void setPurchaseOption(String purchaseOption) { this.purchaseOption = purchaseOption; } + public CommitmentsAwsSPCommitment region(String region) { + this.region = region; + return this; + } + + /** + * The AWS region covered by the Savings Plan. Only returned for EC2 Instance Savings Plans. + * + * @return region + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + public CommitmentsAwsSPCommitment savingsPlanType(String savingsPlanType) { this.savingsPlanType = savingsPlanType; return this; @@ -192,25 +243,25 @@ public void setStartDate(String startDate) { this.startDate = startDate; } - public CommitmentsAwsSPCommitment termLength(Double termLength) { - this.termLength = termLength; + public CommitmentsAwsSPCommitment termLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; return this; } /** - * The term length in years. + * The commitment term in whole months. Omitted when the term is unknown. * - * @return termLength + * @return termLengthMonths */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonProperty(JSON_PROPERTY_TERM_LENGTH_MONTHS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getTermLength() { - return termLength; + public Long getTermLengthMonths() { + return termLengthMonths; } - public void setTermLength(Double termLength) { - this.termLength = termLength; + public void setTermLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; } public CommitmentsAwsSPCommitment utilization(Double utilization) { @@ -219,7 +270,7 @@ public CommitmentsAwsSPCommitment utilization(Double utilization) { } /** - * The utilization percentage of the commitment. + * The utilization percentage of the commitment, from 0 to 100. * * @return utilization */ @@ -294,10 +345,12 @@ public boolean equals(Object o) { && Objects.equals( this.committedSpendPerHour, commitmentsAwsSpCommitment.committedSpendPerHour) && Objects.equals(this.expirationDate, commitmentsAwsSpCommitment.expirationDate) + && Objects.equals(this.instanceTypeFamily, commitmentsAwsSpCommitment.instanceTypeFamily) && Objects.equals(this.purchaseOption, commitmentsAwsSpCommitment.purchaseOption) + && Objects.equals(this.region, commitmentsAwsSpCommitment.region) && Objects.equals(this.savingsPlanType, commitmentsAwsSpCommitment.savingsPlanType) && Objects.equals(this.startDate, commitmentsAwsSpCommitment.startDate) - && Objects.equals(this.termLength, commitmentsAwsSpCommitment.termLength) + && Objects.equals(this.termLengthMonths, commitmentsAwsSpCommitment.termLengthMonths) && Objects.equals(this.utilization, commitmentsAwsSpCommitment.utilization) && Objects.equals( this.additionalProperties, commitmentsAwsSpCommitment.additionalProperties); @@ -309,10 +362,12 @@ public int hashCode() { commitmentId, committedSpendPerHour, expirationDate, + instanceTypeFamily, purchaseOption, + region, savingsPlanType, startDate, - termLength, + termLengthMonths, utilization, additionalProperties); } @@ -326,10 +381,12 @@ public String toString() { .append(toIndentedString(committedSpendPerHour)) .append("\n"); sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" instanceTypeFamily: ").append(toIndentedString(instanceTypeFamily)).append("\n"); sb.append(" purchaseOption: ").append(toIndentedString(purchaseOption)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); sb.append(" savingsPlanType: ").append(toIndentedString(savingsPlanType)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); - sb.append(" termLength: ").append(toIndentedString(termLength)).append("\n"); + sb.append(" termLengthMonths: ").append(toIndentedString(termLengthMonths)).append("\n"); sb.append(" utilization: ").append(toIndentedString(utilization)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureComputeSPCommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureComputeSPCommitment.java index dea5ea78a03..229f0427e30 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureComputeSPCommitment.java +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureComputeSPCommitment.java @@ -23,8 +23,10 @@ CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_COMMITMENT_ID, CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_COMMITTED_SPEND_PER_HOUR, CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_EXPIRATION_DATE, + CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_PRODUCT, + CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_SAVINGS_PLAN_TYPE, CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_START_DATE, - CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_TERM_LENGTH_MONTHS, CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_UTILIZATION }) @jakarta.annotation.Generated( @@ -43,11 +45,17 @@ public class CommitmentsAzureComputeSPCommitment { public static final String JSON_PROPERTY_EXPIRATION_DATE = "expiration_date"; private String expirationDate; + public static final String JSON_PROPERTY_PRODUCT = "product"; + private String product; + + public static final String JSON_PROPERTY_SAVINGS_PLAN_TYPE = "savings_plan_type"; + private String savingsPlanType; + public static final String JSON_PROPERTY_START_DATE = "start_date"; private String startDate; - public static final String JSON_PROPERTY_TERM_LENGTH = "term_length"; - private Double termLength; + public static final String JSON_PROPERTY_TERM_LENGTH_MONTHS = "term_length_months"; + private Long termLengthMonths; public static final String JSON_PROPERTY_UTILIZATION = "utilization"; private Double utilization; @@ -144,6 +152,49 @@ public void setExpirationDate(String expirationDate) { this.expirationDate = expirationDate; } + public CommitmentsAzureComputeSPCommitment product(String product) { + this.product = product; + return this; + } + + /** + * The Azure Savings Plan product, Compute or Database, based on the + * product order name. Omitted when it cannot be classified. + * + * @return product + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRODUCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProduct() { + return product; + } + + public void setProduct(String product) { + this.product = product; + } + + public CommitmentsAzureComputeSPCommitment savingsPlanType(String savingsPlanType) { + this.savingsPlanType = savingsPlanType; + return this; + } + + /** + * The Azure Savings Plan type. + * + * @return savingsPlanType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SAVINGS_PLAN_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSavingsPlanType() { + return savingsPlanType; + } + + public void setSavingsPlanType(String savingsPlanType) { + this.savingsPlanType = savingsPlanType; + } + public CommitmentsAzureComputeSPCommitment startDate(String startDate) { this.startDate = startDate; return this; @@ -165,25 +216,25 @@ public void setStartDate(String startDate) { this.startDate = startDate; } - public CommitmentsAzureComputeSPCommitment termLength(Double termLength) { - this.termLength = termLength; + public CommitmentsAzureComputeSPCommitment termLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; return this; } /** - * The term length in years. + * The commitment term in whole months. Omitted when the term is unknown. * - * @return termLength + * @return termLengthMonths */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonProperty(JSON_PROPERTY_TERM_LENGTH_MONTHS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getTermLength() { - return termLength; + public Long getTermLengthMonths() { + return termLengthMonths; } - public void setTermLength(Double termLength) { - this.termLength = termLength; + public void setTermLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; } public CommitmentsAzureComputeSPCommitment utilization(Double utilization) { @@ -192,7 +243,7 @@ public CommitmentsAzureComputeSPCommitment utilization(Double utilization) { } /** - * The utilization percentage of the commitment. + * The utilization percentage of the commitment, from 0 to 100. * * @return utilization */ @@ -269,8 +320,11 @@ public boolean equals(Object o) { && Objects.equals( this.committedSpendPerHour, commitmentsAzureComputeSpCommitment.committedSpendPerHour) && Objects.equals(this.expirationDate, commitmentsAzureComputeSpCommitment.expirationDate) + && Objects.equals(this.product, commitmentsAzureComputeSpCommitment.product) + && Objects.equals(this.savingsPlanType, commitmentsAzureComputeSpCommitment.savingsPlanType) && Objects.equals(this.startDate, commitmentsAzureComputeSpCommitment.startDate) - && Objects.equals(this.termLength, commitmentsAzureComputeSpCommitment.termLength) + && Objects.equals( + this.termLengthMonths, commitmentsAzureComputeSpCommitment.termLengthMonths) && Objects.equals(this.utilization, commitmentsAzureComputeSpCommitment.utilization) && Objects.equals( this.additionalProperties, commitmentsAzureComputeSpCommitment.additionalProperties); @@ -283,8 +337,10 @@ public int hashCode() { commitmentId, committedSpendPerHour, expirationDate, + product, + savingsPlanType, startDate, - termLength, + termLengthMonths, utilization, additionalProperties); } @@ -299,8 +355,10 @@ public String toString() { .append(toIndentedString(committedSpendPerHour)) .append("\n"); sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" savingsPlanType: ").append(toIndentedString(savingsPlanType)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); - sb.append(" termLength: ").append(toIndentedString(termLength)).append("\n"); + sb.append(" termLengthMonths: ").append(toIndentedString(termLengthMonths)).append("\n"); sb.append(" utilization: ").append(toIndentedString(utilization)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureVMRICommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureVMRICommitment.java index 5ae6dc3ef7b..52445e6e53a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureVMRICommitment.java +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureVMRICommitment.java @@ -24,10 +24,11 @@ CommitmentsAzureVMRICommitment.JSON_PROPERTY_EXPIRATION_DATE, CommitmentsAzureVMRICommitment.JSON_PROPERTY_INSTANCE_TYPE, CommitmentsAzureVMRICommitment.JSON_PROPERTY_METER_SUB_CATEGORY, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_PRODUCT, CommitmentsAzureVMRICommitment.JSON_PROPERTY_REGION, CommitmentsAzureVMRICommitment.JSON_PROPERTY_START_DATE, CommitmentsAzureVMRICommitment.JSON_PROPERTY_STATUS, - CommitmentsAzureVMRICommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_TERM_LENGTH_MONTHS, CommitmentsAzureVMRICommitment.JSON_PROPERTY_UTILIZATION }) @jakarta.annotation.Generated( @@ -49,6 +50,9 @@ public class CommitmentsAzureVMRICommitment { public static final String JSON_PROPERTY_METER_SUB_CATEGORY = "meter_sub_category"; private String meterSubCategory; + public static final String JSON_PROPERTY_PRODUCT = "product"; + private String product; + public static final String JSON_PROPERTY_REGION = "region"; private String region; @@ -58,8 +62,8 @@ public class CommitmentsAzureVMRICommitment { public static final String JSON_PROPERTY_STATUS = "status"; private CommitmentsAzureVMRIStatus status; - public static final String JSON_PROPERTY_TERM_LENGTH = "term_length"; - private Double termLength; + public static final String JSON_PROPERTY_TERM_LENGTH_MONTHS = "term_length_months"; + private Long termLengthMonths; public static final String JSON_PROPERTY_UTILIZATION = "utilization"; private Double utilization; @@ -186,6 +190,27 @@ public void setMeterSubCategory(String meterSubCategory) { this.meterSubCategory = meterSubCategory; } + public CommitmentsAzureVMRICommitment product(String product) { + this.product = product; + return this; + } + + /** + * The Azure product of the reservation. Omitted when it cannot be classified. + * + * @return product + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRODUCT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProduct() { + return product; + } + + public void setProduct(String product) { + this.product = product; + } + public CommitmentsAzureVMRICommitment region(String region) { this.region = region; return this; @@ -251,25 +276,25 @@ public void setStatus(CommitmentsAzureVMRIStatus status) { this.status = status; } - public CommitmentsAzureVMRICommitment termLength(Double termLength) { - this.termLength = termLength; + public CommitmentsAzureVMRICommitment termLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; return this; } /** - * The term length in years. + * The commitment term in whole months. Omitted when the term is unknown. * - * @return termLength + * @return termLengthMonths */ @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonProperty(JSON_PROPERTY_TERM_LENGTH_MONTHS) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getTermLength() { - return termLength; + public Long getTermLengthMonths() { + return termLengthMonths; } - public void setTermLength(Double termLength) { - this.termLength = termLength; + public void setTermLengthMonths(Long termLengthMonths) { + this.termLengthMonths = termLengthMonths; } public CommitmentsAzureVMRICommitment utilization(Double utilization) { @@ -278,7 +303,7 @@ public CommitmentsAzureVMRICommitment utilization(Double utilization) { } /** - * The utilization percentage of the commitment. + * The utilization percentage of the commitment, from 0 to 100. * * @return utilization */ @@ -355,10 +380,11 @@ public boolean equals(Object o) { && Objects.equals(this.expirationDate, commitmentsAzureVmriCommitment.expirationDate) && Objects.equals(this.instanceType, commitmentsAzureVmriCommitment.instanceType) && Objects.equals(this.meterSubCategory, commitmentsAzureVmriCommitment.meterSubCategory) + && Objects.equals(this.product, commitmentsAzureVmriCommitment.product) && Objects.equals(this.region, commitmentsAzureVmriCommitment.region) && Objects.equals(this.startDate, commitmentsAzureVmriCommitment.startDate) && Objects.equals(this.status, commitmentsAzureVmriCommitment.status) - && Objects.equals(this.termLength, commitmentsAzureVmriCommitment.termLength) + && Objects.equals(this.termLengthMonths, commitmentsAzureVmriCommitment.termLengthMonths) && Objects.equals(this.utilization, commitmentsAzureVmriCommitment.utilization) && Objects.equals( this.additionalProperties, commitmentsAzureVmriCommitment.additionalProperties); @@ -372,10 +398,11 @@ public int hashCode() { expirationDate, instanceType, meterSubCategory, + product, region, startDate, status, - termLength, + termLengthMonths, utilization, additionalProperties); } @@ -389,10 +416,11 @@ public String toString() { sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); sb.append(" instanceType: ").append(toIndentedString(instanceType)).append("\n"); sb.append(" meterSubCategory: ").append(toIndentedString(meterSubCategory)).append("\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); sb.append(" region: ").append(toIndentedString(region)).append("\n"); sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" termLength: ").append(toIndentedString(termLength)).append("\n"); + sb.append(" termLengthMonths: ").append(toIndentedString(termLengthMonths)).append("\n"); sb.append(" utilization: ").append(toIndentedString(utilization)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsListMeta.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListMeta.java index d44b52f4762..5a2106dd2c4 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CommitmentsListMeta.java +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListMeta.java @@ -17,7 +17,10 @@ import java.util.Objects; /** Metadata for a commitments list response. */ -@JsonPropertyOrder({CommitmentsListMeta.JSON_PROPERTY_COMMITTED_SPEND_UNIT}) +@JsonPropertyOrder({ + CommitmentsListMeta.JSON_PROPERTY_COMMITTED_SPEND_UNIT, + CommitmentsListMeta.JSON_PROPERTY_UNUSED_COST_UNAVAILABLE +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class CommitmentsListMeta { @@ -25,6 +28,9 @@ public class CommitmentsListMeta { public static final String JSON_PROPERTY_COMMITTED_SPEND_UNIT = "committed_spend_unit"; private CommitmentsUnit committedSpendUnit; + public static final String JSON_PROPERTY_UNUSED_COST_UNAVAILABLE = "unused_cost_unavailable"; + private Boolean unusedCostUnavailable; + public CommitmentsListMeta committedSpendUnit(CommitmentsUnit committedSpendUnit) { this.committedSpendUnit = committedSpendUnit; this.unparsed |= committedSpendUnit.unparsed; @@ -50,6 +56,28 @@ public void setCommittedSpendUnit(CommitmentsUnit committedSpendUnit) { } } + public CommitmentsListMeta unusedCostUnavailable(Boolean unusedCostUnavailable) { + this.unusedCostUnavailable = unusedCostUnavailable; + return this; + } + + /** + * Set for Azure when the cost data lacks the unused cost of some commitments, as with exports + * scoped below the billing profile. Utilization is then overstated. + * + * @return unusedCostUnavailable + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNUSED_COST_UNAVAILABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUnusedCostUnavailable() { + return unusedCostUnavailable; + } + + public void setUnusedCostUnavailable(Boolean unusedCostUnavailable) { + this.unusedCostUnavailable = unusedCostUnavailable; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -107,12 +135,13 @@ public boolean equals(Object o) { } CommitmentsListMeta commitmentsListMeta = (CommitmentsListMeta) o; return Objects.equals(this.committedSpendUnit, commitmentsListMeta.committedSpendUnit) + && Objects.equals(this.unusedCostUnavailable, commitmentsListMeta.unusedCostUnavailable) && Objects.equals(this.additionalProperties, commitmentsListMeta.additionalProperties); } @Override public int hashCode() { - return Objects.hash(committedSpendUnit, additionalProperties); + return Objects.hash(committedSpendUnit, unusedCostUnavailable, additionalProperties); } @Override @@ -120,6 +149,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CommitmentsListMeta {\n"); sb.append(" committedSpendUnit: ").append(toIndentedString(committedSpendUnit)).append("\n"); + sb.append(" unusedCostUnavailable: ") + .append(toIndentedString(unusedCostUnavailable)) + .append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponse.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponse.java index 581111faeaf..d2054a5ab46 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponse.java @@ -13,95 +13,49 @@ 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; /** Response containing a list of cloud commitment details. */ -@JsonPropertyOrder({ - CommitmentsListResponse.JSON_PROPERTY_COMMITMENTS, - CommitmentsListResponse.JSON_PROPERTY_META -}) +@JsonPropertyOrder({CommitmentsListResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class CommitmentsListResponse { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_COMMITMENTS = "commitments"; - private List commitments = new ArrayList<>(); - - public static final String JSON_PROPERTY_META = "meta"; - private CommitmentsListMeta meta; + public static final String JSON_PROPERTY_DATA = "data"; + private CommitmentsListResponseData data; public CommitmentsListResponse() {} @JsonCreator public CommitmentsListResponse( - @JsonProperty(required = true, value = JSON_PROPERTY_COMMITMENTS) - List commitments) { - this.commitments = commitments; - for (CommitmentsListItem item : commitments) { - this.unparsed |= item.unparsed; - } + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CommitmentsListResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; } - public CommitmentsListResponse commitments(List commitments) { - this.commitments = commitments; - for (CommitmentsListItem item : commitments) { - this.unparsed |= item.unparsed; - } - return this; - } - - public CommitmentsListResponse addCommitmentsItem(CommitmentsListItem commitmentsItem) { - this.commitments.add(commitmentsItem); - this.unparsed |= commitmentsItem.unparsed; + public CommitmentsListResponse data(CommitmentsListResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; return this; } /** - * Array of commitment items. + * The commitments list resource. * - * @return commitments + * @return data */ - @JsonProperty(JSON_PROPERTY_COMMITMENTS) + @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getCommitments() { - return commitments; - } - - public void setCommitments(List commitments) { - this.commitments = commitments; - if (commitments != null) { - for (CommitmentsListItem item : commitments) { - this.unparsed |= item.unparsed; - } - } - } - - public CommitmentsListResponse meta(CommitmentsListMeta meta) { - this.meta = meta; - this.unparsed |= meta.unparsed; - return this; - } - - /** - * Metadata for a commitments list response. - * - * @return meta - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_META) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public CommitmentsListMeta getMeta() { - return meta; + public CommitmentsListResponseData getData() { + return data; } - public void setMeta(CommitmentsListMeta meta) { - this.meta = meta; - if (meta != null) { - this.unparsed |= meta.unparsed; + public void setData(CommitmentsListResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; } } @@ -161,22 +115,20 @@ public boolean equals(Object o) { return false; } CommitmentsListResponse commitmentsListResponse = (CommitmentsListResponse) o; - return Objects.equals(this.commitments, commitmentsListResponse.commitments) - && Objects.equals(this.meta, commitmentsListResponse.meta) + return Objects.equals(this.data, commitmentsListResponse.data) && Objects.equals(this.additionalProperties, commitmentsListResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(commitments, meta, additionalProperties); + return Objects.hash(data, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class CommitmentsListResponse {\n"); - sb.append(" commitments: ").append(toIndentedString(commitments)).append("\n"); - sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponseAttributes.java new file mode 100644 index 00000000000..fca0e9415a5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponseAttributes.java @@ -0,0 +1,232 @@ +/* + * 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; + +/** Attributes of a commitments list response. */ +@JsonPropertyOrder({ + CommitmentsListResponseAttributes.JSON_PROPERTY_COMMITMENTS, + CommitmentsListResponseAttributes.JSON_PROPERTY_META, + CommitmentsListResponseAttributes.JSON_PROPERTY_QUERY_DEFINITION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsListResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMMITMENTS = "commitments"; + private List commitments = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private CommitmentsListMeta meta; + + public static final String JSON_PROPERTY_QUERY_DEFINITION = "query_definition"; + private CommitmentsQueryDefinition queryDefinition; + + public CommitmentsListResponseAttributes() {} + + @JsonCreator + public CommitmentsListResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_COMMITMENTS) + List commitments) { + this.commitments = commitments; + for (CommitmentsListItem item : commitments) { + this.unparsed |= item.unparsed; + } + } + + public CommitmentsListResponseAttributes commitments(List commitments) { + this.commitments = commitments; + for (CommitmentsListItem item : commitments) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CommitmentsListResponseAttributes addCommitmentsItem(CommitmentsListItem commitmentsItem) { + this.commitments.add(commitmentsItem); + this.unparsed |= commitmentsItem.unparsed; + return this; + } + + /** + * Array of commitment items. + * + * @return commitments + */ + @JsonProperty(JSON_PROPERTY_COMMITMENTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getCommitments() { + return commitments; + } + + public void setCommitments(List commitments) { + this.commitments = commitments; + if (commitments != null) { + for (CommitmentsListItem item : commitments) { + this.unparsed |= item.unparsed; + } + } + } + + public CommitmentsListResponseAttributes meta(CommitmentsListMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for a commitments list response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CommitmentsListMeta getMeta() { + return meta; + } + + public void setMeta(CommitmentsListMeta meta) { + this.meta = meta; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + + public CommitmentsListResponseAttributes queryDefinition( + CommitmentsQueryDefinition queryDefinition) { + this.queryDefinition = queryDefinition; + this.unparsed |= queryDefinition.unparsed; + return this; + } + + /** + * The query behind the response's values, in the form dashboard and notebook widget requests + * take, so a client can graph them in a widget. Each formula's id names the response + * value it produces. + * + * @return queryDefinition + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY_DEFINITION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CommitmentsQueryDefinition getQueryDefinition() { + return queryDefinition; + } + + public void setQueryDefinition(CommitmentsQueryDefinition queryDefinition) { + this.queryDefinition = queryDefinition; + if (queryDefinition != null) { + this.unparsed |= queryDefinition.unparsed; + } + } + + /** + * 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 CommitmentsListResponseAttributes + */ + @JsonAnySetter + public CommitmentsListResponseAttributes 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 CommitmentsListResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsListResponseAttributes commitmentsListResponseAttributes = + (CommitmentsListResponseAttributes) o; + return Objects.equals(this.commitments, commitmentsListResponseAttributes.commitments) + && Objects.equals(this.meta, commitmentsListResponseAttributes.meta) + && Objects.equals(this.queryDefinition, commitmentsListResponseAttributes.queryDefinition) + && Objects.equals( + this.additionalProperties, commitmentsListResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(commitments, meta, queryDefinition, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsListResponseAttributes {\n"); + sb.append(" commitments: ").append(toIndentedString(commitments)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" queryDefinition: ").append(toIndentedString(queryDefinition)).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/CommitmentsListResponseData.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponseData.java new file mode 100644 index 00000000000..bf8c53e94b4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponseData.java @@ -0,0 +1,213 @@ +/* + * 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; + +/** The commitments list resource. */ +@JsonPropertyOrder({ + CommitmentsListResponseData.JSON_PROPERTY_ATTRIBUTES, + CommitmentsListResponseData.JSON_PROPERTY_ID, + CommitmentsListResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsListResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CommitmentsListResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CommitmentsListResponseType type = CommitmentsListResponseType.COMMITMENTS_LIST_RESPONSE; + + public CommitmentsListResponseData() {} + + @JsonCreator + public CommitmentsListResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CommitmentsListResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CommitmentsListResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CommitmentsListResponseData attributes(CommitmentsListResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a commitments list response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsListResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CommitmentsListResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public CommitmentsListResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The identifier of the commitments list response. + * + * @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 CommitmentsListResponseData type(CommitmentsListResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the commitments list response resource. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsListResponseType getType() { + return type; + } + + public void setType(CommitmentsListResponseType 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 CommitmentsListResponseData + */ + @JsonAnySetter + public CommitmentsListResponseData 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 CommitmentsListResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsListResponseData commitmentsListResponseData = (CommitmentsListResponseData) o; + return Objects.equals(this.attributes, commitmentsListResponseData.attributes) + && Objects.equals(this.id, commitmentsListResponseData.id) + && Objects.equals(this.type, commitmentsListResponseData.type) + && Objects.equals( + this.additionalProperties, commitmentsListResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsListResponseData {\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/CommitmentsListResponseType.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponseType.java new file mode 100644 index 00000000000..4162c99f919 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponseType.java @@ -0,0 +1,57 @@ +/* + * 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 the commitments list response resource. */ +@JsonSerialize(using = CommitmentsListResponseType.CommitmentsListResponseTypeSerializer.class) +public class CommitmentsListResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("commitments_list_response")); + + public static final CommitmentsListResponseType COMMITMENTS_LIST_RESPONSE = + new CommitmentsListResponseType("commitments_list_response"); + + CommitmentsListResponseType(String value) { + super(value, allowedValues); + } + + public static class CommitmentsListResponseTypeSerializer + extends StdSerializer { + public CommitmentsListResponseTypeSerializer(Class t) { + super(t); + } + + public CommitmentsListResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CommitmentsListResponseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CommitmentsListResponseType fromValue(String value) { + return new CommitmentsListResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinition.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinition.java new file mode 100644 index 00000000000..94f57d4757e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinition.java @@ -0,0 +1,217 @@ +/* + * 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; + +/** + * The query behind the response's values, in the form dashboard and notebook widget requests take, + * so a client can graph them in a widget. Each formula's id names the response value + * it produces. + */ +@JsonPropertyOrder({ + CommitmentsQueryDefinition.JSON_PROPERTY_FORMULAS, + CommitmentsQueryDefinition.JSON_PROPERTY_QUERIES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsQueryDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FORMULAS = "formulas"; + private List formulas = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUERIES = "queries"; + private List queries = new ArrayList<>(); + + public CommitmentsQueryDefinition() {} + + @JsonCreator + public CommitmentsQueryDefinition( + @JsonProperty(required = true, value = JSON_PROPERTY_FORMULAS) + List formulas, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERIES) + List queries) { + this.formulas = formulas; + for (CommitmentsQueryDefinitionFormula item : formulas) { + this.unparsed |= item.unparsed; + } + this.queries = queries; + for (CommitmentsQueryDefinitionQuery item : queries) { + this.unparsed |= item.unparsed; + } + } + + public CommitmentsQueryDefinition formulas(List formulas) { + this.formulas = formulas; + for (CommitmentsQueryDefinitionFormula item : formulas) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CommitmentsQueryDefinition addFormulasItem( + CommitmentsQueryDefinitionFormula formulasItem) { + this.formulas.add(formulasItem); + this.unparsed |= formulasItem.unparsed; + return this; + } + + /** + * The formulas of a query definition. + * + * @return formulas + */ + @JsonProperty(JSON_PROPERTY_FORMULAS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFormulas() { + return formulas; + } + + public void setFormulas(List formulas) { + this.formulas = formulas; + if (formulas != null) { + for (CommitmentsQueryDefinitionFormula item : formulas) { + this.unparsed |= item.unparsed; + } + } + } + + public CommitmentsQueryDefinition queries(List queries) { + this.queries = queries; + for (CommitmentsQueryDefinitionQuery item : queries) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CommitmentsQueryDefinition addQueriesItem(CommitmentsQueryDefinitionQuery queriesItem) { + this.queries.add(queriesItem); + this.unparsed |= queriesItem.unparsed; + return this; + } + + /** + * The metric queries of a query definition. + * + * @return queries + */ + @JsonProperty(JSON_PROPERTY_QUERIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getQueries() { + return queries; + } + + public void setQueries(List queries) { + this.queries = queries; + if (queries != null) { + for (CommitmentsQueryDefinitionQuery item : queries) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * 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 CommitmentsQueryDefinition + */ + @JsonAnySetter + public CommitmentsQueryDefinition 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 CommitmentsQueryDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsQueryDefinition commitmentsQueryDefinition = (CommitmentsQueryDefinition) o; + return Objects.equals(this.formulas, commitmentsQueryDefinition.formulas) + && Objects.equals(this.queries, commitmentsQueryDefinition.queries) + && Objects.equals( + this.additionalProperties, commitmentsQueryDefinition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(formulas, queries, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsQueryDefinition {\n"); + sb.append(" formulas: ").append(toIndentedString(formulas)).append("\n"); + sb.append(" queries: ").append(toIndentedString(queries)).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/CommitmentsQueryDefinitionAggregator.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinitionAggregator.java new file mode 100644 index 00000000000..9ddcc942c3d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinitionAggregator.java @@ -0,0 +1,66 @@ +/* + * 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; + +/** The reducer a scalar widget applies to the query. */ +@JsonSerialize( + using = + CommitmentsQueryDefinitionAggregator.CommitmentsQueryDefinitionAggregatorSerializer.class) +public class CommitmentsQueryDefinitionAggregator extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("sum", "avg", "min", "max")); + + public static final CommitmentsQueryDefinitionAggregator SUM = + new CommitmentsQueryDefinitionAggregator("sum"); + public static final CommitmentsQueryDefinitionAggregator AVG = + new CommitmentsQueryDefinitionAggregator("avg"); + public static final CommitmentsQueryDefinitionAggregator MIN = + new CommitmentsQueryDefinitionAggregator("min"); + public static final CommitmentsQueryDefinitionAggregator MAX = + new CommitmentsQueryDefinitionAggregator("max"); + + CommitmentsQueryDefinitionAggregator(String value) { + super(value, allowedValues); + } + + public static class CommitmentsQueryDefinitionAggregatorSerializer + extends StdSerializer { + public CommitmentsQueryDefinitionAggregatorSerializer( + Class t) { + super(t); + } + + public CommitmentsQueryDefinitionAggregatorSerializer() { + this(null); + } + + @Override + public void serialize( + CommitmentsQueryDefinitionAggregator value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CommitmentsQueryDefinitionAggregator fromValue(String value) { + return new CommitmentsQueryDefinitionAggregator(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinitionDataSource.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinitionDataSource.java new file mode 100644 index 00000000000..485f051019d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinitionDataSource.java @@ -0,0 +1,62 @@ +/* + * 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; + +/** The data source of the query. */ +@JsonSerialize( + using = + CommitmentsQueryDefinitionDataSource.CommitmentsQueryDefinitionDataSourceSerializer.class) +public class CommitmentsQueryDefinitionDataSource extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("cloud_cost", "metrics")); + + public static final CommitmentsQueryDefinitionDataSource CLOUD_COST = + new CommitmentsQueryDefinitionDataSource("cloud_cost"); + public static final CommitmentsQueryDefinitionDataSource METRICS = + new CommitmentsQueryDefinitionDataSource("metrics"); + + CommitmentsQueryDefinitionDataSource(String value) { + super(value, allowedValues); + } + + public static class CommitmentsQueryDefinitionDataSourceSerializer + extends StdSerializer { + public CommitmentsQueryDefinitionDataSourceSerializer( + Class t) { + super(t); + } + + public CommitmentsQueryDefinitionDataSourceSerializer() { + this(null); + } + + @Override + public void serialize( + CommitmentsQueryDefinitionDataSource value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CommitmentsQueryDefinitionDataSource fromValue(String value) { + return new CommitmentsQueryDefinitionDataSource(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinitionFormula.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinitionFormula.java new file mode 100644 index 00000000000..b482d05f7c1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinitionFormula.java @@ -0,0 +1,175 @@ +/* + * 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; + +/** A formula of a query definition. */ +@JsonPropertyOrder({ + CommitmentsQueryDefinitionFormula.JSON_PROPERTY_FORMULA, + CommitmentsQueryDefinitionFormula.JSON_PROPERTY_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsQueryDefinitionFormula { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FORMULA = "formula"; + private String formula; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public CommitmentsQueryDefinitionFormula() {} + + @JsonCreator + public CommitmentsQueryDefinitionFormula( + @JsonProperty(required = true, value = JSON_PROPERTY_FORMULA) String formula, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id) { + this.formula = formula; + this.id = id; + } + + public CommitmentsQueryDefinitionFormula formula(String formula) { + this.formula = formula; + return this; + } + + /** + * The formula expression over the named queries. + * + * @return formula + */ + @JsonProperty(JSON_PROPERTY_FORMULA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFormula() { + return formula; + } + + public void setFormula(String formula) { + this.formula = formula; + } + + public CommitmentsQueryDefinitionFormula id(String id) { + this.id = id; + return this; + } + + /** + * The name of the response value the formula produces. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + /** + * 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 CommitmentsQueryDefinitionFormula + */ + @JsonAnySetter + public CommitmentsQueryDefinitionFormula 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 CommitmentsQueryDefinitionFormula object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsQueryDefinitionFormula commitmentsQueryDefinitionFormula = + (CommitmentsQueryDefinitionFormula) o; + return Objects.equals(this.formula, commitmentsQueryDefinitionFormula.formula) + && Objects.equals(this.id, commitmentsQueryDefinitionFormula.id) + && Objects.equals( + this.additionalProperties, commitmentsQueryDefinitionFormula.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(formula, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsQueryDefinitionFormula {\n"); + sb.append(" formula: ").append(toIndentedString(formula)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).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/CommitmentsQueryDefinitionQuery.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinitionQuery.java new file mode 100644 index 00000000000..c6aa47e4538 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsQueryDefinitionQuery.java @@ -0,0 +1,245 @@ +/* + * 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; + +/** A metric query of a query definition. */ +@JsonPropertyOrder({ + CommitmentsQueryDefinitionQuery.JSON_PROPERTY_AGGREGATOR, + CommitmentsQueryDefinitionQuery.JSON_PROPERTY_DATA_SOURCE, + CommitmentsQueryDefinitionQuery.JSON_PROPERTY_NAME, + CommitmentsQueryDefinitionQuery.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsQueryDefinitionQuery { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGGREGATOR = "aggregator"; + private CommitmentsQueryDefinitionAggregator aggregator; + + public static final String JSON_PROPERTY_DATA_SOURCE = "data_source"; + private CommitmentsQueryDefinitionDataSource dataSource; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public CommitmentsQueryDefinitionQuery() {} + + @JsonCreator + public CommitmentsQueryDefinitionQuery( + @JsonProperty(required = true, value = JSON_PROPERTY_AGGREGATOR) + CommitmentsQueryDefinitionAggregator aggregator, + @JsonProperty(required = true, value = JSON_PROPERTY_DATA_SOURCE) + CommitmentsQueryDefinitionDataSource dataSource, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY) String query) { + this.aggregator = aggregator; + this.unparsed |= !aggregator.isValid(); + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + this.name = name; + this.query = query; + } + + public CommitmentsQueryDefinitionQuery aggregator( + CommitmentsQueryDefinitionAggregator aggregator) { + this.aggregator = aggregator; + this.unparsed |= !aggregator.isValid(); + return this; + } + + /** + * The reducer a scalar widget applies to the query. + * + * @return aggregator + */ + @JsonProperty(JSON_PROPERTY_AGGREGATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsQueryDefinitionAggregator getAggregator() { + return aggregator; + } + + public void setAggregator(CommitmentsQueryDefinitionAggregator aggregator) { + if (!aggregator.isValid()) { + this.unparsed = true; + } + this.aggregator = aggregator; + } + + public CommitmentsQueryDefinitionQuery dataSource( + CommitmentsQueryDefinitionDataSource dataSource) { + this.dataSource = dataSource; + this.unparsed |= !dataSource.isValid(); + return this; + } + + /** + * The data source of the query. + * + * @return dataSource + */ + @JsonProperty(JSON_PROPERTY_DATA_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsQueryDefinitionDataSource getDataSource() { + return dataSource; + } + + public void setDataSource(CommitmentsQueryDefinitionDataSource dataSource) { + if (!dataSource.isValid()) { + this.unparsed = true; + } + this.dataSource = dataSource; + } + + public CommitmentsQueryDefinitionQuery name(String name) { + this.name = name; + return this; + } + + /** + * The name formulas use to reference the query. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CommitmentsQueryDefinitionQuery query(String query) { + this.query = query; + return this; + } + + /** + * The metric query. + * + * @return query + */ + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + /** + * 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 CommitmentsQueryDefinitionQuery + */ + @JsonAnySetter + public CommitmentsQueryDefinitionQuery 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 CommitmentsQueryDefinitionQuery object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsQueryDefinitionQuery commitmentsQueryDefinitionQuery = + (CommitmentsQueryDefinitionQuery) o; + return Objects.equals(this.aggregator, commitmentsQueryDefinitionQuery.aggregator) + && Objects.equals(this.dataSource, commitmentsQueryDefinitionQuery.dataSource) + && Objects.equals(this.name, commitmentsQueryDefinitionQuery.name) + && Objects.equals(this.query, commitmentsQueryDefinitionQuery.query) + && Objects.equals( + this.additionalProperties, commitmentsQueryDefinitionQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregator, dataSource, name, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsQueryDefinitionQuery {\n"); + sb.append(" aggregator: ").append(toIndentedString(aggregator)).append("\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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 ec0defe48d7..dabf8accf8e 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 @@ -549,27 +549,31 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK - @generated @skip @team:ddoghq/cloud-cost-management + @team:ddoghq/cloud-cost-management Scenario: Get commitments list returns "Bad Request" response Given operation "GetCommitmentsCommitmentList" enabled And new "GetCommitmentsCommitmentList" request - And request contains "provider" parameter from "REPLACE.ME" - And request contains "product" parameter from "REPLACE.ME" - And request contains "start" parameter from "REPLACE.ME" - And request contains "end" parameter from "REPLACE.ME" + And request contains "provider" parameter with value "aws" + And request contains "product" parameter with value "invalid-product" + And request contains "start" parameter with value 1788220800000 + And request contains "end" parameter with value 1790812799000 When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:ddoghq/cloud-cost-management + @team:ddoghq/cloud-cost-management Scenario: Get commitments list returns "OK" response Given operation "GetCommitmentsCommitmentList" enabled And new "GetCommitmentsCommitmentList" request - And request contains "provider" parameter from "REPLACE.ME" - And request contains "product" parameter from "REPLACE.ME" - And request contains "start" parameter from "REPLACE.ME" - And request contains "end" parameter from "REPLACE.ME" + And request contains "provider" parameter with value "aws" + And request contains "product" parameter with value "ec2" + And request contains "start" parameter with value 1788220800000 + And request contains "end" parameter with value 1790812799000 + And request contains "commitmentType" parameter with value "ri" When the request is sent Then the response status is 200 OK + And the response "data.type" is equal to "commitments_list_response" + And the response "data.id" is equal to "commitments_list_response" + And the response "data.attributes" has field "commitments" @generated @skip @team:ddoghq/cloud-cost-management Scenario: Get commitments on-demand hot spots (scalar) returns "Bad Request" response diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index 79334fa3a43..85c01b5a777 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -4235,6 +4235,20 @@ "scenario": "Get a tag pipeline ruleset returns \"OK\" response", "version": "v2" }, + { + "feature": "Cloud Cost Management", + "feature_file": "../../com/datadog/api/client/v2/api/cloud_cost_management.feature", + "file": "v2/cloud-cost-management/get-commitments-list-returns-bad-request-response.json", + "scenario": "Get commitments list returns \"Bad Request\" response", + "version": "v2" + }, + { + "feature": "Cloud Cost Management", + "feature_file": "../../com/datadog/api/client/v2/api/cloud_cost_management.feature", + "file": "v2/cloud-cost-management/get-commitments-list-returns-ok-response.json", + "scenario": "Get commitments list returns \"OK\" response", + "version": "v2" + }, { "feature": "Cloud Cost Management", "feature_file": "../../com/datadog/api/client/v2/api/cloud_cost_management.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v2/cloud-cost-management/get-commitments-list-returns-bad-request-response.json b/src/test/resources/generated-test/test-runner-data/v2/cloud-cost-management/get-commitments-list-returns-bad-request-response.json new file mode 100644 index 00000000000..839c328d886 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/cloud-cost-management/get-commitments-list-returns-bad-request-response.json @@ -0,0 +1,83 @@ +{ + "api": "CloudCostManagement", + "expected_status": 400, + "feature": "Cloud Cost Management", + "id": "v2/Cloud Cost Management/Get commitments list returns \"Bad Request\" response", + "operation_id": "GetCommitmentsCommitmentList", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "query", + "name": "provider", + "required": true, + "schema": { + "format": null, + "ref": "CommitmentsProvider", + "type": "string" + }, + "source": { + "type": "literal", + "value": "aws" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "product", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "invalid-product" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "start", + "required": true, + "schema": { + "format": "int64", + "ref": null, + "type": "integer" + }, + "source": { + "type": "literal", + "value": 1788220800000 + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "end", + "required": true, + "schema": { + "format": "int64", + "ref": null, + "type": "integer" + }, + "source": { + "type": "literal", + "value": 1790812799000 + }, + "style": null + } + ], + "path": "/api/v2/cost/commitments/commitment-list" + }, + "scenario": "Get commitments list returns \"Bad Request\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/cloud-cost-management/get-commitments-list-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/cloud-cost-management/get-commitments-list-returns-ok-response.json new file mode 100644 index 00000000000..74c4d601f2d --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/cloud-cost-management/get-commitments-list-returns-ok-response.json @@ -0,0 +1,99 @@ +{ + "api": "CloudCostManagement", + "expected_status": 200, + "feature": "Cloud Cost Management", + "id": "v2/Cloud Cost Management/Get commitments list returns \"OK\" response", + "operation_id": "GetCommitmentsCommitmentList", + "request": { + "body": null, + "content_type": null, + "method": "GET", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "query", + "name": "provider", + "required": true, + "schema": { + "format": null, + "ref": "CommitmentsProvider", + "type": "string" + }, + "source": { + "type": "literal", + "value": "aws" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "product", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "type": "literal", + "value": "ec2" + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "start", + "required": true, + "schema": { + "format": "int64", + "ref": null, + "type": "integer" + }, + "source": { + "type": "literal", + "value": 1788220800000 + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "end", + "required": true, + "schema": { + "format": "int64", + "ref": null, + "type": "integer" + }, + "source": { + "type": "literal", + "value": 1790812799000 + }, + "style": null + }, + { + "explode": null, + "in": "query", + "name": "commitmentType", + "required": false, + "schema": { + "format": null, + "ref": "CommitmentsCommitmentType", + "type": "string" + }, + "source": { + "type": "literal", + "value": "ri" + }, + "style": null + } + ], + "path": "/api/v2/cost/commitments/commitment-list" + }, + "scenario": "Get commitments list returns \"OK\" response", + "schema_version": 1, + "version": "v2" +}