Skip to content

Commit 8d6dd8b

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 4359eda of spec repo (#4195)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 30670a1 commit 8d6dd8b

18 files changed

Lines changed: 917 additions & 5 deletions

.generator/schemas/v1/openapi.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22716,7 +22716,13 @@ components:
2271622716
$ref: "#/components/schemas/UsageSpecifiedCustomReportsMeta"
2271722717
type: object
2271822718
UsageSummaryDate:
22719-
description: Response with hourly report of all data billed by Datadog all organizations.
22719+
description: |-
22720+
Response with hourly report of all data billed by Datadog for all organizations.
22721+
22722+
Newly added billing dimensions and usage types appear as untyped keys on the
22723+
`additionalProperties` map instead of as typed fields. Call
22724+
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
22725+
at this response level—both typed fields and `additionalProperties` keys.
2272022726
properties:
2272122727
agent_host_top99p:
2272222728
description: Shows the 99th percentile of all agent hosts over all hours in the current date for all organizations.
@@ -23739,7 +23745,13 @@ components:
2373923745
type: integer
2374023746
type: object
2374123747
UsageSummaryDateOrg:
23742-
description: Global hourly report of all data billed by Datadog for a given organization.
23748+
description: |-
23749+
Global hourly report of all data billed by Datadog for a given organization.
23750+
23751+
Newly added billing dimensions and usage types appear as untyped keys on the
23752+
`additionalProperties` map instead of as typed fields. Call
23753+
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
23754+
at this response level—both typed fields and `additionalProperties` keys.
2374323755
properties:
2374423756
account_name:
2374523757
description: The account name.
@@ -24780,7 +24792,14 @@ components:
2478024792
type: integer
2478124793
type: object
2478224794
UsageSummaryResponse:
24783-
description: Response summarizing all usage aggregated across the months in the request for all organizations, and broken down by month and by organization.
24795+
description: |-
24796+
Response summarizing all usage aggregated across the months in the request for
24797+
all organizations, and broken down by month and by organization.
24798+
24799+
Newly added billing dimensions and usage types appear as untyped keys on the
24800+
`additionalProperties` map instead of as typed fields. Call
24801+
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
24802+
at this response level—both typed fields and `additionalProperties` keys.
2478424803
properties:
2478524804
agent_host_top99p_sum:
2478624805
description: Shows the 99th percentile of all agent hosts over all hours in the current month for all organizations.
@@ -42260,6 +42279,12 @@ paths:
4226042279
description: |-
4226142280
Get all usage across your account.
4226242281

42282+
Newly added billing dimensions and usage types appear as untyped keys on the
42283+
`additionalProperties` map of `UsageSummaryResponse`, `UsageSummaryDate`, and
42284+
`UsageSummaryDateOrg` instead of as typed fields. Call
42285+
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
42286+
at each response level—both typed fields and `additionalProperties` keys.
42287+
4226342288
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
4226442289
operationId: GetUsageSummary
4226542290
parameters:

.generator/schemas/v2/openapi.yaml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96978,6 +96978,67 @@ components:
9697896978
$ref: "#/components/schemas/UsageDataObject"
9697996979
type: array
9698096980
type: object
96981+
UsageSummaryAvailableFieldsAttributes:
96982+
description: |-
96983+
The lists of field names returned by `GET /api/v1/usage/summary` at each
96984+
of its three response levels. Each list contains every key the data endpoint
96985+
emits—both typed fields declared in the OpenAPI spec and untyped keys
96986+
exposed through `additionalProperties`.
96987+
properties:
96988+
date_fields:
96989+
description: |-
96990+
Sorted list of every key returned inside each `UsageSummaryDate`
96991+
entry of `usage[]` (typed fields and `additionalProperties` keys
96992+
combined).
96993+
items:
96994+
type: string
96995+
type: array
96996+
date_org_fields:
96997+
description: |-
96998+
Sorted list of every key returned inside each `UsageSummaryDateOrg`
96999+
entry of `usage[].orgs[]` (typed fields and `additionalProperties`
97000+
keys combined).
97001+
items:
97002+
type: string
97003+
type: array
97004+
response_fields:
97005+
description: |-
97006+
Sorted list of every key returned as a direct property of
97007+
`UsageSummaryResponse` (typed fields and `additionalProperties`
97008+
keys combined).
97009+
items:
97010+
type: string
97011+
type: array
97012+
type: object
97013+
UsageSummaryAvailableFieldsBody:
97014+
description: Available-fields data.
97015+
properties:
97016+
attributes:
97017+
$ref: "#/components/schemas/UsageSummaryAvailableFieldsAttributes"
97018+
id:
97019+
description: The identifier for the discovery scope. Always `"all"`.
97020+
example: all
97021+
type: string
97022+
type:
97023+
$ref: "#/components/schemas/UsageSummaryAvailableFieldsType"
97024+
type: object
97025+
UsageSummaryAvailableFieldsResponse:
97026+
description: |-
97027+
Response listing every field name returned by `GET /api/v1/usage/summary`
97028+
at each of its three response levels. Includes both typed fields and untyped
97029+
`additionalProperties` keys.
97030+
properties:
97031+
data:
97032+
$ref: "#/components/schemas/UsageSummaryAvailableFieldsBody"
97033+
type: object
97034+
UsageSummaryAvailableFieldsType:
97035+
default: usage_summary_available_fields
97036+
description: Type of available-fields data.
97037+
enum:
97038+
- usage_summary_available_fields
97039+
type: string
97040+
x-enum-varnames:
97041+
- USAGE_SUMMARY_AVAILABLE_FIELDS
9698197042
UsageTimeSeriesObject:
9698297043
description: Usage timeseries data.
9698397044
properties:
@@ -174018,6 +174079,67 @@ paths:
174018174079
permissions:
174019174080
- usage_read
174020174081
- billing_read
174082+
/api/v2/usage/summary/available_fields:
174083+
get:
174084+
description: |-
174085+
List the field names returned by `GET /api/v1/usage/summary` at each of its
174086+
three response levels. Each list contains every key the data endpoint
174087+
emits—both typed fields declared in the OpenAPI spec and untyped keys
174088+
exposed through `additionalProperties` (the latter used for billing
174089+
dimensions and usage types added after the v1 schema freeze).
174090+
174091+
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
174092+
operationId: GetUsageSummaryAvailableFields
174093+
responses:
174094+
"200":
174095+
content:
174096+
application/json;datetime-format=rfc3339:
174097+
examples:
174098+
default:
174099+
value:
174100+
data:
174101+
attributes:
174102+
date_fields:
174103+
- agent_host_top99p
174104+
- aws_host_top99p
174105+
- ccm_anthropic_spend_last
174106+
date_org_fields:
174107+
- agent_host_top99p
174108+
- aws_host_top99p
174109+
- ccm_anthropic_spend_last
174110+
response_fields:
174111+
- agent_host_top99p_sum
174112+
- aws_host_top99p_sum
174113+
- ccm_anthropic_spend_last_sum
174114+
id: all
174115+
type: usage_summary_available_fields
174116+
schema:
174117+
$ref: "#/components/schemas/UsageSummaryAvailableFieldsResponse"
174118+
description: OK.
174119+
"403":
174120+
content:
174121+
application/json;datetime-format=rfc3339:
174122+
schema:
174123+
$ref: "#/components/schemas/APIErrorResponse"
174124+
description: Forbidden - User is not authorized.
174125+
"429":
174126+
content:
174127+
application/json;datetime-format=rfc3339:
174128+
schema:
174129+
$ref: "#/components/schemas/APIErrorResponse"
174130+
description: Too many requests.
174131+
security:
174132+
- apiKeyAuth: []
174133+
appKeyAuth: []
174134+
- AuthZ:
174135+
- usage_read
174136+
summary: Get available fields for usage summary
174137+
tags:
174138+
- Usage Metering
174139+
"x-permission":
174140+
operator: OR
174141+
permissions:
174142+
- usage_read
174021174143
/api/v2/usage/usage-attribution-types:
174022174144
get:
174023174145
description: |-

api/datadogV1/api_usage_metering.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3577,6 +3577,12 @@ func (r *GetUsageSummaryOptionalParameters) WithIncludeConnectedAccounts(include
35773577
// GetUsageSummary Get usage across your account.
35783578
// Get all usage across your account.
35793579
//
3580+
// Newly added billing dimensions and usage types appear as untyped keys on the
3581+
// `additionalProperties` map of `UsageSummaryResponse`, `UsageSummaryDate`, and
3582+
// `UsageSummaryDateOrg` instead of as typed fields. Call
3583+
// `GET /api/v2/usage/summary/available_fields` to enumerate every key returned
3584+
// at each response level—both typed fields and `additionalProperties` keys.
3585+
//
35803586
// This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
35813587
func (a *UsageMeteringApi) GetUsageSummary(ctx _context.Context, startMonth time.Time, o ...GetUsageSummaryOptionalParameters) (UsageSummaryResponse, *_nethttp.Response, error) {
35823588
var (

api/datadogV1/model_usage_summary_date.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ import (
1010
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
1111
)
1212

13-
// UsageSummaryDate Response with hourly report of all data billed by Datadog all organizations.
13+
// UsageSummaryDate Response with hourly report of all data billed by Datadog for all organizations.
14+
//
15+
// Newly added billing dimensions and usage types appear as untyped keys on the
16+
// `additionalProperties` map instead of as typed fields. Call
17+
// `GET /api/v2/usage/summary/available_fields` to enumerate every key returned
18+
// at this response level—both typed fields and `additionalProperties` keys.
1419
type UsageSummaryDate struct {
1520
// Shows the 99th percentile of all agent hosts over all hours in the current date for all organizations.
1621
AgentHostTop99p *int64 `json:"agent_host_top99p,omitempty"`

api/datadogV1/model_usage_summary_date_org.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ import (
99
)
1010

1111
// UsageSummaryDateOrg Global hourly report of all data billed by Datadog for a given organization.
12+
//
13+
// Newly added billing dimensions and usage types appear as untyped keys on the
14+
// `additionalProperties` map instead of as typed fields. Call
15+
// `GET /api/v2/usage/summary/available_fields` to enumerate every key returned
16+
// at this response level—both typed fields and `additionalProperties` keys.
1217
type UsageSummaryDateOrg struct {
1318
// The account name.
1419
AccountName *string `json:"account_name,omitempty"`

api/datadogV1/model_usage_summary_response.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ import (
1010
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
1111
)
1212

13-
// UsageSummaryResponse Response summarizing all usage aggregated across the months in the request for all organizations, and broken down by month and by organization.
13+
// UsageSummaryResponse Response summarizing all usage aggregated across the months in the request for
14+
// all organizations, and broken down by month and by organization.
15+
//
16+
// Newly added billing dimensions and usage types appear as untyped keys on the
17+
// `additionalProperties` map instead of as typed fields. Call
18+
// `GET /api/v2/usage/summary/available_fields` to enumerate every key returned
19+
// at this response level—both typed fields and `additionalProperties` keys.
1420
type UsageSummaryResponse struct {
1521
// Shows the 99th percentile of all agent hosts over all hours in the current month for all organizations.
1622
AgentHostTop99pSum *int64 `json:"agent_host_top99p_sum,omitempty"`

api/datadogV2/api_usage_metering.go

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,6 +1487,89 @@ func (a *UsageMeteringApi) GetUsageObservabilityPipelines(ctx _context.Context,
14871487
return localVarReturnValue, localVarHTTPResponse, nil
14881488
}
14891489

1490+
// GetUsageSummaryAvailableFields Get available fields for usage summary.
1491+
// List the field names returned by `GET /api/v1/usage/summary` at each of its
1492+
// three response levels. Each list contains every key the data endpoint
1493+
// emits—both typed fields declared in the OpenAPI spec and untyped keys
1494+
// exposed through `additionalProperties` (the latter used for billing
1495+
// dimensions and usage types added after the v1 schema freeze).
1496+
//
1497+
// This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
1498+
func (a *UsageMeteringApi) GetUsageSummaryAvailableFields(ctx _context.Context) (UsageSummaryAvailableFieldsResponse, *_nethttp.Response, error) {
1499+
var (
1500+
localVarHTTPMethod = _nethttp.MethodGet
1501+
localVarPostBody interface{}
1502+
localVarReturnValue UsageSummaryAvailableFieldsResponse
1503+
)
1504+
1505+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.UsageMeteringApi.GetUsageSummaryAvailableFields")
1506+
if err != nil {
1507+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
1508+
}
1509+
1510+
localVarPath := localBasePath + "/api/v2/usage/summary/available_fields"
1511+
1512+
localVarHeaderParams := make(map[string]string)
1513+
localVarQueryParams := _neturl.Values{}
1514+
localVarFormParams := _neturl.Values{}
1515+
localVarHeaderParams["Accept"] = "application/json;datetime-format=rfc3339"
1516+
1517+
if a.Client.Cfg.DelegatedTokenConfig != nil {
1518+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
1519+
if err != nil {
1520+
return localVarReturnValue, nil, err
1521+
}
1522+
} else {
1523+
datadog.SetAuthKeys(
1524+
ctx,
1525+
&localVarHeaderParams,
1526+
[2]string{"apiKeyAuth", "DD-API-KEY"},
1527+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
1528+
)
1529+
}
1530+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
1531+
if err != nil {
1532+
return localVarReturnValue, nil, err
1533+
}
1534+
1535+
localVarHTTPResponse, err := a.Client.CallAPI(req)
1536+
if err != nil || localVarHTTPResponse == nil {
1537+
return localVarReturnValue, localVarHTTPResponse, err
1538+
}
1539+
1540+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
1541+
if err != nil {
1542+
return localVarReturnValue, localVarHTTPResponse, err
1543+
}
1544+
1545+
if localVarHTTPResponse.StatusCode >= 300 {
1546+
newErr := datadog.GenericOpenAPIError{
1547+
ErrorBody: localVarBody,
1548+
ErrorMessage: localVarHTTPResponse.Status,
1549+
}
1550+
if localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 429 {
1551+
var v APIErrorResponse
1552+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1553+
if err != nil {
1554+
return localVarReturnValue, localVarHTTPResponse, newErr
1555+
}
1556+
newErr.ErrorModel = v
1557+
}
1558+
return localVarReturnValue, localVarHTTPResponse, newErr
1559+
}
1560+
1561+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
1562+
if err != nil {
1563+
newErr := datadog.GenericOpenAPIError{
1564+
ErrorBody: localVarBody,
1565+
ErrorMessage: err.Error(),
1566+
}
1567+
return localVarReturnValue, localVarHTTPResponse, newErr
1568+
}
1569+
1570+
return localVarReturnValue, localVarHTTPResponse, nil
1571+
}
1572+
14901573
// NewUsageMeteringApi Returns NewUsageMeteringApi.
14911574
func NewUsageMeteringApi(client *datadog.APIClient) *UsageMeteringApi {
14921575
return &UsageMeteringApi{

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,7 @@
12291229
// - [UsageMeteringApi.GetUsageAttributionTypes]
12301230
// - [UsageMeteringApi.GetUsageLambdaTracedInvocations]
12311231
// - [UsageMeteringApi.GetUsageObservabilityPipelines]
1232+
// - [UsageMeteringApi.GetUsageSummaryAvailableFields]
12321233
// - [UsersApi.AnonymizeUsers]
12331234
// - [UsersApi.CreateUser]
12341235
// - [UsersApi.DeleteUserInvitations]

0 commit comments

Comments
 (0)