Skip to content

Commit b8a2df3

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Marks the paths as unstable since the API is in private beta (#420)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent d0906df commit b8a2df3

File tree

8 files changed

+63
-15
lines changed

8 files changed

+63
-15
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-12-13 14:48:41.684377",
8-
"spec_repo_commit": "5392df51"
7+
"regenerated": "2024-12-13 15:30:23.938359",
8+
"spec_repo_commit": "e7a707af"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-12-13 14:48:41.704277",
13-
"spec_repo_commit": "5392df51"
12+
"regenerated": "2024-12-13 15:30:23.957891",
13+
"spec_repo_commit": "e7a707af"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31356,6 +31356,9 @@ paths:
3135631356
permissions:
3135731357
- rum_delete_data
3135831358
- logs_delete_data
31359+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
31360+
31361+
contact [Datadog support](https://docs.datadoghq.com/help/).'
3135931362
/api/v2/deletion/requests:
3136031363
get:
3136131364
description: Gets a list of data deletion requests based on several filter parameters.
@@ -31431,6 +31434,9 @@ paths:
3143131434
permissions:
3143231435
- rum_delete_data
3143331436
- logs_delete_data
31437+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
31438+
31439+
contact [Datadog support](https://docs.datadoghq.com/help/).'
3143431440
/api/v2/deletion/requests/{id}/cancel:
3143531441
put:
3143631442
description: Cancels a data deletion request by providing its ID.
@@ -31473,6 +31479,9 @@ paths:
3147331479
permissions:
3147431480
- rum_delete_data
3147531481
- logs_delete_data
31482+
x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback,
31483+
31484+
contact [Datadog support](https://docs.datadoghq.com/help/).'
3147631485
/api/v2/domain_allowlist:
3147731486
get:
3147831487
description: Get the domain allowlist for an organization.

examples/v2_data-deletion_CancelDataDeletionRequest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use datadog_api_client::datadogV2::api_data_deletion::DataDeletionAPI;
66
async fn main() {
77
// there is a valid "deletion_request" in the system
88
let deletion_request_data_id = std::env::var("DELETION_REQUEST_DATA_ID").unwrap();
9-
let configuration = datadog::Configuration::new();
9+
let mut configuration = datadog::Configuration::new();
10+
configuration.set_unstable_operation_enabled("v2.CancelDataDeletionRequest", true);
1011
let api = DataDeletionAPI::with_config(configuration);
1112
let resp = api
1213
.cancel_data_deletion_request(deletion_request_data_id.clone())

examples/v2_data-deletion_CreateDataDeletionRequest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ async fn main() {
1919
)
2020
.indexes(vec!["test-index".to_string(), "test-index-2".to_string()]),
2121
));
22-
let configuration = datadog::Configuration::new();
22+
let mut configuration = datadog::Configuration::new();
23+
configuration.set_unstable_operation_enabled("v2.CreateDataDeletionRequest", true);
2324
let api = DataDeletionAPI::with_config(configuration);
2425
let resp = api
2526
.create_data_deletion_request("logs".to_string(), body)

examples/v2_data-deletion_GetDataDeletionRequests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use datadog_api_client::datadogV2::api_data_deletion::GetDataDeletionRequestsOpt
55

66
#[tokio::main]
77
async fn main() {
8-
let configuration = datadog::Configuration::new();
8+
let mut configuration = datadog::Configuration::new();
9+
configuration.set_unstable_operation_enabled("v2.GetDataDeletionRequests", true);
910
let api = DataDeletionAPI::with_config(configuration);
1011
let resp = api
1112
.get_data_deletion_requests(GetDataDeletionRequestsOptionalParams::default())

src/datadog/configuration.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ impl Default for Configuration {
137137
("v2.get_active_billing_dimensions".to_owned(), false),
138138
("v2.get_billing_dimension_mapping".to_owned(), false),
139139
("v2.get_monthly_cost_attribution".to_owned(), false),
140+
("v2.cancel_data_deletion_request".to_owned(), false),
141+
("v2.create_data_deletion_request".to_owned(), false),
142+
("v2.get_data_deletion_requests".to_owned(), false),
140143
("v2.create_dora_deployment".to_owned(), false),
141144
("v2.create_dora_incident".to_owned(), false),
142145
("v2.create_incident".to_owned(), false),

src/datadogV2/api/api_data_deletion.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use flate2::{
66
write::{GzEncoder, ZlibEncoder},
77
Compression,
88
};
9+
use log::warn;
910
use reqwest::header::{HeaderMap, HeaderValue};
1011
use serde::{Deserialize, Serialize};
1112
use std::io::Write;
@@ -175,6 +176,14 @@ impl DataDeletionAPI {
175176
> {
176177
let local_configuration = &self.config;
177178
let operation_id = "v2.cancel_data_deletion_request";
179+
if local_configuration.is_unstable_operation_enabled(operation_id) {
180+
warn!("Using unstable operation {operation_id}");
181+
} else {
182+
let local_error = datadog::UnstableOperationDisabledError {
183+
msg: "Operation 'v2.cancel_data_deletion_request' is not enabled".to_string(),
184+
};
185+
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
186+
}
178187

179188
let local_client = &self.client;
180189

@@ -289,6 +298,14 @@ impl DataDeletionAPI {
289298
> {
290299
let local_configuration = &self.config;
291300
let operation_id = "v2.create_data_deletion_request";
301+
if local_configuration.is_unstable_operation_enabled(operation_id) {
302+
warn!("Using unstable operation {operation_id}");
303+
} else {
304+
let local_error = datadog::UnstableOperationDisabledError {
305+
msg: "Operation 'v2.create_data_deletion_request' is not enabled".to_string(),
306+
};
307+
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
308+
}
292309

293310
let local_client = &self.client;
294311

@@ -444,6 +461,14 @@ impl DataDeletionAPI {
444461
> {
445462
let local_configuration = &self.config;
446463
let operation_id = "v2.get_data_deletion_requests";
464+
if local_configuration.is_unstable_operation_enabled(operation_id) {
465+
warn!("Using unstable operation {operation_id}");
466+
} else {
467+
let local_error = datadog::UnstableOperationDisabledError {
468+
msg: "Operation 'v2.get_data_deletion_requests' is not enabled".to_string(),
469+
};
470+
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
471+
}
447472

448473
// unbox and build optional parameters
449474
let next_page = params.next_page;

tests/scenarios/features/v2/data_deletion.feature

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ Feature: Data Deletion
1111

1212
@replay-only @team:DataDog/supportability-engineering
1313
Scenario: Cancels a data deletion request returns "Bad Request" response
14-
Given new "CancelDataDeletionRequest" request
14+
Given operation "CancelDataDeletionRequest" enabled
15+
And new "CancelDataDeletionRequest" request
1516
And request contains "id" parameter with value "id-1"
1617
When the request is sent
1718
Then the response status is 400 Bad Request
1819

1920
@team:DataDog/supportability-engineering
2021
Scenario: Cancels a data deletion request returns "OK" response
21-
Given there is a valid "deletion_request" in the system
22+
Given operation "CancelDataDeletionRequest" enabled
23+
And there is a valid "deletion_request" in the system
2224
And new "CancelDataDeletionRequest" request
2325
And request contains "id" parameter from "deletion_request.data.id"
2426
When the request is sent
@@ -30,22 +32,25 @@ Feature: Data Deletion
3032

3133
@replay-only @team:DataDog/supportability-engineering
3234
Scenario: Cancels a data deletion request returns "Precondition failed error" response
33-
Given new "CancelDataDeletionRequest" request
35+
Given operation "CancelDataDeletionRequest" enabled
36+
And new "CancelDataDeletionRequest" request
3437
And request contains "id" parameter with value "-1"
3538
When the request is sent
3639
Then the response status is 412 Precondition failed error
3740

3841
@generated @skip @team:DataDog/supportability-engineering
3942
Scenario: Creates a data deletion request returns "Bad Request" response
40-
Given new "CreateDataDeletionRequest" request
43+
Given operation "CreateDataDeletionRequest" enabled
44+
And new "CreateDataDeletionRequest" request
4145
And request contains "product" parameter from "REPLACE.ME"
4246
And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}}}
4347
When the request is sent
4448
Then the response status is 400 Bad Request
4549

4650
@team:DataDog/supportability-engineering
4751
Scenario: Creates a data deletion request returns "OK" response
48-
Given new "CreateDataDeletionRequest" request
52+
Given operation "CreateDataDeletionRequest" enabled
53+
And new "CreateDataDeletionRequest" request
4954
And request contains "product" parameter with value "logs"
5055
And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {"host": "abc", "service": "xyz"}, "to": 1704063600000}}}
5156
When the request is sent
@@ -56,21 +61,24 @@ Feature: Data Deletion
5661

5762
@replay-only @team:DataDog/supportability-engineering
5863
Scenario: Creates a data deletion request returns "Precondition failed error" response
59-
Given new "CreateDataDeletionRequest" request
64+
Given operation "CreateDataDeletionRequest" enabled
65+
And new "CreateDataDeletionRequest" request
6066
And request contains "product" parameter with value "logs"
6167
And body with value {"data": {"attributes": {"from": 1672527600000, "indexes": ["test-index", "test-index-2"], "query": {}, "to": 1704063600000}}}
6268
When the request is sent
6369
Then the response status is 412 Precondition failed error
6470

6571
@generated @skip @team:DataDog/supportability-engineering
6672
Scenario: Gets a list of data deletion requests returns "Bad Request" response
67-
Given new "GetDataDeletionRequests" request
73+
Given operation "GetDataDeletionRequests" enabled
74+
And new "GetDataDeletionRequests" request
6875
When the request is sent
6976
Then the response status is 400 Bad Request
7077

7178
@team:DataDog/supportability-engineering
7279
Scenario: Gets a list of data deletion requests returns "OK" response
73-
Given there is a valid "deletion_request" in the system
80+
Given operation "GetDataDeletionRequests" enabled
81+
And there is a valid "deletion_request" in the system
7482
And new "GetDataDeletionRequests" request
7583
When the request is sent
7684
Then the response status is 200 OK

0 commit comments

Comments
 (0)