Skip to content

Commit

Permalink
Regenerate client from commit 3231f2a2 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Dec 10, 2024
1 parent 8805564 commit 7d8dfb0
Show file tree
Hide file tree
Showing 12 changed files with 1,036 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-12-10 17:29:07.286101",
"spec_repo_commit": "f35e3502"
"regenerated": "2024-12-10 19:47:51.621056",
"spec_repo_commit": "3231f2a2"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-12-10 17:29:07.306202",
"spec_repo_commit": "f35e3502"
"regenerated": "2024-12-10 19:47:51.640401",
"spec_repo_commit": "3231f2a2"
}
}
}
96 changes: 95 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15869,6 +15869,36 @@ components:
- COUNT
- RATE
- GAUGE
MetricMetaPage:
description: Paging attributes. Only present if pagination query parameters
were provided.
properties:
cursor:
description: The cursor used to get the current results, if any.
nullable: true
type: string
limit:
description: Number of results returned
format: int32
maximum: 20000
minimum: 0
type: integer
next_cursor:
description: The cursor used to get the next results, if any.
nullable: true
type: string
type:
$ref: '#/components/schemas/MetricMetaPageType'
type: object
MetricMetaPageType:
default: cursor_limit
description: Type of metric pagination.
enum:
- cursor_limit
example: cursor_limit
type: string
x-enum-varnames:
- CURSOR_LIMIT
MetricMetadata:
description: Metadata for the metric.
properties:
Expand Down Expand Up @@ -15951,6 +15981,12 @@ components:
maximum: 1000
type: integer
type: object
MetricPaginationMeta:
description: Response metadata object.
properties:
pagination:
$ref: '#/components/schemas/MetricMetaPage'
type: object
MetricPayload:
description: The metrics' payload.
properties:
Expand Down Expand Up @@ -16427,6 +16463,10 @@ components:
items:
$ref: '#/components/schemas/MetricsAndMetricTagConfigurations'
type: array
links:
$ref: '#/components/schemas/MetricsListResponseLinks'
meta:
$ref: '#/components/schemas/MetricPaginationMeta'
readOnly: true
type: object
MetricsDataSource:
Expand All @@ -16440,6 +16480,29 @@ components:
x-enum-varnames:
- METRICS
- CLOUD_COST
MetricsListResponseLinks:
description: Pagination links. Only present if pagination query parameters were
provided.
properties:
first:
description: Link to the first page.
type: string
last:
description: Link to the last page.
nullable: true
type: string
next:
description: Link to the next page.
nullable: true
type: string
prev:
description: Link to previous page.
nullable: true
type: string
self:
description: Link to current page.
type: string
type: object
MetricsScalarQuery:
description: An individual scalar metrics query.
properties:
Expand Down Expand Up @@ -35623,7 +35686,12 @@ paths:
get:
description: "Returns all metrics that can be configured in the Metrics Summary
page or with Metrics without Limits\u2122 (matching additional filters if
specified)."
specified).\nOptionally, paginate by using the `page[cursor]` and/or `page[size]`
query parameters.\nTo fetch the first page, pass in a query parameter with
either a valid `page[size]` or an empty cursor like `page[cursor]=`. To fetch
the next page, pass in the `next_cursor` value from the response as the new
`page[cursor]` value.\nOnce the `meta.pagination.next_cursor` value is null,
all pages have been retrieved."
operationId: ListTagConfigurations
parameters:
- description: Filter custom metrics that have configured tags.
Expand Down Expand Up @@ -35688,6 +35756,27 @@ paths:
schema:
format: int64
type: integer
- description: Maximum number of results returned.
in: query
name: page[size]
required: false
schema:
default: 10000
format: int32
maximum: 10000
minimum: 1
type: integer
- description: 'String to query the next page of results.

This key is provided with each valid response from the API in `meta.pagination.next_cursor`.

Once the `meta.pagination.next_cursor` key is null, all pages have been
retrieved.'
in: query
name: page[cursor]
required: false
schema:
type: string
responses:
'200':
content:
Expand Down Expand Up @@ -35721,6 +35810,11 @@ paths:
summary: Get a list of metrics
tags:
- Metrics
x-pagination:
cursorParam: page[cursor]
cursorPath: meta.pagination.next_cursor
limitParam: page[size]
resultsPath: data
x-permission:
operator: OR
permissions:
Expand Down
81 changes: 81 additions & 0 deletions api/datadogV2/api_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@ type ListTagConfigurationsOptionalParameters struct {
FilterQueried *bool
FilterTags *string
WindowSeconds *int64
PageSize *int32
PageCursor *string
}

