Skip to content

Commit 25bad3a

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 81ae0a32 of spec repo
1 parent 62ae88d commit 25bad3a

15 files changed

+394
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2023-11-16 15:25:33.881633",
8-
"spec_repo_commit": "c536b702"
7+
"regenerated": "2023-11-16 16:22:39.817709",
8+
"spec_repo_commit": "81ae0a32"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-11-16 15:25:33.900228",
13-
"spec_repo_commit": "c536b702"
12+
"regenerated": "2023-11-16 16:22:39.831804",
13+
"spec_repo_commit": "81ae0a32"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,47 @@ components:
721721
type: string
722722
x-enum-varnames:
723723
- API_KEYS
724+
ActiveBillingDimensionsAttributes:
725+
description: List of active billing dimensions.
726+
properties:
727+
month:
728+
description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`.'
729+
format: date-time
730+
type: string
731+
values:
732+
description: 'List of active billing dimensions. Example: `[infra_host,
733+
apm_host, serverless_infra]`.'
734+
items:
735+
description: A given billing dimension in a list.
736+
example: infra_host
737+
type: string
738+
type: array
739+
type: object
740+
ActiveBillingDimensionsBody:
741+
description: Active billing dimensions data.
742+
properties:
743+
attributes:
744+
$ref: '#/components/schemas/ActiveBillingDimensionsAttributes'
745+
id:
746+
description: Unique ID of the response.
747+
type: string
748+
type:
749+
$ref: '#/components/schemas/ActiveBillingDimensionsType'
750+
type: object
751+
ActiveBillingDimensionsResponse:
752+
description: Active billing dimensions response.
753+
properties:
754+
data:
755+
$ref: '#/components/schemas/ActiveBillingDimensionsBody'
756+
type: object
757+
ActiveBillingDimensionsType:
758+
default: billing_dimensions
759+
description: Type of active billing dimensions data.
760+
enum:
761+
- billing_dimensions
762+
type: string
763+
x-enum-varnames:
764+
- BILLING_DIMENSIONS
724765
ApmRetentionFilterType:
725766
default: apm_retention_filter
726767
description: The type of the resource.
@@ -20823,6 +20864,47 @@ paths:
2082320864
resultsPath: data
2082420865
x-unstable: '**Note**: This endpoint is in public beta.
2082520866

20867+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
20868+
/api/v2/cost_by_tag/active_billing_dimensions:
20869+
get:
20870+
description: Get active billing dimensions for cost attribution. Cost data for
20871+
a given month becomes available no later than the 17th of the following month.
20872+
operationId: GetActiveBillingDimensions
20873+
responses:
20874+
'200':
20875+
content:
20876+
application/json;datetime-format=rfc3339:
20877+
schema:
20878+
$ref: '#/components/schemas/ActiveBillingDimensionsResponse'
20879+
description: OK
20880+
'400':
20881+
content:
20882+
application/json;datetime-format=rfc3339:
20883+
schema:
20884+
$ref: '#/components/schemas/APIErrorResponse'
20885+
description: Bad Request
20886+
'403':
20887+
content:
20888+
application/json;datetime-format=rfc3339:
20889+
schema:
20890+
$ref: '#/components/schemas/APIErrorResponse'
20891+
description: Forbidden - User is not authorized
20892+
'429':
20893+
content:
20894+
application/json;datetime-format=rfc3339:
20895+
schema:
20896+
$ref: '#/components/schemas/APIErrorResponse'
20897+
description: Too many requests
20898+
security:
20899+
- apiKeyAuth: []
20900+
appKeyAuth: []
20901+
- AuthZ:
20902+
- usage_read
20903+
summary: Get active billing dimensions for cost attribution
20904+
tags:
20905+
- Usage Metering
20906+
x-unstable: '**Note**: This endpoint is in public beta.
20907+
2082620908
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
2082720909
/api/v2/current_user/application_keys:
2082820910
get:

docs/datadog_api_client.v2.model.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
11
datadog\_api\_client.v2.model
22
=============================
33

4+
active\_billing\_dimensions\_attributes
5+
---------------------------------------
6+
7+
.. automodule:: datadog_api_client.v2.model.active_billing_dimensions_attributes
8+
:members:
9+
:show-inheritance:
10+
11+
active\_billing\_dimensions\_body
12+
---------------------------------
13+
14+
.. automodule:: datadog_api_client.v2.model.active_billing_dimensions_body
15+
:members:
16+
:show-inheritance:
17+
18+
active\_billing\_dimensions\_response
19+
-------------------------------------
20+
21+
.. automodule:: datadog_api_client.v2.model.active_billing_dimensions_response
22+
:members:
23+
:show-inheritance:
24+
25+
active\_billing\_dimensions\_type
26+
---------------------------------
27+
28+
.. automodule:: datadog_api_client.v2.model.active_billing_dimensions_type
29+
:members:
30+
:show-inheritance:
31+
432
api\_error\_response
533
--------------------
634

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""
2+
Get active billing dimensions for cost attribution returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi
7+
8+
configuration = Configuration()
9+
configuration.unstable_operations["get_active_billing_dimensions"] = True
10+
with ApiClient(configuration) as api_client:
11+
api_instance = UsageMeteringApi(api_client)
12+
response = api_instance.get_active_billing_dimensions()
13+
14+
print(response)

src/datadog_api_client/configuration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def __init__(
239239
"v2.create_ci_app_pipeline_event": False,
240240
"v2.list_container_images": False,
241241
"v2.list_containers": False,
242+
"v2.get_active_billing_dimensions": False,
242243
"v2.list_events": False,
243244
"v2.search_events": False,
244245
"v2.create_incident": False,

src/datadog_api_client/v2/api/usage_metering_api.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
UnsetType,
1414
unset,
1515
)
16+
from datadog_api_client.v2.model.active_billing_dimensions_response import ActiveBillingDimensionsResponse
1617
from datadog_api_client.v2.model.usage_application_security_monitoring_response import (
1718
UsageApplicationSecurityMonitoringResponse,
1819
)
@@ -42,6 +43,22 @@ def __init__(self, api_client=None):
4243
api_client = ApiClient(Configuration())
4344
self.api_client = api_client
4445

46+
self._get_active_billing_dimensions_endpoint = _Endpoint(
47+
settings={
48+
"response_type": (ActiveBillingDimensionsResponse,),
49+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
50+
"endpoint_path": "/api/v2/cost_by_tag/active_billing_dimensions",
51+
"operation_id": "get_active_billing_dimensions",
52+
"http_method": "GET",
53+
"version": "v2",
54+
},
55+
params_map={},
56+
headers_map={
57+
"accept": ["application/json;datetime-format=rfc3339"],
58+
},
59+
api_client=api_client,
60+
)
61+
4562
self._get_cost_by_org_endpoint = _Endpoint(
4663
settings={
4764
"response_type": (CostByOrgResponse,),
@@ -314,6 +331,18 @@ def __init__(self, api_client=None):
314331
api_client=api_client,
315332
)
316333

334+
def get_active_billing_dimensions(
335+
self,
336+
) -> ActiveBillingDimensionsResponse:
337+
"""Get active billing dimensions for cost attribution.
338+
339+
Get active billing dimensions for cost attribution. Cost data for a given month becomes available no later than the 17th of the following month.
340+
341+
:rtype: ActiveBillingDimensionsResponse
342+
"""
343+
kwargs: Dict[str, Any] = {}
344+
return self._get_active_billing_dimensions_endpoint.call_with_http_info(**kwargs)
345+
317346
def get_cost_by_org(
318347
self,
319348
start_month: datetime,
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import List, Union
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
datetime,
12+
unset,
13+
UnsetType,
14+
)
15+
16+
17+
class ActiveBillingDimensionsAttributes(ModelNormal):
18+
@cached_property
19+
def openapi_types(_):
20+
return {
21+
"month": (datetime,),
22+
"values": ([str],),
23+
}
24+
25+
attribute_map = {
26+
"month": "month",
27+
"values": "values",
28+
}
29+
30+
def __init__(
31+
self_, month: Union[datetime, UnsetType] = unset, values: Union[List[str], UnsetType] = unset, **kwargs
32+
):
33+
"""
34+
List of active billing dimensions.
35+
36+
:param month: Datetime in ISO-8601 format, UTC, precise to hour: ``[YYYY-MM-DDThh]``.
37+
:type month: datetime, optional
38+
39+
:param values: List of active billing dimensions. Example: ``[infra_host, apm_host, serverless_infra]``.
40+
:type values: [str], optional
41+
"""
42+
if month is not unset:
43+
kwargs["month"] = month
44+
if values is not unset:
45+
kwargs["values"] = values
46+
super().__init__(kwargs)
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.active_billing_dimensions_attributes import ActiveBillingDimensionsAttributes
18+
from datadog_api_client.v2.model.active_billing_dimensions_type import ActiveBillingDimensionsType
19+
20+
21+
class ActiveBillingDimensionsBody(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v2.model.active_billing_dimensions_attributes import ActiveBillingDimensionsAttributes
25+
from datadog_api_client.v2.model.active_billing_dimensions_type import ActiveBillingDimensionsType
26+
27+
return {
28+
"attributes": (ActiveBillingDimensionsAttributes,),
29+
"id": (str,),
30+
"type": (ActiveBillingDimensionsType,),
31+
}
32+
33+
attribute_map = {
34+
"attributes": "attributes",
35+
"id": "id",
36+
"type": "type",
37+
}
38+
39+
def __init__(
40+
self_,
41+
attributes: Union[ActiveBillingDimensionsAttributes, UnsetType] = unset,
42+
id: Union[str, UnsetType] = unset,
43+
type: Union[ActiveBillingDimensionsType, UnsetType] = unset,
44+
**kwargs,
45+
):
46+
"""
47+
Active billing dimensions data.
48+
49+
:param attributes: List of active billing dimensions.
50+
:type attributes: ActiveBillingDimensionsAttributes, optional
51+
52+
:param id: Unique ID of the response.
53+
:type id: str, optional
54+
55+
:param type: Type of active billing dimensions data.
56+
:type type: ActiveBillingDimensionsType, optional
57+
"""
58+
if attributes is not unset:
59+
kwargs["attributes"] = attributes
60+
if id is not unset:
61+
kwargs["id"] = id
62+
if type is not unset:
63+
kwargs["type"] = type
64+
super().__init__(kwargs)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.active_billing_dimensions_body import ActiveBillingDimensionsBody
18+
19+
20+
class ActiveBillingDimensionsResponse(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.active_billing_dimensions_body import ActiveBillingDimensionsBody
24+
25+
return {
26+
"data": (ActiveBillingDimensionsBody,),
27+
}
28+
29+
attribute_map = {
30+
"data": "data",
31+
}
32+
33+
def __init__(self_, data: Union[ActiveBillingDimensionsBody, UnsetType] = unset, **kwargs):
34+
"""
35+
Active billing dimensions response.
36+
37+
:param data: Active billing dimensions data.
38+
:type data: ActiveBillingDimensionsBody, optional
39+
"""
40+
if data is not unset:
41+
kwargs["data"] = data
42+
super().__init__(kwargs)

0 commit comments

Comments
 (0)