diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c354fca49e3..87b387fbe24 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -312,6 +312,54 @@ components: required: false schema: type: string + CommitmentsCommitmentType: + description: Type of commitment to query. ri for Reserved Instances, sp for Savings Plans. Defaults to ri. + in: query + name: commitmentType + required: false + schema: + $ref: "#/components/schemas/CommitmentsCommitmentType" + CommitmentsEnd: + description: End of the query time range in Unix milliseconds. + example: 1696118400000 + in: query + name: end + required: true + schema: + format: int64 + type: integer + CommitmentsFilterBy: + description: Optional filter expression to narrow down results. + in: query + name: filterBy + required: false + schema: + type: string + CommitmentsProduct: + description: Cloud product identifier (for example, ec2, rds, virtualmachines). + example: ec2 + in: query + name: product + required: true + schema: + type: string + CommitmentsProvider: + description: Cloud provider for commitment programs (aws or azure). + example: aws + in: query + name: provider + required: true + schema: + $ref: "#/components/schemas/CommitmentsProvider" + CommitmentsStart: + description: Start of the query time range in Unix milliseconds. + example: 1693526400000 + in: query + name: start + required: true + schema: + format: int64 + type: integer ConfluentAccountID: description: Confluent Account ID. in: path @@ -14016,6 +14064,623 @@ components: type: string x-enum-varnames: - CI_APP_COVERAGE_COMMIT_SUMMARY_REQUEST + CommitmentsAwsEC2RICommitment: + description: AWS EC2 Reserved Instance commitment details. + properties: + availability_zone: + description: The availability zone of the reservation. + example: us-east-1a + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The EC2 instance type. + example: m5.xlarge + type: string + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + offering_class: + description: The offering class of the Reserved Instance. + example: standard + type: string + operating_system: + description: The operating system of the Reserved Instance. + example: Linux + type: string + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + 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 + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - instance_type + - offering_class + - operating_system + - purchase_option + - region + type: object + CommitmentsAwsElasticacheRICommitment: + description: AWS ElastiCache Reserved Instance commitment details. + properties: + cache_engine: + description: The cache engine type of the Reserved Instance. + example: Redis + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The ElastiCache instance type. + example: cache.m5.xlarge + type: string + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + 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 + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - cache_engine + - commitment_id + - instance_type + - purchase_option + - region + type: object + CommitmentsAwsRDSRICommitment: + description: AWS RDS Reserved Instance commitment details. + properties: + commitment_id: + description: The unique identifier of the Reserved Instance. + example: ri-0123456789abcdef0 + type: string + database_engine: + description: The database engine of the Reserved Instance. + example: MySQL + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The RDS instance type. + example: db.m5.xlarge + type: string + is_multi_az: + description: Whether the Reserved Instance is Multi-AZ. + example: false + type: boolean + number_of_nfus: + description: The number of Normalized Capacity Units. + example: 8 + format: double + type: number + number_of_reservations: + description: The number of reserved instances. + example: 2 + format: double + type: number + purchase_option: + description: The payment option for the Reserved Instance. + example: All Upfront + type: string + region: + description: The AWS region of the Reserved Instance. + example: us-east-1 + 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 + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - database_engine + - instance_type + - purchase_option + - region + type: object + CommitmentsAwsSPCommitment: + description: AWS Savings Plan commitment details. + properties: + commitment_id: + description: The unique identifier of the Savings Plan. + example: arn:aws:savingsplans::123456789:savingsplan/abc123 + type: string + committed_spend_per_hour: + description: The hourly committed spend for the Savings Plan. + example: 1.5 + format: double + type: number + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + purchase_option: + description: The payment option for the Savings Plan. + example: All Upfront + type: string + savings_plan_type: + description: The Savings Plan type. + example: ComputeSavingsPlans + 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 + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - commitment_id + - purchase_option + - savings_plan_type + type: object + CommitmentsAzureComputeSPCommitment: + description: Azure Compute Savings Plan commitment details. + properties: + benefit_name: + description: The display name of the Azure Savings Plan. + example: my-compute-savings-plan + type: string + commitment_id: + description: The unique identifier of the Savings Plan. + example: /subscriptions/abc123/providers/Microsoft.BillingBenefits/savingsPlanOrders/xyz789 + type: string + committed_spend_per_hour: + description: The hourly committed spend for the Savings Plan. + example: 2.5 + format: double + type: number + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + 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 + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - benefit_name + - commitment_id + type: object + CommitmentsAzureVMRICommitment: + description: Azure Virtual Machine Reserved Instance commitment details. + properties: + benefit_name: + description: The display name of the Azure reservation. + example: my-vm-reservation + type: string + commitment_id: + description: The unique identifier of the Reserved Instance. + example: /subscriptions/abc123/providers/Microsoft.Capacity/reservationOrders/xyz789 + type: string + expiration_date: + description: The expiration date of the commitment. + example: "2025-12-31T00:00:00Z" + type: string + instance_type: + description: The Azure VM instance type. + example: Standard_D4s_v3 + type: string + meter_sub_category: + description: The Azure meter sub-category for the reservation. + example: D4s v3 + type: string + region: + description: The Azure region of the Reserved Instance. + example: eastus + type: string + start_date: + description: The start date of the commitment. + example: "2023-01-01T00:00:00Z" + type: string + status: + $ref: "#/components/schemas/CommitmentsAzureVMRIStatus" + term_length: + description: The term length in years. + example: 1 + format: double + type: number + utilization: + description: The utilization percentage of the commitment. + example: 0.85 + format: double + type: number + required: + - benefit_name + - commitment_id + - instance_type + - meter_sub_category + - region + - status + type: object + CommitmentsAzureVMRIStatus: + description: Status of an Azure VM Reserved Instance. + enum: + - running + - expired + - cancelled + example: running + type: string + x-enum-varnames: + - RUNNING + - EXPIRED + - CANCELLED + CommitmentsCommitmentType: + description: Type of commitment. ri for Reserved Instances, sp for Savings Plans. + enum: + - ri + - sp + example: ri + type: string + x-enum-varnames: + - RESERVED_INSTANCES + - SAVINGS_PLANS + CommitmentsCoverageScalarResponse: + description: Response containing scalar coverage metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + type: object + CommitmentsCoverageTimeseriesResponse: + description: Response containing timeseries coverage metrics for cloud commitment programs. + properties: + cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + hours: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + required: + - cost + - hours + type: object + CommitmentsListItem: + description: A commitment item, which varies based on the provider, product, and commitment type. + oneOf: + - $ref: "#/components/schemas/CommitmentsAwsEC2RICommitment" + - $ref: "#/components/schemas/CommitmentsAwsRDSRICommitment" + - $ref: "#/components/schemas/CommitmentsAwsElasticacheRICommitment" + - $ref: "#/components/schemas/CommitmentsAwsSPCommitment" + - $ref: "#/components/schemas/CommitmentsAzureVMRICommitment" + - $ref: "#/components/schemas/CommitmentsAzureComputeSPCommitment" + CommitmentsListItems: + description: Array of commitment items. + example: + - commitment_id: ri-0123456789abcdef0 + instance_type: m5.xlarge + offering_class: standard + operating_system: Linux + purchase_option: All Upfront + region: us-east-1 + items: + $ref: "#/components/schemas/CommitmentsListItem" + type: array + CommitmentsListMeta: + description: Metadata for a commitments list response. + properties: + committed_spend_unit: + $ref: "#/components/schemas/CommitmentsUnit" + type: object + CommitmentsListResponse: + description: Response containing a list of cloud commitment details. + properties: + commitments: + $ref: "#/components/schemas/CommitmentsListItems" + meta: + $ref: "#/components/schemas/CommitmentsListMeta" + required: + - commitments + type: object + CommitmentsOnDemandHotspotsScalarMeta: + description: Metadata for the on-demand hot-spots scalar response. + properties: + on_demand_filters: + description: Active on-demand filters applied to the response. + example: "region:us-east-1" + type: string + required: + - on_demand_filters + type: object + CommitmentsOnDemandHotspotsScalarResponse: + description: Response containing scalar on-demand hot-spots data for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + meta: + $ref: "#/components/schemas/CommitmentsOnDemandHotspotsScalarMeta" + total: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + - total + type: object + CommitmentsProvider: + description: Cloud provider for commitment programs. + enum: + - aws + - azure + example: aws + type: string + x-enum-varnames: + - AWS + - AZURE + CommitmentsSavingsScalarResponse: + description: Response containing scalar savings metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + required: + - columns + type: object + CommitmentsSavingsTimeseriesResponse: + description: Response containing timeseries savings metrics for cloud commitment programs. + properties: + actual_cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + effective_savings_rate: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + on_demand_equivalent_cost: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + realized_savings: + $ref: "#/components/schemas/CommitmentsTimeseriesMetric" + required: + - actual_cost + - effective_savings_rate + - on_demand_equivalent_cost + - realized_savings + type: object + CommitmentsScalarColumn: + description: A column in a scalar response. When type is "group", values contains arrays of strings. When type is "number", values contains numeric values. + properties: + meta: + $ref: "#/components/schemas/CommitmentsScalarColumnMeta" + name: + description: The column name. + example: utilization + type: string + type: + $ref: "#/components/schemas/CommitmentsScalarColumnType" + values: + $ref: "#/components/schemas/CommitmentsScalarColumnValueItems" + required: + - name + - type + - values + type: object + CommitmentsScalarColumnMeta: + description: Metadata for a scalar column, including unit information. + properties: + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - unit + type: object + CommitmentsScalarColumnType: + description: The column type. "group" for dimension columns, "number" for metric columns. + enum: + - group + - number + example: group + type: string + x-enum-varnames: + - GROUP + - NUMBER + CommitmentsScalarColumnValueItems: + description: Values for a scalar column. Arrays of strings for group columns, numbers for value columns. + example: + - 0.85 + - 0.72 + items: {} + type: array + CommitmentsScalarColumns: + description: Array of scalar columns in the response. + items: + $ref: "#/components/schemas/CommitmentsScalarColumn" + type: array + CommitmentsTimeseriesMetric: + description: A timeseries metric containing timestamps, series values, and optional unit metadata. + properties: + series: + $ref: "#/components/schemas/CommitmentsTimeseriesSeries" + times: + $ref: "#/components/schemas/CommitmentsTimestamps" + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - series + - times + type: object + CommitmentsTimeseriesSeries: + additionalProperties: + $ref: "#/components/schemas/CommitmentsTimeseriesValues" + description: Timeseries data as a map of series names to their corresponding value arrays. + type: object + CommitmentsTimeseriesValues: + description: A series of numeric values for a timeseries metric. + items: + format: double + type: number + type: array + CommitmentsTimestamps: + description: Unix timestamps in seconds for the timeseries data points. + example: + - 1693526400 + - 1693612800 + items: + format: int64 + type: integer + type: array + CommitmentsUnit: + description: Unit metadata for a numeric metric. + properties: + family: + description: The unit family (for example, percentage or money). + example: percentage + type: string + id: + description: The unit identifier. + example: 17 + format: int64 + type: integer + name: + description: The unit name (for example, percent or dollar). + example: percent + type: string + plural: + description: The plural form of the unit name. + example: percent + type: string + scale_factor: + description: The scale factor for the unit. + example: 1 + format: double + type: number + short_name: + description: The abbreviated unit name (for example, % or $). + example: "%" + type: string + required: + - family + - id + - name + - plural + - scale_factor + - short_name + type: object + CommitmentsUtilizationScalarProductBreakdown: + description: Array of per-product utilization breakdown entries. + items: + $ref: "#/components/schemas/CommitmentsUtilizationScalarProductBreakdownEntry" + type: array + CommitmentsUtilizationScalarProductBreakdownEntry: + description: Per-product utilization data in a scalar utilization response. + properties: + product: + description: The cloud product name. + example: ec2 + type: string + utilization: + description: The utilization percentage for the product. + example: 0.85 + format: double + type: number + required: + - product + - utilization + type: object + CommitmentsUtilizationScalarResponse: + description: Response containing scalar utilization metrics for cloud commitment programs. + properties: + columns: + $ref: "#/components/schemas/CommitmentsScalarColumns" + product_breakdown: + $ref: "#/components/schemas/CommitmentsUtilizationScalarProductBreakdown" + required: + - columns + type: object + CommitmentsUtilizationTimeseriesResponse: + description: Response containing timeseries utilization metrics for cloud commitment programs. + properties: + series: + $ref: "#/components/schemas/CommitmentsTimeseriesSeries" + times: + $ref: "#/components/schemas/CommitmentsTimestamps" + unit: + $ref: "#/components/schemas/CommitmentsUnit" + required: + - series + - times + type: object CompletionCondition: description: The definition of `CompletionCondition` object. properties: @@ -97220,6 +97885,545 @@ paths: summary: List budgets tags: - Cloud Cost Management + /api/v2/cost/commitments/commitment-list: + get: + description: Get a list of individual cloud commitments (Reserved Instances or Savings Plans) with their utilization details. The response schema varies based on the provider, product, and commitment type. + operationId: GetCommitmentsCommitmentList + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + 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 + schema: + $ref: "#/components/schemas/CommitmentsListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments list + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/coverage/scalar: + get: + description: Get scalar coverage metrics for cloud commitment programs, including hours and cost coverage percentages. + operationId: GetCommitmentsCoverageScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: hours_coverage + type: number + values: + - 0.78 + schema: + $ref: "#/components/schemas/CommitmentsCoverageScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments coverage (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/coverage/timeseries: + get: + description: Get timeseries coverage metrics for cloud commitment programs, broken down by coverage type (Reserved Instances, Savings Plans, On-Demand, and Spot) for both hours and cost. + operationId: GetCommitmentsCoverageTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + cost: + series: + on_demand_only: + - 1000.0 + - 900.0 + ri: + - 3600.0 + - 3700.0 + sp: + - 400.0 + - 400.0 + spot_only: + - 50.0 + - 50.0 + times: + - 1693526400 + - 1693612800 + hours: + series: + on_demand_only: + - 500.0 + - 450.0 + ri: + - 1800.0 + - 1850.0 + sp: + - 200.0 + - 200.0 + spot_only: + - 100.0 + - 100.0 + times: + - 1693526400 + - 1693612800 + schema: + $ref: "#/components/schemas/CommitmentsCoverageTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments coverage (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/on-demand-hot-spots/scalar: + get: + description: Get scalar on-demand hot-spots data for cloud commitment programs, showing per-dimension breakdowns of on-demand spending with coverage metrics and potential savings. + operationId: GetCommitmentsOnDemandHotspotsScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: on_demand_cost + type: number + values: + - 1500.0 + total: + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: on_demand_cost + type: number + values: + - 1500.0 + schema: + $ref: "#/components/schemas/CommitmentsOnDemandHotspotsScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments on-demand hot spots (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/savings/scalar: + get: + description: Get scalar savings metrics for cloud commitment programs, including realized savings and effective savings rate. + operationId: GetCommitmentsSavingsScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - meta: + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + name: realized_savings + type: number + values: + - 2500.0 + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: effective_savings_rate + type: number + values: + - 0.33 + schema: + $ref: "#/components/schemas/CommitmentsSavingsScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments savings (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/savings/timeseries: + get: + description: Get timeseries savings metrics for cloud commitment programs, including actual cost, on-demand equivalent cost, realized savings, and effective savings rate over time. + operationId: GetCommitmentsSavingsTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + responses: + "200": + content: + application/json: + examples: + default: + value: + actual_cost: + series: + total: + - 5000.0 + - 5200.0 + times: + - 1693526400 + - 1693612800 + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + effective_savings_rate: + series: + total: + - 0.33 + - 0.33 + times: + - 1693526400 + - 1693612800 + on_demand_equivalent_cost: + series: + total: + - 7500.0 + - 7800.0 + times: + - 1693526400 + - 1693612800 + realized_savings: + series: + total: + - 2500.0 + - 2600.0 + times: + - 1693526400 + - 1693612800 + schema: + $ref: "#/components/schemas/CommitmentsSavingsTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments savings (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/utilization/scalar: + get: + description: Get scalar utilization metrics for cloud commitment programs, including utilization percentage and unused cost. + operationId: GetCommitmentsUtilizationScalar + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + columns: + - name: service + type: group + values: + - - ec2 + - - rds + - meta: + unit: + family: percentage + id: 17 + name: percent + plural: percent + scale_factor: 1 + short_name: "%" + name: utilization + type: number + values: + - 0.85 + - 0.72 + schema: + $ref: "#/components/schemas/CommitmentsUtilizationScalarResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments utilization (scalar) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/cost/commitments/utilization/timeseries: + get: + description: Get timeseries utilization metrics for cloud commitment programs, including used and unused cost series over time. + operationId: GetCommitmentsUtilizationTimeseries + parameters: + - $ref: "#/components/parameters/CommitmentsProvider" + - $ref: "#/components/parameters/CommitmentsProduct" + - $ref: "#/components/parameters/CommitmentsStart" + - $ref: "#/components/parameters/CommitmentsEnd" + - $ref: "#/components/parameters/CommitmentsFilterBy" + - $ref: "#/components/parameters/CommitmentsCommitmentType" + responses: + "200": + content: + application/json: + examples: + default: + value: + series: + unused: + - 750.0 + - 600.0 + used: + - 4250.0 + - 4400.0 + times: + - 1693526400 + - 1693612800 + unit: + family: money + id: 1 + name: dollar + plural: dollars + scale_factor: 1 + short_name: "$" + schema: + $ref: "#/components/schemas/CommitmentsUtilizationTimeseriesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - cloud_cost_management_read + summary: Get commitments utilization (timeseries) + tags: + - Cloud Cost Management + "x-permission": + operator: OR + permissions: + - cloud_cost_management_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cost/custom_costs: get: description: List the Custom Costs files. diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.java b/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.java new file mode 100644 index 00000000000..e76ad0c7e58 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCommitmentList.java @@ -0,0 +1,29 @@ +// Get commitments list returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CommitmentsListResponse; +import com.datadog.api.client.v2.model.CommitmentsProvider; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCommitmentsCommitmentList", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CommitmentsListResponse result = + apiInstance.getCommitmentsCommitmentList( + CommitmentsProvider.AWS, "ec2", 1693526400000L, 1696118400000L); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCommitmentsCommitmentList"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.java b/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.java new file mode 100644 index 00000000000..974f3047dc4 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCoverageScalar.java @@ -0,0 +1,29 @@ +// Get commitments coverage (scalar) returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CommitmentsCoverageScalarResponse; +import com.datadog.api.client.v2.model.CommitmentsProvider; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCommitmentsCoverageScalar", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CommitmentsCoverageScalarResponse result = + apiInstance.getCommitmentsCoverageScalar( + CommitmentsProvider.AWS, "ec2", 1693526400000L, 1696118400000L); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCommitmentsCoverageScalar"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.java b/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.java new file mode 100644 index 00000000000..a9e5b51a020 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsCoverageTimeseries.java @@ -0,0 +1,29 @@ +// Get commitments coverage (timeseries) returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CommitmentsCoverageTimeseriesResponse; +import com.datadog.api.client.v2.model.CommitmentsProvider; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCommitmentsCoverageTimeseries", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CommitmentsCoverageTimeseriesResponse result = + apiInstance.getCommitmentsCoverageTimeseries( + CommitmentsProvider.AWS, "ec2", 1693526400000L, 1696118400000L); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCommitmentsCoverageTimeseries"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.java b/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.java new file mode 100644 index 00000000000..95359f2b9d5 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsOnDemandHotspotsScalar.java @@ -0,0 +1,29 @@ +// Get commitments on-demand hot spots (scalar) returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CommitmentsOnDemandHotspotsScalarResponse; +import com.datadog.api.client.v2.model.CommitmentsProvider; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCommitmentsOnDemandHotspotsScalar", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CommitmentsOnDemandHotspotsScalarResponse result = + apiInstance.getCommitmentsOnDemandHotspotsScalar( + CommitmentsProvider.AWS, "ec2", 1693526400000L, 1696118400000L); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCommitmentsOnDemandHotspotsScalar"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.java b/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.java new file mode 100644 index 00000000000..36c8e943fea --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsSavingsScalar.java @@ -0,0 +1,29 @@ +// Get commitments savings (scalar) returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CommitmentsProvider; +import com.datadog.api.client.v2.model.CommitmentsSavingsScalarResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCommitmentsSavingsScalar", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CommitmentsSavingsScalarResponse result = + apiInstance.getCommitmentsSavingsScalar( + CommitmentsProvider.AWS, "ec2", 1693526400000L, 1696118400000L); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCommitmentsSavingsScalar"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.java b/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.java new file mode 100644 index 00000000000..f6e04b6d134 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsSavingsTimeseries.java @@ -0,0 +1,29 @@ +// Get commitments savings (timeseries) returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CommitmentsProvider; +import com.datadog.api.client.v2.model.CommitmentsSavingsTimeseriesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCommitmentsSavingsTimeseries", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CommitmentsSavingsTimeseriesResponse result = + apiInstance.getCommitmentsSavingsTimeseries( + CommitmentsProvider.AWS, "ec2", 1693526400000L, 1696118400000L); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCommitmentsSavingsTimeseries"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.java b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.java new file mode 100644 index 00000000000..efd8e16611c --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationScalar.java @@ -0,0 +1,29 @@ +// Get commitments utilization (scalar) returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CommitmentsProvider; +import com.datadog.api.client.v2.model.CommitmentsUtilizationScalarResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCommitmentsUtilizationScalar", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CommitmentsUtilizationScalarResponse result = + apiInstance.getCommitmentsUtilizationScalar( + CommitmentsProvider.AWS, "ec2", 1693526400000L, 1696118400000L); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCommitmentsUtilizationScalar"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.java b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.java new file mode 100644 index 00000000000..819cfd66970 --- /dev/null +++ b/examples/v2/cloud-cost-management/GetCommitmentsUtilizationTimeseries.java @@ -0,0 +1,29 @@ +// Get commitments utilization (timeseries) returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.CloudCostManagementApi; +import com.datadog.api.client.v2.model.CommitmentsProvider; +import com.datadog.api.client.v2.model.CommitmentsUtilizationTimeseriesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getCommitmentsUtilizationTimeseries", true); + CloudCostManagementApi apiInstance = new CloudCostManagementApi(defaultClient); + + try { + CommitmentsUtilizationTimeseriesResponse result = + apiInstance.getCommitmentsUtilizationTimeseries( + CommitmentsProvider.AWS, "ec2", 1693526400000L, 1696118400000L); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling CloudCostManagementApi#getCommitmentsUtilizationTimeseries"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 91249da7223..412e469ea96 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -860,6 +860,14 @@ public class ApiClient { put("v2.getCodeCoverageBranchSummary", false); put("v2.getCodeCoverageCommitSummary", false); put("v2.getRuleBasedView", false); + put("v2.getCommitmentsCommitmentList", false); + put("v2.getCommitmentsCoverageScalar", false); + put("v2.getCommitmentsCoverageTimeseries", false); + put("v2.getCommitmentsOnDemandHotspotsScalar", false); + put("v2.getCommitmentsSavingsScalar", false); + put("v2.getCommitmentsSavingsTimeseries", false); + put("v2.getCommitmentsUtilizationScalar", false); + put("v2.getCommitmentsUtilizationTimeseries", false); put("v2.getCostAnomaly", false); put("v2.listCostAnomalies", false); put("v2.createDashboardSecureEmbed", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java index f0fabda18db..e119877a3b6 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CloudCostManagementApi.java @@ -20,6 +20,16 @@ import com.datadog.api.client.v2.model.BudgetValidationRequest; import com.datadog.api.client.v2.model.BudgetValidationResponse; import com.datadog.api.client.v2.model.BudgetWithEntries; +import com.datadog.api.client.v2.model.CommitmentsCommitmentType; +import com.datadog.api.client.v2.model.CommitmentsCoverageScalarResponse; +import com.datadog.api.client.v2.model.CommitmentsCoverageTimeseriesResponse; +import com.datadog.api.client.v2.model.CommitmentsListResponse; +import com.datadog.api.client.v2.model.CommitmentsOnDemandHotspotsScalarResponse; +import com.datadog.api.client.v2.model.CommitmentsProvider; +import com.datadog.api.client.v2.model.CommitmentsSavingsScalarResponse; +import com.datadog.api.client.v2.model.CommitmentsSavingsTimeseriesResponse; +import com.datadog.api.client.v2.model.CommitmentsUtilizationScalarResponse; +import com.datadog.api.client.v2.model.CommitmentsUtilizationTimeseriesResponse; import com.datadog.api.client.v2.model.CostAnomaliesResponse; import com.datadog.api.client.v2.model.CostAnomalyResponse; import com.datadog.api.client.v2.model.CostTagDescriptionsResponse; @@ -1847,6 +1857,2650 @@ public CompletableFuture> getBudgetWithHttpInfoAs new GenericType() {}); } + /** Manage optional parameters to getCommitmentsCommitmentList. */ + public static class GetCommitmentsCommitmentListOptionalParameters { + private String filterBy; + private CommitmentsCommitmentType commitmentType; + + /** + * Set filterBy. + * + * @param filterBy Optional filter expression to narrow down results. (optional) + * @return GetCommitmentsCommitmentListOptionalParameters + */ + public GetCommitmentsCommitmentListOptionalParameters filterBy(String filterBy) { + this.filterBy = filterBy; + return this; + } + + /** + * Set commitmentType. + * + * @param commitmentType Type of commitment to query. ri for Reserved Instances, sp for Savings + * Plans. Defaults to ri. (optional) + * @return GetCommitmentsCommitmentListOptionalParameters + */ + public GetCommitmentsCommitmentListOptionalParameters commitmentType( + CommitmentsCommitmentType commitmentType) { + this.commitmentType = commitmentType; + return this; + } + } + + /** + * Get commitments list. + * + *

See {@link #getCommitmentsCommitmentListWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CommitmentsListResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsListResponse getCommitmentsCommitmentList( + CommitmentsProvider provider, String product, Long start, Long end) throws ApiException { + return getCommitmentsCommitmentListWithHttpInfo( + provider, product, start, end, new GetCommitmentsCommitmentListOptionalParameters()) + .getData(); + } + + /** + * Get commitments list. + * + *

See {@link #getCommitmentsCommitmentListWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CompletableFuture<CommitmentsListResponse> + */ + public CompletableFuture getCommitmentsCommitmentListAsync( + CommitmentsProvider provider, String product, Long start, Long end) { + return getCommitmentsCommitmentListWithHttpInfoAsync( + provider, product, start, end, new GetCommitmentsCommitmentListOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get commitments list. + * + *

See {@link #getCommitmentsCommitmentListWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CommitmentsListResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsListResponse getCommitmentsCommitmentList( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCommitmentListOptionalParameters parameters) + throws ApiException { + return getCommitmentsCommitmentListWithHttpInfo(provider, product, start, end, parameters) + .getData(); + } + + /** + * Get commitments list. + * + *

See {@link #getCommitmentsCommitmentListWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CommitmentsListResponse> + */ + public CompletableFuture getCommitmentsCommitmentListAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCommitmentListOptionalParameters parameters) { + return getCommitmentsCommitmentListWithHttpInfoAsync(provider, product, start, end, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of individual cloud commitments (Reserved Instances or Savings Plans) with their + * utilization details. The response schema varies based on the provider, product, and commitment + * type. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CommitmentsListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse getCommitmentsCommitmentListWithHttpInfo( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCommitmentListOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCommitmentsCommitmentList"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException( + 400, + "Missing the required parameter 'provider' when calling getCommitmentsCommitmentList"); + } + + // verify the required parameter 'product' is set + if (product == null) { + throw new ApiException( + 400, + "Missing the required parameter 'product' when calling getCommitmentsCommitmentList"); + } + + // verify the required parameter 'start' is set + if (start == null) { + throw new ApiException( + 400, "Missing the required parameter 'start' when calling getCommitmentsCommitmentList"); + } + + // verify the required parameter 'end' is set + if (end == null) { + throw new ApiException( + 400, "Missing the required parameter 'end' when calling getCommitmentsCommitmentList"); + } + String filterBy = parameters.filterBy; + CommitmentsCommitmentType commitmentType = parameters.commitmentType; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/commitment-list"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "commitmentType", commitmentType)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsCommitmentList", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get commitments list. + * + *

See {@link #getCommitmentsCommitmentListWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CommitmentsListResponse>> + */ + public CompletableFuture> + getCommitmentsCommitmentListWithHttpInfoAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCommitmentListOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getCommitmentsCommitmentList"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsCommitmentList")); + return result; + } + + // verify the required parameter 'product' is set + if (product == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'product' when calling" + + " getCommitmentsCommitmentList")); + return result; + } + + // verify the required parameter 'start' is set + if (start == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'start' when calling getCommitmentsCommitmentList")); + return result; + } + + // verify the required parameter 'end' is set + if (end == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'end' when calling getCommitmentsCommitmentList")); + return result; + } + String filterBy = parameters.filterBy; + CommitmentsCommitmentType commitmentType = parameters.commitmentType; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/commitment-list"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "commitmentType", commitmentType)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsCommitmentList", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getCommitmentsCoverageScalar. */ + public static class GetCommitmentsCoverageScalarOptionalParameters { + private String filterBy; + + /** + * Set filterBy. + * + * @param filterBy Optional filter expression to narrow down results. (optional) + * @return GetCommitmentsCoverageScalarOptionalParameters + */ + public GetCommitmentsCoverageScalarOptionalParameters filterBy(String filterBy) { + this.filterBy = filterBy; + return this; + } + } + + /** + * Get commitments coverage (scalar). + * + *

See {@link #getCommitmentsCoverageScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CommitmentsCoverageScalarResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsCoverageScalarResponse getCommitmentsCoverageScalar( + CommitmentsProvider provider, String product, Long start, Long end) throws ApiException { + return getCommitmentsCoverageScalarWithHttpInfo( + provider, product, start, end, new GetCommitmentsCoverageScalarOptionalParameters()) + .getData(); + } + + /** + * Get commitments coverage (scalar). + * + *

See {@link #getCommitmentsCoverageScalarWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CompletableFuture<CommitmentsCoverageScalarResponse> + */ + public CompletableFuture getCommitmentsCoverageScalarAsync( + CommitmentsProvider provider, String product, Long start, Long end) { + return getCommitmentsCoverageScalarWithHttpInfoAsync( + provider, product, start, end, new GetCommitmentsCoverageScalarOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get commitments coverage (scalar). + * + *

See {@link #getCommitmentsCoverageScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CommitmentsCoverageScalarResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsCoverageScalarResponse getCommitmentsCoverageScalar( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCoverageScalarOptionalParameters parameters) + throws ApiException { + return getCommitmentsCoverageScalarWithHttpInfo(provider, product, start, end, parameters) + .getData(); + } + + /** + * Get commitments coverage (scalar). + * + *

See {@link #getCommitmentsCoverageScalarWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CommitmentsCoverageScalarResponse> + */ + public CompletableFuture getCommitmentsCoverageScalarAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCoverageScalarOptionalParameters parameters) { + return getCommitmentsCoverageScalarWithHttpInfoAsync(provider, product, start, end, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get scalar coverage metrics for cloud commitment programs, including hours and cost coverage + * percentages. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CommitmentsCoverageScalarResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse getCommitmentsCoverageScalarWithHttpInfo( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCoverageScalarOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCommitmentsCoverageScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException( + 400, + "Missing the required parameter 'provider' when calling getCommitmentsCoverageScalar"); + } + + // verify the required parameter 'product' is set + if (product == null) { + throw new ApiException( + 400, + "Missing the required parameter 'product' when calling getCommitmentsCoverageScalar"); + } + + // verify the required parameter 'start' is set + if (start == null) { + throw new ApiException( + 400, "Missing the required parameter 'start' when calling getCommitmentsCoverageScalar"); + } + + // verify the required parameter 'end' is set + if (end == null) { + throw new ApiException( + 400, "Missing the required parameter 'end' when calling getCommitmentsCoverageScalar"); + } + String filterBy = parameters.filterBy; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/coverage/scalar"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsCoverageScalar", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get commitments coverage (scalar). + * + *

See {@link #getCommitmentsCoverageScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CommitmentsCoverageScalarResponse>> + */ + public CompletableFuture> + getCommitmentsCoverageScalarWithHttpInfoAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCoverageScalarOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getCommitmentsCoverageScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsCoverageScalar")); + return result; + } + + // verify the required parameter 'product' is set + if (product == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'product' when calling" + + " getCommitmentsCoverageScalar")); + return result; + } + + // verify the required parameter 'start' is set + if (start == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'start' when calling getCommitmentsCoverageScalar")); + return result; + } + + // verify the required parameter 'end' is set + if (end == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'end' when calling getCommitmentsCoverageScalar")); + return result; + } + String filterBy = parameters.filterBy; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/coverage/scalar"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsCoverageScalar", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getCommitmentsCoverageTimeseries. */ + public static class GetCommitmentsCoverageTimeseriesOptionalParameters { + private String filterBy; + + /** + * Set filterBy. + * + * @param filterBy Optional filter expression to narrow down results. (optional) + * @return GetCommitmentsCoverageTimeseriesOptionalParameters + */ + public GetCommitmentsCoverageTimeseriesOptionalParameters filterBy(String filterBy) { + this.filterBy = filterBy; + return this; + } + } + + /** + * Get commitments coverage (timeseries). + * + *

See {@link #getCommitmentsCoverageTimeseriesWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CommitmentsCoverageTimeseriesResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsCoverageTimeseriesResponse getCommitmentsCoverageTimeseries( + CommitmentsProvider provider, String product, Long start, Long end) throws ApiException { + return getCommitmentsCoverageTimeseriesWithHttpInfo( + provider, product, start, end, new GetCommitmentsCoverageTimeseriesOptionalParameters()) + .getData(); + } + + /** + * Get commitments coverage (timeseries). + * + *

See {@link #getCommitmentsCoverageTimeseriesWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CompletableFuture<CommitmentsCoverageTimeseriesResponse> + */ + public CompletableFuture + getCommitmentsCoverageTimeseriesAsync( + CommitmentsProvider provider, String product, Long start, Long end) { + return getCommitmentsCoverageTimeseriesWithHttpInfoAsync( + provider, product, start, end, new GetCommitmentsCoverageTimeseriesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get commitments coverage (timeseries). + * + *

See {@link #getCommitmentsCoverageTimeseriesWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CommitmentsCoverageTimeseriesResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsCoverageTimeseriesResponse getCommitmentsCoverageTimeseries( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCoverageTimeseriesOptionalParameters parameters) + throws ApiException { + return getCommitmentsCoverageTimeseriesWithHttpInfo(provider, product, start, end, parameters) + .getData(); + } + + /** + * Get commitments coverage (timeseries). + * + *

See {@link #getCommitmentsCoverageTimeseriesWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CommitmentsCoverageTimeseriesResponse> + */ + public CompletableFuture + getCommitmentsCoverageTimeseriesAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCoverageTimeseriesOptionalParameters parameters) { + return getCommitmentsCoverageTimeseriesWithHttpInfoAsync( + provider, product, start, end, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get timeseries coverage metrics for cloud commitment programs, broken down by coverage type + * (Reserved Instances, Savings Plans, On-Demand, and Spot) for both hours and cost. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CommitmentsCoverageTimeseriesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse + getCommitmentsCoverageTimeseriesWithHttpInfo( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCoverageTimeseriesOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCommitmentsCoverageTimeseries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsCoverageTimeseries"); + } + + // verify the required parameter 'product' is set + if (product == null) { + throw new ApiException( + 400, + "Missing the required parameter 'product' when calling getCommitmentsCoverageTimeseries"); + } + + // verify the required parameter 'start' is set + if (start == null) { + throw new ApiException( + 400, + "Missing the required parameter 'start' when calling getCommitmentsCoverageTimeseries"); + } + + // verify the required parameter 'end' is set + if (end == null) { + throw new ApiException( + 400, + "Missing the required parameter 'end' when calling getCommitmentsCoverageTimeseries"); + } + String filterBy = parameters.filterBy; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/coverage/timeseries"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsCoverageTimeseries", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get commitments coverage (timeseries). + * + *

See {@link #getCommitmentsCoverageTimeseriesWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CommitmentsCoverageTimeseriesResponse>> + */ + public CompletableFuture> + getCommitmentsCoverageTimeseriesWithHttpInfoAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsCoverageTimeseriesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getCommitmentsCoverageTimeseries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsCoverageTimeseries")); + return result; + } + + // verify the required parameter 'product' is set + if (product == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'product' when calling" + + " getCommitmentsCoverageTimeseries")); + return result; + } + + // verify the required parameter 'start' is set + if (start == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'start' when calling" + + " getCommitmentsCoverageTimeseries")); + return result; + } + + // verify the required parameter 'end' is set + if (end == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'end' when calling" + + " getCommitmentsCoverageTimeseries")); + return result; + } + String filterBy = parameters.filterBy; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/coverage/timeseries"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsCoverageTimeseries", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getCommitmentsOnDemandHotspotsScalar. */ + public static class GetCommitmentsOnDemandHotspotsScalarOptionalParameters { + private String filterBy; + + /** + * Set filterBy. + * + * @param filterBy Optional filter expression to narrow down results. (optional) + * @return GetCommitmentsOnDemandHotspotsScalarOptionalParameters + */ + public GetCommitmentsOnDemandHotspotsScalarOptionalParameters filterBy(String filterBy) { + this.filterBy = filterBy; + return this; + } + } + + /** + * Get commitments on-demand hot spots (scalar). + * + *

See {@link #getCommitmentsOnDemandHotspotsScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CommitmentsOnDemandHotspotsScalarResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsOnDemandHotspotsScalarResponse getCommitmentsOnDemandHotspotsScalar( + CommitmentsProvider provider, String product, Long start, Long end) throws ApiException { + return getCommitmentsOnDemandHotspotsScalarWithHttpInfo( + provider, + product, + start, + end, + new GetCommitmentsOnDemandHotspotsScalarOptionalParameters()) + .getData(); + } + + /** + * Get commitments on-demand hot spots (scalar). + * + *

See {@link #getCommitmentsOnDemandHotspotsScalarWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CompletableFuture<CommitmentsOnDemandHotspotsScalarResponse> + */ + public CompletableFuture + getCommitmentsOnDemandHotspotsScalarAsync( + CommitmentsProvider provider, String product, Long start, Long end) { + return getCommitmentsOnDemandHotspotsScalarWithHttpInfoAsync( + provider, + product, + start, + end, + new GetCommitmentsOnDemandHotspotsScalarOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get commitments on-demand hot spots (scalar). + * + *

See {@link #getCommitmentsOnDemandHotspotsScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CommitmentsOnDemandHotspotsScalarResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsOnDemandHotspotsScalarResponse getCommitmentsOnDemandHotspotsScalar( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsOnDemandHotspotsScalarOptionalParameters parameters) + throws ApiException { + return getCommitmentsOnDemandHotspotsScalarWithHttpInfo( + provider, product, start, end, parameters) + .getData(); + } + + /** + * Get commitments on-demand hot spots (scalar). + * + *

See {@link #getCommitmentsOnDemandHotspotsScalarWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CommitmentsOnDemandHotspotsScalarResponse> + */ + public CompletableFuture + getCommitmentsOnDemandHotspotsScalarAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsOnDemandHotspotsScalarOptionalParameters parameters) { + return getCommitmentsOnDemandHotspotsScalarWithHttpInfoAsync( + provider, product, start, end, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get scalar on-demand hot-spots data for cloud commitment programs, showing per-dimension + * breakdowns of on-demand spending with coverage metrics and potential savings. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CommitmentsOnDemandHotspotsScalarResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse + getCommitmentsOnDemandHotspotsScalarWithHttpInfo( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsOnDemandHotspotsScalarOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCommitmentsOnDemandHotspotsScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsOnDemandHotspotsScalar"); + } + + // verify the required parameter 'product' is set + if (product == null) { + throw new ApiException( + 400, + "Missing the required parameter 'product' when calling" + + " getCommitmentsOnDemandHotspotsScalar"); + } + + // verify the required parameter 'start' is set + if (start == null) { + throw new ApiException( + 400, + "Missing the required parameter 'start' when calling" + + " getCommitmentsOnDemandHotspotsScalar"); + } + + // verify the required parameter 'end' is set + if (end == null) { + throw new ApiException( + 400, + "Missing the required parameter 'end' when calling getCommitmentsOnDemandHotspotsScalar"); + } + String filterBy = parameters.filterBy; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/on-demand-hot-spots/scalar"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsOnDemandHotspotsScalar", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get commitments on-demand hot spots (scalar). + * + *

See {@link #getCommitmentsOnDemandHotspotsScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CommitmentsOnDemandHotspotsScalarResponse>> + */ + public CompletableFuture> + getCommitmentsOnDemandHotspotsScalarWithHttpInfoAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsOnDemandHotspotsScalarOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getCommitmentsOnDemandHotspotsScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsOnDemandHotspotsScalar")); + return result; + } + + // verify the required parameter 'product' is set + if (product == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'product' when calling" + + " getCommitmentsOnDemandHotspotsScalar")); + return result; + } + + // verify the required parameter 'start' is set + if (start == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'start' when calling" + + " getCommitmentsOnDemandHotspotsScalar")); + return result; + } + + // verify the required parameter 'end' is set + if (end == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'end' when calling" + + " getCommitmentsOnDemandHotspotsScalar")); + return result; + } + String filterBy = parameters.filterBy; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/on-demand-hot-spots/scalar"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsOnDemandHotspotsScalar", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getCommitmentsSavingsScalar. */ + public static class GetCommitmentsSavingsScalarOptionalParameters { + private String filterBy; + + /** + * Set filterBy. + * + * @param filterBy Optional filter expression to narrow down results. (optional) + * @return GetCommitmentsSavingsScalarOptionalParameters + */ + public GetCommitmentsSavingsScalarOptionalParameters filterBy(String filterBy) { + this.filterBy = filterBy; + return this; + } + } + + /** + * Get commitments savings (scalar). + * + *

See {@link #getCommitmentsSavingsScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CommitmentsSavingsScalarResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsSavingsScalarResponse getCommitmentsSavingsScalar( + CommitmentsProvider provider, String product, Long start, Long end) throws ApiException { + return getCommitmentsSavingsScalarWithHttpInfo( + provider, product, start, end, new GetCommitmentsSavingsScalarOptionalParameters()) + .getData(); + } + + /** + * Get commitments savings (scalar). + * + *

See {@link #getCommitmentsSavingsScalarWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CompletableFuture<CommitmentsSavingsScalarResponse> + */ + public CompletableFuture getCommitmentsSavingsScalarAsync( + CommitmentsProvider provider, String product, Long start, Long end) { + return getCommitmentsSavingsScalarWithHttpInfoAsync( + provider, product, start, end, new GetCommitmentsSavingsScalarOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get commitments savings (scalar). + * + *

See {@link #getCommitmentsSavingsScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CommitmentsSavingsScalarResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsSavingsScalarResponse getCommitmentsSavingsScalar( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsSavingsScalarOptionalParameters parameters) + throws ApiException { + return getCommitmentsSavingsScalarWithHttpInfo(provider, product, start, end, parameters) + .getData(); + } + + /** + * Get commitments savings (scalar). + * + *

See {@link #getCommitmentsSavingsScalarWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CommitmentsSavingsScalarResponse> + */ + public CompletableFuture getCommitmentsSavingsScalarAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsSavingsScalarOptionalParameters parameters) { + return getCommitmentsSavingsScalarWithHttpInfoAsync(provider, product, start, end, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get scalar savings metrics for cloud commitment programs, including realized savings and + * effective savings rate. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CommitmentsSavingsScalarResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse getCommitmentsSavingsScalarWithHttpInfo( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsSavingsScalarOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCommitmentsSavingsScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException( + 400, + "Missing the required parameter 'provider' when calling getCommitmentsSavingsScalar"); + } + + // verify the required parameter 'product' is set + if (product == null) { + throw new ApiException( + 400, "Missing the required parameter 'product' when calling getCommitmentsSavingsScalar"); + } + + // verify the required parameter 'start' is set + if (start == null) { + throw new ApiException( + 400, "Missing the required parameter 'start' when calling getCommitmentsSavingsScalar"); + } + + // verify the required parameter 'end' is set + if (end == null) { + throw new ApiException( + 400, "Missing the required parameter 'end' when calling getCommitmentsSavingsScalar"); + } + String filterBy = parameters.filterBy; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/savings/scalar"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsSavingsScalar", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get commitments savings (scalar). + * + *

See {@link #getCommitmentsSavingsScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CommitmentsSavingsScalarResponse>> + */ + public CompletableFuture> + getCommitmentsSavingsScalarWithHttpInfoAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsSavingsScalarOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getCommitmentsSavingsScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsSavingsScalar")); + return result; + } + + // verify the required parameter 'product' is set + if (product == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'product' when calling getCommitmentsSavingsScalar")); + return result; + } + + // verify the required parameter 'start' is set + if (start == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'start' when calling getCommitmentsSavingsScalar")); + return result; + } + + // verify the required parameter 'end' is set + if (end == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'end' when calling getCommitmentsSavingsScalar")); + return result; + } + String filterBy = parameters.filterBy; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/savings/scalar"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsSavingsScalar", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getCommitmentsSavingsTimeseries. */ + public static class GetCommitmentsSavingsTimeseriesOptionalParameters { + private String filterBy; + + /** + * Set filterBy. + * + * @param filterBy Optional filter expression to narrow down results. (optional) + * @return GetCommitmentsSavingsTimeseriesOptionalParameters + */ + public GetCommitmentsSavingsTimeseriesOptionalParameters filterBy(String filterBy) { + this.filterBy = filterBy; + return this; + } + } + + /** + * Get commitments savings (timeseries). + * + *

See {@link #getCommitmentsSavingsTimeseriesWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CommitmentsSavingsTimeseriesResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsSavingsTimeseriesResponse getCommitmentsSavingsTimeseries( + CommitmentsProvider provider, String product, Long start, Long end) throws ApiException { + return getCommitmentsSavingsTimeseriesWithHttpInfo( + provider, product, start, end, new GetCommitmentsSavingsTimeseriesOptionalParameters()) + .getData(); + } + + /** + * Get commitments savings (timeseries). + * + *

See {@link #getCommitmentsSavingsTimeseriesWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CompletableFuture<CommitmentsSavingsTimeseriesResponse> + */ + public CompletableFuture + getCommitmentsSavingsTimeseriesAsync( + CommitmentsProvider provider, String product, Long start, Long end) { + return getCommitmentsSavingsTimeseriesWithHttpInfoAsync( + provider, product, start, end, new GetCommitmentsSavingsTimeseriesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get commitments savings (timeseries). + * + *

See {@link #getCommitmentsSavingsTimeseriesWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CommitmentsSavingsTimeseriesResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsSavingsTimeseriesResponse getCommitmentsSavingsTimeseries( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsSavingsTimeseriesOptionalParameters parameters) + throws ApiException { + return getCommitmentsSavingsTimeseriesWithHttpInfo(provider, product, start, end, parameters) + .getData(); + } + + /** + * Get commitments savings (timeseries). + * + *

See {@link #getCommitmentsSavingsTimeseriesWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CommitmentsSavingsTimeseriesResponse> + */ + public CompletableFuture + getCommitmentsSavingsTimeseriesAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsSavingsTimeseriesOptionalParameters parameters) { + return getCommitmentsSavingsTimeseriesWithHttpInfoAsync( + provider, product, start, end, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get timeseries savings metrics for cloud commitment programs, including actual cost, on-demand + * equivalent cost, realized savings, and effective savings rate over time. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CommitmentsSavingsTimeseriesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse + getCommitmentsSavingsTimeseriesWithHttpInfo( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsSavingsTimeseriesOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCommitmentsSavingsTimeseries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException( + 400, + "Missing the required parameter 'provider' when calling getCommitmentsSavingsTimeseries"); + } + + // verify the required parameter 'product' is set + if (product == null) { + throw new ApiException( + 400, + "Missing the required parameter 'product' when calling getCommitmentsSavingsTimeseries"); + } + + // verify the required parameter 'start' is set + if (start == null) { + throw new ApiException( + 400, + "Missing the required parameter 'start' when calling getCommitmentsSavingsTimeseries"); + } + + // verify the required parameter 'end' is set + if (end == null) { + throw new ApiException( + 400, "Missing the required parameter 'end' when calling getCommitmentsSavingsTimeseries"); + } + String filterBy = parameters.filterBy; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/savings/timeseries"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsSavingsTimeseries", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get commitments savings (timeseries). + * + *

See {@link #getCommitmentsSavingsTimeseriesWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CommitmentsSavingsTimeseriesResponse>> + */ + public CompletableFuture> + getCommitmentsSavingsTimeseriesWithHttpInfoAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsSavingsTimeseriesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getCommitmentsSavingsTimeseries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsSavingsTimeseries")); + return result; + } + + // verify the required parameter 'product' is set + if (product == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'product' when calling" + + " getCommitmentsSavingsTimeseries")); + return result; + } + + // verify the required parameter 'start' is set + if (start == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'start' when calling" + + " getCommitmentsSavingsTimeseries")); + return result; + } + + // verify the required parameter 'end' is set + if (end == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'end' when calling getCommitmentsSavingsTimeseries")); + return result; + } + String filterBy = parameters.filterBy; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/savings/timeseries"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsSavingsTimeseries", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getCommitmentsUtilizationScalar. */ + public static class GetCommitmentsUtilizationScalarOptionalParameters { + private String filterBy; + private CommitmentsCommitmentType commitmentType; + + /** + * Set filterBy. + * + * @param filterBy Optional filter expression to narrow down results. (optional) + * @return GetCommitmentsUtilizationScalarOptionalParameters + */ + public GetCommitmentsUtilizationScalarOptionalParameters filterBy(String filterBy) { + this.filterBy = filterBy; + return this; + } + + /** + * Set commitmentType. + * + * @param commitmentType Type of commitment to query. ri for Reserved Instances, sp for Savings + * Plans. Defaults to ri. (optional) + * @return GetCommitmentsUtilizationScalarOptionalParameters + */ + public GetCommitmentsUtilizationScalarOptionalParameters commitmentType( + CommitmentsCommitmentType commitmentType) { + this.commitmentType = commitmentType; + return this; + } + } + + /** + * Get commitments utilization (scalar). + * + *

See {@link #getCommitmentsUtilizationScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CommitmentsUtilizationScalarResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsUtilizationScalarResponse getCommitmentsUtilizationScalar( + CommitmentsProvider provider, String product, Long start, Long end) throws ApiException { + return getCommitmentsUtilizationScalarWithHttpInfo( + provider, product, start, end, new GetCommitmentsUtilizationScalarOptionalParameters()) + .getData(); + } + + /** + * Get commitments utilization (scalar). + * + *

See {@link #getCommitmentsUtilizationScalarWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CompletableFuture<CommitmentsUtilizationScalarResponse> + */ + public CompletableFuture + getCommitmentsUtilizationScalarAsync( + CommitmentsProvider provider, String product, Long start, Long end) { + return getCommitmentsUtilizationScalarWithHttpInfoAsync( + provider, product, start, end, new GetCommitmentsUtilizationScalarOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get commitments utilization (scalar). + * + *

See {@link #getCommitmentsUtilizationScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CommitmentsUtilizationScalarResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsUtilizationScalarResponse getCommitmentsUtilizationScalar( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsUtilizationScalarOptionalParameters parameters) + throws ApiException { + return getCommitmentsUtilizationScalarWithHttpInfo(provider, product, start, end, parameters) + .getData(); + } + + /** + * Get commitments utilization (scalar). + * + *

See {@link #getCommitmentsUtilizationScalarWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CommitmentsUtilizationScalarResponse> + */ + public CompletableFuture + getCommitmentsUtilizationScalarAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsUtilizationScalarOptionalParameters parameters) { + return getCommitmentsUtilizationScalarWithHttpInfoAsync( + provider, product, start, end, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get scalar utilization metrics for cloud commitment programs, including utilization percentage + * and unused cost. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CommitmentsUtilizationScalarResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse + getCommitmentsUtilizationScalarWithHttpInfo( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsUtilizationScalarOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCommitmentsUtilizationScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException( + 400, + "Missing the required parameter 'provider' when calling getCommitmentsUtilizationScalar"); + } + + // verify the required parameter 'product' is set + if (product == null) { + throw new ApiException( + 400, + "Missing the required parameter 'product' when calling getCommitmentsUtilizationScalar"); + } + + // verify the required parameter 'start' is set + if (start == null) { + throw new ApiException( + 400, + "Missing the required parameter 'start' when calling getCommitmentsUtilizationScalar"); + } + + // verify the required parameter 'end' is set + if (end == null) { + throw new ApiException( + 400, "Missing the required parameter 'end' when calling getCommitmentsUtilizationScalar"); + } + String filterBy = parameters.filterBy; + CommitmentsCommitmentType commitmentType = parameters.commitmentType; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/utilization/scalar"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "commitmentType", commitmentType)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsUtilizationScalar", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get commitments utilization (scalar). + * + *

See {@link #getCommitmentsUtilizationScalarWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CommitmentsUtilizationScalarResponse>> + */ + public CompletableFuture> + getCommitmentsUtilizationScalarWithHttpInfoAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsUtilizationScalarOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getCommitmentsUtilizationScalar"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsUtilizationScalar")); + return result; + } + + // verify the required parameter 'product' is set + if (product == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'product' when calling" + + " getCommitmentsUtilizationScalar")); + return result; + } + + // verify the required parameter 'start' is set + if (start == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'start' when calling" + + " getCommitmentsUtilizationScalar")); + return result; + } + + // verify the required parameter 'end' is set + if (end == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'end' when calling getCommitmentsUtilizationScalar")); + return result; + } + String filterBy = parameters.filterBy; + CommitmentsCommitmentType commitmentType = parameters.commitmentType; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/utilization/scalar"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "commitmentType", commitmentType)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsUtilizationScalar", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getCommitmentsUtilizationTimeseries. */ + public static class GetCommitmentsUtilizationTimeseriesOptionalParameters { + private String filterBy; + private CommitmentsCommitmentType commitmentType; + + /** + * Set filterBy. + * + * @param filterBy Optional filter expression to narrow down results. (optional) + * @return GetCommitmentsUtilizationTimeseriesOptionalParameters + */ + public GetCommitmentsUtilizationTimeseriesOptionalParameters filterBy(String filterBy) { + this.filterBy = filterBy; + return this; + } + + /** + * Set commitmentType. + * + * @param commitmentType Type of commitment to query. ri for Reserved Instances, sp for Savings + * Plans. Defaults to ri. (optional) + * @return GetCommitmentsUtilizationTimeseriesOptionalParameters + */ + public GetCommitmentsUtilizationTimeseriesOptionalParameters commitmentType( + CommitmentsCommitmentType commitmentType) { + this.commitmentType = commitmentType; + return this; + } + } + + /** + * Get commitments utilization (timeseries). + * + *

See {@link #getCommitmentsUtilizationTimeseriesWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CommitmentsUtilizationTimeseriesResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsUtilizationTimeseriesResponse getCommitmentsUtilizationTimeseries( + CommitmentsProvider provider, String product, Long start, Long end) throws ApiException { + return getCommitmentsUtilizationTimeseriesWithHttpInfo( + provider, + product, + start, + end, + new GetCommitmentsUtilizationTimeseriesOptionalParameters()) + .getData(); + } + + /** + * Get commitments utilization (timeseries). + * + *

See {@link #getCommitmentsUtilizationTimeseriesWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @return CompletableFuture<CommitmentsUtilizationTimeseriesResponse> + */ + public CompletableFuture + getCommitmentsUtilizationTimeseriesAsync( + CommitmentsProvider provider, String product, Long start, Long end) { + return getCommitmentsUtilizationTimeseriesWithHttpInfoAsync( + provider, + product, + start, + end, + new GetCommitmentsUtilizationTimeseriesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get commitments utilization (timeseries). + * + *

See {@link #getCommitmentsUtilizationTimeseriesWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CommitmentsUtilizationTimeseriesResponse + * @throws ApiException if fails to make API call + */ + public CommitmentsUtilizationTimeseriesResponse getCommitmentsUtilizationTimeseries( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsUtilizationTimeseriesOptionalParameters parameters) + throws ApiException { + return getCommitmentsUtilizationTimeseriesWithHttpInfo( + provider, product, start, end, parameters) + .getData(); + } + + /** + * Get commitments utilization (timeseries). + * + *

See {@link #getCommitmentsUtilizationTimeseriesWithHttpInfoAsync}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<CommitmentsUtilizationTimeseriesResponse> + */ + public CompletableFuture + getCommitmentsUtilizationTimeseriesAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsUtilizationTimeseriesOptionalParameters parameters) { + return getCommitmentsUtilizationTimeseriesWithHttpInfoAsync( + provider, product, start, end, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get timeseries utilization metrics for cloud commitment programs, including used and unused + * cost series over time. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<CommitmentsUtilizationTimeseriesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse + getCommitmentsUtilizationTimeseriesWithHttpInfo( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsUtilizationTimeseriesOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getCommitmentsUtilizationTimeseries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsUtilizationTimeseries"); + } + + // verify the required parameter 'product' is set + if (product == null) { + throw new ApiException( + 400, + "Missing the required parameter 'product' when calling" + + " getCommitmentsUtilizationTimeseries"); + } + + // verify the required parameter 'start' is set + if (start == null) { + throw new ApiException( + 400, + "Missing the required parameter 'start' when calling" + + " getCommitmentsUtilizationTimeseries"); + } + + // verify the required parameter 'end' is set + if (end == null) { + throw new ApiException( + 400, + "Missing the required parameter 'end' when calling getCommitmentsUtilizationTimeseries"); + } + String filterBy = parameters.filterBy; + CommitmentsCommitmentType commitmentType = parameters.commitmentType; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/utilization/timeseries"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "commitmentType", commitmentType)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsUtilizationTimeseries", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get commitments utilization (timeseries). + * + *

See {@link #getCommitmentsUtilizationTimeseriesWithHttpInfo}. + * + * @param provider Cloud provider for commitment programs (aws or azure). (required) + * @param product Cloud product identifier (for example, ec2, rds, virtualmachines). (required) + * @param start Start of the query time range in Unix milliseconds. (required) + * @param end End of the query time range in Unix milliseconds. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<CommitmentsUtilizationTimeseriesResponse>> + */ + public CompletableFuture> + getCommitmentsUtilizationTimeseriesWithHttpInfoAsync( + CommitmentsProvider provider, + String product, + Long start, + Long end, + GetCommitmentsUtilizationTimeseriesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getCommitmentsUtilizationTimeseries"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'provider' is set + if (provider == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'provider' when calling" + + " getCommitmentsUtilizationTimeseries")); + return result; + } + + // verify the required parameter 'product' is set + if (product == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'product' when calling" + + " getCommitmentsUtilizationTimeseries")); + return result; + } + + // verify the required parameter 'start' is set + if (start == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'start' when calling" + + " getCommitmentsUtilizationTimeseries")); + return result; + } + + // verify the required parameter 'end' is set + if (end == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'end' when calling" + + " getCommitmentsUtilizationTimeseries")); + return result; + } + String filterBy = parameters.filterBy; + CommitmentsCommitmentType commitmentType = parameters.commitmentType; + // create path and map variables + String localVarPath = "/api/v2/cost/commitments/utilization/timeseries"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "provider", provider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "product", product)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filterBy", filterBy)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "commitmentType", commitmentType)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.CloudCostManagementApi.getCommitmentsUtilizationTimeseries", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get cost anomaly. * 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 new file mode 100644 index 00000000000..4e18c3397ac --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsEC2RICommitment.java @@ -0,0 +1,492 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** AWS EC2 Reserved Instance commitment details. */ +@JsonPropertyOrder({ + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_AVAILABILITY_ZONE, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_COMMITMENT_ID, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_EXPIRATION_DATE, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_INSTANCE_TYPE, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_NUMBER_OF_NFUS, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_NUMBER_OF_RESERVATIONS, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_OFFERING_CLASS, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_OPERATING_SYSTEM, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_PURCHASE_OPTION, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_REGION, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_START_DATE, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAwsEC2RICommitment.JSON_PROPERTY_UTILIZATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsAwsEC2RICommitment { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AVAILABILITY_ZONE = "availability_zone"; + private String availabilityZone; + + public static final String JSON_PROPERTY_COMMITMENT_ID = "commitment_id"; + private String commitmentId; + + public static final String JSON_PROPERTY_EXPIRATION_DATE = "expiration_date"; + private String expirationDate; + + public static final String JSON_PROPERTY_INSTANCE_TYPE = "instance_type"; + private String instanceType; + + public static final String JSON_PROPERTY_NUMBER_OF_NFUS = "number_of_nfus"; + private Double numberOfNfus; + + public static final String JSON_PROPERTY_NUMBER_OF_RESERVATIONS = "number_of_reservations"; + private Double numberOfReservations; + + public static final String JSON_PROPERTY_OFFERING_CLASS = "offering_class"; + private String offeringClass; + + public static final String JSON_PROPERTY_OPERATING_SYSTEM = "operating_system"; + private String operatingSystem; + + 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_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_UTILIZATION = "utilization"; + private Double utilization; + + public CommitmentsAwsEC2RICommitment() {} + + @JsonCreator + public CommitmentsAwsEC2RICommitment( + @JsonProperty(required = true, value = JSON_PROPERTY_COMMITMENT_ID) String commitmentId, + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_TYPE) String instanceType, + @JsonProperty(required = true, value = JSON_PROPERTY_OFFERING_CLASS) String offeringClass, + @JsonProperty(required = true, value = JSON_PROPERTY_OPERATING_SYSTEM) String operatingSystem, + @JsonProperty(required = true, value = JSON_PROPERTY_PURCHASE_OPTION) String purchaseOption, + @JsonProperty(required = true, value = JSON_PROPERTY_REGION) String region) { + this.commitmentId = commitmentId; + this.instanceType = instanceType; + this.offeringClass = offeringClass; + this.operatingSystem = operatingSystem; + this.purchaseOption = purchaseOption; + this.region = region; + } + + public CommitmentsAwsEC2RICommitment availabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * The availability zone of the reservation. + * + * @return availabilityZone + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AVAILABILITY_ZONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAvailabilityZone() { + return availabilityZone; + } + + public void setAvailabilityZone(String availabilityZone) { + this.availabilityZone = availabilityZone; + } + + public CommitmentsAwsEC2RICommitment commitmentId(String commitmentId) { + this.commitmentId = commitmentId; + return this; + } + + /** + * The unique identifier of the Reserved Instance. + * + * @return commitmentId + */ + @JsonProperty(JSON_PROPERTY_COMMITMENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCommitmentId() { + return commitmentId; + } + + public void setCommitmentId(String commitmentId) { + this.commitmentId = commitmentId; + } + + public CommitmentsAwsEC2RICommitment expirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * The expiration date of the commitment. + * + * @return expirationDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + public CommitmentsAwsEC2RICommitment instanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * The EC2 instance type. + * + * @return instanceType + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInstanceType() { + return instanceType; + } + + public void setInstanceType(String instanceType) { + this.instanceType = instanceType; + } + + public CommitmentsAwsEC2RICommitment numberOfNfus(Double numberOfNfus) { + this.numberOfNfus = numberOfNfus; + return this; + } + + /** + * The number of Normalized Capacity Units. + * + * @return numberOfNfus + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER_OF_NFUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getNumberOfNfus() { + return numberOfNfus; + } + + public void setNumberOfNfus(Double numberOfNfus) { + this.numberOfNfus = numberOfNfus; + } + + public CommitmentsAwsEC2RICommitment numberOfReservations(Double numberOfReservations) { + this.numberOfReservations = numberOfReservations; + return this; + } + + /** + * The number of reserved instances. + * + * @return numberOfReservations + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER_OF_RESERVATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getNumberOfReservations() { + return numberOfReservations; + } + + public void setNumberOfReservations(Double numberOfReservations) { + this.numberOfReservations = numberOfReservations; + } + + public CommitmentsAwsEC2RICommitment offeringClass(String offeringClass) { + this.offeringClass = offeringClass; + return this; + } + + /** + * The offering class of the Reserved Instance. + * + * @return offeringClass + */ + @JsonProperty(JSON_PROPERTY_OFFERING_CLASS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOfferingClass() { + return offeringClass; + } + + public void setOfferingClass(String offeringClass) { + this.offeringClass = offeringClass; + } + + public CommitmentsAwsEC2RICommitment operatingSystem(String operatingSystem) { + this.operatingSystem = operatingSystem; + return this; + } + + /** + * The operating system of the Reserved Instance. + * + * @return operatingSystem + */ + @JsonProperty(JSON_PROPERTY_OPERATING_SYSTEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOperatingSystem() { + return operatingSystem; + } + + public void setOperatingSystem(String operatingSystem) { + this.operatingSystem = operatingSystem; + } + + public CommitmentsAwsEC2RICommitment purchaseOption(String purchaseOption) { + this.purchaseOption = purchaseOption; + return this; + } + + /** + * The payment option for the Reserved Instance. + * + * @return purchaseOption + */ + @JsonProperty(JSON_PROPERTY_PURCHASE_OPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPurchaseOption() { + return purchaseOption; + } + + public void setPurchaseOption(String purchaseOption) { + this.purchaseOption = purchaseOption; + } + + public CommitmentsAwsEC2RICommitment region(String region) { + this.region = region; + return this; + } + + /** + * The AWS region of the Reserved Instance. + * + * @return region + */ + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public CommitmentsAwsEC2RICommitment startDate(String startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the commitment. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public CommitmentsAwsEC2RICommitment termLength(Double termLength) { + this.termLength = termLength; + return this; + } + + /** + * The term length in years. + * + * @return termLength + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTermLength() { + return termLength; + } + + public void setTermLength(Double termLength) { + this.termLength = termLength; + } + + public CommitmentsAwsEC2RICommitment utilization(Double utilization) { + this.utilization = utilization; + return this; + } + + /** + * The utilization percentage of the commitment. + * + * @return utilization + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UTILIZATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getUtilization() { + return utilization; + } + + public void setUtilization(Double utilization) { + this.utilization = utilization; + } + + /** + * 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 CommitmentsAwsEC2RICommitment + */ + @JsonAnySetter + public CommitmentsAwsEC2RICommitment 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 CommitmentsAwsEC2RICommitment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsAwsEC2RICommitment commitmentsAwsEC2RiCommitment = (CommitmentsAwsEC2RICommitment) o; + return Objects.equals(this.availabilityZone, commitmentsAwsEC2RiCommitment.availabilityZone) + && Objects.equals(this.commitmentId, commitmentsAwsEC2RiCommitment.commitmentId) + && Objects.equals(this.expirationDate, commitmentsAwsEC2RiCommitment.expirationDate) + && Objects.equals(this.instanceType, commitmentsAwsEC2RiCommitment.instanceType) + && Objects.equals(this.numberOfNfus, commitmentsAwsEC2RiCommitment.numberOfNfus) + && Objects.equals( + this.numberOfReservations, commitmentsAwsEC2RiCommitment.numberOfReservations) + && Objects.equals(this.offeringClass, commitmentsAwsEC2RiCommitment.offeringClass) + && Objects.equals(this.operatingSystem, commitmentsAwsEC2RiCommitment.operatingSystem) + && 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.utilization, commitmentsAwsEC2RiCommitment.utilization) + && Objects.equals( + this.additionalProperties, commitmentsAwsEC2RiCommitment.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + availabilityZone, + commitmentId, + expirationDate, + instanceType, + numberOfNfus, + numberOfReservations, + offeringClass, + operatingSystem, + purchaseOption, + region, + startDate, + termLength, + utilization, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsAwsEC2RICommitment {\n"); + sb.append(" availabilityZone: ").append(toIndentedString(availabilityZone)).append("\n"); + sb.append(" commitmentId: ").append(toIndentedString(commitmentId)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" instanceType: ").append(toIndentedString(instanceType)).append("\n"); + sb.append(" numberOfNfus: ").append(toIndentedString(numberOfNfus)).append("\n"); + sb.append(" numberOfReservations: ") + .append(toIndentedString(numberOfReservations)) + .append("\n"); + sb.append(" offeringClass: ").append(toIndentedString(offeringClass)).append("\n"); + sb.append(" operatingSystem: ").append(toIndentedString(operatingSystem)).append("\n"); + 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(" utilization: ").append(toIndentedString(utilization)).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/CommitmentsAwsElasticacheRICommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsElasticacheRICommitment.java new file mode 100644 index 00000000000..6002e1df78f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsElasticacheRICommitment.java @@ -0,0 +1,436 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** AWS ElastiCache Reserved Instance commitment details. */ +@JsonPropertyOrder({ + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_CACHE_ENGINE, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_COMMITMENT_ID, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_EXPIRATION_DATE, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_INSTANCE_TYPE, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_NUMBER_OF_NFUS, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_NUMBER_OF_RESERVATIONS, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_PURCHASE_OPTION, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_REGION, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_START_DATE, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAwsElasticacheRICommitment.JSON_PROPERTY_UTILIZATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsAwsElasticacheRICommitment { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CACHE_ENGINE = "cache_engine"; + private String cacheEngine; + + public static final String JSON_PROPERTY_COMMITMENT_ID = "commitment_id"; + private String commitmentId; + + public static final String JSON_PROPERTY_EXPIRATION_DATE = "expiration_date"; + private String expirationDate; + + public static final String JSON_PROPERTY_INSTANCE_TYPE = "instance_type"; + private String instanceType; + + public static final String JSON_PROPERTY_NUMBER_OF_NFUS = "number_of_nfus"; + private Double numberOfNfus; + + public static final String JSON_PROPERTY_NUMBER_OF_RESERVATIONS = "number_of_reservations"; + private Double numberOfReservations; + + 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_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_UTILIZATION = "utilization"; + private Double utilization; + + public CommitmentsAwsElasticacheRICommitment() {} + + @JsonCreator + public CommitmentsAwsElasticacheRICommitment( + @JsonProperty(required = true, value = JSON_PROPERTY_CACHE_ENGINE) String cacheEngine, + @JsonProperty(required = true, value = JSON_PROPERTY_COMMITMENT_ID) String commitmentId, + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_TYPE) String instanceType, + @JsonProperty(required = true, value = JSON_PROPERTY_PURCHASE_OPTION) String purchaseOption, + @JsonProperty(required = true, value = JSON_PROPERTY_REGION) String region) { + this.cacheEngine = cacheEngine; + this.commitmentId = commitmentId; + this.instanceType = instanceType; + this.purchaseOption = purchaseOption; + this.region = region; + } + + public CommitmentsAwsElasticacheRICommitment cacheEngine(String cacheEngine) { + this.cacheEngine = cacheEngine; + return this; + } + + /** + * The cache engine type of the Reserved Instance. + * + * @return cacheEngine + */ + @JsonProperty(JSON_PROPERTY_CACHE_ENGINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCacheEngine() { + return cacheEngine; + } + + public void setCacheEngine(String cacheEngine) { + this.cacheEngine = cacheEngine; + } + + public CommitmentsAwsElasticacheRICommitment commitmentId(String commitmentId) { + this.commitmentId = commitmentId; + return this; + } + + /** + * The unique identifier of the Reserved Instance. + * + * @return commitmentId + */ + @JsonProperty(JSON_PROPERTY_COMMITMENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCommitmentId() { + return commitmentId; + } + + public void setCommitmentId(String commitmentId) { + this.commitmentId = commitmentId; + } + + public CommitmentsAwsElasticacheRICommitment expirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * The expiration date of the commitment. + * + * @return expirationDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + public CommitmentsAwsElasticacheRICommitment instanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * The ElastiCache instance type. + * + * @return instanceType + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInstanceType() { + return instanceType; + } + + public void setInstanceType(String instanceType) { + this.instanceType = instanceType; + } + + public CommitmentsAwsElasticacheRICommitment numberOfNfus(Double numberOfNfus) { + this.numberOfNfus = numberOfNfus; + return this; + } + + /** + * The number of Normalized Capacity Units. + * + * @return numberOfNfus + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER_OF_NFUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getNumberOfNfus() { + return numberOfNfus; + } + + public void setNumberOfNfus(Double numberOfNfus) { + this.numberOfNfus = numberOfNfus; + } + + public CommitmentsAwsElasticacheRICommitment numberOfReservations(Double numberOfReservations) { + this.numberOfReservations = numberOfReservations; + return this; + } + + /** + * The number of reserved instances. + * + * @return numberOfReservations + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER_OF_RESERVATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getNumberOfReservations() { + return numberOfReservations; + } + + public void setNumberOfReservations(Double numberOfReservations) { + this.numberOfReservations = numberOfReservations; + } + + public CommitmentsAwsElasticacheRICommitment purchaseOption(String purchaseOption) { + this.purchaseOption = purchaseOption; + return this; + } + + /** + * The payment option for the Reserved Instance. + * + * @return purchaseOption + */ + @JsonProperty(JSON_PROPERTY_PURCHASE_OPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPurchaseOption() { + return purchaseOption; + } + + public void setPurchaseOption(String purchaseOption) { + this.purchaseOption = purchaseOption; + } + + public CommitmentsAwsElasticacheRICommitment region(String region) { + this.region = region; + return this; + } + + /** + * The AWS region of the Reserved Instance. + * + * @return region + */ + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public CommitmentsAwsElasticacheRICommitment startDate(String startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the commitment. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public CommitmentsAwsElasticacheRICommitment termLength(Double termLength) { + this.termLength = termLength; + return this; + } + + /** + * The term length in years. + * + * @return termLength + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTermLength() { + return termLength; + } + + public void setTermLength(Double termLength) { + this.termLength = termLength; + } + + public CommitmentsAwsElasticacheRICommitment utilization(Double utilization) { + this.utilization = utilization; + return this; + } + + /** + * The utilization percentage of the commitment. + * + * @return utilization + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UTILIZATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getUtilization() { + return utilization; + } + + public void setUtilization(Double utilization) { + this.utilization = utilization; + } + + /** + * 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 CommitmentsAwsElasticacheRICommitment + */ + @JsonAnySetter + public CommitmentsAwsElasticacheRICommitment 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 CommitmentsAwsElasticacheRICommitment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsAwsElasticacheRICommitment commitmentsAwsElasticacheRiCommitment = + (CommitmentsAwsElasticacheRICommitment) o; + return Objects.equals(this.cacheEngine, commitmentsAwsElasticacheRiCommitment.cacheEngine) + && Objects.equals(this.commitmentId, commitmentsAwsElasticacheRiCommitment.commitmentId) + && Objects.equals(this.expirationDate, commitmentsAwsElasticacheRiCommitment.expirationDate) + && Objects.equals(this.instanceType, commitmentsAwsElasticacheRiCommitment.instanceType) + && Objects.equals(this.numberOfNfus, commitmentsAwsElasticacheRiCommitment.numberOfNfus) + && Objects.equals( + this.numberOfReservations, commitmentsAwsElasticacheRiCommitment.numberOfReservations) + && 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.utilization, commitmentsAwsElasticacheRiCommitment.utilization) + && Objects.equals( + this.additionalProperties, commitmentsAwsElasticacheRiCommitment.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + cacheEngine, + commitmentId, + expirationDate, + instanceType, + numberOfNfus, + numberOfReservations, + purchaseOption, + region, + startDate, + termLength, + utilization, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsAwsElasticacheRICommitment {\n"); + sb.append(" cacheEngine: ").append(toIndentedString(cacheEngine)).append("\n"); + sb.append(" commitmentId: ").append(toIndentedString(commitmentId)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" instanceType: ").append(toIndentedString(instanceType)).append("\n"); + sb.append(" numberOfNfus: ").append(toIndentedString(numberOfNfus)).append("\n"); + sb.append(" numberOfReservations: ") + .append(toIndentedString(numberOfReservations)) + .append("\n"); + 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(" utilization: ").append(toIndentedString(utilization)).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/CommitmentsAwsRDSRICommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsRDSRICommitment.java new file mode 100644 index 00000000000..07b7a52b03f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsRDSRICommitment.java @@ -0,0 +1,463 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** AWS RDS Reserved Instance commitment details. */ +@JsonPropertyOrder({ + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_COMMITMENT_ID, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_DATABASE_ENGINE, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_EXPIRATION_DATE, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_INSTANCE_TYPE, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_IS_MULTI_AZ, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_NUMBER_OF_NFUS, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_NUMBER_OF_RESERVATIONS, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_PURCHASE_OPTION, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_REGION, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_START_DATE, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAwsRDSRICommitment.JSON_PROPERTY_UTILIZATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsAwsRDSRICommitment { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMMITMENT_ID = "commitment_id"; + private String commitmentId; + + public static final String JSON_PROPERTY_DATABASE_ENGINE = "database_engine"; + private String databaseEngine; + + public static final String JSON_PROPERTY_EXPIRATION_DATE = "expiration_date"; + private String expirationDate; + + public static final String JSON_PROPERTY_INSTANCE_TYPE = "instance_type"; + private String instanceType; + + public static final String JSON_PROPERTY_IS_MULTI_AZ = "is_multi_az"; + private Boolean isMultiAz; + + public static final String JSON_PROPERTY_NUMBER_OF_NFUS = "number_of_nfus"; + private Double numberOfNfus; + + public static final String JSON_PROPERTY_NUMBER_OF_RESERVATIONS = "number_of_reservations"; + private Double numberOfReservations; + + 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_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_UTILIZATION = "utilization"; + private Double utilization; + + public CommitmentsAwsRDSRICommitment() {} + + @JsonCreator + public CommitmentsAwsRDSRICommitment( + @JsonProperty(required = true, value = JSON_PROPERTY_COMMITMENT_ID) String commitmentId, + @JsonProperty(required = true, value = JSON_PROPERTY_DATABASE_ENGINE) String databaseEngine, + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_TYPE) String instanceType, + @JsonProperty(required = true, value = JSON_PROPERTY_PURCHASE_OPTION) String purchaseOption, + @JsonProperty(required = true, value = JSON_PROPERTY_REGION) String region) { + this.commitmentId = commitmentId; + this.databaseEngine = databaseEngine; + this.instanceType = instanceType; + this.purchaseOption = purchaseOption; + this.region = region; + } + + public CommitmentsAwsRDSRICommitment commitmentId(String commitmentId) { + this.commitmentId = commitmentId; + return this; + } + + /** + * The unique identifier of the Reserved Instance. + * + * @return commitmentId + */ + @JsonProperty(JSON_PROPERTY_COMMITMENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCommitmentId() { + return commitmentId; + } + + public void setCommitmentId(String commitmentId) { + this.commitmentId = commitmentId; + } + + public CommitmentsAwsRDSRICommitment databaseEngine(String databaseEngine) { + this.databaseEngine = databaseEngine; + return this; + } + + /** + * The database engine of the Reserved Instance. + * + * @return databaseEngine + */ + @JsonProperty(JSON_PROPERTY_DATABASE_ENGINE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDatabaseEngine() { + return databaseEngine; + } + + public void setDatabaseEngine(String databaseEngine) { + this.databaseEngine = databaseEngine; + } + + public CommitmentsAwsRDSRICommitment expirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * The expiration date of the commitment. + * + * @return expirationDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + public CommitmentsAwsRDSRICommitment instanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * The RDS instance type. + * + * @return instanceType + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInstanceType() { + return instanceType; + } + + public void setInstanceType(String instanceType) { + this.instanceType = instanceType; + } + + public CommitmentsAwsRDSRICommitment isMultiAz(Boolean isMultiAz) { + this.isMultiAz = isMultiAz; + return this; + } + + /** + * Whether the Reserved Instance is Multi-AZ. + * + * @return isMultiAz + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_IS_MULTI_AZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIsMultiAz() { + return isMultiAz; + } + + public void setIsMultiAz(Boolean isMultiAz) { + this.isMultiAz = isMultiAz; + } + + public CommitmentsAwsRDSRICommitment numberOfNfus(Double numberOfNfus) { + this.numberOfNfus = numberOfNfus; + return this; + } + + /** + * The number of Normalized Capacity Units. + * + * @return numberOfNfus + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER_OF_NFUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getNumberOfNfus() { + return numberOfNfus; + } + + public void setNumberOfNfus(Double numberOfNfus) { + this.numberOfNfus = numberOfNfus; + } + + public CommitmentsAwsRDSRICommitment numberOfReservations(Double numberOfReservations) { + this.numberOfReservations = numberOfReservations; + return this; + } + + /** + * The number of reserved instances. + * + * @return numberOfReservations + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER_OF_RESERVATIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getNumberOfReservations() { + return numberOfReservations; + } + + public void setNumberOfReservations(Double numberOfReservations) { + this.numberOfReservations = numberOfReservations; + } + + public CommitmentsAwsRDSRICommitment purchaseOption(String purchaseOption) { + this.purchaseOption = purchaseOption; + return this; + } + + /** + * The payment option for the Reserved Instance. + * + * @return purchaseOption + */ + @JsonProperty(JSON_PROPERTY_PURCHASE_OPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPurchaseOption() { + return purchaseOption; + } + + public void setPurchaseOption(String purchaseOption) { + this.purchaseOption = purchaseOption; + } + + public CommitmentsAwsRDSRICommitment region(String region) { + this.region = region; + return this; + } + + /** + * The AWS region of the Reserved Instance. + * + * @return region + */ + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public CommitmentsAwsRDSRICommitment startDate(String startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the commitment. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public CommitmentsAwsRDSRICommitment termLength(Double termLength) { + this.termLength = termLength; + return this; + } + + /** + * The term length in years. + * + * @return termLength + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTermLength() { + return termLength; + } + + public void setTermLength(Double termLength) { + this.termLength = termLength; + } + + public CommitmentsAwsRDSRICommitment utilization(Double utilization) { + this.utilization = utilization; + return this; + } + + /** + * The utilization percentage of the commitment. + * + * @return utilization + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UTILIZATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getUtilization() { + return utilization; + } + + public void setUtilization(Double utilization) { + this.utilization = utilization; + } + + /** + * 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 CommitmentsAwsRDSRICommitment + */ + @JsonAnySetter + public CommitmentsAwsRDSRICommitment 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 CommitmentsAwsRDSRICommitment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsAwsRDSRICommitment commitmentsAwsRdsriCommitment = (CommitmentsAwsRDSRICommitment) o; + return Objects.equals(this.commitmentId, commitmentsAwsRdsriCommitment.commitmentId) + && Objects.equals(this.databaseEngine, commitmentsAwsRdsriCommitment.databaseEngine) + && Objects.equals(this.expirationDate, commitmentsAwsRdsriCommitment.expirationDate) + && Objects.equals(this.instanceType, commitmentsAwsRdsriCommitment.instanceType) + && Objects.equals(this.isMultiAz, commitmentsAwsRdsriCommitment.isMultiAz) + && Objects.equals(this.numberOfNfus, commitmentsAwsRdsriCommitment.numberOfNfus) + && Objects.equals( + this.numberOfReservations, commitmentsAwsRdsriCommitment.numberOfReservations) + && 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.utilization, commitmentsAwsRdsriCommitment.utilization) + && Objects.equals( + this.additionalProperties, commitmentsAwsRdsriCommitment.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + commitmentId, + databaseEngine, + expirationDate, + instanceType, + isMultiAz, + numberOfNfus, + numberOfReservations, + purchaseOption, + region, + startDate, + termLength, + utilization, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsAwsRDSRICommitment {\n"); + sb.append(" commitmentId: ").append(toIndentedString(commitmentId)).append("\n"); + sb.append(" databaseEngine: ").append(toIndentedString(databaseEngine)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" instanceType: ").append(toIndentedString(instanceType)).append("\n"); + sb.append(" isMultiAz: ").append(toIndentedString(isMultiAz)).append("\n"); + sb.append(" numberOfNfus: ").append(toIndentedString(numberOfNfus)).append("\n"); + sb.append(" numberOfReservations: ") + .append(toIndentedString(numberOfReservations)) + .append("\n"); + 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(" utilization: ").append(toIndentedString(utilization)).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/CommitmentsAwsSPCommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsSPCommitment.java new file mode 100644 index 00000000000..b1eda2f1f8e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAwsSPCommitment.java @@ -0,0 +1,350 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** AWS Savings Plan commitment details. */ +@JsonPropertyOrder({ + CommitmentsAwsSPCommitment.JSON_PROPERTY_COMMITMENT_ID, + CommitmentsAwsSPCommitment.JSON_PROPERTY_COMMITTED_SPEND_PER_HOUR, + CommitmentsAwsSPCommitment.JSON_PROPERTY_EXPIRATION_DATE, + CommitmentsAwsSPCommitment.JSON_PROPERTY_PURCHASE_OPTION, + CommitmentsAwsSPCommitment.JSON_PROPERTY_SAVINGS_PLAN_TYPE, + CommitmentsAwsSPCommitment.JSON_PROPERTY_START_DATE, + CommitmentsAwsSPCommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAwsSPCommitment.JSON_PROPERTY_UTILIZATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsAwsSPCommitment { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMMITMENT_ID = "commitment_id"; + private String commitmentId; + + public static final String JSON_PROPERTY_COMMITTED_SPEND_PER_HOUR = "committed_spend_per_hour"; + private Double committedSpendPerHour; + + public static final String JSON_PROPERTY_EXPIRATION_DATE = "expiration_date"; + private String expirationDate; + + public static final String JSON_PROPERTY_PURCHASE_OPTION = "purchase_option"; + private String purchaseOption; + + 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_UTILIZATION = "utilization"; + private Double utilization; + + public CommitmentsAwsSPCommitment() {} + + @JsonCreator + public CommitmentsAwsSPCommitment( + @JsonProperty(required = true, value = JSON_PROPERTY_COMMITMENT_ID) String commitmentId, + @JsonProperty(required = true, value = JSON_PROPERTY_PURCHASE_OPTION) String purchaseOption, + @JsonProperty(required = true, value = JSON_PROPERTY_SAVINGS_PLAN_TYPE) + String savingsPlanType) { + this.commitmentId = commitmentId; + this.purchaseOption = purchaseOption; + this.savingsPlanType = savingsPlanType; + } + + public CommitmentsAwsSPCommitment commitmentId(String commitmentId) { + this.commitmentId = commitmentId; + return this; + } + + /** + * The unique identifier of the Savings Plan. + * + * @return commitmentId + */ + @JsonProperty(JSON_PROPERTY_COMMITMENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCommitmentId() { + return commitmentId; + } + + public void setCommitmentId(String commitmentId) { + this.commitmentId = commitmentId; + } + + public CommitmentsAwsSPCommitment committedSpendPerHour(Double committedSpendPerHour) { + this.committedSpendPerHour = committedSpendPerHour; + return this; + } + + /** + * The hourly committed spend for the Savings Plan. + * + * @return committedSpendPerHour + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMITTED_SPEND_PER_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCommittedSpendPerHour() { + return committedSpendPerHour; + } + + public void setCommittedSpendPerHour(Double committedSpendPerHour) { + this.committedSpendPerHour = committedSpendPerHour; + } + + public CommitmentsAwsSPCommitment expirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * The expiration date of the commitment. + * + * @return expirationDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + public CommitmentsAwsSPCommitment purchaseOption(String purchaseOption) { + this.purchaseOption = purchaseOption; + return this; + } + + /** + * The payment option for the Savings Plan. + * + * @return purchaseOption + */ + @JsonProperty(JSON_PROPERTY_PURCHASE_OPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPurchaseOption() { + return purchaseOption; + } + + public void setPurchaseOption(String purchaseOption) { + this.purchaseOption = purchaseOption; + } + + public CommitmentsAwsSPCommitment savingsPlanType(String savingsPlanType) { + this.savingsPlanType = savingsPlanType; + return this; + } + + /** + * The Savings Plan type. + * + * @return savingsPlanType + */ + @JsonProperty(JSON_PROPERTY_SAVINGS_PLAN_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSavingsPlanType() { + return savingsPlanType; + } + + public void setSavingsPlanType(String savingsPlanType) { + this.savingsPlanType = savingsPlanType; + } + + public CommitmentsAwsSPCommitment startDate(String startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the commitment. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public CommitmentsAwsSPCommitment termLength(Double termLength) { + this.termLength = termLength; + return this; + } + + /** + * The term length in years. + * + * @return termLength + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTermLength() { + return termLength; + } + + public void setTermLength(Double termLength) { + this.termLength = termLength; + } + + public CommitmentsAwsSPCommitment utilization(Double utilization) { + this.utilization = utilization; + return this; + } + + /** + * The utilization percentage of the commitment. + * + * @return utilization + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UTILIZATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getUtilization() { + return utilization; + } + + public void setUtilization(Double utilization) { + this.utilization = utilization; + } + + /** + * 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 CommitmentsAwsSPCommitment + */ + @JsonAnySetter + public CommitmentsAwsSPCommitment 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 CommitmentsAwsSPCommitment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsAwsSPCommitment commitmentsAwsSpCommitment = (CommitmentsAwsSPCommitment) o; + return Objects.equals(this.commitmentId, commitmentsAwsSpCommitment.commitmentId) + && Objects.equals( + this.committedSpendPerHour, commitmentsAwsSpCommitment.committedSpendPerHour) + && Objects.equals(this.expirationDate, commitmentsAwsSpCommitment.expirationDate) + && Objects.equals(this.purchaseOption, commitmentsAwsSpCommitment.purchaseOption) + && Objects.equals(this.savingsPlanType, commitmentsAwsSpCommitment.savingsPlanType) + && Objects.equals(this.startDate, commitmentsAwsSpCommitment.startDate) + && Objects.equals(this.termLength, commitmentsAwsSpCommitment.termLength) + && Objects.equals(this.utilization, commitmentsAwsSpCommitment.utilization) + && Objects.equals( + this.additionalProperties, commitmentsAwsSpCommitment.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + commitmentId, + committedSpendPerHour, + expirationDate, + purchaseOption, + savingsPlanType, + startDate, + termLength, + utilization, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsAwsSPCommitment {\n"); + sb.append(" commitmentId: ").append(toIndentedString(commitmentId)).append("\n"); + sb.append(" committedSpendPerHour: ") + .append(toIndentedString(committedSpendPerHour)) + .append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" purchaseOption: ").append(toIndentedString(purchaseOption)).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(" utilization: ").append(toIndentedString(utilization)).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/CommitmentsAzureComputeSPCommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureComputeSPCommitment.java new file mode 100644 index 00000000000..dea5ea78a03 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureComputeSPCommitment.java @@ -0,0 +1,321 @@ +/* + * 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; + +/** Azure Compute Savings Plan commitment details. */ +@JsonPropertyOrder({ + CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_BENEFIT_NAME, + CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_COMMITMENT_ID, + CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_COMMITTED_SPEND_PER_HOUR, + CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_EXPIRATION_DATE, + CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_START_DATE, + CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAzureComputeSPCommitment.JSON_PROPERTY_UTILIZATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsAzureComputeSPCommitment { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BENEFIT_NAME = "benefit_name"; + private String benefitName; + + public static final String JSON_PROPERTY_COMMITMENT_ID = "commitment_id"; + private String commitmentId; + + public static final String JSON_PROPERTY_COMMITTED_SPEND_PER_HOUR = "committed_spend_per_hour"; + private Double committedSpendPerHour; + + public static final String JSON_PROPERTY_EXPIRATION_DATE = "expiration_date"; + private String expirationDate; + + 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_UTILIZATION = "utilization"; + private Double utilization; + + public CommitmentsAzureComputeSPCommitment() {} + + @JsonCreator + public CommitmentsAzureComputeSPCommitment( + @JsonProperty(required = true, value = JSON_PROPERTY_BENEFIT_NAME) String benefitName, + @JsonProperty(required = true, value = JSON_PROPERTY_COMMITMENT_ID) String commitmentId) { + this.benefitName = benefitName; + this.commitmentId = commitmentId; + } + + public CommitmentsAzureComputeSPCommitment benefitName(String benefitName) { + this.benefitName = benefitName; + return this; + } + + /** + * The display name of the Azure Savings Plan. + * + * @return benefitName + */ + @JsonProperty(JSON_PROPERTY_BENEFIT_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBenefitName() { + return benefitName; + } + + public void setBenefitName(String benefitName) { + this.benefitName = benefitName; + } + + public CommitmentsAzureComputeSPCommitment commitmentId(String commitmentId) { + this.commitmentId = commitmentId; + return this; + } + + /** + * The unique identifier of the Savings Plan. + * + * @return commitmentId + */ + @JsonProperty(JSON_PROPERTY_COMMITMENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCommitmentId() { + return commitmentId; + } + + public void setCommitmentId(String commitmentId) { + this.commitmentId = commitmentId; + } + + public CommitmentsAzureComputeSPCommitment committedSpendPerHour(Double committedSpendPerHour) { + this.committedSpendPerHour = committedSpendPerHour; + return this; + } + + /** + * The hourly committed spend for the Savings Plan. + * + * @return committedSpendPerHour + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMITTED_SPEND_PER_HOUR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getCommittedSpendPerHour() { + return committedSpendPerHour; + } + + public void setCommittedSpendPerHour(Double committedSpendPerHour) { + this.committedSpendPerHour = committedSpendPerHour; + } + + public CommitmentsAzureComputeSPCommitment expirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * The expiration date of the commitment. + * + * @return expirationDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + public CommitmentsAzureComputeSPCommitment startDate(String startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the commitment. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public CommitmentsAzureComputeSPCommitment termLength(Double termLength) { + this.termLength = termLength; + return this; + } + + /** + * The term length in years. + * + * @return termLength + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTermLength() { + return termLength; + } + + public void setTermLength(Double termLength) { + this.termLength = termLength; + } + + public CommitmentsAzureComputeSPCommitment utilization(Double utilization) { + this.utilization = utilization; + return this; + } + + /** + * The utilization percentage of the commitment. + * + * @return utilization + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UTILIZATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getUtilization() { + return utilization; + } + + public void setUtilization(Double utilization) { + this.utilization = utilization; + } + + /** + * 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 CommitmentsAzureComputeSPCommitment + */ + @JsonAnySetter + public CommitmentsAzureComputeSPCommitment 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 CommitmentsAzureComputeSPCommitment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsAzureComputeSPCommitment commitmentsAzureComputeSpCommitment = + (CommitmentsAzureComputeSPCommitment) o; + return Objects.equals(this.benefitName, commitmentsAzureComputeSpCommitment.benefitName) + && Objects.equals(this.commitmentId, commitmentsAzureComputeSpCommitment.commitmentId) + && Objects.equals( + this.committedSpendPerHour, commitmentsAzureComputeSpCommitment.committedSpendPerHour) + && Objects.equals(this.expirationDate, commitmentsAzureComputeSpCommitment.expirationDate) + && Objects.equals(this.startDate, commitmentsAzureComputeSpCommitment.startDate) + && Objects.equals(this.termLength, commitmentsAzureComputeSpCommitment.termLength) + && Objects.equals(this.utilization, commitmentsAzureComputeSpCommitment.utilization) + && Objects.equals( + this.additionalProperties, commitmentsAzureComputeSpCommitment.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + benefitName, + commitmentId, + committedSpendPerHour, + expirationDate, + startDate, + termLength, + utilization, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsAzureComputeSPCommitment {\n"); + sb.append(" benefitName: ").append(toIndentedString(benefitName)).append("\n"); + sb.append(" commitmentId: ").append(toIndentedString(commitmentId)).append("\n"); + sb.append(" committedSpendPerHour: ") + .append(toIndentedString(committedSpendPerHour)) + .append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" termLength: ").append(toIndentedString(termLength)).append("\n"); + sb.append(" utilization: ").append(toIndentedString(utilization)).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/CommitmentsAzureVMRICommitment.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureVMRICommitment.java new file mode 100644 index 00000000000..5ae6dc3ef7b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureVMRICommitment.java @@ -0,0 +1,413 @@ +/* + * 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; + +/** Azure Virtual Machine Reserved Instance commitment details. */ +@JsonPropertyOrder({ + CommitmentsAzureVMRICommitment.JSON_PROPERTY_BENEFIT_NAME, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_COMMITMENT_ID, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_EXPIRATION_DATE, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_INSTANCE_TYPE, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_METER_SUB_CATEGORY, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_REGION, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_START_DATE, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_STATUS, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_TERM_LENGTH, + CommitmentsAzureVMRICommitment.JSON_PROPERTY_UTILIZATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsAzureVMRICommitment { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_BENEFIT_NAME = "benefit_name"; + private String benefitName; + + public static final String JSON_PROPERTY_COMMITMENT_ID = "commitment_id"; + private String commitmentId; + + public static final String JSON_PROPERTY_EXPIRATION_DATE = "expiration_date"; + private String expirationDate; + + public static final String JSON_PROPERTY_INSTANCE_TYPE = "instance_type"; + private String instanceType; + + public static final String JSON_PROPERTY_METER_SUB_CATEGORY = "meter_sub_category"; + private String meterSubCategory; + + public static final String JSON_PROPERTY_REGION = "region"; + private String region; + + public static final String JSON_PROPERTY_START_DATE = "start_date"; + private String startDate; + + 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_UTILIZATION = "utilization"; + private Double utilization; + + public CommitmentsAzureVMRICommitment() {} + + @JsonCreator + public CommitmentsAzureVMRICommitment( + @JsonProperty(required = true, value = JSON_PROPERTY_BENEFIT_NAME) String benefitName, + @JsonProperty(required = true, value = JSON_PROPERTY_COMMITMENT_ID) String commitmentId, + @JsonProperty(required = true, value = JSON_PROPERTY_INSTANCE_TYPE) String instanceType, + @JsonProperty(required = true, value = JSON_PROPERTY_METER_SUB_CATEGORY) + String meterSubCategory, + @JsonProperty(required = true, value = JSON_PROPERTY_REGION) String region, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) + CommitmentsAzureVMRIStatus status) { + this.benefitName = benefitName; + this.commitmentId = commitmentId; + this.instanceType = instanceType; + this.meterSubCategory = meterSubCategory; + this.region = region; + this.status = status; + this.unparsed |= !status.isValid(); + } + + public CommitmentsAzureVMRICommitment benefitName(String benefitName) { + this.benefitName = benefitName; + return this; + } + + /** + * The display name of the Azure reservation. + * + * @return benefitName + */ + @JsonProperty(JSON_PROPERTY_BENEFIT_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getBenefitName() { + return benefitName; + } + + public void setBenefitName(String benefitName) { + this.benefitName = benefitName; + } + + public CommitmentsAzureVMRICommitment commitmentId(String commitmentId) { + this.commitmentId = commitmentId; + return this; + } + + /** + * The unique identifier of the Reserved Instance. + * + * @return commitmentId + */ + @JsonProperty(JSON_PROPERTY_COMMITMENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCommitmentId() { + return commitmentId; + } + + public void setCommitmentId(String commitmentId) { + this.commitmentId = commitmentId; + } + + public CommitmentsAzureVMRICommitment expirationDate(String expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * The expiration date of the commitment. + * + * @return expirationDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRATION_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(String expirationDate) { + this.expirationDate = expirationDate; + } + + public CommitmentsAzureVMRICommitment instanceType(String instanceType) { + this.instanceType = instanceType; + return this; + } + + /** + * The Azure VM instance type. + * + * @return instanceType + */ + @JsonProperty(JSON_PROPERTY_INSTANCE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInstanceType() { + return instanceType; + } + + public void setInstanceType(String instanceType) { + this.instanceType = instanceType; + } + + public CommitmentsAzureVMRICommitment meterSubCategory(String meterSubCategory) { + this.meterSubCategory = meterSubCategory; + return this; + } + + /** + * The Azure meter sub-category for the reservation. + * + * @return meterSubCategory + */ + @JsonProperty(JSON_PROPERTY_METER_SUB_CATEGORY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMeterSubCategory() { + return meterSubCategory; + } + + public void setMeterSubCategory(String meterSubCategory) { + this.meterSubCategory = meterSubCategory; + } + + public CommitmentsAzureVMRICommitment region(String region) { + this.region = region; + return this; + } + + /** + * The Azure region of the Reserved Instance. + * + * @return region + */ + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public CommitmentsAzureVMRICommitment startDate(String startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the commitment. + * + * @return startDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public CommitmentsAzureVMRICommitment status(CommitmentsAzureVMRIStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Status of an Azure VM Reserved Instance. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsAzureVMRIStatus getStatus() { + return status; + } + + public void setStatus(CommitmentsAzureVMRIStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public CommitmentsAzureVMRICommitment termLength(Double termLength) { + this.termLength = termLength; + return this; + } + + /** + * The term length in years. + * + * @return termLength + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TERM_LENGTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getTermLength() { + return termLength; + } + + public void setTermLength(Double termLength) { + this.termLength = termLength; + } + + public CommitmentsAzureVMRICommitment utilization(Double utilization) { + this.utilization = utilization; + return this; + } + + /** + * The utilization percentage of the commitment. + * + * @return utilization + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UTILIZATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getUtilization() { + return utilization; + } + + public void setUtilization(Double utilization) { + this.utilization = utilization; + } + + /** + * 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 CommitmentsAzureVMRICommitment + */ + @JsonAnySetter + public CommitmentsAzureVMRICommitment 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 CommitmentsAzureVMRICommitment object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsAzureVMRICommitment commitmentsAzureVmriCommitment = + (CommitmentsAzureVMRICommitment) o; + return Objects.equals(this.benefitName, commitmentsAzureVmriCommitment.benefitName) + && Objects.equals(this.commitmentId, commitmentsAzureVmriCommitment.commitmentId) + && Objects.equals(this.expirationDate, commitmentsAzureVmriCommitment.expirationDate) + && Objects.equals(this.instanceType, commitmentsAzureVmriCommitment.instanceType) + && Objects.equals(this.meterSubCategory, commitmentsAzureVmriCommitment.meterSubCategory) + && 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.utilization, commitmentsAzureVmriCommitment.utilization) + && Objects.equals( + this.additionalProperties, commitmentsAzureVmriCommitment.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + benefitName, + commitmentId, + expirationDate, + instanceType, + meterSubCategory, + region, + startDate, + status, + termLength, + utilization, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsAzureVMRICommitment {\n"); + sb.append(" benefitName: ").append(toIndentedString(benefitName)).append("\n"); + sb.append(" commitmentId: ").append(toIndentedString(commitmentId)).append("\n"); + 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(" 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(" utilization: ").append(toIndentedString(utilization)).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/CommitmentsAzureVMRIStatus.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureVMRIStatus.java new file mode 100644 index 00000000000..7183cc9391e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsAzureVMRIStatus.java @@ -0,0 +1,61 @@ +/* + * 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; + +/** Status of an Azure VM Reserved Instance. */ +@JsonSerialize(using = CommitmentsAzureVMRIStatus.CommitmentsAzureVMRIStatusSerializer.class) +public class CommitmentsAzureVMRIStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("running", "expired", "cancelled")); + + public static final CommitmentsAzureVMRIStatus RUNNING = + new CommitmentsAzureVMRIStatus("running"); + public static final CommitmentsAzureVMRIStatus EXPIRED = + new CommitmentsAzureVMRIStatus("expired"); + public static final CommitmentsAzureVMRIStatus CANCELLED = + new CommitmentsAzureVMRIStatus("cancelled"); + + CommitmentsAzureVMRIStatus(String value) { + super(value, allowedValues); + } + + public static class CommitmentsAzureVMRIStatusSerializer + extends StdSerializer { + public CommitmentsAzureVMRIStatusSerializer(Class t) { + super(t); + } + + public CommitmentsAzureVMRIStatusSerializer() { + this(null); + } + + @Override + public void serialize( + CommitmentsAzureVMRIStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CommitmentsAzureVMRIStatus fromValue(String value) { + return new CommitmentsAzureVMRIStatus(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsCommitmentType.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsCommitmentType.java new file mode 100644 index 00000000000..f58334c532a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsCommitmentType.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 commitment. ri for Reserved Instances, sp for Savings Plans. */ +@JsonSerialize(using = CommitmentsCommitmentType.CommitmentsCommitmentTypeSerializer.class) +public class CommitmentsCommitmentType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("ri", "sp")); + + public static final CommitmentsCommitmentType RESERVED_INSTANCES = + new CommitmentsCommitmentType("ri"); + public static final CommitmentsCommitmentType SAVINGS_PLANS = new CommitmentsCommitmentType("sp"); + + CommitmentsCommitmentType(String value) { + super(value, allowedValues); + } + + public static class CommitmentsCommitmentTypeSerializer + extends StdSerializer { + public CommitmentsCommitmentTypeSerializer(Class t) { + super(t); + } + + public CommitmentsCommitmentTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CommitmentsCommitmentType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CommitmentsCommitmentType fromValue(String value) { + return new CommitmentsCommitmentType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsCoverageScalarResponse.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsCoverageScalarResponse.java new file mode 100644 index 00000000000..7e70c22999e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsCoverageScalarResponse.java @@ -0,0 +1,157 @@ +/* + * 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; + +/** Response containing scalar coverage metrics for cloud commitment programs. */ +@JsonPropertyOrder({CommitmentsCoverageScalarResponse.JSON_PROPERTY_COLUMNS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsCoverageScalarResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMNS = "columns"; + private List columns = new ArrayList<>(); + + public CommitmentsCoverageScalarResponse() {} + + @JsonCreator + public CommitmentsCoverageScalarResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_COLUMNS) + List columns) { + this.columns = columns; + } + + public CommitmentsCoverageScalarResponse columns(List columns) { + this.columns = columns; + for (CommitmentsScalarColumn item : columns) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CommitmentsCoverageScalarResponse addColumnsItem(CommitmentsScalarColumn columnsItem) { + this.columns.add(columnsItem); + this.unparsed |= columnsItem.unparsed; + return this; + } + + /** + * Array of scalar columns in the response. + * + * @return columns + */ + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getColumns() { + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + /** + * 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 CommitmentsCoverageScalarResponse + */ + @JsonAnySetter + public CommitmentsCoverageScalarResponse 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 CommitmentsCoverageScalarResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsCoverageScalarResponse commitmentsCoverageScalarResponse = + (CommitmentsCoverageScalarResponse) o; + return Objects.equals(this.columns, commitmentsCoverageScalarResponse.columns) + && Objects.equals( + this.additionalProperties, commitmentsCoverageScalarResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(columns, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsCoverageScalarResponse {\n"); + sb.append(" columns: ").append(toIndentedString(columns)).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/CommitmentsCoverageTimeseriesResponse.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsCoverageTimeseriesResponse.java new file mode 100644 index 00000000000..58bdb09a757 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsCoverageTimeseriesResponse.java @@ -0,0 +1,180 @@ +/* + * 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; + +/** Response containing timeseries coverage metrics for cloud commitment programs. */ +@JsonPropertyOrder({ + CommitmentsCoverageTimeseriesResponse.JSON_PROPERTY_COST, + CommitmentsCoverageTimeseriesResponse.JSON_PROPERTY_HOURS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsCoverageTimeseriesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COST = "cost"; + private CommitmentsTimeseriesMetric cost; + + public static final String JSON_PROPERTY_HOURS = "hours"; + private CommitmentsTimeseriesMetric hours; + + public CommitmentsCoverageTimeseriesResponse() {} + + @JsonCreator + public CommitmentsCoverageTimeseriesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_COST) CommitmentsTimeseriesMetric cost, + @JsonProperty(required = true, value = JSON_PROPERTY_HOURS) + CommitmentsTimeseriesMetric hours) { + this.cost = cost; + this.unparsed |= cost.unparsed; + this.hours = hours; + this.unparsed |= hours.unparsed; + } + + public CommitmentsCoverageTimeseriesResponse cost(CommitmentsTimeseriesMetric cost) { + this.cost = cost; + this.unparsed |= cost.unparsed; + return this; + } + + /** + * A timeseries metric containing timestamps, series values, and optional unit metadata. + * + * @return cost + */ + @JsonProperty(JSON_PROPERTY_COST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsTimeseriesMetric getCost() { + return cost; + } + + public void setCost(CommitmentsTimeseriesMetric cost) { + this.cost = cost; + } + + public CommitmentsCoverageTimeseriesResponse hours(CommitmentsTimeseriesMetric hours) { + this.hours = hours; + this.unparsed |= hours.unparsed; + return this; + } + + /** + * A timeseries metric containing timestamps, series values, and optional unit metadata. + * + * @return hours + */ + @JsonProperty(JSON_PROPERTY_HOURS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsTimeseriesMetric getHours() { + return hours; + } + + public void setHours(CommitmentsTimeseriesMetric hours) { + this.hours = hours; + } + + /** + * 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 CommitmentsCoverageTimeseriesResponse + */ + @JsonAnySetter + public CommitmentsCoverageTimeseriesResponse 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 CommitmentsCoverageTimeseriesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsCoverageTimeseriesResponse commitmentsCoverageTimeseriesResponse = + (CommitmentsCoverageTimeseriesResponse) o; + return Objects.equals(this.cost, commitmentsCoverageTimeseriesResponse.cost) + && Objects.equals(this.hours, commitmentsCoverageTimeseriesResponse.hours) + && Objects.equals( + this.additionalProperties, commitmentsCoverageTimeseriesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cost, hours, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsCoverageTimeseriesResponse {\n"); + sb.append(" cost: ").append(toIndentedString(cost)).append("\n"); + sb.append(" hours: ").append(toIndentedString(hours)).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/CommitmentsListItem.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListItem.java new file mode 100644 index 00000000000..0b534aae91f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListItem.java @@ -0,0 +1,574 @@ +/* + * 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.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = CommitmentsListItem.CommitmentsListItemDeserializer.class) +@JsonSerialize(using = CommitmentsListItem.CommitmentsListItemSerializer.class) +public class CommitmentsListItem extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CommitmentsListItem.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class CommitmentsListItemSerializer extends StdSerializer { + public CommitmentsListItemSerializer(Class t) { + super(t); + } + + public CommitmentsListItemSerializer() { + this(null); + } + + @Override + public void serialize( + CommitmentsListItem value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class CommitmentsListItemDeserializer extends StdDeserializer { + public CommitmentsListItemDeserializer() { + this(CommitmentsListItem.class); + } + + public CommitmentsListItemDeserializer(Class vc) { + super(vc); + } + + @Override + public CommitmentsListItem deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize CommitmentsAwsEC2RICommitment + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CommitmentsAwsEC2RICommitment.class.equals(Integer.class) + || CommitmentsAwsEC2RICommitment.class.equals(Long.class) + || CommitmentsAwsEC2RICommitment.class.equals(Float.class) + || CommitmentsAwsEC2RICommitment.class.equals(Double.class) + || CommitmentsAwsEC2RICommitment.class.equals(Boolean.class) + || CommitmentsAwsEC2RICommitment.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CommitmentsAwsEC2RICommitment.class.equals(Integer.class) + || CommitmentsAwsEC2RICommitment.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CommitmentsAwsEC2RICommitment.class.equals(Float.class) + || CommitmentsAwsEC2RICommitment.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CommitmentsAwsEC2RICommitment.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CommitmentsAwsEC2RICommitment.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(CommitmentsAwsEC2RICommitment.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CommitmentsAwsEC2RICommitment) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CommitmentsAwsEC2RICommitment'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'CommitmentsAwsEC2RICommitment'", e); + } + + // deserialize CommitmentsAwsRDSRICommitment + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CommitmentsAwsRDSRICommitment.class.equals(Integer.class) + || CommitmentsAwsRDSRICommitment.class.equals(Long.class) + || CommitmentsAwsRDSRICommitment.class.equals(Float.class) + || CommitmentsAwsRDSRICommitment.class.equals(Double.class) + || CommitmentsAwsRDSRICommitment.class.equals(Boolean.class) + || CommitmentsAwsRDSRICommitment.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CommitmentsAwsRDSRICommitment.class.equals(Integer.class) + || CommitmentsAwsRDSRICommitment.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CommitmentsAwsRDSRICommitment.class.equals(Float.class) + || CommitmentsAwsRDSRICommitment.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CommitmentsAwsRDSRICommitment.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CommitmentsAwsRDSRICommitment.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(CommitmentsAwsRDSRICommitment.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CommitmentsAwsRDSRICommitment) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CommitmentsAwsRDSRICommitment'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'CommitmentsAwsRDSRICommitment'", e); + } + + // deserialize CommitmentsAwsElasticacheRICommitment + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CommitmentsAwsElasticacheRICommitment.class.equals(Integer.class) + || CommitmentsAwsElasticacheRICommitment.class.equals(Long.class) + || CommitmentsAwsElasticacheRICommitment.class.equals(Float.class) + || CommitmentsAwsElasticacheRICommitment.class.equals(Double.class) + || CommitmentsAwsElasticacheRICommitment.class.equals(Boolean.class) + || CommitmentsAwsElasticacheRICommitment.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CommitmentsAwsElasticacheRICommitment.class.equals(Integer.class) + || CommitmentsAwsElasticacheRICommitment.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CommitmentsAwsElasticacheRICommitment.class.equals(Float.class) + || CommitmentsAwsElasticacheRICommitment.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CommitmentsAwsElasticacheRICommitment.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CommitmentsAwsElasticacheRICommitment.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()).readValueAs(CommitmentsAwsElasticacheRICommitment.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CommitmentsAwsElasticacheRICommitment) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CommitmentsAwsElasticacheRICommitment'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'CommitmentsAwsElasticacheRICommitment'", + e); + } + + // deserialize CommitmentsAwsSPCommitment + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CommitmentsAwsSPCommitment.class.equals(Integer.class) + || CommitmentsAwsSPCommitment.class.equals(Long.class) + || CommitmentsAwsSPCommitment.class.equals(Float.class) + || CommitmentsAwsSPCommitment.class.equals(Double.class) + || CommitmentsAwsSPCommitment.class.equals(Boolean.class) + || CommitmentsAwsSPCommitment.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CommitmentsAwsSPCommitment.class.equals(Integer.class) + || CommitmentsAwsSPCommitment.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CommitmentsAwsSPCommitment.class.equals(Float.class) + || CommitmentsAwsSPCommitment.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CommitmentsAwsSPCommitment.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CommitmentsAwsSPCommitment.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(CommitmentsAwsSPCommitment.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CommitmentsAwsSPCommitment) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CommitmentsAwsSPCommitment'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'CommitmentsAwsSPCommitment'", e); + } + + // deserialize CommitmentsAzureVMRICommitment + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CommitmentsAzureVMRICommitment.class.equals(Integer.class) + || CommitmentsAzureVMRICommitment.class.equals(Long.class) + || CommitmentsAzureVMRICommitment.class.equals(Float.class) + || CommitmentsAzureVMRICommitment.class.equals(Double.class) + || CommitmentsAzureVMRICommitment.class.equals(Boolean.class) + || CommitmentsAzureVMRICommitment.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CommitmentsAzureVMRICommitment.class.equals(Integer.class) + || CommitmentsAzureVMRICommitment.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CommitmentsAzureVMRICommitment.class.equals(Float.class) + || CommitmentsAzureVMRICommitment.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CommitmentsAzureVMRICommitment.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CommitmentsAzureVMRICommitment.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(CommitmentsAzureVMRICommitment.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CommitmentsAzureVMRICommitment) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CommitmentsAzureVMRICommitment'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'CommitmentsAzureVMRICommitment'", e); + } + + // deserialize CommitmentsAzureComputeSPCommitment + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CommitmentsAzureComputeSPCommitment.class.equals(Integer.class) + || CommitmentsAzureComputeSPCommitment.class.equals(Long.class) + || CommitmentsAzureComputeSPCommitment.class.equals(Float.class) + || CommitmentsAzureComputeSPCommitment.class.equals(Double.class) + || CommitmentsAzureComputeSPCommitment.class.equals(Boolean.class) + || CommitmentsAzureComputeSPCommitment.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CommitmentsAzureComputeSPCommitment.class.equals(Integer.class) + || CommitmentsAzureComputeSPCommitment.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CommitmentsAzureComputeSPCommitment.class.equals(Float.class) + || CommitmentsAzureComputeSPCommitment.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CommitmentsAzureComputeSPCommitment.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CommitmentsAzureComputeSPCommitment.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(CommitmentsAzureComputeSPCommitment.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CommitmentsAzureComputeSPCommitment) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CommitmentsAzureComputeSPCommitment'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'CommitmentsAzureComputeSPCommitment'", + e); + } + + CommitmentsListItem ret = new CommitmentsListItem(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public CommitmentsListItem getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "CommitmentsListItem cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public CommitmentsListItem() { + super("oneOf", Boolean.FALSE); + } + + public CommitmentsListItem(CommitmentsAwsEC2RICommitment o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public CommitmentsListItem(CommitmentsAwsRDSRICommitment o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public CommitmentsListItem(CommitmentsAwsElasticacheRICommitment o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public CommitmentsListItem(CommitmentsAwsSPCommitment o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public CommitmentsListItem(CommitmentsAzureVMRICommitment o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public CommitmentsListItem(CommitmentsAzureComputeSPCommitment o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "CommitmentsAwsEC2RICommitment", new GenericType() {}); + schemas.put( + "CommitmentsAwsRDSRICommitment", new GenericType() {}); + schemas.put( + "CommitmentsAwsElasticacheRICommitment", + new GenericType() {}); + schemas.put("CommitmentsAwsSPCommitment", new GenericType() {}); + schemas.put( + "CommitmentsAzureVMRICommitment", new GenericType() {}); + schemas.put( + "CommitmentsAzureComputeSPCommitment", + new GenericType() {}); + JSON.registerDescendants(CommitmentsListItem.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return CommitmentsListItem.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: CommitmentsAwsEC2RICommitment, CommitmentsAwsRDSRICommitment, + * CommitmentsAwsElasticacheRICommitment, CommitmentsAwsSPCommitment, + * CommitmentsAzureVMRICommitment, CommitmentsAzureComputeSPCommitment + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(CommitmentsAwsEC2RICommitment.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(CommitmentsAwsRDSRICommitment.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + CommitmentsAwsElasticacheRICommitment.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(CommitmentsAwsSPCommitment.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + CommitmentsAzureVMRICommitment.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + CommitmentsAzureComputeSPCommitment.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be CommitmentsAwsEC2RICommitment," + + " CommitmentsAwsRDSRICommitment, CommitmentsAwsElasticacheRICommitment," + + " CommitmentsAwsSPCommitment, CommitmentsAzureVMRICommitment," + + " CommitmentsAzureComputeSPCommitment"); + } + + /** + * Get the actual instance, which can be the following: CommitmentsAwsEC2RICommitment, + * CommitmentsAwsRDSRICommitment, CommitmentsAwsElasticacheRICommitment, + * CommitmentsAwsSPCommitment, CommitmentsAzureVMRICommitment, CommitmentsAzureComputeSPCommitment + * + * @return The actual instance (CommitmentsAwsEC2RICommitment, CommitmentsAwsRDSRICommitment, + * CommitmentsAwsElasticacheRICommitment, CommitmentsAwsSPCommitment, + * CommitmentsAzureVMRICommitment, CommitmentsAzureComputeSPCommitment) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CommitmentsAwsEC2RICommitment`. If the actual instance is not + * `CommitmentsAwsEC2RICommitment`, the ClassCastException will be thrown. + * + * @return The actual instance of `CommitmentsAwsEC2RICommitment` + * @throws ClassCastException if the instance is not `CommitmentsAwsEC2RICommitment` + */ + public CommitmentsAwsEC2RICommitment getCommitmentsAwsEC2RICommitment() + throws ClassCastException { + return (CommitmentsAwsEC2RICommitment) super.getActualInstance(); + } + + /** + * Get the actual instance of `CommitmentsAwsRDSRICommitment`. If the actual instance is not + * `CommitmentsAwsRDSRICommitment`, the ClassCastException will be thrown. + * + * @return The actual instance of `CommitmentsAwsRDSRICommitment` + * @throws ClassCastException if the instance is not `CommitmentsAwsRDSRICommitment` + */ + public CommitmentsAwsRDSRICommitment getCommitmentsAwsRDSRICommitment() + throws ClassCastException { + return (CommitmentsAwsRDSRICommitment) super.getActualInstance(); + } + + /** + * Get the actual instance of `CommitmentsAwsElasticacheRICommitment`. If the actual instance is + * not `CommitmentsAwsElasticacheRICommitment`, the ClassCastException will be thrown. + * + * @return The actual instance of `CommitmentsAwsElasticacheRICommitment` + * @throws ClassCastException if the instance is not `CommitmentsAwsElasticacheRICommitment` + */ + public CommitmentsAwsElasticacheRICommitment getCommitmentsAwsElasticacheRICommitment() + throws ClassCastException { + return (CommitmentsAwsElasticacheRICommitment) super.getActualInstance(); + } + + /** + * Get the actual instance of `CommitmentsAwsSPCommitment`. If the actual instance is not + * `CommitmentsAwsSPCommitment`, the ClassCastException will be thrown. + * + * @return The actual instance of `CommitmentsAwsSPCommitment` + * @throws ClassCastException if the instance is not `CommitmentsAwsSPCommitment` + */ + public CommitmentsAwsSPCommitment getCommitmentsAwsSPCommitment() throws ClassCastException { + return (CommitmentsAwsSPCommitment) super.getActualInstance(); + } + + /** + * Get the actual instance of `CommitmentsAzureVMRICommitment`. If the actual instance is not + * `CommitmentsAzureVMRICommitment`, the ClassCastException will be thrown. + * + * @return The actual instance of `CommitmentsAzureVMRICommitment` + * @throws ClassCastException if the instance is not `CommitmentsAzureVMRICommitment` + */ + public CommitmentsAzureVMRICommitment getCommitmentsAzureVMRICommitment() + throws ClassCastException { + return (CommitmentsAzureVMRICommitment) super.getActualInstance(); + } + + /** + * Get the actual instance of `CommitmentsAzureComputeSPCommitment`. If the actual instance is not + * `CommitmentsAzureComputeSPCommitment`, the ClassCastException will be thrown. + * + * @return The actual instance of `CommitmentsAzureComputeSPCommitment` + * @throws ClassCastException if the instance is not `CommitmentsAzureComputeSPCommitment` + */ + public CommitmentsAzureComputeSPCommitment getCommitmentsAzureComputeSPCommitment() + throws ClassCastException { + return (CommitmentsAzureComputeSPCommitment) super.getActualInstance(); + } +} 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 new file mode 100644 index 00000000000..a0d6dde5cf5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListMeta.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata for a commitments list response. */ +@JsonPropertyOrder({CommitmentsListMeta.JSON_PROPERTY_COMMITTED_SPEND_UNIT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsListMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COMMITTED_SPEND_UNIT = "committed_spend_unit"; + private CommitmentsUnit committedSpendUnit; + + public CommitmentsListMeta committedSpendUnit(CommitmentsUnit committedSpendUnit) { + this.committedSpendUnit = committedSpendUnit; + this.unparsed |= committedSpendUnit.unparsed; + return this; + } + + /** + * Unit metadata for a numeric metric. + * + * @return committedSpendUnit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMITTED_SPEND_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CommitmentsUnit getCommittedSpendUnit() { + return committedSpendUnit; + } + + public void setCommittedSpendUnit(CommitmentsUnit committedSpendUnit) { + this.committedSpendUnit = committedSpendUnit; + } + + /** + * 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 CommitmentsListMeta + */ + @JsonAnySetter + public CommitmentsListMeta 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 CommitmentsListMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsListMeta commitmentsListMeta = (CommitmentsListMeta) o; + return Objects.equals(this.committedSpendUnit, commitmentsListMeta.committedSpendUnit) + && Objects.equals(this.additionalProperties, commitmentsListMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(committedSpendUnit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsListMeta {\n"); + sb.append(" committedSpendUnit: ").append(toIndentedString(committedSpendUnit)).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/CommitmentsListResponse.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponse.java new file mode 100644 index 00000000000..253c4a40df3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsListResponse.java @@ -0,0 +1,185 @@ +/* + * 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; + +/** Response containing a list of cloud commitment details. */ +@JsonPropertyOrder({ + CommitmentsListResponse.JSON_PROPERTY_COMMITMENTS, + CommitmentsListResponse.JSON_PROPERTY_META +}) +@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 CommitmentsListResponse() {} + + @JsonCreator + public CommitmentsListResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_COMMITMENTS) + List commitments) { + this.commitments = commitments; + } + + 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; + 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; + } + + 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 void setMeta(CommitmentsListMeta meta) { + this.meta = meta; + } + + /** + * 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 CommitmentsListResponse + */ + @JsonAnySetter + public CommitmentsListResponse 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 CommitmentsListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsListResponse commitmentsListResponse = (CommitmentsListResponse) o; + return Objects.equals(this.commitments, commitmentsListResponse.commitments) + && Objects.equals(this.meta, commitmentsListResponse.meta) + && Objects.equals(this.additionalProperties, commitmentsListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(commitments, meta, 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(" 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/CommitmentsOnDemandHotspotsScalarMeta.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsOnDemandHotspotsScalarMeta.java new file mode 100644 index 00000000000..33e85a43a02 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsOnDemandHotspotsScalarMeta.java @@ -0,0 +1,147 @@ +/* + * 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; + +/** Metadata for the on-demand hot-spots scalar response. */ +@JsonPropertyOrder({CommitmentsOnDemandHotspotsScalarMeta.JSON_PROPERTY_ON_DEMAND_FILTERS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsOnDemandHotspotsScalarMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ON_DEMAND_FILTERS = "on_demand_filters"; + private String onDemandFilters; + + public CommitmentsOnDemandHotspotsScalarMeta() {} + + @JsonCreator + public CommitmentsOnDemandHotspotsScalarMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_ON_DEMAND_FILTERS) + String onDemandFilters) { + this.onDemandFilters = onDemandFilters; + } + + public CommitmentsOnDemandHotspotsScalarMeta onDemandFilters(String onDemandFilters) { + this.onDemandFilters = onDemandFilters; + return this; + } + + /** + * Active on-demand filters applied to the response. + * + * @return onDemandFilters + */ + @JsonProperty(JSON_PROPERTY_ON_DEMAND_FILTERS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOnDemandFilters() { + return onDemandFilters; + } + + public void setOnDemandFilters(String onDemandFilters) { + this.onDemandFilters = onDemandFilters; + } + + /** + * 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 CommitmentsOnDemandHotspotsScalarMeta + */ + @JsonAnySetter + public CommitmentsOnDemandHotspotsScalarMeta 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 CommitmentsOnDemandHotspotsScalarMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsOnDemandHotspotsScalarMeta commitmentsOnDemandHotspotsScalarMeta = + (CommitmentsOnDemandHotspotsScalarMeta) o; + return Objects.equals( + this.onDemandFilters, commitmentsOnDemandHotspotsScalarMeta.onDemandFilters) + && Objects.equals( + this.additionalProperties, commitmentsOnDemandHotspotsScalarMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(onDemandFilters, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsOnDemandHotspotsScalarMeta {\n"); + sb.append(" onDemandFilters: ").append(toIndentedString(onDemandFilters)).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/CommitmentsOnDemandHotspotsScalarResponse.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsOnDemandHotspotsScalarResponse.java new file mode 100644 index 00000000000..8b007d2bb04 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsOnDemandHotspotsScalarResponse.java @@ -0,0 +1,228 @@ +/* + * 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; + +/** Response containing scalar on-demand hot-spots data for cloud commitment programs. */ +@JsonPropertyOrder({ + CommitmentsOnDemandHotspotsScalarResponse.JSON_PROPERTY_COLUMNS, + CommitmentsOnDemandHotspotsScalarResponse.JSON_PROPERTY_META, + CommitmentsOnDemandHotspotsScalarResponse.JSON_PROPERTY_TOTAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsOnDemandHotspotsScalarResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMNS = "columns"; + private List columns = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private CommitmentsOnDemandHotspotsScalarMeta meta; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private List total = new ArrayList<>(); + + public CommitmentsOnDemandHotspotsScalarResponse() {} + + @JsonCreator + public CommitmentsOnDemandHotspotsScalarResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_COLUMNS) + List columns, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL) + List total) { + this.columns = columns; + this.total = total; + } + + public CommitmentsOnDemandHotspotsScalarResponse columns(List columns) { + this.columns = columns; + for (CommitmentsScalarColumn item : columns) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CommitmentsOnDemandHotspotsScalarResponse addColumnsItem( + CommitmentsScalarColumn columnsItem) { + this.columns.add(columnsItem); + this.unparsed |= columnsItem.unparsed; + return this; + } + + /** + * Array of scalar columns in the response. + * + * @return columns + */ + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getColumns() { + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + public CommitmentsOnDemandHotspotsScalarResponse meta( + CommitmentsOnDemandHotspotsScalarMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for the on-demand hot-spots scalar response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CommitmentsOnDemandHotspotsScalarMeta getMeta() { + return meta; + } + + public void setMeta(CommitmentsOnDemandHotspotsScalarMeta meta) { + this.meta = meta; + } + + public CommitmentsOnDemandHotspotsScalarResponse total(List total) { + this.total = total; + for (CommitmentsScalarColumn item : total) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CommitmentsOnDemandHotspotsScalarResponse addTotalItem(CommitmentsScalarColumn totalItem) { + this.total.add(totalItem); + this.unparsed |= totalItem.unparsed; + return this; + } + + /** + * Array of scalar columns in the response. + * + * @return total + */ + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTotal() { + return total; + } + + public void setTotal(List total) { + this.total = total; + } + + /** + * 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 CommitmentsOnDemandHotspotsScalarResponse + */ + @JsonAnySetter + public CommitmentsOnDemandHotspotsScalarResponse 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 CommitmentsOnDemandHotspotsScalarResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsOnDemandHotspotsScalarResponse commitmentsOnDemandHotspotsScalarResponse = + (CommitmentsOnDemandHotspotsScalarResponse) o; + return Objects.equals(this.columns, commitmentsOnDemandHotspotsScalarResponse.columns) + && Objects.equals(this.meta, commitmentsOnDemandHotspotsScalarResponse.meta) + && Objects.equals(this.total, commitmentsOnDemandHotspotsScalarResponse.total) + && Objects.equals( + this.additionalProperties, + commitmentsOnDemandHotspotsScalarResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(columns, meta, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsOnDemandHotspotsScalarResponse {\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).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/CommitmentsProvider.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsProvider.java new file mode 100644 index 00000000000..89f04676f22 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsProvider.java @@ -0,0 +1,56 @@ +/* + * 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; + +/** Cloud provider for commitment programs. */ +@JsonSerialize(using = CommitmentsProvider.CommitmentsProviderSerializer.class) +public class CommitmentsProvider extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("aws", "azure")); + + public static final CommitmentsProvider AWS = new CommitmentsProvider("aws"); + public static final CommitmentsProvider AZURE = new CommitmentsProvider("azure"); + + CommitmentsProvider(String value) { + super(value, allowedValues); + } + + public static class CommitmentsProviderSerializer extends StdSerializer { + public CommitmentsProviderSerializer(Class t) { + super(t); + } + + public CommitmentsProviderSerializer() { + this(null); + } + + @Override + public void serialize( + CommitmentsProvider value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CommitmentsProvider fromValue(String value) { + return new CommitmentsProvider(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsSavingsScalarResponse.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsSavingsScalarResponse.java new file mode 100644 index 00000000000..e47f845c05f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsSavingsScalarResponse.java @@ -0,0 +1,157 @@ +/* + * 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; + +/** Response containing scalar savings metrics for cloud commitment programs. */ +@JsonPropertyOrder({CommitmentsSavingsScalarResponse.JSON_PROPERTY_COLUMNS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsSavingsScalarResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMNS = "columns"; + private List columns = new ArrayList<>(); + + public CommitmentsSavingsScalarResponse() {} + + @JsonCreator + public CommitmentsSavingsScalarResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_COLUMNS) + List columns) { + this.columns = columns; + } + + public CommitmentsSavingsScalarResponse columns(List columns) { + this.columns = columns; + for (CommitmentsScalarColumn item : columns) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CommitmentsSavingsScalarResponse addColumnsItem(CommitmentsScalarColumn columnsItem) { + this.columns.add(columnsItem); + this.unparsed |= columnsItem.unparsed; + return this; + } + + /** + * Array of scalar columns in the response. + * + * @return columns + */ + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getColumns() { + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + /** + * 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 CommitmentsSavingsScalarResponse + */ + @JsonAnySetter + public CommitmentsSavingsScalarResponse 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 CommitmentsSavingsScalarResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsSavingsScalarResponse commitmentsSavingsScalarResponse = + (CommitmentsSavingsScalarResponse) o; + return Objects.equals(this.columns, commitmentsSavingsScalarResponse.columns) + && Objects.equals( + this.additionalProperties, commitmentsSavingsScalarResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(columns, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsSavingsScalarResponse {\n"); + sb.append(" columns: ").append(toIndentedString(columns)).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/CommitmentsSavingsTimeseriesResponse.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsSavingsTimeseriesResponse.java new file mode 100644 index 00000000000..71eedd6c004 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsSavingsTimeseriesResponse.java @@ -0,0 +1,259 @@ +/* + * 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; + +/** Response containing timeseries savings metrics for cloud commitment programs. */ +@JsonPropertyOrder({ + CommitmentsSavingsTimeseriesResponse.JSON_PROPERTY_ACTUAL_COST, + CommitmentsSavingsTimeseriesResponse.JSON_PROPERTY_EFFECTIVE_SAVINGS_RATE, + CommitmentsSavingsTimeseriesResponse.JSON_PROPERTY_ON_DEMAND_EQUIVALENT_COST, + CommitmentsSavingsTimeseriesResponse.JSON_PROPERTY_REALIZED_SAVINGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsSavingsTimeseriesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTUAL_COST = "actual_cost"; + private CommitmentsTimeseriesMetric actualCost; + + public static final String JSON_PROPERTY_EFFECTIVE_SAVINGS_RATE = "effective_savings_rate"; + private CommitmentsTimeseriesMetric effectiveSavingsRate; + + public static final String JSON_PROPERTY_ON_DEMAND_EQUIVALENT_COST = "on_demand_equivalent_cost"; + private CommitmentsTimeseriesMetric onDemandEquivalentCost; + + public static final String JSON_PROPERTY_REALIZED_SAVINGS = "realized_savings"; + private CommitmentsTimeseriesMetric realizedSavings; + + public CommitmentsSavingsTimeseriesResponse() {} + + @JsonCreator + public CommitmentsSavingsTimeseriesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTUAL_COST) + CommitmentsTimeseriesMetric actualCost, + @JsonProperty(required = true, value = JSON_PROPERTY_EFFECTIVE_SAVINGS_RATE) + CommitmentsTimeseriesMetric effectiveSavingsRate, + @JsonProperty(required = true, value = JSON_PROPERTY_ON_DEMAND_EQUIVALENT_COST) + CommitmentsTimeseriesMetric onDemandEquivalentCost, + @JsonProperty(required = true, value = JSON_PROPERTY_REALIZED_SAVINGS) + CommitmentsTimeseriesMetric realizedSavings) { + this.actualCost = actualCost; + this.unparsed |= actualCost.unparsed; + this.effectiveSavingsRate = effectiveSavingsRate; + this.unparsed |= effectiveSavingsRate.unparsed; + this.onDemandEquivalentCost = onDemandEquivalentCost; + this.unparsed |= onDemandEquivalentCost.unparsed; + this.realizedSavings = realizedSavings; + this.unparsed |= realizedSavings.unparsed; + } + + public CommitmentsSavingsTimeseriesResponse actualCost(CommitmentsTimeseriesMetric actualCost) { + this.actualCost = actualCost; + this.unparsed |= actualCost.unparsed; + return this; + } + + /** + * A timeseries metric containing timestamps, series values, and optional unit metadata. + * + * @return actualCost + */ + @JsonProperty(JSON_PROPERTY_ACTUAL_COST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsTimeseriesMetric getActualCost() { + return actualCost; + } + + public void setActualCost(CommitmentsTimeseriesMetric actualCost) { + this.actualCost = actualCost; + } + + public CommitmentsSavingsTimeseriesResponse effectiveSavingsRate( + CommitmentsTimeseriesMetric effectiveSavingsRate) { + this.effectiveSavingsRate = effectiveSavingsRate; + this.unparsed |= effectiveSavingsRate.unparsed; + return this; + } + + /** + * A timeseries metric containing timestamps, series values, and optional unit metadata. + * + * @return effectiveSavingsRate + */ + @JsonProperty(JSON_PROPERTY_EFFECTIVE_SAVINGS_RATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsTimeseriesMetric getEffectiveSavingsRate() { + return effectiveSavingsRate; + } + + public void setEffectiveSavingsRate(CommitmentsTimeseriesMetric effectiveSavingsRate) { + this.effectiveSavingsRate = effectiveSavingsRate; + } + + public CommitmentsSavingsTimeseriesResponse onDemandEquivalentCost( + CommitmentsTimeseriesMetric onDemandEquivalentCost) { + this.onDemandEquivalentCost = onDemandEquivalentCost; + this.unparsed |= onDemandEquivalentCost.unparsed; + return this; + } + + /** + * A timeseries metric containing timestamps, series values, and optional unit metadata. + * + * @return onDemandEquivalentCost + */ + @JsonProperty(JSON_PROPERTY_ON_DEMAND_EQUIVALENT_COST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsTimeseriesMetric getOnDemandEquivalentCost() { + return onDemandEquivalentCost; + } + + public void setOnDemandEquivalentCost(CommitmentsTimeseriesMetric onDemandEquivalentCost) { + this.onDemandEquivalentCost = onDemandEquivalentCost; + } + + public CommitmentsSavingsTimeseriesResponse realizedSavings( + CommitmentsTimeseriesMetric realizedSavings) { + this.realizedSavings = realizedSavings; + this.unparsed |= realizedSavings.unparsed; + return this; + } + + /** + * A timeseries metric containing timestamps, series values, and optional unit metadata. + * + * @return realizedSavings + */ + @JsonProperty(JSON_PROPERTY_REALIZED_SAVINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsTimeseriesMetric getRealizedSavings() { + return realizedSavings; + } + + public void setRealizedSavings(CommitmentsTimeseriesMetric realizedSavings) { + this.realizedSavings = realizedSavings; + } + + /** + * 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 CommitmentsSavingsTimeseriesResponse + */ + @JsonAnySetter + public CommitmentsSavingsTimeseriesResponse 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 CommitmentsSavingsTimeseriesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsSavingsTimeseriesResponse commitmentsSavingsTimeseriesResponse = + (CommitmentsSavingsTimeseriesResponse) o; + return Objects.equals(this.actualCost, commitmentsSavingsTimeseriesResponse.actualCost) + && Objects.equals( + this.effectiveSavingsRate, commitmentsSavingsTimeseriesResponse.effectiveSavingsRate) + && Objects.equals( + this.onDemandEquivalentCost, + commitmentsSavingsTimeseriesResponse.onDemandEquivalentCost) + && Objects.equals( + this.realizedSavings, commitmentsSavingsTimeseriesResponse.realizedSavings) + && Objects.equals( + this.additionalProperties, commitmentsSavingsTimeseriesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + actualCost, + effectiveSavingsRate, + onDemandEquivalentCost, + realizedSavings, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsSavingsTimeseriesResponse {\n"); + sb.append(" actualCost: ").append(toIndentedString(actualCost)).append("\n"); + sb.append(" effectiveSavingsRate: ") + .append(toIndentedString(effectiveSavingsRate)) + .append("\n"); + sb.append(" onDemandEquivalentCost: ") + .append(toIndentedString(onDemandEquivalentCost)) + .append("\n"); + sb.append(" realizedSavings: ").append(toIndentedString(realizedSavings)).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/CommitmentsScalarColumn.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsScalarColumn.java new file mode 100644 index 00000000000..e7311b88ad4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsScalarColumn.java @@ -0,0 +1,244 @@ +/* + * 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; + +/** + * A column in a scalar response. When type is "group", values contains arrays of strings. When type + * is "number", values contains numeric values. + */ +@JsonPropertyOrder({ + CommitmentsScalarColumn.JSON_PROPERTY_META, + CommitmentsScalarColumn.JSON_PROPERTY_NAME, + CommitmentsScalarColumn.JSON_PROPERTY_TYPE, + CommitmentsScalarColumn.JSON_PROPERTY_VALUES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsScalarColumn { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_META = "meta"; + private CommitmentsScalarColumnMeta meta; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CommitmentsScalarColumnType type; + + public static final String JSON_PROPERTY_VALUES = "values"; + private List values = new ArrayList<>(); + + public CommitmentsScalarColumn() {} + + @JsonCreator + public CommitmentsScalarColumn( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CommitmentsScalarColumnType type, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUES) List values) { + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + this.values = values; + } + + public CommitmentsScalarColumn meta(CommitmentsScalarColumnMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for a scalar column, including unit information. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CommitmentsScalarColumnMeta getMeta() { + return meta; + } + + public void setMeta(CommitmentsScalarColumnMeta meta) { + this.meta = meta; + } + + public CommitmentsScalarColumn name(String name) { + this.name = name; + return this; + } + + /** + * The column name. + * + * @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 CommitmentsScalarColumn type(CommitmentsScalarColumnType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The column type. "group" for dimension columns, "number" for metric columns. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsScalarColumnType getType() { + return type; + } + + public void setType(CommitmentsScalarColumnType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + public CommitmentsScalarColumn values(List values) { + this.values = values; + return this; + } + + public CommitmentsScalarColumn addValuesItem(Object valuesItem) { + this.values.add(valuesItem); + return this; + } + + /** + * Values for a scalar column. Arrays of strings for group columns, numbers for value columns. + * + * @return values + */ + @JsonProperty(JSON_PROPERTY_VALUES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getValues() { + return values; + } + + public void setValues(List values) { + this.values = values; + } + + /** + * 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 CommitmentsScalarColumn + */ + @JsonAnySetter + public CommitmentsScalarColumn 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 CommitmentsScalarColumn object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsScalarColumn commitmentsScalarColumn = (CommitmentsScalarColumn) o; + return Objects.equals(this.meta, commitmentsScalarColumn.meta) + && Objects.equals(this.name, commitmentsScalarColumn.name) + && Objects.equals(this.type, commitmentsScalarColumn.type) + && Objects.equals(this.values, commitmentsScalarColumn.values) + && Objects.equals(this.additionalProperties, commitmentsScalarColumn.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(meta, name, type, values, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsScalarColumn {\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" values: ").append(toIndentedString(values)).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/CommitmentsScalarColumnMeta.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsScalarColumnMeta.java new file mode 100644 index 00000000000..e0e4da2fc24 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsScalarColumnMeta.java @@ -0,0 +1,146 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata for a scalar column, including unit information. */ +@JsonPropertyOrder({CommitmentsScalarColumnMeta.JSON_PROPERTY_UNIT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsScalarColumnMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_UNIT = "unit"; + private CommitmentsUnit unit; + + public CommitmentsScalarColumnMeta() {} + + @JsonCreator + public CommitmentsScalarColumnMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_UNIT) CommitmentsUnit unit) { + this.unit = unit; + this.unparsed |= unit.unparsed; + } + + public CommitmentsScalarColumnMeta unit(CommitmentsUnit unit) { + this.unit = unit; + this.unparsed |= unit.unparsed; + return this; + } + + /** + * Unit metadata for a numeric metric. + * + * @return unit + */ + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CommitmentsUnit getUnit() { + return unit; + } + + public void setUnit(CommitmentsUnit unit) { + this.unit = unit; + } + + /** + * 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 CommitmentsScalarColumnMeta + */ + @JsonAnySetter + public CommitmentsScalarColumnMeta 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 CommitmentsScalarColumnMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsScalarColumnMeta commitmentsScalarColumnMeta = (CommitmentsScalarColumnMeta) o; + return Objects.equals(this.unit, commitmentsScalarColumnMeta.unit) + && Objects.equals( + this.additionalProperties, commitmentsScalarColumnMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(unit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsScalarColumnMeta {\n"); + sb.append(" unit: ").append(toIndentedString(unit)).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/CommitmentsScalarColumnType.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsScalarColumnType.java new file mode 100644 index 00000000000..4702181c777 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsScalarColumnType.java @@ -0,0 +1,58 @@ +/* + * 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 column type. "group" for dimension columns, "number" for metric columns. */ +@JsonSerialize(using = CommitmentsScalarColumnType.CommitmentsScalarColumnTypeSerializer.class) +public class CommitmentsScalarColumnType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("group", "number")); + + public static final CommitmentsScalarColumnType GROUP = new CommitmentsScalarColumnType("group"); + public static final CommitmentsScalarColumnType NUMBER = + new CommitmentsScalarColumnType("number"); + + CommitmentsScalarColumnType(String value) { + super(value, allowedValues); + } + + public static class CommitmentsScalarColumnTypeSerializer + extends StdSerializer { + public CommitmentsScalarColumnTypeSerializer(Class t) { + super(t); + } + + public CommitmentsScalarColumnTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CommitmentsScalarColumnType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CommitmentsScalarColumnType fromValue(String value) { + return new CommitmentsScalarColumnType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CommitmentsTimeseriesMetric.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsTimeseriesMetric.java new file mode 100644 index 00000000000..6a4b863659a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsTimeseriesMetric.java @@ -0,0 +1,214 @@ +/* + * 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; + +/** A timeseries metric containing timestamps, series values, and optional unit metadata. */ +@JsonPropertyOrder({ + CommitmentsTimeseriesMetric.JSON_PROPERTY_SERIES, + CommitmentsTimeseriesMetric.JSON_PROPERTY_TIMES, + CommitmentsTimeseriesMetric.JSON_PROPERTY_UNIT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsTimeseriesMetric { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SERIES = "series"; + private Map> series = new HashMap>(); + + public static final String JSON_PROPERTY_TIMES = "times"; + private List times = new ArrayList<>(); + + public static final String JSON_PROPERTY_UNIT = "unit"; + private CommitmentsUnit unit; + + public CommitmentsTimeseriesMetric() {} + + @JsonCreator + public CommitmentsTimeseriesMetric( + @JsonProperty(required = true, value = JSON_PROPERTY_SERIES) Map> series, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMES) List times) { + this.series = series; + this.times = times; + } + + public CommitmentsTimeseriesMetric series(Map> series) { + this.series = series; + return this; + } + + public CommitmentsTimeseriesMetric putSeriesItem(String key, List seriesItem) { + this.series.put(key, seriesItem); + return this; + } + + /** + * Timeseries data as a map of series names to their corresponding value arrays. + * + * @return series + */ + @JsonProperty(JSON_PROPERTY_SERIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map> getSeries() { + return series; + } + + public void setSeries(Map> series) { + this.series = series; + } + + public CommitmentsTimeseriesMetric times(List times) { + this.times = times; + return this; + } + + public CommitmentsTimeseriesMetric addTimesItem(Long timesItem) { + this.times.add(timesItem); + return this; + } + + /** + * Unix timestamps in seconds for the timeseries data points. + * + * @return times + */ + @JsonProperty(JSON_PROPERTY_TIMES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTimes() { + return times; + } + + public void setTimes(List times) { + this.times = times; + } + + public CommitmentsTimeseriesMetric unit(CommitmentsUnit unit) { + this.unit = unit; + this.unparsed |= unit.unparsed; + return this; + } + + /** + * Unit metadata for a numeric metric. + * + * @return unit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CommitmentsUnit getUnit() { + return unit; + } + + public void setUnit(CommitmentsUnit unit) { + this.unit = unit; + } + + /** + * 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 CommitmentsTimeseriesMetric + */ + @JsonAnySetter + public CommitmentsTimeseriesMetric 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 CommitmentsTimeseriesMetric object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsTimeseriesMetric commitmentsTimeseriesMetric = (CommitmentsTimeseriesMetric) o; + return Objects.equals(this.series, commitmentsTimeseriesMetric.series) + && Objects.equals(this.times, commitmentsTimeseriesMetric.times) + && Objects.equals(this.unit, commitmentsTimeseriesMetric.unit) + && Objects.equals( + this.additionalProperties, commitmentsTimeseriesMetric.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(series, times, unit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsTimeseriesMetric {\n"); + sb.append(" series: ").append(toIndentedString(series)).append("\n"); + sb.append(" times: ").append(toIndentedString(times)).append("\n"); + sb.append(" unit: ").append(toIndentedString(unit)).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/CommitmentsUnit.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsUnit.java new file mode 100644 index 00000000000..adeb1cc09ec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsUnit.java @@ -0,0 +1,285 @@ +/* + * 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; + +/** Unit metadata for a numeric metric. */ +@JsonPropertyOrder({ + CommitmentsUnit.JSON_PROPERTY_FAMILY, + CommitmentsUnit.JSON_PROPERTY_ID, + CommitmentsUnit.JSON_PROPERTY_NAME, + CommitmentsUnit.JSON_PROPERTY_PLURAL, + CommitmentsUnit.JSON_PROPERTY_SCALE_FACTOR, + CommitmentsUnit.JSON_PROPERTY_SHORT_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsUnit { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FAMILY = "family"; + private String family; + + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PLURAL = "plural"; + private String plural; + + public static final String JSON_PROPERTY_SCALE_FACTOR = "scale_factor"; + private Double scaleFactor; + + public static final String JSON_PROPERTY_SHORT_NAME = "short_name"; + private String shortName; + + public CommitmentsUnit() {} + + @JsonCreator + public CommitmentsUnit( + @JsonProperty(required = true, value = JSON_PROPERTY_FAMILY) String family, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) Long id, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_PLURAL) String plural, + @JsonProperty(required = true, value = JSON_PROPERTY_SCALE_FACTOR) Double scaleFactor, + @JsonProperty(required = true, value = JSON_PROPERTY_SHORT_NAME) String shortName) { + this.family = family; + this.id = id; + this.name = name; + this.plural = plural; + this.scaleFactor = scaleFactor; + this.shortName = shortName; + } + + public CommitmentsUnit family(String family) { + this.family = family; + return this; + } + + /** + * The unit family (for example, percentage or money). + * + * @return family + */ + @JsonProperty(JSON_PROPERTY_FAMILY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFamily() { + return family; + } + + public void setFamily(String family) { + this.family = family; + } + + public CommitmentsUnit id(Long id) { + this.id = id; + return this; + } + + /** + * The unit identifier. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public CommitmentsUnit name(String name) { + this.name = name; + return this; + } + + /** + * The unit name (for example, percent or dollar). + * + * @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 CommitmentsUnit plural(String plural) { + this.plural = plural; + return this; + } + + /** + * The plural form of the unit name. + * + * @return plural + */ + @JsonProperty(JSON_PROPERTY_PLURAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPlural() { + return plural; + } + + public void setPlural(String plural) { + this.plural = plural; + } + + public CommitmentsUnit scaleFactor(Double scaleFactor) { + this.scaleFactor = scaleFactor; + return this; + } + + /** + * The scale factor for the unit. + * + * @return scaleFactor + */ + @JsonProperty(JSON_PROPERTY_SCALE_FACTOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getScaleFactor() { + return scaleFactor; + } + + public void setScaleFactor(Double scaleFactor) { + this.scaleFactor = scaleFactor; + } + + public CommitmentsUnit shortName(String shortName) { + this.shortName = shortName; + return this; + } + + /** + * The abbreviated unit name (for example, % or $). + * + * @return shortName + */ + @JsonProperty(JSON_PROPERTY_SHORT_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShortName() { + return shortName; + } + + public void setShortName(String shortName) { + this.shortName = shortName; + } + + /** + * 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 CommitmentsUnit + */ + @JsonAnySetter + public CommitmentsUnit 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 CommitmentsUnit object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsUnit commitmentsUnit = (CommitmentsUnit) o; + return Objects.equals(this.family, commitmentsUnit.family) + && Objects.equals(this.id, commitmentsUnit.id) + && Objects.equals(this.name, commitmentsUnit.name) + && Objects.equals(this.plural, commitmentsUnit.plural) + && Objects.equals(this.scaleFactor, commitmentsUnit.scaleFactor) + && Objects.equals(this.shortName, commitmentsUnit.shortName) + && Objects.equals(this.additionalProperties, commitmentsUnit.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(family, id, name, plural, scaleFactor, shortName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsUnit {\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" plural: ").append(toIndentedString(plural)).append("\n"); + sb.append(" scaleFactor: ").append(toIndentedString(scaleFactor)).append("\n"); + sb.append(" shortName: ").append(toIndentedString(shortName)).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/CommitmentsUtilizationScalarProductBreakdownEntry.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsUtilizationScalarProductBreakdownEntry.java new file mode 100644 index 00000000000..01f36d986ab --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsUtilizationScalarProductBreakdownEntry.java @@ -0,0 +1,179 @@ +/* + * 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; + +/** Per-product utilization data in a scalar utilization response. */ +@JsonPropertyOrder({ + CommitmentsUtilizationScalarProductBreakdownEntry.JSON_PROPERTY_PRODUCT, + CommitmentsUtilizationScalarProductBreakdownEntry.JSON_PROPERTY_UTILIZATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsUtilizationScalarProductBreakdownEntry { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PRODUCT = "product"; + private String product; + + public static final String JSON_PROPERTY_UTILIZATION = "utilization"; + private Double utilization; + + public CommitmentsUtilizationScalarProductBreakdownEntry() {} + + @JsonCreator + public CommitmentsUtilizationScalarProductBreakdownEntry( + @JsonProperty(required = true, value = JSON_PROPERTY_PRODUCT) String product, + @JsonProperty(required = true, value = JSON_PROPERTY_UTILIZATION) Double utilization) { + this.product = product; + this.utilization = utilization; + } + + public CommitmentsUtilizationScalarProductBreakdownEntry product(String product) { + this.product = product; + return this; + } + + /** + * The cloud product name. + * + * @return product + */ + @JsonProperty(JSON_PROPERTY_PRODUCT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getProduct() { + return product; + } + + public void setProduct(String product) { + this.product = product; + } + + public CommitmentsUtilizationScalarProductBreakdownEntry utilization(Double utilization) { + this.utilization = utilization; + return this; + } + + /** + * The utilization percentage for the product. + * + * @return utilization + */ + @JsonProperty(JSON_PROPERTY_UTILIZATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getUtilization() { + return utilization; + } + + public void setUtilization(Double utilization) { + this.utilization = utilization; + } + + /** + * 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 CommitmentsUtilizationScalarProductBreakdownEntry + */ + @JsonAnySetter + public CommitmentsUtilizationScalarProductBreakdownEntry 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 CommitmentsUtilizationScalarProductBreakdownEntry object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsUtilizationScalarProductBreakdownEntry + commitmentsUtilizationScalarProductBreakdownEntry = + (CommitmentsUtilizationScalarProductBreakdownEntry) o; + return Objects.equals(this.product, commitmentsUtilizationScalarProductBreakdownEntry.product) + && Objects.equals( + this.utilization, commitmentsUtilizationScalarProductBreakdownEntry.utilization) + && Objects.equals( + this.additionalProperties, + commitmentsUtilizationScalarProductBreakdownEntry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(product, utilization, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsUtilizationScalarProductBreakdownEntry {\n"); + sb.append(" product: ").append(toIndentedString(product)).append("\n"); + sb.append(" utilization: ").append(toIndentedString(utilization)).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/CommitmentsUtilizationScalarResponse.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsUtilizationScalarResponse.java new file mode 100644 index 00000000000..23c32f83e53 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsUtilizationScalarResponse.java @@ -0,0 +1,202 @@ +/* + * 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; + +/** Response containing scalar utilization metrics for cloud commitment programs. */ +@JsonPropertyOrder({ + CommitmentsUtilizationScalarResponse.JSON_PROPERTY_COLUMNS, + CommitmentsUtilizationScalarResponse.JSON_PROPERTY_PRODUCT_BREAKDOWN +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsUtilizationScalarResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COLUMNS = "columns"; + private List columns = new ArrayList<>(); + + public static final String JSON_PROPERTY_PRODUCT_BREAKDOWN = "product_breakdown"; + private List productBreakdown = null; + + public CommitmentsUtilizationScalarResponse() {} + + @JsonCreator + public CommitmentsUtilizationScalarResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_COLUMNS) + List columns) { + this.columns = columns; + } + + public CommitmentsUtilizationScalarResponse columns(List columns) { + this.columns = columns; + for (CommitmentsScalarColumn item : columns) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CommitmentsUtilizationScalarResponse addColumnsItem(CommitmentsScalarColumn columnsItem) { + this.columns.add(columnsItem); + this.unparsed |= columnsItem.unparsed; + return this; + } + + /** + * Array of scalar columns in the response. + * + * @return columns + */ + @JsonProperty(JSON_PROPERTY_COLUMNS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getColumns() { + return columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + public CommitmentsUtilizationScalarResponse productBreakdown( + List productBreakdown) { + this.productBreakdown = productBreakdown; + for (CommitmentsUtilizationScalarProductBreakdownEntry item : productBreakdown) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CommitmentsUtilizationScalarResponse addProductBreakdownItem( + CommitmentsUtilizationScalarProductBreakdownEntry productBreakdownItem) { + if (this.productBreakdown == null) { + this.productBreakdown = new ArrayList<>(); + } + this.productBreakdown.add(productBreakdownItem); + this.unparsed |= productBreakdownItem.unparsed; + return this; + } + + /** + * Array of per-product utilization breakdown entries. + * + * @return productBreakdown + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRODUCT_BREAKDOWN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getProductBreakdown() { + return productBreakdown; + } + + public void setProductBreakdown( + List productBreakdown) { + this.productBreakdown = productBreakdown; + } + + /** + * 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 CommitmentsUtilizationScalarResponse + */ + @JsonAnySetter + public CommitmentsUtilizationScalarResponse 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 CommitmentsUtilizationScalarResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsUtilizationScalarResponse commitmentsUtilizationScalarResponse = + (CommitmentsUtilizationScalarResponse) o; + return Objects.equals(this.columns, commitmentsUtilizationScalarResponse.columns) + && Objects.equals( + this.productBreakdown, commitmentsUtilizationScalarResponse.productBreakdown) + && Objects.equals( + this.additionalProperties, commitmentsUtilizationScalarResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(columns, productBreakdown, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsUtilizationScalarResponse {\n"); + sb.append(" columns: ").append(toIndentedString(columns)).append("\n"); + sb.append(" productBreakdown: ").append(toIndentedString(productBreakdown)).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/CommitmentsUtilizationTimeseriesResponse.java b/src/main/java/com/datadog/api/client/v2/model/CommitmentsUtilizationTimeseriesResponse.java new file mode 100644 index 00000000000..0ca2080c58e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CommitmentsUtilizationTimeseriesResponse.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; + +/** Response containing timeseries utilization metrics for cloud commitment programs. */ +@JsonPropertyOrder({ + CommitmentsUtilizationTimeseriesResponse.JSON_PROPERTY_SERIES, + CommitmentsUtilizationTimeseriesResponse.JSON_PROPERTY_TIMES, + CommitmentsUtilizationTimeseriesResponse.JSON_PROPERTY_UNIT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CommitmentsUtilizationTimeseriesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SERIES = "series"; + private Map> series = new HashMap>(); + + public static final String JSON_PROPERTY_TIMES = "times"; + private List times = new ArrayList<>(); + + public static final String JSON_PROPERTY_UNIT = "unit"; + private CommitmentsUnit unit; + + public CommitmentsUtilizationTimeseriesResponse() {} + + @JsonCreator + public CommitmentsUtilizationTimeseriesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_SERIES) Map> series, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMES) List times) { + this.series = series; + this.times = times; + } + + public CommitmentsUtilizationTimeseriesResponse series(Map> series) { + this.series = series; + return this; + } + + public CommitmentsUtilizationTimeseriesResponse putSeriesItem( + String key, List seriesItem) { + this.series.put(key, seriesItem); + return this; + } + + /** + * Timeseries data as a map of series names to their corresponding value arrays. + * + * @return series + */ + @JsonProperty(JSON_PROPERTY_SERIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Map> getSeries() { + return series; + } + + public void setSeries(Map> series) { + this.series = series; + } + + public CommitmentsUtilizationTimeseriesResponse times(List times) { + this.times = times; + return this; + } + + public CommitmentsUtilizationTimeseriesResponse addTimesItem(Long timesItem) { + this.times.add(timesItem); + return this; + } + + /** + * Unix timestamps in seconds for the timeseries data points. + * + * @return times + */ + @JsonProperty(JSON_PROPERTY_TIMES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTimes() { + return times; + } + + public void setTimes(List times) { + this.times = times; + } + + public CommitmentsUtilizationTimeseriesResponse unit(CommitmentsUnit unit) { + this.unit = unit; + this.unparsed |= unit.unparsed; + return this; + } + + /** + * Unit metadata for a numeric metric. + * + * @return unit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UNIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CommitmentsUnit getUnit() { + return unit; + } + + public void setUnit(CommitmentsUnit unit) { + this.unit = unit; + } + + /** + * 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 CommitmentsUtilizationTimeseriesResponse + */ + @JsonAnySetter + public CommitmentsUtilizationTimeseriesResponse 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 CommitmentsUtilizationTimeseriesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CommitmentsUtilizationTimeseriesResponse commitmentsUtilizationTimeseriesResponse = + (CommitmentsUtilizationTimeseriesResponse) o; + return Objects.equals(this.series, commitmentsUtilizationTimeseriesResponse.series) + && Objects.equals(this.times, commitmentsUtilizationTimeseriesResponse.times) + && Objects.equals(this.unit, commitmentsUtilizationTimeseriesResponse.unit) + && Objects.equals( + this.additionalProperties, + commitmentsUtilizationTimeseriesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(series, times, unit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CommitmentsUtilizationTimeseriesResponse {\n"); + sb.append(" series: ").append(toIndentedString(series)).append("\n"); + sb.append(" times: ").append(toIndentedString(times)).append("\n"); + sb.append(" unit: ").append(toIndentedString(unit)).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 d06acba8d82..76cb7c1d63e 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 @@ -294,6 +294,182 @@ Feature: Cloud Cost Management When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (scalar) returns "Bad Request" response + Given operation "GetCommitmentsCoverageScalar" enabled + And new "GetCommitmentsCoverageScalar" 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" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (scalar) returns "OK" response + Given operation "GetCommitmentsCoverageScalar" enabled + And new "GetCommitmentsCoverageScalar" 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" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsCoverageTimeseries" enabled + And new "GetCommitmentsCoverageTimeseries" 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" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments coverage (timeseries) returns "OK" response + Given operation "GetCommitmentsCoverageTimeseries" enabled + And new "GetCommitmentsCoverageTimeseries" 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" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/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" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/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" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments on-demand hot spots (scalar) returns "Bad Request" response + Given operation "GetCommitmentsOnDemandHotspotsScalar" enabled + And new "GetCommitmentsOnDemandHotspotsScalar" 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" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments on-demand hot spots (scalar) returns "OK" response + Given operation "GetCommitmentsOnDemandHotspotsScalar" enabled + And new "GetCommitmentsOnDemandHotspotsScalar" 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" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (scalar) returns "Bad Request" response + Given operation "GetCommitmentsSavingsScalar" enabled + And new "GetCommitmentsSavingsScalar" 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" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (scalar) returns "OK" response + Given operation "GetCommitmentsSavingsScalar" enabled + And new "GetCommitmentsSavingsScalar" 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" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsSavingsTimeseries" enabled + And new "GetCommitmentsSavingsTimeseries" 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" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments savings (timeseries) returns "OK" response + Given operation "GetCommitmentsSavingsTimeseries" enabled + And new "GetCommitmentsSavingsTimeseries" 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" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (scalar) returns "Bad Request" response + Given operation "GetCommitmentsUtilizationScalar" enabled + And new "GetCommitmentsUtilizationScalar" 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" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (scalar) returns "OK" response + Given operation "GetCommitmentsUtilizationScalar" enabled + And new "GetCommitmentsUtilizationScalar" 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" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (timeseries) returns "Bad Request" response + Given operation "GetCommitmentsUtilizationTimeseries" enabled + And new "GetCommitmentsUtilizationTimeseries" 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" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-cost-management + Scenario: Get commitments utilization (timeseries) returns "OK" response + Given operation "GetCommitmentsUtilizationTimeseries" enabled + And new "GetCommitmentsUtilizationTimeseries" 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" + When the request is sent + Then the response status is 200 OK + @replay-only @team:DataDog/cloud-cost-management Scenario: Get cost AWS CUR config returns "OK" response Given new "GetCostAWSCURConfig" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 35b117222c3..66617ea0c43 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1428,6 +1428,54 @@ "type": "safe" } }, + "GetCommitmentsCommitmentList": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsCoverageScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsCoverageTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsOnDemandHotspotsScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsSavingsScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsSavingsTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsUtilizationScalar": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, + "GetCommitmentsUtilizationTimeseries": { + "tag": "Cloud Cost Management", + "undo": { + "type": "safe" + } + }, "ListCustomCostsFiles": { "tag": "Cloud Cost Management", "undo": {