// NewListTagConfigurationsOptionalParameters creates an empty struct for parameters.
Expand Down Expand Up @@ -750,8 +752,23 @@ func (r *ListTagConfigurationsOptionalParameters) WithWindowSeconds(windowSecond
return r
}

// WithPageSize sets the corresponding parameter name and returns the struct.
func (r *ListTagConfigurationsOptionalParameters) WithPageSize(pageSize int32) *ListTagConfigurationsOptionalParameters {
r.PageSize = &pageSize
return r
}

// WithPageCursor sets the corresponding parameter name and returns the struct.
func (r *ListTagConfigurationsOptionalParameters) WithPageCursor(pageCursor string) *ListTagConfigurationsOptionalParameters {
r.PageCursor = &pageCursor
return r
}

// ListTagConfigurations Get a list of metrics.
// Returns all metrics that can be configured in the Metrics Summary page or with Metrics without Limits™ (matching additional filters if specified).
// Optionally, paginate by using the `page[cursor]` and/or `page[size]` query parameters.
// To fetch the first page, pass in a query parameter with either a valid `page[size]` or an empty cursor like `page[cursor]=`. To fetch the next page, pass in the `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.
func (a *MetricsApi) ListTagConfigurations(ctx _context.Context, o ...ListTagConfigurationsOptionalParameters) (MetricsAndMetricTagConfigurationsResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodGet
Expand Down Expand Up @@ -798,6 +815,12 @@ func (a *MetricsApi) ListTagConfigurations(ctx _context.Context, o ...ListTagCon
if optionalParams.WindowSeconds != nil {
localVarQueryParams.Add("window[seconds]", datadog.ParameterToString(*optionalParams.WindowSeconds, ""))
}
if optionalParams.PageSize != nil {
localVarQueryParams.Add("page[size]", datadog.ParameterToString(*optionalParams.PageSize, ""))
}
if optionalParams.PageCursor != nil {
localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*optionalParams.PageCursor, ""))
}
localVarHeaderParams["Accept"] = "application/json"

datadog.SetAuthKeys(
Expand Down Expand Up @@ -849,6 +872,64 @@ func (a *MetricsApi) ListTagConfigurations(ctx _context.Context, o ...ListTagCon
return localVarReturnValue, localVarHTTPResponse, nil
}

// ListTagConfigurationsWithPagination provides a paginated version of ListTagConfigurations returning a channel with all items.
func (a *MetricsApi) ListTagConfigurationsWithPagination(ctx _context.Context, o ...ListTagConfigurationsOptionalParameters) (<-chan datadog.PaginationResult[MetricsAndMetricTagConfigurations], func()) {
ctx, cancel := _context.WithCancel(ctx)
pageSize_ := int32(10000)
if len(o) == 0 {
o = append(o, ListTagConfigurationsOptionalParameters{})
}
if o[0].PageSize != nil {
pageSize_ = *o[0].PageSize
}
o[0].PageSize = &pageSize_

items := make(chan datadog.PaginationResult[MetricsAndMetricTagConfigurations], pageSize_)
go func() {
for {
resp, _, err := a.ListTagConfigurations(ctx, o...)
if err != nil {
var returnItem MetricsAndMetricTagConfigurations
items <- datadog.PaginationResult[MetricsAndMetricTagConfigurations]{Item: returnItem, Error: err}
break
}
respData, ok := resp.GetDataOk()
if !ok {
break
}
results := *respData

for _, item := range results {
select {
case items <- datadog.PaginationResult[MetricsAndMetricTagConfigurations]{Item: item, Error: nil}:
case <-ctx.Done():
close(items)
return
}
}
if len(results) < int(pageSize_) {
break
}
cursorMeta, ok := resp.GetMetaOk()
if !ok {
break
}
cursorMetaPagination, ok := cursorMeta.GetPaginationOk()
if !ok {
break
}
cursorMetaPaginationNextCursor, ok := cursorMetaPagination.GetNextCursorOk()
if !ok {
break
}

o[0].PageCursor = cursorMetaPaginationNextCursor
}
close(items)
}()
return items, cancel
}

// ListTagsByMetricName List tags by metric name.
// View indexed tag key-value pairs for a given metric name over the previous hour.
func (a *MetricsApi) ListTagsByMetricName(ctx _context.Context, metricName string) (MetricAllTagsResponse, *_nethttp.Response, error) {
Expand Down
Loading

0 comments on commit 7d8dfb0

Please sign in to comment.