Skip to content

Commit a24c168

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 5514c15f of spec repo
1 parent 71a12a1 commit a24c168

File tree

11 files changed

+376
-4
lines changed

11 files changed

+376
-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-06 16:31:16.204614",
8-
"spec_repo_commit": "62fc6756"
7+
"regenerated": "2023-11-06 19:20:08.304725",
8+
"spec_repo_commit": "5514c15f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2023-11-06 16:31:16.221809",
13-
"spec_repo_commit": "62fc6756"
12+
"regenerated": "2023-11-06 19:20:08.318842",
13+
"spec_repo_commit": "5514c15f"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11738,6 +11738,53 @@ components:
1173811738
type: string
1173911739
x-enum-varnames:
1174011740
- PROCESS
11741+
ProjectedCost:
11742+
description: Projected Cost data.
11743+
properties:
11744+
attributes:
11745+
$ref: '#/components/schemas/ProjectedCostAttributes'
11746+
id:
11747+
description: Unique ID of the response.
11748+
type: string
11749+
type:
11750+
$ref: '#/components/schemas/CostByOrgType'
11751+
type: object
11752+
ProjectedCostAttributes:
11753+
description: Projected Cost attributes data.
11754+
properties:
11755+
charges:
11756+
description: List of charges data reported for the requested month.
11757+
items:
11758+
$ref: '#/components/schemas/ChargebackBreakdown'
11759+
type: array
11760+
date:
11761+
description: The month requested.
11762+
format: date-time
11763+
type: string
11764+
org_name:
11765+
description: The organization name.
11766+
type: string
11767+
projected_total_cost:
11768+
description: The total projected cost of products for the month.
11769+
format: double
11770+
type: number
11771+
public_id:
11772+
description: The organization public ID.
11773+
type: string
11774+
region:
11775+
description: The region of the Datadog instance that the organization belongs
11776+
to.
11777+
type: string
11778+
type: object
11779+
ProjectedCostResponse:
11780+
description: Projected Cost response.
11781+
properties:
11782+
data:
11783+
description: Response containing Projected Cost.
11784+
items:
11785+
$ref: '#/components/schemas/ProjectedCost'
11786+
type: array
11787+
type: object
1174111788
QueryFormula:
1174211789
description: A formula for calculation based on one or more queries.
1174311790
properties:
@@ -29915,6 +29962,49 @@ paths:
2991529962
summary: Get hourly usage for observability pipelines
2991629963
tags:
2991729964
- Usage Metering
29965+
/api/v2/usage/projected_cost:
29966+
get:
29967+
description: 'Get projected cost across multi-org and single root-org accounts.
29968+
29969+
Projected cost data is only available for the current month and becomes available
29970+
around the 12th of the month.
29971+
29972+
This endpoint requires the usage_read authorization scope.'
29973+
operationId: GetProjectedCost
29974+
parameters: []
29975+
responses:
29976+
'200':
29977+
content:
29978+
application/json;datetime-format=rfc3339:
29979+
schema:
29980+
$ref: '#/components/schemas/ProjectedCostResponse'
29981+
description: OK
29982+
'400':
29983+
content:
29984+
application/json;datetime-format=rfc3339:
29985+
schema:
29986+
$ref: '#/components/schemas/APIErrorResponse'
29987+
description: Bad Request
29988+
'403':
29989+
content:
29990+
application/json;datetime-format=rfc3339:
29991+
schema:
29992+
$ref: '#/components/schemas/APIErrorResponse'
29993+
description: Forbidden - User is not authorized
29994+
'429':
29995+
content:
29996+
application/json;datetime-format=rfc3339:
29997+
schema:
29998+
$ref: '#/components/schemas/APIErrorResponse'
29999+
description: Too many requests
30000+
security:
30001+
- apiKeyAuth: []
30002+
appKeyAuth: []
30003+
- AuthZ:
30004+
- usage_read
30005+
summary: Get projected cost across your account
30006+
tags:
30007+
- Usage Metering
2991830008
/api/v2/user_invitations:
2991930009
post:
2992030010
description: Sends emails to one or more users inviting them to join the organization.

docs/datadog_api_client.v2.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5125,6 +5125,27 @@ process\_summary\_type
51255125
:members:
51265126
:show-inheritance:
51275127

5128+
projected\_cost
5129+
---------------
5130+
5131+
.. automodule:: datadog_api_client.v2.model.projected_cost
5132+
:members:
5133+
:show-inheritance:
5134+
5135+
projected\_cost\_attributes
5136+
---------------------------
5137+
5138+
.. automodule:: datadog_api_client.v2.model.projected_cost_attributes
5139+
:members:
5140+
:show-inheritance:
5141+
5142+
projected\_cost\_response
5143+
-------------------------
5144+
5145+
.. automodule:: datadog_api_client.v2.model.projected_cost_response
5146+
:members:
5147+
:show-inheritance:
5148+
51285149
query\_formula
51295150
--------------
51305151

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Get projected cost across your account 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+
with ApiClient(configuration) as api_client:
10+
api_instance = UsageMeteringApi(api_client)
11+
response = api_instance.get_projected_cost()
12+
13+
print(response)

src/datadog_api_client/v2/api/usage_metering_api.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from datadog_api_client.v2.model.hourly_usage_response import HourlyUsageResponse
2121
from datadog_api_client.v2.model.usage_lambda_traced_invocations_response import UsageLambdaTracedInvocationsResponse
2222
from datadog_api_client.v2.model.usage_observability_pipelines_response import UsageObservabilityPipelinesResponse
23+
from datadog_api_client.v2.model.projected_cost_response import ProjectedCostResponse
2324

