Skip to content

Commit 2c3ec23

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 54c0c7c of spec repo
1 parent 6e9535c commit 2c3ec23

11 files changed

Lines changed: 524 additions & 5 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 145 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13185,6 +13185,20 @@ components:
1318513185
BudgetAttributes:
1318613186
description: The attributes of a budget.
1318713187
properties:
13188+
costs:
13189+
$ref: "#/components/schemas/BudgetAttributesCosts"
13190+
description: Aggregated cost data for the budget. Present only when `actual=true` or `forecast=true` is requested.
13191+
costs_period_end:
13192+
description: The end of the period used to compute cost data, in milliseconds since epoch.
13193+
format: int64
13194+
type: integer
13195+
costs_period_start:
13196+
description: The start of the period used to compute cost data, in milliseconds since epoch.
13197+
format: int64
13198+
type: integer
13199+
costs_unit:
13200+
$ref: "#/components/schemas/BudgetAttributesCostsUnit"
13201+
description: The unit used for all cost values in the response.
1318813202
created_at:
1318913203
description: The timestamp when the budget was created.
1319013204
example: 1738258683590
@@ -13237,6 +13251,53 @@ components:
1323713251
example: 00000000-0a0a-0a0a-aaa0-00000000000a
1323813252
type: string
1323913253
type: object
13254+
BudgetAttributesCosts:
13255+
description: Aggregated cost data for the budget over the requested period.
13256+
properties:
13257+
actual:
13258+
description: The total actual cost. Present only when `actual=true` is requested.
13259+
format: double
13260+
nullable: true
13261+
type: number
13262+
amount:
13263+
description: The total budgeted amount over the requested period.
13264+
format: double
13265+
nullable: true
13266+
type: number
13267+
forecast:
13268+
description: The total forecast cost, with any custom forecast overrides applied. Present only when `forecast=true` is requested.
13269+
format: double
13270+
nullable: true
13271+
type: number
13272+
ootb_forecast:
13273+
description: The out-of-the-box ML forecast before custom overrides. Present only when `forecast=true` is requested.
13274+
format: double
13275+
nullable: true
13276+
type: number
13277+
type: object
13278+
BudgetAttributesCostsUnit:
13279+
description: The unit used for all cost values in the response.
13280+
properties:
13281+
family:
13282+
description: The unit family (for example, `currency`).
13283+
type: string
13284+
id:
13285+
description: The unique identifier for the unit.
13286+
type: string
13287+
name:
13288+
description: The full name of the unit.
13289+
type: string
13290+
plural:
13291+
description: The plural form of the unit name.
13292+
type: string
13293+
scale_factor:
13294+
description: The scale factor applied to raw cost values.
13295+
format: double
13296+
type: number
13297+
short_name:
13298+
description: The abbreviated unit name.
13299+
type: string
13300+
type: object
1324013301
BudgetValidationRequest:
1324113302
description: The request object for validating a budget configuration before creating or updating it.
1324213303
example:
@@ -13402,6 +13463,9 @@ components:
1340213463
description: The budgeted amount for this entry.
1340313464
format: double
1340413465
type: number
13466+
costs:
13467+
$ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsCosts"
13468+
description: Cost data for this entry. Present only when `actual=true` or `forecast=true` is requested.
1340513469
month:
1340613470
description: The month this budget entry applies to, in YYYYMM format.
1340713471
format: int64
@@ -13412,6 +13476,36 @@ components:
1341213476
$ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems"
1341313477
type: array
1341413478
type: object
13479+
BudgetWithEntriesDataAttributesEntriesItemsCosts:
13480+
description: Cost data for a single budget entry.
13481+
properties:
13482+
actual:
13483+
description: The actual cost for this entry. Present only when `actual=true` is requested.
13484+
format: double
13485+
nullable: true
13486+
type: number
13487+
amount:
13488+
description: The budgeted amount for this entry.
13489+
format: double
13490+
nullable: true
13491+
type: number
13492+
custom_forecast:
13493+
description: |-
13494+
The custom forecast override for this entry. `null` when `forecast=true` is requested but no custom forecast has been set for this entry's month. A numeric value, including `0`, indicates an explicit custom forecast override. Omitted when `forecast=false` or the feature is not available for the organization.
13495+
format: double
13496+
nullable: true
13497+
type: number
13498+
forecast:
13499+
description: The final forecast for this entry, with any custom forecast override applied. Present only when `forecast=true` is requested.
13500+
format: double
13501+
nullable: true
13502+
type: number
13503+
ootb_forecast:
13504+
description: The out-of-the-box ML forecast for this entry, before custom overrides. Present only when `forecast=true` is requested.
13505+
format: double
13506+
nullable: true
13507+
type: number
13508+
type: object
1341513509
BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems:
1341613510
description: A tag filter used to scope a budget entry to specific resource tags.
1341713511
properties:
@@ -124497,10 +124591,36 @@ paths:
124497124591
tags:
124498124592
- Cloud Cost Management
124499124593
get:
124500-
description: Get a budget
124594+
description: Get a budget by ID. Pass `actual=true` or `forecast=true` to include cost data in the response. Use `start` and `end` (millisecond epochs, both required) to set the cost window. When `forecast=true`, each entry also includes `ootb_forecast` (the ML forecast before overrides) and `custom_forecast` (`null` if no override is set, a number if one is).
124501124595
operationId: GetBudget
124502124596
parameters:
124503124597
- $ref: "#/components/parameters/BudgetID"
124598+
- description: When `true`, includes actual cost data in the response.
124599+
in: query
124600+
name: actual
124601+
required: false
124602+
schema:
124603+
type: boolean
124604+
- description: When `true`, includes forecast cost data in the response, including `ootb_forecast` and `custom_forecast` per entry.
124605+
in: query
124606+
name: forecast
124607+
required: false
124608+
schema:
124609+
type: boolean
124610+
- description: Start of the cost window in milliseconds since epoch. Must be used together with `end`.
124611+
in: query
124612+
name: start
124613+
required: false
124614+
schema:
124615+
format: int64
124616+
type: integer
124617+
- description: End of the cost window in milliseconds since epoch. Must be used together with `start`.
124618+
in: query
124619+
name: end
124620+
required: false
124621+
schema:
124622+
format: int64
124623+
type: integer
124504124624
responses:
124505124625
"200":
124506124626
content:
@@ -124510,11 +124630,31 @@ paths:
124510124630
value:
124511124631
data:
124512124632
attributes:
124633+
costs:
124634+
actual: 850.25
124635+
amount: 1000.0
124636+
forecast: 1100.5
124637+
ootb_forecast: 1100.5
124638+
costs_period_end: 1740873600000
124639+
costs_period_start: 1738281600000
124640+
costs_unit:
124641+
family: currency
124642+
id: "1"
124643+
name: dollar
124644+
plural: dollars
124645+
scale_factor: 1.0
124646+
short_name: $
124513124647
created_at: 1738258683590
124514124648
created_by: 00000000-0a0a-0a0a-aaa0-00000000000a
124515124649
end_month: 202502
124516124650
entries:
124517124651
- amount: 500
124652+
costs:
124653+
actual: 425.5
124654+
amount: 500.0
124655+
custom_forecast:
124656+
forecast: 550.25
124657+
ootb_forecast: 550.25
124518124658
month: 202501
124519124659
tag_filters:
124520124660
- tag_key: service
@@ -124531,6 +124671,10 @@ paths:
124531124671
schema:
124532124672
$ref: "#/components/schemas/BudgetWithEntries"
124533124673
description: OK
124674+
"400":
124675+
$ref: "#/components/responses/BadRequestResponse"
124676+
"404":
124677+
$ref: "#/components/responses/NotFoundResponse"
124534124678
"429":
124535124679
$ref: "#/components/responses/TooManyRequestsResponse"
124536124680
security:

