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
4 changes: 3 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22397,7 +22397,9 @@ components:
$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."
description: |-
Controls how costs are aggregated when using `start_date`.
The `cumulative` option returns month-to-date running totals.
enum:
- cumulative
type: string
Expand Down
28 changes: 28 additions & 0 deletions src/main/java/com/datadog/api/client/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public class ApiClient {
protected Map<String, String> defaultCookieMap = new HashMap<String, String>();
protected String basePath = "https://api.datadoghq.com";
protected String userAgent;
private boolean isIaC = false;
private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;

protected List<ServerConfiguration> servers =
Expand Down Expand Up @@ -1937,6 +1938,33 @@ public ApiClient addDefaultHeader(String key, String value) {
return this;
}

/**
* Set whether this API client is managed by Infrastructure as Code (IaC) tooling. When enabled,
* the {@code X-Datadog-Managed-By: iac} header is sent on every request made through this client
* (by adding to the default header map).
*
* @param isIaC Whether calls made with this client originate from IaC tooling
* @return API client
*/
public ApiClient setIsIaC(boolean isIaC) {
this.isIaC = isIaC;
if (isIaC) {
addDefaultHeader("X-Datadog-Managed-By", "iac");
} else {
defaultHeaderMap.remove("X-Datadog-Managed-By");
}
return this;
}

/**
* Get whether this API client is managed by Infrastructure as Code (IaC) tooling.
*
* @return Whether this client is managed by IaC tooling
*/
public boolean getIsIaC() {
return isIaC;
}

/**
* Add a default cookie.
*
Expand Down
Loading