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
59 changes: 58 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38523,6 +38523,8 @@ components:
properties:
id:
$ref: '#/components/schemas/MetricName'
relationships:
$ref: '#/components/schemas/MetricRelationships'
type:
$ref: '#/components/schemas/MetricType'
type: object
Expand Down Expand Up @@ -39298,6 +39300,12 @@ components:
format: double
type: number
type: object
MetricRelationships:
description: Relationships to related metric objects.
properties:
metric_volumes:
$ref: '#/components/schemas/MetricVolumesRelationship'
type: object
MetricResource:
description: Metric resource.
example:
Expand Down Expand Up @@ -39741,6 +39749,33 @@ components:
oneOf:
- $ref: '#/components/schemas/MetricDistinctVolume'
- $ref: '#/components/schemas/MetricIngestedIndexedVolume'
MetricVolumesInclude:
description: Comma-separated list of additional data to include in the response.
Allowed values are `metric_volumes`.
enum:
- metric_volumes
- generated_metric_attributes
type: string
x-enum-varnames:
- METRIC_VOLUMES
- GENERATED_METRIC_ATTRIBUTES
MetricVolumesRelationship:
description: Relationship to a metric's ingested and indexed volumes.
properties:
data:
$ref: '#/components/schemas/MetricVolumesRelationshipData'
type: object
MetricVolumesRelationshipData:
description: Relationship data for a metric's ingested and indexed volumes.
properties:
id:
$ref: '#/components/schemas/MetricName'
type:
$ref: '#/components/schemas/MetricIngestedIndexedVolumeType'
required:
- type
- id
type: object
MetricVolumesResponse:
description: Response object which includes a single metric's volume.
properties:
Expand Down Expand Up @@ -39787,6 +39822,12 @@ components:
items:
$ref: '#/components/schemas/MetricsAndMetricTagConfigurations'
type: array
included:
description: Array of included metric volume objects. Only present when
`include=metric_volumes` is requested.
items:
$ref: '#/components/schemas/MetricIngestedIndexedVolume'
type: array
links:
$ref: '#/components/schemas/MetricsListResponseLinks'
meta:
Expand Down Expand Up @@ -91450,7 +91491,13 @@ paths:
`next_cursor` value from the response as the new `page[cursor]` value.

Once the `meta.pagination.next_cursor` value is null, all pages have been
retrieved.'
retrieved.

Use the `include` query parameter to fetch additional data with the response.
When `include=metric_volumes` is specified, the response includes volume data
for each custom metric in the `included` array, with a corresponding `relationships`
link on each metric in `data`. Volume data is only returned for custom metrics.
All volume values represent a 1-hour timeframe.'
operationId: ListTagConfigurations
parameters:
- description: Filter custom metrics that have configured tags.
Expand Down Expand Up @@ -91532,6 +91579,16 @@ paths:
required: false
schema:
type: boolean
- description: 'Comma-separated list of additional data to include in the response.
Allowed values: `metric_volumes`. When `metric_volumes` is specified, the
response includes volume data for each custom metric in the `included` array,
with a corresponding `relationships` link on each metric in `data`.'
example: metric_volumes
in: query
name: include
required: false
schema:
$ref: '#/components/schemas/MetricVolumesInclude'
- description: 'The number of seconds of look back (from now) to apply to a
filter[tag] or filter[queried] query.