docs/datadog_api_client.v2.model.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4484,6 +4484,20 @@ datadog\_api\_client.v2.model.budget\_attributes module
44844484
:members:
44854485
:show-inheritance:
44864486

4487+
datadog\_api\_client.v2.model.budget\_attributes\_costs module
4488+
--------------------------------------------------------------
4489+
4490+
.. automodule:: datadog_api_client.v2.model.budget_attributes_costs
4491+
:members:
4492+
:show-inheritance:
4493+
4494+
datadog\_api\_client.v2.model.budget\_attributes\_costs\_unit module
4495+
--------------------------------------------------------------------
4496+
4497+
.. automodule:: datadog_api_client.v2.model.budget_attributes_costs_unit
4498+
:members:
4499+
:show-inheritance:
4500+
44874501
datadog\_api\_client.v2.model.budget\_validation\_request module
44884502
----------------------------------------------------------------
44894503

@@ -4554,6 +4568,13 @@ datadog\_api\_client.v2.model.budget\_with\_entries\_data\_attributes\_entries\_
45544568
:members:
45554569
:show-inheritance:
45564570

4571+
datadog\_api\_client.v2.model.budget\_with\_entries\_data\_attributes\_entries\_items\_costs module
4572+
---------------------------------------------------------------------------------------------------
4573+
4574+
.. automodule:: datadog_api_client.v2.model.budget_with_entries_data_attributes_entries_items_costs
4575+
:members:
4576+
:show-inheritance:
4577+
45574578
datadog\_api\_client.v2.model.budget\_with\_entries\_data\_attributes\_entries\_items\_tag\_filters\_items module
45584579
-----------------------------------------------------------------------------------------------------------------
45594580

