Skip to content

Commit b441f55

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 11ca4e2 of spec repo
1 parent d765a5b commit b441f55

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
@@ -12570,6 +12570,20 @@ components:
1257012570
BudgetAttributes:
1257112571
description: The attributes of a budget.
1257212572
properties:
12573+
costs:
12574+
$ref: "#/components/schemas/BudgetAttributesCosts"
12575+
description: Aggregated cost data for the budget. Present only when `actual=true` or `forecast=true` is requested.
12576+
costs_period_end:
12577+
description: The end of the period used to compute cost data, in milliseconds since epoch.
12578+
format: int64
12579+
type: integer
12580+
costs_period_start:
12581+
description: The start of the period used to compute cost data, in milliseconds since epoch.
12582+
format: int64
12583+
type: integer
12584+
costs_unit:
12585+
$ref: "#/components/schemas/BudgetAttributesCostsUnit"
12586+
description: The unit used for all cost values in the response.
1257312587
created_at:
1257412588
description: The timestamp when the budget was created.
1257512589
example: 1738258683590
@@ -12622,6 +12636,53 @@ components:
1262212636
example: 00000000-0a0a-0a0a-aaa0-00000000000a
1262312637
type: string
1262412638
type: object
12639+
BudgetAttributesCosts:
12640+
description: Aggregated cost data for the budget over the requested period.
12641+
properties:
12642+
actual:
12643+
description: The total actual cost. Present only when `actual=true` is requested.
12644+
format: double
12645+
nullable: true
12646+
type: number
12647+
amount:
12648+
description: The total budgeted amount over the requested period.
12649+
format: double
12650+
nullable: true
12651+
type: number
12652+
forecast:
12653+
description: The total forecast cost, with any custom forecast overrides applied. Present only when `forecast=true` is requested.
12654+
format: double
12655+
nullable: true
12656+
type: number
12657+
ootb_forecast:
12658+
description: The out-of-the-box ML forecast before custom overrides. Present only when `forecast=true` is requested.
12659+
format: double
12660+
nullable: true
12661+
type: number
12662+
type: object
12663+
BudgetAttributesCostsUnit:
12664+
description: The unit used for all cost values in the response.
12665+
properties:
12666+
family:
12667+
description: The unit family (for example, `currency`).
12668+
type: string
12669+
id:
12670+
description: The unique identifier for the unit.
12671+
type: string
12672+
name:
12673+
description: The full name of the unit.
12674+
type: string
12675+
plural:
12676+
description: The plural form of the unit name.
12677+
type: string
12678+
scale_factor:
12679+
description: The scale factor applied to raw cost values.
12680+
format: double
12681+
type: number
12682+
short_name:
12683+
description: The abbreviated unit name.
12684+
type: string
12685+
type: object
1262512686
BudgetValidationRequest:
1262612687
description: The request object for validating a budget configuration before creating or updating it.
1262712688
example:
@@ -12787,6 +12848,9 @@ components:
1278712848
description: The budgeted amount for this entry.
1278812849
format: double
1278912850
type: number
12851+
costs:
12852+
$ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsCosts"
12853+
description: Cost data for this entry. Present only when `actual=true` or `forecast=true` is requested.
1279012854
month:
1279112855
description: The month this budget entry applies to, in YYYYMM format.
1279212856
format: int64
@@ -12797,6 +12861,36 @@ components:
1279712861
$ref: "#/components/schemas/BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems"
1279812862
type: array
1279912863
type: object
12864+
BudgetWithEntriesDataAttributesEntriesItemsCosts:
12865+
description: Cost data for a single budget entry.
12866+
properties:
12867+
actual:
12868+
description: The actual cost for this entry. Present only when `actual=true` is requested.
12869+
format: double
12870+
nullable: true
12871+
type: number
12872+
amount:
12873+
description: The budgeted amount for this entry.
12874+
format: double
12875+
nullable: true
12876+
type: number
12877+
custom_forecast:
12878+
description: |-
12879+
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.
12880+
format: double
12881+
nullable: true
12882+
type: number
12883+
forecast:
12884+
description: The final forecast for this entry, with any custom forecast override applied. Present only when `forecast=true` is requested.
12885+
format: double
12886+
nullable: true
12887+
type: number
12888+
ootb_forecast:
12889+
description: The out-of-the-box ML forecast for this entry, before custom overrides. Present only when `forecast=true` is requested.
12890+
format: double
12891+
nullable: true
12892+
type: number
12893+
type: object
1280012894
BudgetWithEntriesDataAttributesEntriesItemsTagFiltersItems:
1280112895
description: A tag filter used to scope a budget entry to specific resource tags.
1280212896
properties:
@@ -116220,10 +116314,36 @@ paths:
116220116314
tags:
116221116315
- Cloud Cost Management
116222116316
get:
116223-
description: Get a budget
116317+
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).
116224116318
operationId: GetBudget
116225116319
parameters:
116226116320
- $ref: "#/components/parameters/BudgetID"
116321+
- description: When `true`, includes actual cost data in the response.
116322+
in: query
116323+
name: actual
116324+
required: false
116325+
schema:
116326+
type: boolean
116327+
- description: When `true`, includes forecast cost data in the response, including `ootb_forecast` and `custom_forecast` per entry.
116328+
in: query
116329+
name: forecast
116330+
required: false
116331+
schema:
116332+
type: boolean
116333+
- description: Start of the cost window in milliseconds since epoch. Must be used together with `end`.
116334+
in: query
116335+
name: start
116336+
required: false
116337+
schema:
116338+
format: int64
116339+
type: integer
116340+
- description: End of the cost window in milliseconds since epoch. Must be used together with `start`.
116341+
in: query
116342+
name: end
116343+
required: false
116344+
schema:
116345+
format: int64
116346+
type: integer
116227116347
responses:
116228116348
"200":
116229116349
content:
@@ -116233,11 +116353,31 @@ paths:
116233116353
value:
116234116354
data:
116235116355
attributes:
116356+
costs:
116357+
actual: 850.25
116358+
amount: 1000.0
116359+
forecast: 1100.5
116360+
ootb_forecast: 1100.5
116361+
costs_period_end: 1740873600000
116362+
costs_period_start: 1738281600000
116363+
costs_unit:
116364+
family: currency
116365+
id: "1"
116366+
name: dollar
116367+
plural: dollars
116368+
scale_factor: 1.0
116369+
short_name: $
116236116370
created_at: 1738258683590
116237116371
created_by: 00000000-0a0a-0a0a-aaa0-00000000000a
116238116372
end_month: 202502
116239116373
entries:
116240116374
- amount: 500
116375+
costs:
116376+
actual: 425.5
116377+
amount: 500.0
116378+
custom_forecast:
116379+
forecast: 550.25
116380+
ootb_forecast: 550.25
116241116381
month: 202501
116242116382
tag_filters:
116243116383
- tag_key: service
@@ -116254,6 +116394,10 @@ paths:
116254116394
schema:
116255116395
$ref: "#/components/schemas/BudgetWithEntries"
116256116396
description: OK
116397+
"400":
116398+
$ref: "#/components/responses/BadRequestResponse"
116399+
"404":
116400+
$ref: "#/components/responses/NotFoundResponse"
116257116401
"429":
116258116402
$ref: "#/components/responses/TooManyRequestsResponse"
116259116403
security:

