Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-02 18:17:53.184204",
"spec_repo_commit": "464f0cec"
"regenerated": "2024-07-02 18:50:32.192164",
"spec_repo_commit": "fae9d797"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-02 18:17:53.201791",
"spec_repo_commit": "464f0cec"
"regenerated": "2024-07-02 18:50:32.211734",
"spec_repo_commit": "fae9d797"
}
}
}
7 changes: 7 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14944,6 +14944,13 @@ components:

to delete.'
properties:
force_delete_dependencies:
description: 'Delete the Synthetic test even if it''s referenced by other
resources

(for example, SLOs and composite monitors).'
example: false
type: boolean
public_ids:
description: An array of Synthetic test IDs you want to delete.
example: []
Expand Down
19 changes: 19 additions & 0 deletions src/datadogV1/model/model_synthetics_delete_tests_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ use std::fmt::{self, Formatter};
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct SyntheticsDeleteTestsPayload {
/// Delete the Synthetic test even if it's referenced by other resources
/// (for example, SLOs and composite monitors).
#[serde(rename = "force_delete_dependencies")]
pub force_delete_dependencies: Option<bool>,
/// An array of Synthetic test IDs you want to delete.
#[serde(rename = "public_ids")]
pub public_ids: Option<Vec<String>>,
Expand All @@ -23,11 +27,17 @@ pub struct SyntheticsDeleteTestsPayload {
impl SyntheticsDeleteTestsPayload {
pub fn new() -> SyntheticsDeleteTestsPayload {
SyntheticsDeleteTestsPayload {
force_delete_dependencies: None,
public_ids: None,
_unparsed: false,
}
}

pub fn force_delete_dependencies(mut self, value: bool) -> Self {
self.force_delete_dependencies = Some(value);
self
}

pub fn public_ids(mut self, value: Vec<String>) -> Self {
self.public_ids = Some(value);
self
Expand Down Expand Up @@ -57,11 +67,19 @@ impl<'de> Deserialize<'de> for SyntheticsDeleteTestsPayload {
where
M: MapAccess<'a>,
{
let mut force_delete_dependencies: Option<bool> = None;
let mut public_ids: Option<Vec<String>> = None;
let mut _unparsed = false;

while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
match k.as_str() {
"force_delete_dependencies" => {
if v.is_null() {
continue;
}
force_delete_dependencies =
Some(serde_json::from_value(v).map_err(M::Error::custom)?);
}
"public_ids" => {
if v.is_null() {
continue;
Expand All @@ -73,6 +91,7 @@ impl<'de> Deserialize<'de> for SyntheticsDeleteTestsPayload {
}

let content = SyntheticsDeleteTestsPayload {
force_delete_dependencies,
public_ids,
_unparsed,
};
Expand Down
4 changes: 2 additions & 2 deletions tests/scenarios/features/v1/synthetics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,14 @@ Feature: Synthetics
@generated @skip @team:DataDog/synthetics-ct
Scenario: Delete tests returns "- JSON format is wrong" response
Given new "DeleteTests" request
And body with value {"public_ids": []}
And body with value {"force_delete_dependencies": false, "public_ids": []}
When the request is sent
Then the response status is 400 - JSON format is wrong

@generated @skip @team:DataDog/synthetics-ct
Scenario: Delete tests returns "- Tests to be deleted can't be found" response
Given new "DeleteTests" request
And body with value {"public_ids": []}
And body with value {"force_delete_dependencies": false, "public_ids": []}
When the request is sent
Then the response status is 404 - Tests to be deleted can't be found

Expand Down