examples/v2/cloud-cost-management/UpsertBudget.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,42 @@
55
from datadog_api_client import ApiClient, Configuration
66
from datadog_api_client.v2.api.cloud_cost_management_api import CloudCostManagementApi
77
from datadog_api_client.v2.model.budget_attributes import BudgetAttributes
8+
from datadog_api_client.v2.model.budget_attributes_costs import BudgetAttributesCosts
9+
from datadog_api_client.v2.model.budget_attributes_costs_unit import BudgetAttributesCostsUnit
810
from datadog_api_client.v2.model.budget_with_entries import BudgetWithEntries
911
from datadog_api_client.v2.model.budget_with_entries_data import BudgetWithEntriesData
1012
from datadog_api_client.v2.model.budget_with_entries_data_attributes_entries_items import (
1113
BudgetWithEntriesDataAttributesEntriesItems,
1214
)
15+
from datadog_api_client.v2.model.budget_with_entries_data_attributes_entries_items_costs import (
16+
BudgetWithEntriesDataAttributesEntriesItemsCosts,
17+
)
1318
from datadog_api_client.v2.model.budget_with_entries_data_attributes_entries_items_tag_filters_items import (
1419
BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems,
1520
)
1621

1722
body = BudgetWithEntries(
1823
data=BudgetWithEntriesData(
1924
attributes=BudgetAttributes(
25+
costs=BudgetAttributesCosts(
26+
actual=None,
27+
amount=None,
28+
forecast=None,
29+
ootb_forecast=None,
30+
),
31+
costs_unit=BudgetAttributesCostsUnit(),
2032
created_at=1738258683590,
2133
created_by="00000000-0a0a-0a0a-aaa0-00000000000a",
2234
end_month=202502,
2335
entries=[
2436
BudgetWithEntriesDataAttributesEntriesItems(
37+
costs=BudgetWithEntriesDataAttributesEntriesItemsCosts(
38+
actual=None,
39+
amount=None,
40+
custom_forecast=None,
41+
forecast=None,
42+
ootb_forecast=None,
43+
),
2544
tag_filters=[
2645
BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems(),
2746
],

src/datadog_api_client/v2/api/cloud_cost_management_api.py

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,26 @@ def __init__(self, api_client=None):
445445
"attribute": "budget_id",
446446
"location": "path",
447447
},
448+
"actual": {
449+
"openapi_types": (bool,),
450+
"attribute": "actual",
451+
"location": "query",
452+
},
453+
"forecast": {
454+
"openapi_types": (bool,),
455+
"attribute": "forecast",
456+
"location": "query",
457+
},
458+
"start": {
459+
"openapi_types": (int,),
460+
"attribute": "start",
461+
"location": "query",
462+
},
463+
"end": {
464+
"openapi_types": (int,),
465+
"attribute": "end",
466+
"location": "query",
467+
},
448468
},
449469
headers_map={
450470
"accept": ["application/json"],
@@ -2222,18 +2242,43 @@ def generate_cost_tag_description_by_key(
22222242
def get_budget(
22232243
self,
22242244
budget_id: str,
2245+
*,
2246+
actual: Union[bool, UnsetType] = unset,
2247+
forecast: Union[bool, UnsetType] = unset,
2248+
start: Union[int, UnsetType] = unset,
2249+
end: Union[int, UnsetType] = unset,
22252250
) -> BudgetWithEntries:
22262251
"""Get budget.
22272252
2228-
Get a budget
2253+
Get a budget by ID. Pass ``actual=true`` or ``forecast=true`` to include cost data in the response. Use ``start`` and ``end`` (millisecond epochs, both required) to set the cost window. When ``forecast=true`` , each entry also includes ``ootb_forecast`` (the ML forecast before overrides) and ``custom_forecast`` ( ``null`` if no override is set, a number if one is).
22292254
22302255
:param budget_id: Budget id.
22312256
:type budget_id: str
2257+
:param actual: When ``true`` , includes actual cost data in the response.
2258+
:type actual: bool, optional
2259+
:param forecast: When ``true`` , includes forecast cost data in the response, including ``ootb_forecast`` and ``custom_forecast`` per entry.
2260+
:type forecast: bool, optional
2261+
:param start: Start of the cost window in milliseconds since epoch. Must be used together with ``end``.
2262+
:type start: int, optional
2263+
:param end: End of the cost window in milliseconds since epoch. Must be used together with ``start``.
2264+
:type end: int, optional
22322265
:rtype: BudgetWithEntries
22332266
"""
22342267
kwargs: Dict[str, Any] = {}
22352268
kwargs["budget_id"] = budget_id
22362269

2270+
if actual is not unset:
2271+
kwargs["actual"] = actual
2272+
2273+
if forecast is not unset:
2274+
kwargs["forecast"] = forecast
2275+
2276+
if start is not unset:
2277+
kwargs["start"] = start
2278+
2279+
if end is not unset:
2280+
kwargs["end"] = end
2281+
22372282
return self._get_budget_endpoint.call_with_http_info(**kwargs)
22382283

22392284
def get_commitments_commitment_list(

0 commit comments

Comments
 (0)