docs/datadog_api_client.v2.model.rst

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

4361+
datadog\_api\_client.v2.model.budget\_attributes\_costs module
4362+
--------------------------------------------------------------
4363+
4364+
.. automodule:: datadog_api_client.v2.model.budget_attributes_costs
4365+
:members:
4366+
:show-inheritance:
4367+
4368+
datadog\_api\_client.v2.model.budget\_attributes\_costs\_unit module
4369+
--------------------------------------------------------------------
4370+
4371+
.. automodule:: datadog_api_client.v2.model.budget_attributes_costs_unit
4372+
:members:
4373+
:show-inheritance:
4374+
43614375
datadog\_api\_client.v2.model.budget\_validation\_request module
43624376
----------------------------------------------------------------
43634377

@@ -4428,6 +4442,13 @@ datadog\_api\_client.v2.model.budget\_with\_entries\_data\_attributes\_entries\_
44284442
:members:
44294443
:show-inheritance:
44304444

4445+
datadog\_api\_client.v2.model.budget\_with\_entries\_data\_attributes\_entries\_items\_costs module
4446+
---------------------------------------------------------------------------------------------------
4447+
4448+
.. automodule:: datadog_api_client.v2.model.budget_with_entries_data_attributes_entries_items_costs
4449+
:members:
4450+
:show-inheritance:
4451+
44314452
datadog\_api\_client.v2.model.budget\_with\_entries\_data\_attributes\_entries\_items\_tag\_filters\_items module
44324453
-----------------------------------------------------------------------------------------------------------------
44334454

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
@@ -420,6 +420,26 @@ def __init__(self, api_client=None):
420420
"attribute": "budget_id",
421421
"location": "path",
422422
},
423+
"actual": {
424+
"openapi_types": (bool,),
425+
"attribute": "actual",
426+
"location": "query",
427+
},
428+
"forecast": {
429+
"openapi_types": (bool,),
430+
"attribute": "forecast",
431+
"location": "query",
432+
},
433+
"start": {
434+
"openapi_types": (int,),
435+
"attribute": "start",
436+
"location": "query",
437+
},
438+
"end": {
439+
"openapi_types": (int,),
440+
"attribute": "end",
441+
"location": "query",
442+
},
423443
},
424444
headers_map={
425445
"accept": ["application/json"],
@@ -2155,18 +2175,43 @@ def generate_cost_tag_description_by_key(
21552175
def get_budget(
21562176
self,
21572177
budget_id: str,
2178+
*,
2179+
actual: Union[bool, UnsetType] = unset,
2180+
forecast: Union[bool, UnsetType] = unset,
2181+
start: Union[int, UnsetType] = unset,
2182+
end: Union[int, UnsetType] = unset,
21582183
) -> BudgetWithEntries:
21592184
"""Get budget.
21602185
2161-
Get a budget
2186+
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).
21622187
21632188
:param budget_id: Budget id.
21642189
:type budget_id: str
2190+
:param actual: When ``true`` , includes actual cost data in the response.
2191+
:type actual: bool, optional
2192+
:param forecast: When ``true`` , includes forecast cost data in the response, including ``ootb_forecast`` and ``custom_forecast`` per entry.
2193+
:type forecast: bool, optional
2194+
:param start: Start of the cost window in milliseconds since epoch. Must be used together with ``end``.
2195+
:type start: int, optional
2196+
:param end: End of the cost window in milliseconds since epoch. Must be used together with ``start``.
2197+
:type end: int, optional
21652198
:rtype: BudgetWithEntries
21662199
"""
21672200
kwargs: Dict[str, Any] = {}
21682201
kwargs["budget_id"] = budget_id
21692202

2203+
if actual is not unset:
2204+
kwargs["actual"] = actual
2205+
2206+
if forecast is not unset:
2207+
kwargs["forecast"] = forecast
2208+
2209+
if start is not unset:
2210+
kwargs["start"] = start
2211+
2212+
if end is not unset:
2213+
kwargs["end"] = end
2214+
21702215
return self._get_budget_endpoint.call_with_http_info(**kwargs)
21712216

21722217
def get_commitments_commitment_list(

0 commit comments

Comments
 (0)