Skip to content

Commit c228101

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Mark custom forecast endpoints as generally available (#1848)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent b468b40 commit c228101

7 files changed

Lines changed: 12 additions & 60 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -129641,9 +129641,6 @@ paths:
129641129641
summary: Create or replace a budget's custom forecast
129642129642
tags:
129643129643
- Cloud Cost Management
129644-
x-unstable: |-
129645-
**Note**: This endpoint is in preview and is subject to change.
129646-
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
129647129644
/api/v2/cost/budget/validate:
129648129645
post:
129649129646
description: Validate a budget configuration without creating or modifying it
@@ -129837,9 +129834,6 @@ paths:
129837129834
summary: Delete a budget's custom forecast
129838129835
tags:
129839129836
- Cloud Cost Management
129840-
x-unstable: |-
129841-
**Note**: This endpoint is in preview and is subject to change.
129842-
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
129843129837
get:
129844129838
description: Get the custom forecast for a budget.
129845129839
operationId: GetCustomForecast
@@ -129887,9 +129881,6 @@ paths:
129887129881
summary: Get a budget's custom forecast
129888129882
tags:
129889129883
- Cloud Cost Management
129890-
x-unstable: |-
129891-
**Note**: This endpoint is in preview and is subject to change.
129892-
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
129893129884
/api/v2/cost/budgets:
129894129885
get:
129895129886
description: List budgets.

examples/v2_cloud-cost-management_DeleteCustomForecast.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagemen
44

55
#[tokio::main]
66
async fn main() {
7-
let mut configuration = datadog::Configuration::new();
8-
configuration.set_unstable_operation_enabled("v2.DeleteCustomForecast", true);
7+
let configuration = datadog::Configuration::new();
98
let api = CloudCostManagementAPI::with_config(configuration);
109
let resp = api.delete_custom_forecast("budget_id".to_string()).await;
1110
if let Ok(value) = resp {

examples/v2_cloud-cost-management_GetCustomForecast.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ use datadog_api_client::datadogV2::api_cloud_cost_management::CloudCostManagemen
44

55
#[tokio::main]
66
async fn main() {
7-
let mut configuration = datadog::Configuration::new();
8-
configuration.set_unstable_operation_enabled("v2.GetCustomForecast", true);
7+
let configuration = datadog::Configuration::new();
98
let api = CloudCostManagementAPI::with_config(configuration);
109
let resp = api.get_custom_forecast("budget_id".to_string()).await;
1110
if let Ok(value) = resp {

examples/v2_cloud-cost-management_UpsertCustomForecast.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ async fn main() {
2727
)
2828
.id("".to_string()),
2929
);
30-
let mut configuration = datadog::Configuration::new();
31-
configuration.set_unstable_operation_enabled("v2.UpsertCustomForecast", true);
30+
let configuration = datadog::Configuration::new();
3231
let api = CloudCostManagementAPI::with_config(configuration);
3332
let resp = api.upsert_custom_forecast(body).await;
3433
if let Ok(value) = resp {

src/datadog/configuration.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ impl Default for Configuration {
498498
("v2.get_code_coverage_branch_summary".to_owned(), false),
499499
("v2.get_code_coverage_commit_summary".to_owned(), false),
500500
("v2.get_rule_based_view".to_owned(), false),
501-
("v2.delete_custom_forecast".to_owned(), false),
502501
("v2.get_commitments_commitment_list".to_owned(), false),
503502
("v2.get_commitments_coverage_scalar".to_owned(), false),
504503
("v2.get_commitments_coverage_timeseries".to_owned(), false),
@@ -515,15 +514,13 @@ impl Default for Configuration {
515514
),
516515
("v2.get_cost_anomaly".to_owned(), false),
517516
("v2.get_cost_tag_metadata_currency".to_owned(), false),
518-
("v2.get_custom_forecast".to_owned(), false),
519517
("v2.list_cost_anomalies".to_owned(), false),
520518
("v2.list_cost_tag_key_sources".to_owned(), false),
521519
("v2.list_cost_tag_metadata".to_owned(), false),
522520
("v2.list_cost_tag_metadata_metrics".to_owned(), false),
523521
("v2.list_cost_tag_metadata_months".to_owned(), false),
524522
("v2.list_cost_tag_metadata_orchestrators".to_owned(), false),
525523
("v2.search_cost_recommendations".to_owned(), false),
526-
("v2.upsert_custom_forecast".to_owned(), false),
527524
("v2.create_ownership_feedback".to_owned(), false),
528525
("v2.get_ownership_evidence".to_owned(), false),
529526
("v2.get_ownership_inference".to_owned(), false),

src/datadogV2/api/api_cloud_cost_management.rs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,14 +2726,6 @@ impl CloudCostManagementAPI {
27262726
) -> Result<datadog::ResponseContent<()>, datadog::Error<DeleteCustomForecastError>> {
27272727
let local_configuration = &self.config;
27282728
let operation_id = "v2.delete_custom_forecast";
2729-
if local_configuration.is_unstable_operation_enabled(operation_id) {
2730-
warn!("Using unstable operation {operation_id}");
2731-
} else {
2732-
let local_error = datadog::UnstableOperationDisabledError {
2733-
msg: "Operation 'v2.delete_custom_forecast' is not enabled".to_string(),
2734-
};
2735-
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
2736-
}
27372729

27382730
let local_client = &self.client;
27392731

@@ -5469,14 +5461,6 @@ impl CloudCostManagementAPI {
54695461
> {
54705462
let local_configuration = &self.config;
54715463
let operation_id = "v2.get_custom_forecast";
5472-
if local_configuration.is_unstable_operation_enabled(operation_id) {
5473-
warn!("Using unstable operation {operation_id}");
5474-
} else {
5475-
let local_error = datadog::UnstableOperationDisabledError {
5476-
msg: "Operation 'v2.get_custom_forecast' is not enabled".to_string(),
5477-
};
5478-
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
5479-
}
54805464

54815465
let local_client = &self.client;
54825466

@@ -9909,14 +9893,6 @@ impl CloudCostManagementAPI {
99099893
> {
99109894
let local_configuration = &self.config;
99119895
let operation_id = "v2.upsert_custom_forecast";
9912-
if local_configuration.is_unstable_operation_enabled(operation_id) {
9913-
warn!("Using unstable operation {operation_id}");
9914-
} else {
9915-
let local_error = datadog::UnstableOperationDisabledError {
9916-
msg: "Operation 'v2.upsert_custom_forecast' is not enabled".to_string(),
9917-
};
9918-
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
9919-
}
99209896

99219897
let local_client = &self.client;
99229898

tests/scenarios/features/v2/cloud_cost_management.feature

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,21 @@ Feature: Cloud Cost Management
6969

7070
@generated @skip @team:DataDog/cloud-cost-management
7171
Scenario: Create or replace a budget's custom forecast returns "Bad Request" response
72-
Given operation "UpsertCustomForecast" enabled
73-
And new "UpsertCustomForecast" request
72+
Given new "UpsertCustomForecast" request
7473
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"}}
7574
When the request is sent
7675
Then the response status is 400 Bad Request
7776

7877
@generated @skip @team:DataDog/cloud-cost-management
7978
Scenario: Create or replace a budget's custom forecast returns "Not Found" response
80-
Given operation "UpsertCustomForecast" enabled
81-
And new "UpsertCustomForecast" request
79+
Given new "UpsertCustomForecast" request
8280
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"}}
8381
When the request is sent
8482
Then the response status is 404 Not Found
8583

8684
@generated @skip @team:DataDog/cloud-cost-management
8785
Scenario: Create or replace a budget's custom forecast returns "OK" response
88-
Given operation "UpsertCustomForecast" enabled
89-
And new "UpsertCustomForecast" request
86+
Given new "UpsertCustomForecast" request
9087
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"}}
9188
When the request is sent
9289
Then the response status is 200 OK
@@ -237,24 +234,21 @@ Feature: Cloud Cost Management
237234

238235
@generated @skip @team:DataDog/cloud-cost-management
239236
Scenario: Delete a budget's custom forecast returns "Bad Request" response
240-
Given operation "DeleteCustomForecast" enabled
241-
And new "DeleteCustomForecast" request
237+
Given new "DeleteCustomForecast" request
242238
And request contains "budget_id" parameter from "REPLACE.ME"
243239
When the request is sent
244240
Then the response status is 400 Bad Request
245241

246242
@generated @skip @team:DataDog/cloud-cost-management
247243
Scenario: Delete a budget's custom forecast returns "No Content" response
248-
Given operation "DeleteCustomForecast" enabled
249-
And new "DeleteCustomForecast" request
244+
Given new "DeleteCustomForecast" request
250245
And request contains "budget_id" parameter from "REPLACE.ME"
251246
When the request is sent
252247
Then the response status is 204 No Content
253248

254249
@generated @skip @team:DataDog/cloud-cost-management
255250
Scenario: Delete a budget's custom forecast returns "Not Found" response
256-
Given operation "DeleteCustomForecast" enabled
257-
And new "DeleteCustomForecast" request
251+
Given new "DeleteCustomForecast" request
258252
And request contains "budget_id" parameter from "REPLACE.ME"
259253
When the request is sent
260254
Then the response status is 404 Not Found
@@ -377,24 +371,21 @@ Feature: Cloud Cost Management
377371

378372
@generated @skip @team:DataDog/cloud-cost-management
379373
Scenario: Get a budget's custom forecast returns "Bad Request" response
380-
Given operation "GetCustomForecast" enabled
381-
And new "GetCustomForecast" request
374+
Given new "GetCustomForecast" request
382375
And request contains "budget_id" parameter from "REPLACE.ME"
383376
When the request is sent
384377
Then the response status is 400 Bad Request
385378

386379
@generated @skip @team:DataDog/cloud-cost-management
387380
Scenario: Get a budget's custom forecast returns "Not Found" response
388-
Given operation "GetCustomForecast" enabled
389-
And new "GetCustomForecast" request
381+
Given new "GetCustomForecast" request
390382
And request contains "budget_id" parameter from "REPLACE.ME"
391383
When the request is sent
392384
Then the response status is 404 Not Found
393385

394386
@generated @skip @team:DataDog/cloud-cost-management
395387
Scenario: Get a budget's custom forecast returns "OK" response
396-
Given operation "GetCustomForecast" enabled
397-
And new "GetCustomForecast" request
388+
Given new "GetCustomForecast" request
398389
And request contains "budget_id" parameter from "REPLACE.ME"
399390
When the request is sent
400391
Then the response status is 200 OK

0 commit comments

Comments
 (0)