Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13765,6 +13765,13 @@ components:
data:
$ref: "#/components/schemas/ConvertJobResultsToSignalsData"
type: object
CostAggregationType:
description: "Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals."
enum:
- cumulative
type: string
x-enum-varnames:
- CUMULATIVE
CostAttributionAggregates:
description: An array of available aggregates.
items:
Expand Down Expand Up @@ -106713,6 +106720,12 @@ paths:
schema:
format: date-time
type: string
- description: "Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals."
in: query
name: cost_aggregation
required: false
schema:
$ref: "#/components/schemas/CostAggregationType"
- description: "Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to `false`."
in: query
name: include_connected_accounts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.datadog.api.client.Pair;
import com.datadog.api.client.v2.model.ActiveBillingDimensionsResponse;
import com.datadog.api.client.v2.model.BillingDimensionsMappingResponse;
import com.datadog.api.client.v2.model.CostAggregationType;
import com.datadog.api.client.v2.model.CostByOrgResponse;
import com.datadog.api.client.v2.model.HourlyUsageResponse;
import com.datadog.api.client.v2.model.MonthlyCostAttributionResponse;
Expand Down Expand Up @@ -595,6 +596,7 @@ public static class GetEstimatedCostByOrgOptionalParameters {
private OffsetDateTime endMonth;
private OffsetDateTime startDate;
private OffsetDateTime endDate;
private CostAggregationType costAggregation;
private Boolean includeConnectedAccounts;

/**
Expand Down Expand Up @@ -662,6 +664,19 @@ public GetEstimatedCostByOrgOptionalParameters endDate(OffsetDateTime endDate) {
return this;
}

/**
* Set costAggregation.
*
* @param costAggregation Controls how costs are aggregated when using <code>start_date</code>.
* The <code>cumulative</code> option returns month-to-date running totals. (optional)
* @return GetEstimatedCostByOrgOptionalParameters
*/
public GetEstimatedCostByOrgOptionalParameters costAggregation(
CostAggregationType costAggregation) {
this.costAggregation = costAggregation;
return this;
}

/**
* Set includeConnectedAccounts.
*
Expand Down Expand Up @@ -767,6 +782,7 @@ public ApiResponse<CostByOrgResponse> getEstimatedCostByOrgWithHttpInfo(
OffsetDateTime endMonth = parameters.endMonth;
OffsetDateTime startDate = parameters.startDate;
OffsetDateTime endDate = parameters.endDate;
CostAggregationType costAggregation = parameters.costAggregation;
Boolean includeConnectedAccounts = parameters.includeConnectedAccounts;
// create path and map variables
String localVarPath = "/api/v2/usage/estimated_cost";
Expand All @@ -779,6 +795,7 @@ public ApiResponse<CostByOrgResponse> getEstimatedCostByOrgWithHttpInfo(
localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_month", endMonth));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start_date", startDate));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_date", endDate));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "cost_aggregation", costAggregation));
localVarQueryParams.addAll(
apiClient.parameterToPairs("", "include_connected_accounts", includeConnectedAccounts));

Expand Down Expand Up @@ -818,6 +835,7 @@ public CompletableFuture<ApiResponse<CostByOrgResponse>> getEstimatedCostByOrgWi
OffsetDateTime endMonth = parameters.endMonth;
OffsetDateTime startDate = parameters.startDate;
OffsetDateTime endDate = parameters.endDate;
CostAggregationType costAggregation = parameters.costAggregation;
Boolean includeConnectedAccounts = parameters.includeConnectedAccounts;
// create path and map variables
String localVarPath = "/api/v2/usage/estimated_cost";
Expand All @@ -830,6 +848,7 @@ public CompletableFuture<ApiResponse<CostByOrgResponse>> getEstimatedCostByOrgWi
localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_month", endMonth));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "start_date", startDate));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_date", endDate));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "cost_aggregation", costAggregation));
localVarQueryParams.addAll(
apiClient.parameterToPairs("", "include_connected_accounts", includeConnectedAccounts));

Expand Down
Original file line number Diff line number Diff line change
@@ -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;

/**
* Controls how costs are aggregated when using <code>start_date</code>. The <code>cumulative</code>
* option returns month-to-date running totals.
*/
@JsonSerialize(using = CostAggregationType.CostAggregationTypeSerializer.class)
public class CostAggregationType extends ModelEnum<String> {

private static final Set<String> allowedValues = new HashSet<String>(Arrays.asList("cumulative"));

public static final CostAggregationType CUMULATIVE = new CostAggregationType("cumulative");

CostAggregationType(String value) {
super(value, allowedValues);
}

public static class CostAggregationTypeSerializer extends StdSerializer<CostAggregationType> {
public CostAggregationTypeSerializer(Class<CostAggregationType> t) {
super(t);
}

public CostAggregationTypeSerializer() {
this(null);
}

@Override
public void serialize(
CostAggregationType value, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonProcessingException {
jgen.writeObject(value.value);
}
}

@JsonCreator
public static CostAggregationType fromValue(String value) {
return new CostAggregationType(value);
}
}
Loading