diff --git a/.apigentools-info b/.apigentools-info index c53cda096f6..93356a154af 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-26 17:56:33.436535", - "spec_repo_commit": "76086f13" + "regenerated": "2025-06-30 08:48:16.699190", + "spec_repo_commit": "36849030" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-26 17:56:33.454744", - "spec_repo_commit": "76086f13" + "regenerated": "2025-06-30 08:48:16.730642", + "spec_repo_commit": "36849030" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d5a8de2b6ae..f092181602a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -52633,6 +52633,17 @@ paths: operationId: ListVolumesByMetricName parameters: - $ref: '#/components/parameters/MetricName' + - description: 'The number of seconds of look back (from now). + + Default value is 604,800 (1 week), minimum value is 7200 (2 hours), maximum + value is 2,630,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 1ef558d1378..18526075ad1 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 @@ -1980,6 +1980,24 @@ public ApiResponse listTagsByMetricNameWithHttpInfo(Strin 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 604,800 + * (1 week), minimum value is 7200 (2 hours), maximum value is 2,630,000 (1 month). + * (optional) + * @return ListVolumesByMetricNameOptionalParameters + */ + public ListVolumesByMetricNameOptionalParameters windowSeconds(Long windowSeconds) { + this.windowSeconds = windowSeconds; + return this; + } + } + /** * List distinct metric volumes by metric name. * @@ -1990,7 +2008,9 @@ public ApiResponse listTagsByMetricNameWithHttpInfo(Strin * @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(); } /** @@ -2002,7 +2022,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(); @@ -2016,6 +2070,7 @@ public CompletableFuture listVolumesByMetricNameAsync(Str * 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 @@ -2029,8 +2084,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 @@ -2038,19 +2093,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"}, @@ -2072,10 +2131,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 @@ -2087,21 +2148,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"},