Skip to content

update hourly usage API docs for partner program #2054

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-18 17:22:30.657414",
"spec_repo_commit": "9ab8be35"
"regenerated": "2024-07-18 19:18:03.897221",
"spec_repo_commit": "8f19ff48"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-18 17:22:30.683138",
"spec_repo_commit": "9ab8be35"
"regenerated": "2024-07-18 19:18:03.925200",
"spec_repo_commit": "8f19ff48"
}
}
}
15 changes: 15 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8741,6 +8741,12 @@ components:
description: Attributes of hourly usage for a product family for an org for
a time period.
properties:
account_name:
description: The account name.
type: string
account_public_id:
description: The account public ID.
type: string
measurements:
description: List of the measured usage values for the product family for
the org for the time period.
Expand Down Expand Up @@ -36772,6 +36778,15 @@ paths:
schema:
default: false
type: boolean
- 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: filter[include_connected_accounts]
required: false
schema:
default: false
type: boolean
- description: Include breakdown of usage by subcategories where applicable
(for product family logs only). Defaults to false.
in: query
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 @@ -201,6 +201,11 @@ def __init__(self, api_client=None):
"attribute": "filter[include_descendants]",
"location": "query",
},
"filter_include_connected_accounts": {
"openapi_types": (bool,),
"attribute": "filter[include_connected_accounts]",
"location": "query",
},
"filter_include_breakdown": {
"openapi_types": (bool,),
"attribute": "filter[include_breakdown]",
Expand Down Expand Up @@ -535,6 +540,7 @@ def get_hourly_usage(
*,
filter_timestamp_end: Union[datetime, UnsetType] = unset,
filter_include_descendants: Union[bool, UnsetType] = unset,
filter_include_connected_accounts: Union[bool, UnsetType] = unset,
filter_include_breakdown: Union[bool, UnsetType] = unset,
filter_versions: Union[str, UnsetType] = unset,
page_limit: Union[int, UnsetType] = unset,
Expand All @@ -559,6 +565,8 @@ def get_hourly_usage(
:type filter_timestamp_end: datetime, optional
:param filter_include_descendants: Include child org usage in the response. Defaults to false.
:type filter_include_descendants: bool, optional
:param filter_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 filter_include_connected_accounts: bool, optional
:param filter_include_breakdown: Include breakdown of usage by subcategories where applicable (for product family logs only). Defaults to false.
:type filter_include_breakdown: bool, optional
:param filter_versions: Comma separated list of product family versions to use in the format ``product_family:version``. For example,
Expand All @@ -582,6 +590,9 @@ def get_hourly_usage(
if filter_include_descendants is not unset:
kwargs["filter_include_descendants"] = filter_include_descendants

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

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

Expand Down
16 changes: 16 additions & 0 deletions src/datadog_api_client/v2/model/hourly_usage_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.hourly_usage_measurement import HourlyUsageMeasurement

return {
"account_name": (str,),
"account_public_id": (str,),
"measurements": ([HourlyUsageMeasurement],),
"org_name": (str,),
"product_family": (str,),
Expand All @@ -33,6 +35,8 @@ def openapi_types(_):
}

attribute_map = {
"account_name": "account_name",
"account_public_id": "account_public_id",
"measurements": "measurements",
"org_name": "org_name",
"product_family": "product_family",
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,
measurements: Union[List[HourlyUsageMeasurement], UnsetType] = unset,
org_name: Union[str, UnsetType] = unset,
product_family: Union[str, UnsetType] = unset,
Expand All @@ -54,6 +60,12 @@ def __init__(
"""
Attributes of hourly usage for a product family for an org for a time period.

: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 measurements: List of the measured usage values for the product family for the org for the time period.
:type measurements: [HourlyUsageMeasurement], optional

Expand All @@ -72,6 +84,10 @@ def __init__(
:param timestamp: Datetime in ISO-8601 format, UTC. The hour for the usage.
:type timestamp: datetime, 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 measurements is not unset:
kwargs["measurements"] = measurements
if org_name is not unset:
Expand Down
Loading