diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index db3332717da..1eb8e5c4b48 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -116096,12 +116096,22 @@ paths: /api/v2/metrics/{metric_name}/volumes: get: description: |- - View distinct metrics volumes for the given metric name. + View hourly average metric volumes for the given metric name over the look back period. Custom metrics generated in-app from other products will return `null` for ingested volumes. operationId: ListVolumesByMetricName parameters: - $ref: "#/components/parameters/MetricName" + - description: |- + The number of seconds of look back (from now). + Default value is 3,600 (1 hour), maximum value is 2,592,000 (1 month). + example: 7200 + in: query + name: window[seconds] + required: false + schema: + format: int64 + type: integer responses: "200": content: diff --git a/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java b/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java index 0694c174a0a..c29ba43a380 100644 --- a/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/MetricsApi.java @@ -2319,6 +2319,23 @@ public ApiResponse listTagsByMetricNameWithHttpInfo( new GenericType() {}); } + /** Manage optional parameters to listVolumesByMetricName. */ + public static class ListVolumesByMetricNameOptionalParameters { + private Long windowSeconds; + + /** + * Set windowSeconds. + * + * @param windowSeconds The number of seconds of look back (from now). Default value is 3,600 (1 + * hour), maximum value is 2,592,000 (1 month). (optional) + * @return ListVolumesByMetricNameOptionalParameters + */ + public ListVolumesByMetricNameOptionalParameters windowSeconds(Long windowSeconds) { + this.windowSeconds = windowSeconds; + return this; + } + } + /** * List distinct metric volumes by metric name. * @@ -2329,7 +2346,9 @@ public ApiResponse listTagsByMetricNameWithHttpInfo( * @throws ApiException if fails to make API call */ public MetricVolumesResponse listVolumesByMetricName(String metricName) throws ApiException { - return listVolumesByMetricNameWithHttpInfo(metricName).getData(); + return listVolumesByMetricNameWithHttpInfo( + metricName, new ListVolumesByMetricNameOptionalParameters()) + .getData(); } /** @@ -2341,7 +2360,41 @@ public MetricVolumesResponse listVolumesByMetricName(String metricName) throws A * @return CompletableFuture<MetricVolumesResponse> */ public CompletableFuture listVolumesByMetricNameAsync(String metricName) { - return listVolumesByMetricNameWithHttpInfoAsync(metricName) + return listVolumesByMetricNameWithHttpInfoAsync( + metricName, new ListVolumesByMetricNameOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List distinct metric volumes by metric name. + * + *

See {@link #listVolumesByMetricNameWithHttpInfo}. + * + * @param metricName The name of the metric. (required) + * @param parameters Optional parameters for the request. + * @return MetricVolumesResponse + * @throws ApiException if fails to make API call + */ + public MetricVolumesResponse listVolumesByMetricName( + String metricName, ListVolumesByMetricNameOptionalParameters parameters) throws ApiException { + return listVolumesByMetricNameWithHttpInfo(metricName, parameters).getData(); + } + + /** + * List distinct metric volumes by metric name. + * + *

See {@link #listVolumesByMetricNameWithHttpInfoAsync}. + * + * @param metricName The name of the metric. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<MetricVolumesResponse> + */ + public CompletableFuture listVolumesByMetricNameAsync( + String metricName, ListVolumesByMetricNameOptionalParameters parameters) { + return listVolumesByMetricNameWithHttpInfoAsync(metricName, parameters) .thenApply( response -> { return response.getData(); @@ -2349,12 +2402,13 @@ public CompletableFuture listVolumesByMetricNameAsync(Str } /** - * View distinct metrics volumes for the given metric name. + * View hourly average metric volumes for the given metric name over the look back period. * *

Custom metrics generated in-app from other products will return null for * ingested volumes. * * @param metricName The name of the metric. (required) + * @param parameters Optional parameters for the request. * @return ApiResponse<MetricVolumesResponse> * @throws ApiException if fails to make API call * @http.response.details @@ -2368,8 +2422,8 @@ public CompletableFuture listVolumesByMetricNameAsync(Str * 429 Too Many Requests - * */ - public ApiResponse listVolumesByMetricNameWithHttpInfo(String metricName) - throws ApiException { + public ApiResponse listVolumesByMetricNameWithHttpInfo( + String metricName, ListVolumesByMetricNameOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'metricName' is set @@ -2377,19 +2431,23 @@ public ApiResponse listVolumesByMetricNameWithHttpInfo(St throw new ApiException( 400, "Missing the required parameter 'metricName' when calling listVolumesByMetricName"); } + Long windowSeconds = parameters.windowSeconds; // create path and map variables String localVarPath = "/api/v2/metrics/{metric_name}/volumes" .replaceAll( "\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds)); + Invocation.Builder builder = apiClient.createBuilder( "v2.MetricsApi.listVolumesByMetricName", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -2411,10 +2469,12 @@ public ApiResponse listVolumesByMetricNameWithHttpInfo(St *

See {@link #listVolumesByMetricNameWithHttpInfo}. * * @param metricName The name of the metric. (required) + * @param parameters Optional parameters for the request. * @return CompletableFuture<ApiResponse<MetricVolumesResponse>> */ public CompletableFuture> - listVolumesByMetricNameWithHttpInfoAsync(String metricName) { + listVolumesByMetricNameWithHttpInfoAsync( + String metricName, ListVolumesByMetricNameOptionalParameters parameters) { Object localVarPostBody = null; // verify the required parameter 'metricName' is set @@ -2426,21 +2486,25 @@ public ApiResponse listVolumesByMetricNameWithHttpInfo(St "Missing the required parameter 'metricName' when calling listVolumesByMetricName")); return result; } + Long windowSeconds = parameters.windowSeconds; // create path and map variables String localVarPath = "/api/v2/metrics/{metric_name}/volumes" .replaceAll( "\\{" + "metric_name" + "\\}", apiClient.escapeString(metricName.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "window[seconds]", windowSeconds)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( "v2.MetricsApi.listVolumesByMetricName", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"},