Skip to content

Commit 7b653ee

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 1a314fa of spec repo (#4400)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 79685df commit 7b653ee

7 files changed

Lines changed: 104 additions & 34 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22813,10 +22813,11 @@ components:
2281322813
description: |-
2281422814
Response with hourly report of all data billed by Datadog for all organizations.
2281522815

22816-
Newly added billing dimensions and usage types appear as untyped keys on the
22817-
`additionalProperties` map instead of as typed fields. Call
22818-
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
22819-
at this response level—both typed fields and `additionalProperties` keys.
22816+
For SDK users only: all fields at this response level are accessible through the
22817+
`additionalProperties` map. Existing typed-field getters are unchanged. New billing
22818+
dimensions will not have typed-field getters. Use
22819+
[Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
22820+
to enumerate every available key.
2282022821
properties:
2282122822
agent_host_top99p:
2282222823
description: Shows the 99th percentile of all agent hosts over all hours in the current date for all organizations.
@@ -24115,10 +24116,11 @@ components:
2411524116
description: |-
2411624117
Global hourly report of all data billed by Datadog for a given organization.
2411724118

24118-
Newly added billing dimensions and usage types appear as untyped keys on the
24119-
`additionalProperties` map instead of as typed fields. Call
24120-
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
24121-
at this response level—both typed fields and `additionalProperties` keys.
24119+
For SDK users only: all fields at this response level are accessible through the
24120+
`additionalProperties` map. Existing typed-field getters are unchanged. New billing
24121+
dimensions will not have typed-field getters. Use
24122+
[Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
24123+
to enumerate every available key.
2412224124
properties:
2412324125
account_name:
2412424126
description: The account name.
@@ -25436,10 +25438,11 @@ components:
2543625438
Response summarizing all usage aggregated across the months in the request for
2543725439
all organizations, and broken down by month and by organization.
2543825440

25439-
Newly added billing dimensions and usage types appear as untyped keys on the
25440-
`additionalProperties` map instead of as typed fields. Call
25441-
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
25442-
at this response level—both typed fields and `additionalProperties` keys.
25441+
For SDK users only: all fields at this response level are accessible through the
25442+
`additionalProperties` map. Existing typed-field getters are unchanged. New billing
25443+
dimensions will not have typed-field getters. Use
25444+
[Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
25445+
to enumerate every available key.
2544325446
properties:
2544425447
agent_host_top99p_sum:
2544525448
description: Shows the 99th percentile of all agent hosts over all hours in the current month for all organizations.
@@ -43215,11 +43218,12 @@ paths:
4321543218
description: |-
4321643219
Get all usage across your account.
4321743220

43218-
Newly added billing dimensions and usage types appear as untyped keys on the
43219-
`additionalProperties` map of `UsageSummaryResponse`, `UsageSummaryDate`, and
43220-
`UsageSummaryDateOrg` instead of as typed fields. Call
43221-
`GET /api/v2/usage/summary/available_fields` to enumerate every key returned
43222-
at each response level—both typed fields and `additionalProperties` keys.
43221+
For SDK users only: all fields on `UsageSummaryResponse`, `UsageSummaryDate`, and
43222+
`UsageSummaryDateOrg` are accessible through each object's `additionalProperties` map.
43223+
Existing typed-field getters are unchanged. New billing dimensions will not have
43224+
typed-field getters. Use
43225+
[Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
43226+
to enumerate every available key at each response level.
4322343227

4322443228
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
4322543229
operationId: GetUsageSummary

.generator/schemas/v2/openapi.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187306,6 +187306,37 @@ paths:
187306187306
dimensions and usage types added after the v1 schema freeze).
187307187307

187308187308
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
187309+
187310+
Go example:
187311+
187312+
```go
187313+
fields, _, err := api.GetUsageSummaryAvailableFields(ctx)
187314+
attr := fields.Data.GetAttributes()
187315+
187316+
// resp is the *UsageSummaryResponse returned by api.GetUsageSummary(ctx, ...)
187317+
// Layer 1: UsageSummaryResponse
187318+
for _, key := range attr.GetResponseFields() {
187319+
if val, ok := resp.AdditionalProperties[key]; ok {
187320+
fmt.Println(key, val.(json.Number))
187321+
}
187322+
}
187323+
// Layer 2: UsageSummaryDate (per month)
187324+
for _, date := range resp.GetUsage() {
187325+
for _, key := range attr.GetDateFields() {
187326+
if val, ok := date.AdditionalProperties[key]; ok {
187327+
fmt.Println(key, val.(json.Number))
187328+
}
187329+
}
187330+
// Layer 3: UsageSummaryDateOrg (per org per month)
187331+
for _, org := range date.GetOrgs() {
187332+
for _, key := range attr.GetDateOrgFields() {
187333+
if val, ok := org.AdditionalProperties[key]; ok {
187334+
fmt.Println(key, val.(json.Number))
187335+
}
187336+
}
187337+
}
187338+
}
187339+
```
187309187340
operationId: GetUsageSummaryAvailableFields
187310187341
responses:
187311187342
"200":

packages/datadog-api-client-v1/apis/UsageMeteringApi.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5785,11 +5785,12 @@ export class UsageMeteringApi {
57855785
/**
57865786
* Get all usage across your account.
57875787
*
5788-
* Newly added billing dimensions and usage types appear as untyped keys on the
5789-
* `additionalProperties` map of `UsageSummaryResponse`, `UsageSummaryDate`, and
5790-
* `UsageSummaryDateOrg` instead of as typed fields. Call
5791-
* `GET /api/v2/usage/summary/available_fields` to enumerate every key returned
5792-
* at each response level—both typed fields and `additionalProperties` keys.
5788+
* For SDK users only: all fields on `UsageSummaryResponse`, `UsageSummaryDate`, and
5789+
* `UsageSummaryDateOrg` are accessible through each object's `additionalProperties` map.
5790+
* Existing typed-field getters are unchanged. New billing dimensions will not have
5791+
* typed-field getters. Use
5792+
* [Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
5793+
* to enumerate every available key at each response level.
57935794
*
57945795
* This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
57955796
* @param param The request object

packages/datadog-api-client-v1/models/UsageSummaryDate.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1010
/**
1111
* Response with hourly report of all data billed by Datadog for all organizations.
1212
*
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.
13+
* For SDK users only: all fields at this response level are accessible through the
14+
* `additionalProperties` map. Existing typed-field getters are unchanged. New billing
15+
* dimensions will not have typed-field getters. Use
16+
* [Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
17+
* to enumerate every available key.
1718
*/
1819
export class UsageSummaryDate {
1920
/**

packages/datadog-api-client-v1/models/UsageSummaryDateOrg.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
99
/**
1010
* Global hourly report of all data billed by Datadog for a given organization.
1111
*
12-
* Newly added billing dimensions and usage types appear as untyped keys on the
13-
* `additionalProperties` map instead of as typed fields. Call
14-
* `GET /api/v2/usage/summary/available_fields` to enumerate every key returned
15-
* at this response level—both typed fields and `additionalProperties` keys.
12+
* For SDK users only: all fields at this response level are accessible through the
13+
* `additionalProperties` map. Existing typed-field getters are unchanged. New billing
14+
* dimensions will not have typed-field getters. Use
15+
* [Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
16+
* to enumerate every available key.
1617
*/
1718
export class UsageSummaryDateOrg {
1819
/**

packages/datadog-api-client-v1/models/UsageSummaryResponse.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
1212
* Response summarizing all usage aggregated across the months in the request for
1313
* all organizations, and broken down by month and by organization.
1414
*
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.
15+
* For SDK users only: all fields at this response level are accessible through the
16+
* `additionalProperties` map. Existing typed-field getters are unchanged. New billing
17+
* dimensions will not have typed-field getters. Use
18+
* [Get available fields for usage summary](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-summary-available-fields)
19+
* to enumerate every available key.
1920
*/
2021
export class UsageSummaryResponse {
2122
/**

packages/datadog-api-client-v2/apis/UsageMeteringApi.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,6 +2208,37 @@ export class UsageMeteringApi {
22082208
* dimensions and usage types added after the v1 schema freeze).
22092209
*
22102210
* This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).
2211+
*
2212+
* Go example:
2213+
*
2214+
* ```go
2215+
* fields, _, err := api.GetUsageSummaryAvailableFields(ctx)
2216+
* attr := fields.Data.GetAttributes()
2217+
*
2218+
* // resp is the *UsageSummaryResponse returned by api.GetUsageSummary(ctx, ...)
2219+
* // Layer 1: UsageSummaryResponse
2220+
* for _, key := range attr.GetResponseFields() {
2221+
* if val, ok := resp.AdditionalProperties[key]; ok {
2222+
* fmt.Println(key, val.(json.Number))
2223+
* }
2224+
* }
2225+
* // Layer 2: UsageSummaryDate (per month)
2226+
* for _, date := range resp.GetUsage() {
2227+
* for _, key := range attr.GetDateFields() {
2228+
* if val, ok := date.AdditionalProperties[key]; ok {
2229+
* fmt.Println(key, val.(json.Number))
2230+
* }
2231+
* }
2232+
* // Layer 3: UsageSummaryDateOrg (per org per month)
2233+
* for _, org := range date.GetOrgs() {
2234+
* for _, key := range attr.GetDateOrgFields() {
2235+
* if val, ok := org.AdditionalProperties[key]; ok {
2236+
* fmt.Println(key, val.(json.Number))
2237+
* }
2238+
* }
2239+
* }
2240+
* }
2241+
* ```
22112242
* @param param The request object
22122243
*/
22132244
public getUsageSummaryAvailableFields(

0 commit comments

Comments
 (0)