Skip to content
Open
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
13 changes: 13 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13765,6 +13765,13 @@ components:
data:
$ref: "#/components/schemas/ConvertJobResultsToSignalsData"
type: object
CostAggregationType:
description: "Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals."
enum:
- cumulative
type: string
x-enum-varnames:
- CUMULATIVE
CostAttributionAggregates:
description: An array of available aggregates.
items:
Expand Down Expand Up @@ -106713,6 +106720,12 @@ paths:
schema:
format: date-time
type: string
- description: "Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals."
in: query
name: cost_aggregation
required: false
schema:
$ref: "#/components/schemas/CostAggregationType"
- 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
Expand Down
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5772,6 +5772,13 @@ datadog\_api\_client.v2.model.convert\_job\_results\_to\_signals\_request module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.cost\_aggregation\_type module
------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.cost_aggregation_type
:members:
:show-inheritance:

datadog\_api\_client.v2.model.cost\_attribution\_aggregates\_body module
------------------------------------------------------------------------

Expand Down
12 changes: 12 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 @@ -21,6 +21,7 @@
)
from datadog_api_client.v2.model.billing_dimensions_mapping_response import BillingDimensionsMappingResponse
from datadog_api_client.v2.model.cost_by_org_response import CostByOrgResponse
from datadog_api_client.v2.model.cost_aggregation_type import CostAggregationType
from datadog_api_client.v2.model.hourly_usage_response import HourlyUsageResponse
from datadog_api_client.v2.model.usage_lambda_traced_invocations_response import UsageLambdaTracedInvocationsResponse
from datadog_api_client.v2.model.usage_observability_pipelines_response import UsageObservabilityPipelinesResponse
Expand Down Expand Up @@ -153,6 +154,11 @@ def __init__(self, api_client=None):
"attribute": "end_date",
"location": "query",
},
"cost_aggregation": {
"openapi_types": (CostAggregationType,),
"attribute": "cost_aggregation",
"location": "query",
},
"include_connected_accounts": {
"openapi_types": (bool,),
"attribute": "include_connected_accounts",
Expand Down Expand Up @@ -536,6 +542,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,
cost_aggregation: Union[CostAggregationType, UnsetType] = unset,
include_connected_accounts: Union[bool, UnsetType] = unset,
) -> CostByOrgResponse:
"""Get estimated cost across your account.
Expand All @@ -557,6 +564,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 cost_aggregation: Controls how costs are aggregated when using ``start_date``. The ``cumulative`` option returns month-to-date running totals.
:type cost_aggregation: CostAggregationType, 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
Expand All @@ -577,6 +586,9 @@ def get_estimated_cost_by_org(
if end_date is not unset:
kwargs["end_date"] = end_date

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

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

Expand Down
35 changes: 35 additions & 0 deletions src/datadog_api_client/v2/model/cost_aggregation_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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 datadog_api_client.model_utils import (
ModelSimple,
cached_property,
)

from typing import ClassVar


class CostAggregationType(ModelSimple):
"""
Controls how costs are aggregated when using `start_date`. The `cumulative` option returns month-to-date running totals.

:param value: If omitted defaults to "cumulative". Must be one of ["cumulative"].
:type value: str
"""

allowed_values = {
"cumulative",
}
CUMULATIVE: ClassVar["CostAggregationType"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


CostAggregationType.CUMULATIVE = CostAggregationType("cumulative")
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,7 @@
from datadog_api_client.v2.model.convert_job_results_to_signals_data import ConvertJobResultsToSignalsData
from datadog_api_client.v2.model.convert_job_results_to_signals_data_type import ConvertJobResultsToSignalsDataType
from datadog_api_client.v2.model.convert_job_results_to_signals_request import ConvertJobResultsToSignalsRequest
from datadog_api_client.v2.model.cost_aggregation_type import CostAggregationType
from datadog_api_client.v2.model.cost_attribution_aggregates_body import CostAttributionAggregatesBody
from datadog_api_client.v2.model.cost_attribution_tag_names import CostAttributionTagNames
from datadog_api_client.v2.model.cost_attribution_type import CostAttributionType
Expand Down Expand Up @@ -7369,6 +7370,7 @@
"ConvertJobResultsToSignalsData",
"ConvertJobResultsToSignalsDataType",
"ConvertJobResultsToSignalsRequest",
"CostAggregationType",
"CostAttributionAggregatesBody",
"CostAttributionTagNames",
"CostAttributionType",
Expand Down
Loading