Skip to content

update historical_cost and projected_cost for partner program #2056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-23 17:39:46.554429",
"spec_repo_commit": "ad82c0e5"
"regenerated": "2024-07-23 18:14:11.854690",
"spec_repo_commit": "9e027051"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-23 17:39:46.571472",
"spec_repo_commit": "ad82c0e5"
"regenerated": "2024-07-23 18:14:11.871946",
"spec_repo_commit": "9e027051"
}
}
}
24 changes: 24 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15172,6 +15172,12 @@ components:
ProjectedCostAttributes:
description: Projected Cost attributes data.
properties:
account_name:
description: The account name.
type: string
account_public_id:
description: The account public ID.
type: string
charges:
description: List of charges data reported for the requested month.
items:
Expand Down Expand Up @@ -36703,6 +36709,15 @@ paths:
schema:
format: date-time
type: string
- description: 'Boolean to specify whether to include accounts connected to
the current account as partner customers in the Datadog partner network
program. Defaults to `false`. '
in: query
name: include_connected_accounts
required: false
schema:
default: false
type: boolean
responses:
'200':
content:
Expand Down Expand Up @@ -37009,6 +37024,15 @@ paths:
required: false
schema:
type: string
- description: 'Boolean to specify whether to include accounts connected to
the current account as partner customers in the Datadog partner network
program. Defaults to `false`. '
in: query
name: include_connected_accounts
required: false
schema:
default: false
type: boolean
responses:
'200':
content:
Expand Down
22 changes: 22 additions & 0 deletions src/datadog_api_client/v2/api/usage_metering_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ def __init__(self, api_client=None):
"attribute": "end_month",
"location": "query",
},
"include_connected_accounts": {
"openapi_types": (bool,),
"attribute": "include_connected_accounts",
"location": "query",
},
},
headers_map={
"accept": ["application/json;datetime-format=rfc3339"],
Expand Down Expand Up @@ -312,6 +317,11 @@ def __init__(self, api_client=None):
"attribute": "view",
"location": "query",
},
"include_connected_accounts": {
"openapi_types": (bool,),
"attribute": "include_connected_accounts",
"location": "query",
},
},
headers_map={
"accept": ["application/json;datetime-format=rfc3339"],
Expand Down Expand Up @@ -506,6 +516,7 @@ def get_historical_cost_by_org(
*,
view: Union[str, UnsetType] = unset,
end_month: Union[datetime, UnsetType] = unset,
include_connected_accounts: Union[bool, UnsetType] = unset,
) -> CostByOrgResponse:
"""Get historical cost across your account.

Expand All @@ -520,6 +531,8 @@ def get_historical_cost_by_org(
:type view: str, optional
:param end_month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for cost ending this month.
:type end_month: datetime, optional
:param include_connected_accounts: Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to ``false``.
:type include_connected_accounts: bool, optional
:rtype: CostByOrgResponse
"""
kwargs: Dict[str, Any] = {}
Expand All @@ -531,6 +544,9 @@ def get_historical_cost_by_org(
if end_month is not unset:
kwargs["end_month"] = end_month

if include_connected_accounts is not unset:
kwargs["include_connected_accounts"] = include_connected_accounts

return self._get_historical_cost_by_org_endpoint.call_with_http_info(**kwargs)

def get_hourly_usage(
Expand Down Expand Up @@ -690,6 +706,7 @@ def get_projected_cost(
self,
*,
view: Union[str, UnsetType] = unset,
include_connected_accounts: Union[bool, UnsetType] = unset,
) -> ProjectedCostResponse:
"""Get projected cost across your account.

Expand All @@ -700,12 +717,17 @@ def get_projected_cost(

:param view: String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are ``summary`` and ``sub-org``. Defaults to ``summary``.
:type view: str, optional
:param include_connected_accounts: Boolean to specify whether to include accounts connected to the current account as partner customers in the Datadog partner network program. Defaults to ``false``.
:type include_connected_accounts: bool, optional
:rtype: ProjectedCostResponse
"""
kwargs: Dict[str, Any] = {}
if view is not unset:
kwargs["view"] = view

if include_connected_accounts is not unset:
kwargs["include_connected_accounts"] = include_connected_accounts

return self._get_projected_cost_endpoint.call_with_http_info(**kwargs)

def get_usage_application_security_monitoring(
Expand Down
16 changes: 16 additions & 0 deletions src/datadog_api_client/v2/model/projected_cost_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def openapi_types(_):
from datadog_api_client.v2.model.chargeback_breakdown import ChargebackBreakdown

return {
"account_name": (str,),
"account_public_id": (str,),
"charges": ([ChargebackBreakdown],),
"date": (datetime,),
"org_name": (str,),
Expand All @@ -33,6 +35,8 @@ def openapi_types(_):
}

attribute_map = {
"account_name": "account_name",
"account_public_id": "account_public_id",
"charges": "charges",
"date": "date",
"org_name": "org_name",
Expand All @@ -43,6 +47,8 @@ def openapi_types(_):

def __init__(
self_,
account_name: Union[str, UnsetType] = unset,
account_public_id: Union[str, UnsetType] = unset,
charges: Union[List[ChargebackBreakdown], UnsetType] = unset,
date: Union[datetime, UnsetType] = unset,
org_name: Union[str, UnsetType] = unset,
Expand All @@ -54,6 +60,12 @@ def __init__(
"""
Projected Cost attributes data.

:param account_name: The account name.
:type account_name: str, optional

:param account_public_id: The account public ID.
:type account_public_id: str, optional

:param charges: List of charges data reported for the requested month.
:type charges: [ChargebackBreakdown], optional

Expand All @@ -72,6 +84,10 @@ def __init__(
:param region: The region of the Datadog instance that the organization belongs to.
:type region: str, optional
"""
if account_name is not unset:
kwargs["account_name"] = account_name
if account_public_id is not unset:
kwargs["account_public_id"] = account_public_id
if charges is not unset:
kwargs["charges"] = charges
if date is not unset:
Expand Down
Loading