Expand Down
27 changes: 26 additions & 1 deletion src/main/java/com/datadog/api/client/v2/api/MetricsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.datadog.api.client.v2.model.MetricTagConfigurationMetricTypeCategory;
import com.datadog.api.client.v2.model.MetricTagConfigurationResponse;
import com.datadog.api.client.v2.model.MetricTagConfigurationUpdateRequest;
import com.datadog.api.client.v2.model.MetricVolumesInclude;
import com.datadog.api.client.v2.model.MetricVolumesResponse;
import com.datadog.api.client.v2.model.MetricsAndMetricTagConfigurations;
import com.datadog.api.client.v2.model.MetricsAndMetricTagConfigurationsResponse;
Expand Down Expand Up @@ -1599,6 +1600,7 @@ public static class ListTagConfigurationsOptionalParameters {
private Long filterQueriedWindowSeconds;
private String filterTags;
private Boolean filterRelatedAssets;
private MetricVolumesInclude include;
private Long windowSeconds;
private Integer pageSize;
private String pageCursor;
Expand Down Expand Up @@ -1709,6 +1711,21 @@ public ListTagConfigurationsOptionalParameters filterRelatedAssets(
return this;
}

/**
* Set include.
*
* @param include Comma-separated list of additional data to include in the response. Allowed
* values: <code>metric_volumes</code>. When <code>metric_volumes</code> is specified, the
* response includes volume data for each custom metric in the <code>included</code> array,
* with a corresponding <code>relationships</code> link on each metric in <code>data</code>.
* (optional)
* @return ListTagConfigurationsOptionalParameters
*/
public ListTagConfigurationsOptionalParameters include(MetricVolumesInclude include) {
this.include = include;
return this;
}

/**
* Set windowSeconds.
*
Expand Down Expand Up @@ -1867,7 +1884,11 @@ public PaginationIterable<MetricsAndMetricTagConfigurations> listTagConfiguratio
* page[size]</code> or an empty cursor like <code>page[cursor]=</code>. To fetch the next page,
* pass in the <code>next_cursor</code> value from the response as the new <code>page[cursor]
* </code> value. Once the <code>meta.pagination.next_cursor</code> value is null, all pages have
* been retrieved.
* been retrieved. Use the <code>include</code> query parameter to fetch additional data with the
* response. When <code>include=metric_volumes</code> is specified, the response includes volume
* data for each custom metric in the <code>included</code> array, with a corresponding <code>
* relationships</code> link on each metric in <code>data</code>. Volume data is only returned for
* custom metrics. All volume values represent a 1-hour timeframe.
*
* @param parameters Optional parameters for the request.
* @return ApiResponse&lt;MetricsAndMetricTagConfigurationsResponse&gt;
Expand All @@ -1893,6 +1914,7 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
Long filterQueriedWindowSeconds = parameters.filterQueriedWindowSeconds;
String filterTags = parameters.filterTags;
Boolean filterRelatedAssets = parameters.filterRelatedAssets;
MetricVolumesInclude include = parameters.include;
Long windowSeconds = parameters.windowSeconds;
Integer pageSize = parameters.pageSize;
String pageCursor = parameters.pageCursor;
Expand All @@ -1917,6 +1939,7 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags));
localVarQueryParams.addAll(
apiClient.parameterToPairs("", "filter[related_assets]", filterRelatedAssets));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor));
Expand Down Expand Up @@ -1960,6 +1983,7 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
Long filterQueriedWindowSeconds = parameters.filterQueriedWindowSeconds;
String filterTags = parameters.filterTags;
Boolean filterRelatedAssets = parameters.filterRelatedAssets;
MetricVolumesInclude include = parameters.include;
Long windowSeconds = parameters.windowSeconds;
Integer pageSize = parameters.pageSize;
String pageCursor = parameters.pageCursor;
Expand All @@ -1984,6 +2008,7 @@ public ApiResponse<MetricsAndMetricTagConfigurationsResponse> listTagConfigurati
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags));
localVarQueryParams.addAll(
apiClient.parameterToPairs("", "filter[related_assets]", filterRelatedAssets));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "include", include));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor));
Expand Down
35 changes: 33 additions & 2 deletions src/main/java/com/datadog/api/client/v2/model/Metric.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@
import java.util.Objects;

/** Object for a single metric tag configuration. */
@JsonPropertyOrder({Metric.JSON_PROPERTY_ID, Metric.JSON_PROPERTY_TYPE})
@JsonPropertyOrder({
Metric.JSON_PROPERTY_ID,
Metric.JSON_PROPERTY_RELATIONSHIPS,
Metric.JSON_PROPERTY_TYPE
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class Metric {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_ID = "id";
private String id;

public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships";
private MetricRelationships relationships;

public static final String JSON_PROPERTY_TYPE = "type";
private MetricType type = MetricType.METRICS;

Expand All @@ -49,6 +56,28 @@ public void setId(String id) {
this.id = id;
}

public Metric relationships(MetricRelationships relationships) {
this.relationships = relationships;
this.unparsed |= relationships.unparsed;
return this;
}

/**
* Relationships to related metric objects.
*
* @return relationships
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_RELATIONSHIPS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public MetricRelationships getRelationships() {
return relationships;
}

public void setRelationships(MetricRelationships relationships) {
this.relationships = relationships;
}

public Metric type(MetricType type) {
this.type = type;
this.unparsed |= !type.isValid();
Expand Down Expand Up @@ -131,20 +160,22 @@ public boolean equals(Object o) {
}
Metric metric = (Metric) o;
return Objects.equals(this.id, metric.id)
&& Objects.equals(this.relationships, metric.relationships)
&& Objects.equals(this.type, metric.type)
&& Objects.equals(this.additionalProperties, metric.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(id, type, additionalProperties);
return Objects.hash(id, relationships, type, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Metric {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

/** Relationships to related metric objects. */
@JsonPropertyOrder({MetricRelationships.JSON_PROPERTY_METRIC_VOLUMES})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class MetricRelationships {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_METRIC_VOLUMES = "metric_volumes";
private MetricVolumesRelationship metricVolumes;

public MetricRelationships metricVolumes(MetricVolumesRelationship metricVolumes) {
this.metricVolumes = metricVolumes;
this.unparsed |= metricVolumes.unparsed;
return this;
}

/**
* Relationship to a metric's ingested and indexed volumes.
*
* @return metricVolumes
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_METRIC_VOLUMES)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public MetricVolumesRelationship getMetricVolumes() {
return metricVolumes;
}

public void setMetricVolumes(MetricVolumesRelationship metricVolumes) {
this.metricVolumes = metricVolumes;
}

/**
* 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<String, Object> 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 MetricRelationships
*/
@JsonAnySetter
public MetricRelationships putAdditionalProperty(String key, Object value) {
if (this.additionalProperties == null) {
this.additionalProperties = new HashMap<String, Object>();
}
this.additionalProperties.put(key, value);
return this;
}

/**
* Return the additional (undeclared) property.
*
* @return The additional properties
*/
@JsonAnyGetter
public Map<String, Object> 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 MetricRelationships object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MetricRelationships metricRelationships = (MetricRelationships) o;
return Objects.equals(this.metricVolumes, metricRelationships.metricVolumes)
&& Objects.equals(this.additionalProperties, metricRelationships.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(metricVolumes, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class MetricRelationships {\n");
sb.append(" metricVolumes: ").append(toIndentedString(metricVolumes)).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 ");
}
}
Loading
Loading