2425

2526
class UsageMeteringApi:
@@ -207,6 +208,22 @@ def __init__(self, api_client=None):
207208
api_client=api_client,
208209
)
209210

211+
self._get_projected_cost_endpoint = _Endpoint(
212+
settings={
213+
"response_type": (ProjectedCostResponse,),
214+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
215+
"endpoint_path": "/api/v2/usage/projected_cost",
216+
"operation_id": "get_projected_cost",
217+
"http_method": "GET",
218+
"version": "v2",
219+
},
220+
params_map={},
221+
headers_map={
222+
"accept": ["application/json;datetime-format=rfc3339"],
223+
},
224+
api_client=api_client,
225+
)
226+
210227
self._get_usage_application_security_monitoring_endpoint = _Endpoint(
211228
settings={
212229
"response_type": (UsageApplicationSecurityMonitoringResponse,),
@@ -465,6 +482,20 @@ def get_hourly_usage(
465482

466483
return self._get_hourly_usage_endpoint.call_with_http_info(**kwargs)
467484

485+
def get_projected_cost(
486+
self,
487+
) -> ProjectedCostResponse:
488+
"""Get projected cost across your account.
489+
490+
Get projected cost across multi-org and single root-org accounts.
491+
Projected cost data is only available for the current month and becomes available around the 12th of the month.
492+
This endpoint requires the usage_read authorization scope.
493+
494+
:rtype: ProjectedCostResponse
495+
"""
496+
kwargs: Dict[str, Any] = {}
497+
return self._get_projected_cost_endpoint.call_with_http_info(**kwargs)
498+
468499
def get_usage_application_security_monitoring(
469500
self,
470501
start_hr: datetime,
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.projected_cost_attributes import ProjectedCostAttributes
18+
from datadog_api_client.v2.model.cost_by_org_type import CostByOrgType
19+
20+
21+
class ProjectedCost(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v2.model.projected_cost_attributes import ProjectedCostAttributes
25+
from datadog_api_client.v2.model.cost_by_org_type import CostByOrgType
26+
27+
return {
28+
"attributes": (ProjectedCostAttributes,),
29+
"id": (str,),
30+
"type": (CostByOrgType,),
31+
}
32+
33+
attribute_map = {
34+
"attributes": "attributes",
35+
"id": "id",
36+
"type": "type",
37+
}
38+
39+
def __init__(
40+
self_,
41+
attributes: Union[ProjectedCostAttributes, UnsetType] = unset,
42+
id: Union[str, UnsetType] = unset,
43+
type: Union[CostByOrgType, UnsetType] = unset,
44+
**kwargs,
45+
):
46+
"""
47+
Projected Cost data.
48+
49+
:param attributes: Projected Cost attributes data.
50+
:type attributes: ProjectedCostAttributes, optional
51+
52+
:param id: Unique ID of the response.
53+
:type id: str, optional
54+
55+
:param type: Type of cost data.
56+
:type type: CostByOrgType, 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: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
datetime,
12+
unset,
13+
UnsetType,
14+
)
15+
16+
17+
if TYPE_CHECKING:
18+
from datadog_api_client.v2.model.chargeback_breakdown import ChargebackBreakdown
19+
20+
21+
class ProjectedCostAttributes(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v2.model.chargeback_breakdown import ChargebackBreakdown
25+
26+
return {
27+
"charges": ([ChargebackBreakdown],),
28+
"date": (datetime,),
29+
"org_name": (str,),
30+
"projected_total_cost": (float,),
31+
"public_id": (str,),
32+
"region": (str,),
33+
}
34+
35+
attribute_map = {
36+
"charges": "charges",
37+
"date": "date",
38+
"org_name": "org_name",
39+
"projected_total_cost": "projected_total_cost",
40+
"public_id": "public_id",
41+
"region": "region",
42+
}
43+
44+
def __init__(
45+
self_,
46+
charges: Union[List[ChargebackBreakdown], UnsetType] = unset,
47+
date: Union[datetime, UnsetType] = unset,
48+
org_name: Union[str, UnsetType] = unset,
49+
projected_total_cost: Union[float, UnsetType] = unset,
50+
public_id: Union[str, UnsetType] = unset,
51+
region: Union[str, UnsetType] = unset,
52+
**kwargs,
53+
):
54+
"""
55+
Projected Cost attributes data.
56+
57+
:param charges: List of charges data reported for the requested month.
58+
:type charges: [ChargebackBreakdown], optional
59+
60+
:param date: The month requested.
61+
:type date: datetime, optional
62+
63+
:param org_name: The organization name.
64+
:type org_name: str, optional
65+
66+
:param projected_total_cost: The total projected cost of products for the month.
67+
:type projected_total_cost: float, optional
68+
69+
:param public_id: The organization public ID.
70+
:type public_id: str, optional
71+
72+
:param region: The region of the Datadog instance that the organization belongs to.
73+
:type region: str, optional
74+
"""
75+
if charges is not unset:
76+
kwargs["charges"] = charges
77+
if date is not unset:
78+
kwargs["date"] = date
79+
if org_name is not unset:
80+
kwargs["org_name"] = org_name
81+
if projected_total_cost is not unset:
82+
kwargs["projected_total_cost"] = projected_total_cost
83+
if public_id is not unset:
84+
kwargs["public_id"] = public_id
85+
if region is not unset:
86+
kwargs["region"] = region
87+
super().__init__(kwargs)

0 commit comments

Comments
 (0)