From 00185e2ee3db595d918c1c9c568bcd1e96dbc1e0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 30 Jun 2025 08:50:01 +0000 Subject: [PATCH] Regenerate client from commit 36849030 of spec repo --- .apigentools-info | 8 ++--- .generator/schemas/v2/openapi.yaml | 11 +++++++ api/datadogV2/api_metrics.go | 30 ++++++++++++++++++- .../v2/metrics/ListVolumesByMetricName.go | 2 +- 4 files changed, 45 insertions(+), 6 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 39a687f5adf..3d78d741ef8 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:23.043504", - "spec_repo_commit": "76086f13" + "regenerated": "2025-06-30 08:48:16.966449", + "spec_repo_commit": "36849030" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-26 17:56:23.062756", - "spec_repo_commit": "76086f13" + "regenerated": "2025-06-30 08:48:16.998415", + "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/api/datadogV2/api_metrics.go b/api/datadogV2/api_metrics.go index c1a5915232f..c5f4c1d20a2 100644 --- a/api/datadogV2/api_metrics.go +++ b/api/datadogV2/api_metrics.go @@ -1010,17 +1010,42 @@ func (a *MetricsApi) ListTagsByMetricName(ctx _context.Context, metricName strin return localVarReturnValue, localVarHTTPResponse, nil } +// ListVolumesByMetricNameOptionalParameters holds optional parameters for ListVolumesByMetricName. +type ListVolumesByMetricNameOptionalParameters struct { + WindowSeconds *int64 +} + +// NewListVolumesByMetricNameOptionalParameters creates an empty struct for parameters. +func NewListVolumesByMetricNameOptionalParameters() *ListVolumesByMetricNameOptionalParameters { + this := ListVolumesByMetricNameOptionalParameters{} + return &this +} + +// WithWindowSeconds sets the corresponding parameter name and returns the struct. +func (r *ListVolumesByMetricNameOptionalParameters) WithWindowSeconds(windowSeconds int64) *ListVolumesByMetricNameOptionalParameters { + r.WindowSeconds = &windowSeconds + return r +} + // ListVolumesByMetricName List distinct metric volumes by metric name. // View distinct metrics volumes for the given metric name. // // Custom metrics generated in-app from other products will return `null` for ingested volumes. -func (a *MetricsApi) ListVolumesByMetricName(ctx _context.Context, metricName string) (MetricVolumesResponse, *_nethttp.Response, error) { +func (a *MetricsApi) ListVolumesByMetricName(ctx _context.Context, metricName string, o ...ListVolumesByMetricNameOptionalParameters) (MetricVolumesResponse, *_nethttp.Response, error) { var ( localVarHTTPMethod = _nethttp.MethodGet localVarPostBody interface{} localVarReturnValue MetricVolumesResponse + optionalParams ListVolumesByMetricNameOptionalParameters ) + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListVolumesByMetricNameOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.MetricsApi.ListVolumesByMetricName") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -1032,6 +1057,9 @@ func (a *MetricsApi) ListVolumesByMetricName(ctx _context.Context, metricName st localVarHeaderParams := make(map[string]string) localVarQueryParams := _neturl.Values{} localVarFormParams := _neturl.Values{} + if optionalParams.WindowSeconds != nil { + localVarQueryParams.Add("window[seconds]", datadog.ParameterToString(*optionalParams.WindowSeconds, "")) + } localVarHeaderParams["Accept"] = "application/json" datadog.SetAuthKeys( diff --git a/examples/v2/metrics/ListVolumesByMetricName.go b/examples/v2/metrics/ListVolumesByMetricName.go index 8d1cfe97cc0..14696a08192 100644 --- a/examples/v2/metrics/ListVolumesByMetricName.go +++ b/examples/v2/metrics/ListVolumesByMetricName.go @@ -17,7 +17,7 @@ func main() { configuration := datadog.NewConfiguration() apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewMetricsApi(apiClient) - resp, r, err := api.ListVolumesByMetricName(ctx, "static_test_metric_donotdelete") + resp, r, err := api.ListVolumesByMetricName(ctx, "static_test_metric_donotdelete", *datadogV2.NewListVolumesByMetricNameOptionalParameters()) if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `MetricsApi.ListVolumesByMetricName`: %v\n", err)