Skip to content

add changes for datadog partner program to estimated cost and billable usage APIs #2018

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-11 16:35:12.035901",
"spec_repo_commit": "d83fe206"
"regenerated": "2024-07-16 10:52:48.447088",
"spec_repo_commit": "06d5775d"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-11 16:35:12.052518",
"spec_repo_commit": "d83fe206"
"regenerated": "2024-07-16 10:52:48.463831",
"spec_repo_commit": "06d5775d"
}
}
}
15 changes: 15 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17269,6 +17269,12 @@ components:
UsageBillableSummaryHour:
description: Response with monthly summary of data billed by Datadog.
properties:
account_name:
description: The account name.
type: string
account_public_id:
description: The account public ID.
type: string
billing_plan:
description: The billing plan.
type: string
Expand Down Expand Up @@ -31646,6 +31652,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
15 changes: 15 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5390,6 +5390,12 @@ components:
CostByOrgAttributes:
description: 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 @@ -36185,6 +36191,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
11 changes: 11 additions & 0 deletions src/datadog_api_client/v1/api/usage_metering_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,11 @@ def __init__(self, api_client=None):
"attribute": "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 @@ -1574,6 +1579,7 @@ def get_usage_billable_summary(
self,
*,
month: Union[datetime, UnsetType] = unset,
include_connected_accounts: Union[bool, UnsetType] = unset,
) -> UsageBillableSummaryResponse:
"""Get billable usage across your account.

Expand All @@ -1583,12 +1589,17 @@ def get_usage_billable_summary(

:param month: Datetime in ISO-8601 format, UTC, precise to month: ``[YYYY-MM]`` for usage starting this month.
:type 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: UsageBillableSummaryResponse
"""
kwargs: Dict[str, Any] = {}
if month is not unset:
kwargs["month"] = month

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

return self._get_usage_billable_summary_endpoint.call_with_http_info(**kwargs)

def get_usage_ci_app(
Expand Down
16 changes: 16 additions & 0 deletions src/datadog_api_client/v1/model/usage_billable_summary_hour.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def openapi_types(_):
from datadog_api_client.v1.model.usage_billable_summary_keys import UsageBillableSummaryKeys

return {
"account_name": (str,),
"account_public_id": (str,),
"billing_plan": (str,),
"end_date": (datetime,),
"num_orgs": (int,),
Expand All @@ -36,6 +38,8 @@ def openapi_types(_):
}

attribute_map = {
"account_name": "account_name",
"account_public_id": "account_public_id",
"billing_plan": "billing_plan",
"end_date": "end_date",
"num_orgs": "num_orgs",
Expand All @@ -49,6 +53,8 @@ def openapi_types(_):

def __init__(
self_,
account_name: Union[str, UnsetType] = unset,
account_public_id: Union[str, UnsetType] = unset,
billing_plan: Union[str, UnsetType] = unset,
end_date: Union[datetime, UnsetType] = unset,
num_orgs: Union[int, UnsetType] = unset,
Expand All @@ -63,6 +69,12 @@ def __init__(
"""
Response with monthly summary of data billed by Datadog.

: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 billing_plan: The billing plan.
:type billing_plan: str, optional

Expand Down Expand Up @@ -90,6 +102,10 @@ def __init__(
:param usage: Response with aggregated usage types.
:type usage: UsageBillableSummaryKeys, 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 billing_plan is not unset:
kwargs["billing_plan"] = billing_plan
if end_date is not unset:
Expand Down
11 changes: 11 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 @@ -124,6 +124,11 @@ def __init__(self, api_client=None):
"attribute": "end_date",
"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 @@ -444,6 +449,7 @@ def get_estimated_cost_by_org(
end_month: Union[datetime, UnsetType] = unset,
start_date: Union[datetime, UnsetType] = unset,
end_date: Union[datetime, UnsetType] = unset,
include_connected_accounts: Union[bool, UnsetType] = unset,
) -> CostByOrgResponse:
"""Get estimated cost across your account.

Expand All @@ -464,6 +470,8 @@ def get_estimated_cost_by_org(
:type start_date: datetime, optional
:param end_date: Datetime in ISO-8601 format, UTC, precise to day: ``[YYYY-MM-DD]`` for cost ending this day.
:type end_date: 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 @@ -482,6 +490,9 @@ def get_estimated_cost_by_org(
if end_date is not unset:
kwargs["end_date"] = end_date

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

return self._get_estimated_cost_by_org_endpoint.call_with_http_info(**kwargs)

def get_historical_cost_by_org(
Expand Down
16 changes: 16 additions & 0 deletions src/datadog_api_client/v2/model/cost_by_org_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__(
"""
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 total_cost: The total cost of products for the month.
:type total_cost: float, 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