-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit f39beecd of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Nov 15, 2023
1 parent
6cf238b
commit 786489a
Showing
11 changed files
with
400 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Get projected cost across your account returns "OK" response | ||
""" | ||
|
||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi | ||
|
||
configuration = Configuration() | ||
with ApiClient(configuration) as api_client: | ||
api_instance = UsageMeteringApi(api_client) | ||
response = api_instance.get_projected_cost( | ||
view="sub-org", | ||
) | ||
|
||
print(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2019-Present Datadog, Inc. | ||
from __future__ import annotations | ||
|
||
from typing import Union, TYPE_CHECKING | ||
|
||
from datadog_api_client.model_utils import ( | ||
ModelNormal, | ||
cached_property, | ||
unset, | ||
UnsetType, | ||
) | ||
|
||
|
||
if TYPE_CHECKING: | ||
from datadog_api_client.v2.model.projected_cost_attributes import ProjectedCostAttributes | ||
from datadog_api_client.v2.model.cost_by_org_type import CostByOrgType | ||
|
||
|
||
class ProjectedCost(ModelNormal): | ||
@cached_property | ||
def openapi_types(_): | ||
from datadog_api_client.v2.model.projected_cost_attributes import ProjectedCostAttributes | ||
from datadog_api_client.v2.model.cost_by_org_type import CostByOrgType | ||
|
||
return { | ||
"attributes": (ProjectedCostAttributes,), | ||
"id": (str,), | ||
"type": (CostByOrgType,), | ||
} | ||
|
||
attribute_map = { | ||
"attributes": "attributes", | ||
"id": "id", | ||
"type": "type", | ||
} | ||
|
||
def __init__( | ||
self_, | ||
attributes: Union[ProjectedCostAttributes, UnsetType] = unset, | ||
id: Union[str, UnsetType] = unset, | ||
type: Union[CostByOrgType, UnsetType] = unset, | ||
**kwargs, | ||
): | ||
""" | ||
Projected Cost data. | ||
:param attributes: Projected Cost attributes data. | ||
:type attributes: ProjectedCostAttributes, optional | ||
:param id: Unique ID of the response. | ||
:type id: str, optional | ||
:param type: Type of cost data. | ||
:type type: CostByOrgType, optional | ||
""" | ||
if attributes is not unset: | ||
kwargs["attributes"] = attributes | ||
if id is not unset: | ||
kwargs["id"] = id | ||
if type is not unset: | ||
kwargs["type"] = type | ||
super().__init__(kwargs) |
87 changes: 87 additions & 0 deletions
87
src/datadog_api_client/v2/model/projected_cost_attributes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. | ||
# This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
# Copyright 2019-Present Datadog, Inc. | ||
from __future__ import annotations | ||
|
||
from typing import List, Union, TYPE_CHECKING | ||
|
||
from datadog_api_client.model_utils import ( | ||
ModelNormal, | ||
cached_property, | ||
datetime, | ||
unset, | ||
UnsetType, | ||
) | ||
|
||
|
||
if TYPE_CHECKING: | ||
from datadog_api_client.v2.model.chargeback_breakdown import ChargebackBreakdown | ||
|
||
|
||
class ProjectedCostAttributes(ModelNormal): | ||
@cached_property | ||
def openapi_types(_): | ||
from datadog_api_client.v2.model.chargeback_breakdown import ChargebackBreakdown | ||
|
||
return { | ||
"charges": ([ChargebackBreakdown],), | ||
"date": (datetime,), | ||
"org_name": (str,), | ||
"projected_total_cost": (float,), | ||
"public_id": (str,), | ||
"region": (str,), | ||
} | ||
|
||
attribute_map = { | ||
"charges": "charges", | ||
"date": "date", | ||
"org_name": "org_name", | ||
"projected_total_cost": "projected_total_cost", | ||
"public_id": "public_id", | ||
"region": "region", | ||
} | ||
|
||
def __init__( | ||
self_, | ||
charges: Union[List[ChargebackBreakdown], UnsetType] = unset, | ||
date: Union[datetime, UnsetType] = unset, | ||
org_name: Union[str, UnsetType] = unset, | ||
projected_total_cost: Union[float, UnsetType] = unset, | ||
public_id: Union[str, UnsetType] = unset, | ||
region: Union[str, UnsetType] = unset, | ||
**kwargs, | ||
): | ||
""" | ||
Projected Cost attributes data. | ||
:param charges: List of charges data reported for the requested month. | ||
:type charges: [ChargebackBreakdown], optional | ||
:param date: The month requested. | ||
:type date: datetime, optional | ||
:param org_name: The organization name. | ||
:type org_name: str, optional | ||
:param projected_total_cost: The total projected cost of products for the month. | ||
:type projected_total_cost: float, optional | ||
:param public_id: The organization public ID. | ||
:type public_id: str, optional | ||
:param region: The region of the Datadog instance that the organization belongs to. | ||
:type region: str, optional | ||
""" | ||
if charges is not unset: | ||
kwargs["charges"] = charges | ||
if date is not unset: | ||
kwargs["date"] = date | ||
if org_name is not unset: | ||
kwargs["org_name"] = org_name | ||
if projected_total_cost is not unset: | ||
kwargs["projected_total_cost"] = projected_total_cost | ||
if public_id is not unset: | ||
kwargs["public_id"] = public_id | ||
if region is not unset: | ||
kwargs["region"] = region | ||
super().__init__(kwargs) |
Oops, something went wrong.