Skip to content

Commit 99d0325

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 27b019f of spec repo (#3509)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent d1c0b91 commit 99d0325

18 files changed

Lines changed: 1789 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27158,6 +27158,156 @@ components:
2715827158
$ref: "#/components/schemas/CustomDestinationResponseDefinition"
2715927159
type: array
2716027160
type: object
27161+
CustomForecastEntry:
27162+
description: A monthly entry of a custom budget forecast.
27163+
properties:
27164+
amount:
27165+
description: Forecast amount for the month.
27166+
example: 400
27167+
format: double
27168+
type: number
27169+
month:
27170+
description: Month the custom forecast entry applies to, in `YYYYMM` format.
27171+
example: 202501
27172+
format: int64
27173+
type: integer
27174+
tag_filters:
27175+
description: Tag filters that scope this custom forecast entry to specific resources.
27176+
items:
27177+
$ref: "#/components/schemas/CustomForecastEntryTagFilter"
27178+
type: array
27179+
required:
27180+
- month
27181+
- amount
27182+
- tag_filters
27183+
type: object
27184+
CustomForecastEntryTagFilter:
27185+
description: A tag filter that scopes a custom forecast entry to specific resource tags.
27186+
properties:
27187+
tag_key:
27188+
description: The tag key to filter on.
27189+
example: service
27190+
type: string
27191+
tag_value:
27192+
description: The tag value to filter on.
27193+
example: ec2
27194+
type: string
27195+
required:
27196+
- tag_key
27197+
- tag_value
27198+
type: object
27199+
CustomForecastResponse:
27200+
description: Response object containing the custom forecast for a budget.
27201+
properties:
27202+
data:
27203+
$ref: "#/components/schemas/CustomForecastResponseData"
27204+
required:
27205+
- data
27206+
type: object
27207+
CustomForecastResponseData:
27208+
description: Custom forecast resource wrapper in a response.
27209+
properties:
27210+
attributes:
27211+
$ref: "#/components/schemas/CustomForecastResponseDataAttributes"
27212+
id:
27213+
description: The unique identifier of the custom forecast.
27214+
example: 11111111-1111-1111-1111-111111111111
27215+
type: string
27216+
type:
27217+
$ref: "#/components/schemas/CustomForecastType"
27218+
required:
27219+
- id
27220+
- type
27221+
- attributes
27222+
type: object
27223+
CustomForecastResponseDataAttributes:
27224+
description: Attributes of a custom forecast.
27225+
properties:
27226+
budget_uid:
27227+
description: The UUID of the budget that this custom forecast belongs to.
27228+
example: 00000000-0000-0000-0000-000000000001
27229+
type: string
27230+
created_at:
27231+
description: Timestamp the custom forecast was created, in Unix milliseconds.
27232+
example: 1738258683590
27233+
format: int64
27234+
type: integer
27235+
created_by:
27236+
description: The id of the user that created the custom forecast.
27237+
example: 00000000-0a0a-0a0a-aaa0-00000000000a
27238+
type: string
27239+
entries:
27240+
description: Monthly custom forecast entries.
27241+
items:
27242+
$ref: "#/components/schemas/CustomForecastEntry"
27243+
type: array
27244+
updated_at:
27245+
description: Timestamp the custom forecast was last updated, in Unix milliseconds.
27246+
example: 1738258683590
27247+
format: int64
27248+
type: integer
27249+
updated_by:
27250+
description: The id of the user that last updated the custom forecast.
27251+
example: 00000000-0a0a-0a0a-aaa0-00000000000a
27252+
type: string
27253+
required:
27254+
- budget_uid
27255+
- created_at
27256+
- updated_at
27257+
- created_by
27258+
- updated_by
27259+
- entries
27260+
type: object
27261+
CustomForecastType:
27262+
default: custom_forecast
27263+
description: The type of the custom forecast resource. Must be `custom_forecast`.
27264+
enum:
27265+
- custom_forecast
27266+
example: custom_forecast
27267+
type: string
27268+
x-enum-varnames:
27269+
- CUSTOM_FORECAST
27270+
CustomForecastUpsertRequest:
27271+
description: Request body to upsert (create or replace) the custom forecast for a budget.
27272+
properties:
27273+
data:
27274+
$ref: "#/components/schemas/CustomForecastUpsertRequestData"
27275+
required:
27276+
- data
27277+
type: object
27278+
CustomForecastUpsertRequestData:
27279+
description: Custom forecast resource wrapper in an upsert request.
27280+
properties:
27281+
attributes:
27282+
$ref: "#/components/schemas/CustomForecastUpsertRequestDataAttributes"
27283+
id:
27284+
description: Unused on upsert; the resource is keyed by `budget_uid`. Send an empty string.
27285+
example: ""
27286+
type: string
27287+
type:
27288+
$ref: "#/components/schemas/CustomForecastType"
27289+
required:
27290+
- type
27291+
- attributes
27292+
type: object
27293+
CustomForecastUpsertRequestDataAttributes:
27294+
description: Attributes of a custom forecast upsert request.
27295+
properties:
27296+
budget_uid:
27297+
description: The UUID of the budget that this custom forecast belongs to.
27298+
example: 00000000-0000-0000-0000-000000000001
27299+
type: string
27300+
entries:
27301+
description: |-
27302+
Monthly custom forecast entries. An empty list deletes any existing
27303+
custom forecast for the budget.
27304+
items:
27305+
$ref: "#/components/schemas/CustomForecastEntry"
27306+
type: array
27307+
required:
27308+
- budget_uid
27309+
- entries
27310+
type: object
2716127311
CustomFrameworkControl:
2716227312
description: Framework Control.
2716327313
properties:
@@ -124191,6 +124341,82 @@ paths:
124191124341
summary: Validate CSV budget
124192124342
tags:
124193124343
- Cloud Cost Management
124344+
/api/v2/cost/budget/custom-forecast:
124345+
put:
124346+
description: |-
124347+
Create or replace the custom forecast for an existing budget.
124348+
Pass an empty `entries` list to delete the custom forecast for the budget.
124349+
operationId: UpsertCustomForecast
124350+
requestBody:
124351+
content:
124352+
application/json:
124353+
examples:
124354+
default:
124355+
value:
124356+
data:
124357+
attributes:
124358+
budget_uid: 00000000-0000-0000-0000-000000000001
124359+
entries:
124360+
- amount: 400
124361+
month: 202501
124362+
tag_filters:
124363+
- tag_key: service
124364+
tag_value: ec2
124365+
- amount: 450
124366+
month: 202502
124367+
tag_filters:
124368+
- tag_key: service
124369+
tag_value: ec2
124370+
id: ""
124371+
type: custom_forecast
124372+
schema:
124373+
$ref: "#/components/schemas/CustomForecastUpsertRequest"
124374+
required: true
124375+
responses:
124376+
"200":
124377+
content:
124378+
application/json:
124379+
examples:
124380+
default:
124381+
value:
124382+
data:
124383+
attributes:
124384+
budget_uid: 00000000-0000-0000-0000-000000000001
124385+
created_at: 1738258683590
124386+
created_by: 00000000-0a0a-0a0a-aaa0-00000000000a
124387+
entries:
124388+
- amount: 400
124389+
month: 202501
124390+
tag_filters:
124391+
- tag_key: service
124392+
tag_value: ec2
124393+
- amount: 450
124394+
month: 202502
124395+
tag_filters:
124396+
- tag_key: service
124397+
tag_value: ec2
124398+
updated_at: 1738258683590
124399+
updated_by: 00000000-0a0a-0a0a-aaa0-00000000000a
124400+
id: 11111111-1111-1111-1111-111111111111
124401+
type: custom_forecast
124402+
schema:
124403+
$ref: "#/components/schemas/CustomForecastResponse"
124404+
description: OK
124405+
"400":
124406+
$ref: "#/components/responses/BadRequestResponse"
124407+
"404":
124408+
$ref: "#/components/responses/NotFoundResponse"
124409+
"429":
124410+
$ref: "#/components/responses/TooManyRequestsResponse"
124411+
security:
124412+
- apiKeyAuth: []
124413+
appKeyAuth: []
124414+
summary: Create or replace a budget's custom forecast
124415+
tags:
124416+
- Cloud Cost Management
124417+
x-unstable: |-
124418+
**Note**: This endpoint is in preview and is subject to change.
124419+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
124194124420
/api/v2/cost/budget/validate:
124195124421
post:
124196124422
description: Validate a budget configuration without creating or modifying it
@@ -124313,6 +124539,30 @@ paths:
124313124539
summary: Get budget
124314124540
tags:
124315124541
- Cloud Cost Management
124542+
/api/v2/cost/budget/{budget_id}/custom-forecast:
124543+
delete:
124544+
description: Delete the custom forecast for a budget.
124545+
operationId: DeleteCustomForecast
124546+
parameters:
124547+
- $ref: "#/components/parameters/BudgetID"
124548+
responses:
124549+
"204":
124550+
description: No Content
124551+
"400":
124552+
$ref: "#/components/responses/BadRequestResponse"
124553+
"404":
124554+
$ref: "#/components/responses/NotFoundResponse"
124555+
"429":
124556+
$ref: "#/components/responses/TooManyRequestsResponse"
124557+
security:
124558+
- apiKeyAuth: []
124559+
appKeyAuth: []
124560+
summary: Delete a budget's custom forecast
124561+
tags:
124562+
- Cloud Cost Management
124563+
x-unstable: |-
124564+
**Note**: This endpoint is in preview and is subject to change.
124565+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
124316124566
/api/v2/cost/budgets:
124317124567
get:
124318124568
description: List budgets.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Delete a budget's custom forecast returns "No Content" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.delete_custom_forecast".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
8+
api_instance.delete_custom_forecast("budget_id")
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Create or replace a budget's custom forecast returns "OK" response
2+
3+
require "datadog_api_client"
4+
DatadogAPIClient.configure do |config|
5+
config.unstable_operations["v2.upsert_custom_forecast".to_sym] = true
6+
end
7+
api_instance = DatadogAPIClient::V2::CloudCostManagementAPI.new
8+
9+
body = DatadogAPIClient::V2::CustomForecastUpsertRequest.new({
10+
data: DatadogAPIClient::V2::CustomForecastUpsertRequestData.new({
11+
attributes: DatadogAPIClient::V2::CustomForecastUpsertRequestDataAttributes.new({
12+
budget_uid: "00000000-0000-0000-0000-000000000001",
13+
entries: [
14+
DatadogAPIClient::V2::CustomForecastEntry.new({
15+
amount: 400,
16+
month: 202501,
17+
tag_filters: [
18+
DatadogAPIClient::V2::CustomForecastEntryTagFilter.new({
19+
tag_key: "service",
20+
tag_value: "ec2",
21+
}),
22+
],
23+
}),
24+
],
25+
}),
26+
id: "",
27+
type: DatadogAPIClient::V2::CustomForecastType::CUSTOM_FORECAST,
28+
}),
29+
})
30+
p api_instance.upsert_custom_forecast(body)

features/scenarios_model_mapping.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2699,6 +2699,9 @@
26992699
"v2.UpsertBudget" => {
27002700
"body" => "BudgetWithEntries",
27012701
},
2702+
"v2.UpsertCustomForecast" => {
2703+
"body" => "CustomForecastUpsertRequest",
2704+
},
27022705
"v2.ValidateBudget" => {
27032706
"body" => "BudgetValidationRequest",
27042707
},
@@ -2708,6 +2711,9 @@
27082711
"v2.GetBudget" => {
27092712
"budget_id" => "String",
27102713
},
2714+
"v2.DeleteCustomForecast" => {
2715+
"budget_id" => "String",
2716+
},
27112717
"v2.GetCommitmentsCommitmentList" => {
27122718
"provider" => "CommitmentsProvider",
27132719
"product" => "String",

features/v2/cloud_cost_management.feature

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,30 @@ Feature: Cloud Cost Management
6767
And the response "data.type" is equal to "arbitrary_rule"
6868
And the response "data.attributes.rule_name" is equal to "example-arbitrary-cost-rule"
6969

70+
@generated @skip @team:DataDog/cloud-cost-management
71+
Scenario: Create or replace a budget's custom forecast returns "Bad Request" response
72+
Given operation "UpsertCustomForecast" enabled
73+
And new "UpsertCustomForecast" request
74+
And body with value {"data": {"attributes": {"budget_uid": "00000000-0000-0000-0000-000000000001", "entries": [{"amount": 400, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}]}, "id": "", "type": "custom_forecast"}}
75+
When the request is sent
76+
Then the response status is 400 Bad Request
77+
78+
@generated @skip @team:DataDog/cloud-cost-management
79+
Scenario: Create or replace a budget's custom forecast returns "Not Found" response
80+
Given operation "UpsertCustomForecast" enabled
81+
And new "UpsertCustomForecast" request
82+
And body with value {"data": {"attributes": {"budget_uid": "00000000-0000-0000-0000-000000000001", "entries": [{"amount": 400, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}]}, "id": "", "type": "custom_forecast"}}
83+
When the request is sent
84+
Then the response status is 404 Not Found
85+
86+
@generated @skip @team:DataDog/cloud-cost-management
87+
Scenario: Create or replace a budget's custom forecast returns "OK" response
88+
Given operation "UpsertCustomForecast" enabled
89+
And new "UpsertCustomForecast" request
90+
And body with value {"data": {"attributes": {"budget_uid": "00000000-0000-0000-0000-000000000001", "entries": [{"amount": 400, "month": 202501, "tag_filters": [{"tag_key": "service", "tag_value": "ec2"}]}]}, "id": "", "type": "custom_forecast"}}
91+
When the request is sent
92+
Then the response status is 200 OK
93+
7094
@generated @skip @team:DataDog/cloud-cost-management
7195
Scenario: Create or update a budget returns "Bad Request" response
7296
Given new "UpsertBudget" request
@@ -211,6 +235,30 @@ Feature: Cloud Cost Management
211235
When the request is sent
212236
Then the response status is 400 Bad Request
213237

238+
@generated @skip @team:DataDog/cloud-cost-management
239+
Scenario: Delete a budget's custom forecast returns "Bad Request" response
240+
Given operation "DeleteCustomForecast" enabled
241+
And new "DeleteCustomForecast" request
242+
And request contains "budget_id" parameter from "REPLACE.ME"
243+
When the request is sent
244+
Then the response status is 400 Bad Request
245+
246+
@generated @skip @team:DataDog/cloud-cost-management
247+
Scenario: Delete a budget's custom forecast returns "No Content" response
248+
Given operation "DeleteCustomForecast" enabled
249+
And new "DeleteCustomForecast" request
250+
And request contains "budget_id" parameter from "REPLACE.ME"
251+
When the request is sent
252+
Then the response status is 204 No Content
253+
254+
@generated @skip @team:DataDog/cloud-cost-management
255+
Scenario: Delete a budget's custom forecast returns "Not Found" response
256+
Given operation "DeleteCustomForecast" enabled
257+
And new "DeleteCustomForecast" request
258+
And request contains "budget_id" parameter from "REPLACE.ME"
259+
When the request is sent
260+
Then the response status is 404 Not Found
261+
214262
@generated @skip @team:DataDog/cloud-cost-management
215263
Scenario: Delete budget returns "No Content" response
216264
Given new "DeleteBudget" request

0 commit comments

Comments
 (0)