From d2e0b9bb35bc77be09d17fc4c79d822a042d6dc7 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 20 Nov 2024 20:19:56 +0000 Subject: [PATCH] Regenerate client from commit ebf27b5e of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 34 +------- LICENSE-3rdparty.csv | 2 +- .../v1_synthetics_CreateSyntheticsAPITest.rs | 3 +- ..._synthetics_CreateSyntheticsBrowserTest.rs | 3 +- ..._CreateSyntheticsBrowserTest_2932742688.rs | 3 +- ...s_CreateSyntheticsBrowserTest_397420811.rs | 3 +- examples/v1_synthetics_TriggerCITests.rs | 3 +- examples/v1_synthetics_UpdateBrowserTest.rs | 3 +- src/datadogV1/model/mod.rs | 2 - .../model/model_synthetics_batch_result.rs | 16 +--- .../model/model_synthetics_ci_test.rs | 6 +- .../model/model_synthetics_device.rs | 21 +---- .../model/model_synthetics_device_id.rs | 81 ------------------- .../model/model_synthetics_test_options.rs | 6 +- ...l_synthetics_trigger_ci_test_run_result.rs | 16 +--- .../scenarios/features/v1/synthetics.feature | 8 +- 17 files changed, 32 insertions(+), 186 deletions(-) delete mode 100644 src/datadogV1/model/model_synthetics_device_id.rs diff --git a/.apigentools-info b/.apigentools-info index 1bc79d1e9..c5ca4ed75 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-19 21:12:03.890814", - "spec_repo_commit": "2e48953d" + "regenerated": "2024-11-20 20:14:15.868911", + "spec_repo_commit": "ebf27b5e" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-11-19 21:12:03.909789", - "spec_repo_commit": "2e48953d" + "regenerated": "2024-11-20 20:14:15.887480", + "spec_repo_commit": "ebf27b5e" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3fc72f00b..4dc36090d 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -15178,34 +15178,8 @@ components: type: object SyntheticsDeviceID: description: The device ID. - enum: - - laptop_large - - tablet - - mobile_small - - chrome.laptop_large - - chrome.tablet - - chrome.mobile_small - - firefox.laptop_large - - firefox.tablet - - firefox.mobile_small - - edge.laptop_large - - edge.tablet - - edge.mobile_small example: chrome.laptop_large type: string - x-enum-varnames: - - LAPTOP_LARGE - - TABLET - - MOBILE_SMALL - - CHROME_LAPTOP_LARGE - - CHROME_TABLET - - CHROME_MOBILE_SMALL - - FIREFOX_LAPTOP_LARGE - - FIREFOX_TABLET - - FIREFOX_MOBILE_SMALL - - EDGE_LAPTOP_LARGE - - EDGE_TABLET - - EDGE_MOBILE_SMALL SyntheticsFetchUptimesPayload: description: Object containing IDs of Synthetic tests and a timeframe. properties: @@ -15508,10 +15482,6 @@ components: $ref: '#/components/schemas/SyntheticsLocation' type: array type: object - SyntheticsMobileDeviceID: - description: The device ID. - example: synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16 - type: string SyntheticsMobileStep: description: The steps used in a Synthetic mobile test. properties: @@ -15787,7 +15757,7 @@ components: device_ids: description: Array with the different device IDs used to run the test. items: - $ref: '#/components/schemas/SyntheticsMobileDeviceID' + $ref: '#/components/schemas/SyntheticsDeviceID' type: array message: description: Notification message associated with the test. @@ -15876,7 +15846,7 @@ components: example: - synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16 items: - $ref: '#/components/schemas/SyntheticsMobileDeviceID' + $ref: '#/components/schemas/SyntheticsDeviceID' type: array disableAutoAcceptAlert: description: A boolean to disable auto accepting alerts. diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index b26c3970b..dc72c036d 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -136,7 +136,7 @@ tracing-attributes,https://github.com/tokio-rs/tracing,MIT,"Tokio Contributors < tracing-core,https://github.com/tokio-rs/tracing,MIT,Tokio Contributors try-lock,https://github.com/seanmonstar/try-lock,MIT,Sean McArthur unicase,https://github.com/seanmonstar/unicase,MIT OR Apache-2.0,Sean McArthur -unicode-ident,https://github.com/dtolnay/unicode-ident,(MIT OR Apache-2.0) AND Unicode-DFS-2016,David Tolnay +unicode-ident,https://github.com/dtolnay/unicode-ident,(MIT OR Apache-2.0) AND Unicode-3.0,David Tolnay url,https://github.com/servo/rust-url,MIT OR Apache-2.0,The rust-url developers utf16_iter,https://github.com/hsivonen/utf16_iter,Apache-2.0 OR MIT,Henri Sivonen utf8_iter,https://github.com/hsivonen/utf8_iter,Apache-2.0 OR MIT,Henri Sivonen diff --git a/examples/v1_synthetics_CreateSyntheticsAPITest.rs b/examples/v1_synthetics_CreateSyntheticsAPITest.rs index 36dc77eca..10382189c 100644 --- a/examples/v1_synthetics_CreateSyntheticsAPITest.rs +++ b/examples/v1_synthetics_CreateSyntheticsAPITest.rs @@ -9,7 +9,6 @@ use datadog_api_client::datadogV1::model::SyntheticsAssertionOperator; use datadog_api_client::datadogV1::model::SyntheticsAssertionTarget; use datadog_api_client::datadogV1::model::SyntheticsAssertionType; use datadog_api_client::datadogV1::model::SyntheticsBrowserTestRumSettings; -use datadog_api_client::datadogV1::model::SyntheticsDeviceID; use datadog_api_client::datadogV1::model::SyntheticsTestCiOptions; use datadog_api_client::datadogV1::model::SyntheticsTestDetailsSubType; use datadog_api_client::datadogV1::model::SyntheticsTestExecutionRule; @@ -47,7 +46,7 @@ async fn main() { .ci(SyntheticsTestCiOptions::new( SyntheticsTestExecutionRule::BLOCKING, )) - .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE]) + .device_ids(vec!["chrome.laptop_large".to_string()]) .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1) .monitor_options( SyntheticsTestOptionsMonitorOptions::new().notification_preset_name( diff --git a/examples/v1_synthetics_CreateSyntheticsBrowserTest.rs b/examples/v1_synthetics_CreateSyntheticsBrowserTest.rs index a081b568f..e7e66fd3e 100644 --- a/examples/v1_synthetics_CreateSyntheticsBrowserTest.rs +++ b/examples/v1_synthetics_CreateSyntheticsBrowserTest.rs @@ -8,7 +8,6 @@ use datadog_api_client::datadogV1::model::SyntheticsBrowserVariable; use datadog_api_client::datadogV1::model::SyntheticsBrowserVariableType; use datadog_api_client::datadogV1::model::SyntheticsConfigVariable; use datadog_api_client::datadogV1::model::SyntheticsConfigVariableType; -use datadog_api_client::datadogV1::model::SyntheticsDeviceID; use datadog_api_client::datadogV1::model::SyntheticsStep; use datadog_api_client::datadogV1::model::SyntheticsStepType; use datadog_api_client::datadogV1::model::SyntheticsTestOptions; @@ -46,7 +45,7 @@ async fn main() { SyntheticsTestOptions::new() .accept_self_signed(false) .allow_insecure(true) - .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE]) + .device_ids(vec!["chrome.laptop_large".to_string()]) .disable_cors(true) .enable_profiling(true) .enable_security_testing(true) diff --git a/examples/v1_synthetics_CreateSyntheticsBrowserTest_2932742688.rs b/examples/v1_synthetics_CreateSyntheticsBrowserTest_2932742688.rs index 2a0d578fc..7f524f521 100644 --- a/examples/v1_synthetics_CreateSyntheticsBrowserTest_2932742688.rs +++ b/examples/v1_synthetics_CreateSyntheticsBrowserTest_2932742688.rs @@ -7,7 +7,6 @@ use datadog_api_client::datadogV1::model::SyntheticsBrowserTestRumSettings; use datadog_api_client::datadogV1::model::SyntheticsBrowserTestType; use datadog_api_client::datadogV1::model::SyntheticsConfigVariable; use datadog_api_client::datadogV1::model::SyntheticsConfigVariableType; -use datadog_api_client::datadogV1::model::SyntheticsDeviceID; use datadog_api_client::datadogV1::model::SyntheticsStep; use datadog_api_client::datadogV1::model::SyntheticsStepType; use datadog_api_client::datadogV1::model::SyntheticsTestCiOptions; @@ -43,7 +42,7 @@ async fn main() { .ci(SyntheticsTestCiOptions::new( SyntheticsTestExecutionRule::SKIPPED, )) - .device_ids(vec![SyntheticsDeviceID::TABLET]) + .device_ids(vec!["tablet".to_string()]) .disable_cors(true) .disable_csp(true) .follow_redirects(true) diff --git a/examples/v1_synthetics_CreateSyntheticsBrowserTest_397420811.rs b/examples/v1_synthetics_CreateSyntheticsBrowserTest_397420811.rs index d833347f7..bb7828ebf 100644 --- a/examples/v1_synthetics_CreateSyntheticsBrowserTest_397420811.rs +++ b/examples/v1_synthetics_CreateSyntheticsBrowserTest_397420811.rs @@ -7,7 +7,6 @@ use datadog_api_client::datadogV1::model::SyntheticsBrowserTestConfig; use datadog_api_client::datadogV1::model::SyntheticsBrowserTestType; use datadog_api_client::datadogV1::model::SyntheticsConfigVariable; use datadog_api_client::datadogV1::model::SyntheticsConfigVariableType; -use datadog_api_client::datadogV1::model::SyntheticsDeviceID; use datadog_api_client::datadogV1::model::SyntheticsStep; use datadog_api_client::datadogV1::model::SyntheticsStepType; use datadog_api_client::datadogV1::model::SyntheticsTestOptions; @@ -39,7 +38,7 @@ async fn main() { SyntheticsTestOptions::new() .accept_self_signed(false) .allow_insecure(true) - .device_ids(vec![SyntheticsDeviceID::TABLET]) + .device_ids(vec!["tablet".to_string()]) .disable_cors(true) .follow_redirects(true) .min_failure_duration(10) diff --git a/examples/v1_synthetics_TriggerCITests.rs b/examples/v1_synthetics_TriggerCITests.rs index 495d5eff0..d1aa22518 100644 --- a/examples/v1_synthetics_TriggerCITests.rs +++ b/examples/v1_synthetics_TriggerCITests.rs @@ -11,7 +11,6 @@ use datadog_api_client::datadogV1::model::SyntheticsCIBatchMetadataPipeline; use datadog_api_client::datadogV1::model::SyntheticsCIBatchMetadataProvider; use datadog_api_client::datadogV1::model::SyntheticsCITest; use datadog_api_client::datadogV1::model::SyntheticsCITestBody; -use datadog_api_client::datadogV1::model::SyntheticsDeviceID; use datadog_api_client::datadogV1::model::SyntheticsTestOptionsRetry; #[tokio::main] @@ -22,7 +21,7 @@ async fn main() { SyntheticsBasicAuthWeb::new("PaSSw0RD!".to_string(), "my_username".to_string()) .type_(SyntheticsBasicAuthWebType::WEB), ))) - .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE]) + .device_ids(vec!["chrome.laptop_large".to_string()]) .locations(vec!["aws:eu-west-3".to_string()]) .metadata( SyntheticsCIBatchMetadata::new() diff --git a/examples/v1_synthetics_UpdateBrowserTest.rs b/examples/v1_synthetics_UpdateBrowserTest.rs index cc3286d3e..1fdb3f430 100644 --- a/examples/v1_synthetics_UpdateBrowserTest.rs +++ b/examples/v1_synthetics_UpdateBrowserTest.rs @@ -12,7 +12,6 @@ use datadog_api_client::datadogV1::model::SyntheticsBrowserVariable; use datadog_api_client::datadogV1::model::SyntheticsBrowserVariableType; use datadog_api_client::datadogV1::model::SyntheticsConfigVariable; use datadog_api_client::datadogV1::model::SyntheticsConfigVariableType; -use datadog_api_client::datadogV1::model::SyntheticsDeviceID; use datadog_api_client::datadogV1::model::SyntheticsStep; use datadog_api_client::datadogV1::model::SyntheticsStepType; use datadog_api_client::datadogV1::model::SyntheticsTestCallType; @@ -75,7 +74,7 @@ async fn main() { .ci(SyntheticsTestCiOptions::new( SyntheticsTestExecutionRule::BLOCKING, )) - .device_ids(vec![SyntheticsDeviceID::CHROME_LAPTOP_LARGE]) + .device_ids(vec!["chrome.laptop_large".to_string()]) .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1) .monitor_options( SyntheticsTestOptionsMonitorOptions::new().notification_preset_name( diff --git a/src/datadogV1/model/mod.rs b/src/datadogV1/model/mod.rs index 52a08b0d1..059a7e480 100644 --- a/src/datadogV1/model/mod.rs +++ b/src/datadogV1/model/mod.rs @@ -1270,8 +1270,6 @@ pub mod model_synthetics_ci_batch_metadata_git; pub use self::model_synthetics_ci_batch_metadata_git::SyntheticsCIBatchMetadataGit; pub mod model_synthetics_batch_result; pub use self::model_synthetics_batch_result::SyntheticsBatchResult; -pub mod model_synthetics_device_id; -pub use self::model_synthetics_device_id::SyntheticsDeviceID; pub mod model_synthetics_test_execution_rule; pub use self::model_synthetics_test_execution_rule::SyntheticsTestExecutionRule; pub mod model_synthetics_batch_status; diff --git a/src/datadogV1/model/model_synthetics_batch_result.rs b/src/datadogV1/model/model_synthetics_batch_result.rs index c8b5de311..c1ad5a260 100644 --- a/src/datadogV1/model/model_synthetics_batch_result.rs +++ b/src/datadogV1/model/model_synthetics_batch_result.rs @@ -13,7 +13,7 @@ use std::fmt::{self, Formatter}; pub struct SyntheticsBatchResult { /// The device ID. #[serde(rename = "device")] - pub device: Option, + pub device: Option, /// Total duration in millisecond of the test. #[serde(rename = "duration")] pub duration: Option, @@ -66,7 +66,7 @@ impl SyntheticsBatchResult { } } - pub fn device(mut self, value: crate::datadogV1::model::SyntheticsDeviceID) -> Self { + pub fn device(mut self, value: String) -> Self { self.device = Some(value); self } @@ -151,7 +151,7 @@ impl<'de> Deserialize<'de> for SyntheticsBatchResult { where M: MapAccess<'a>, { - let mut device: Option = None; + let mut device: Option = None; let mut duration: Option = None; let mut execution_rule: Option< crate::datadogV1::model::SyntheticsTestExecutionRule, @@ -177,16 +177,6 @@ impl<'de> Deserialize<'de> for SyntheticsBatchResult { continue; } device = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - if let Some(ref _device) = device { - match _device { - crate::datadogV1::model::SyntheticsDeviceID::UnparsedObject( - _device, - ) => { - _unparsed = true; - } - _ => {} - } - } } "duration" => { if v.is_null() { diff --git a/src/datadogV1/model/model_synthetics_ci_test.rs b/src/datadogV1/model/model_synthetics_ci_test.rs index 24dbce7dc..7dbb73c8a 100644 --- a/src/datadogV1/model/model_synthetics_ci_test.rs +++ b/src/datadogV1/model/model_synthetics_ci_test.rs @@ -28,7 +28,7 @@ pub struct SyntheticsCITest { pub cookies: Option, /// For browser test, array with the different device IDs used to run the test. #[serde(rename = "deviceIds")] - pub device_ids: Option>, + pub device_ids: Option>, /// For API HTTP test, whether or not the test should follow redirects. #[serde(rename = "followRedirects")] pub follow_redirects: Option, @@ -107,7 +107,7 @@ impl SyntheticsCITest { self } - pub fn device_ids(mut self, value: Vec) -> Self { + pub fn device_ids(mut self, value: Vec) -> Self { self.device_ids = Some(value); self } @@ -178,7 +178,7 @@ impl<'de> Deserialize<'de> for SyntheticsCITest { let mut body: Option = None; let mut body_type: Option = None; let mut cookies: Option = None; - let mut device_ids: Option> = None; + let mut device_ids: Option> = None; let mut follow_redirects: Option = None; let mut headers: Option> = None; let mut locations: Option> = None; diff --git a/src/datadogV1/model/model_synthetics_device.rs b/src/datadogV1/model/model_synthetics_device.rs index d5da55589..9e13e3a04 100644 --- a/src/datadogV1/model/model_synthetics_device.rs +++ b/src/datadogV1/model/model_synthetics_device.rs @@ -16,7 +16,7 @@ pub struct SyntheticsDevice { pub height: i64, /// The device ID. #[serde(rename = "id")] - pub id: crate::datadogV1::model::SyntheticsDeviceID, + pub id: String, /// Whether or not the device is a mobile. #[serde(rename = "isMobile")] pub is_mobile: Option, @@ -34,12 +34,7 @@ pub struct SyntheticsDevice { } impl SyntheticsDevice { - pub fn new( - height: i64, - id: crate::datadogV1::model::SyntheticsDeviceID, - name: String, - width: i64, - ) -> SyntheticsDevice { + pub fn new(height: i64, id: String, name: String, width: i64) -> SyntheticsDevice { SyntheticsDevice { height, id, @@ -83,7 +78,7 @@ impl<'de> Deserialize<'de> for SyntheticsDevice { M: MapAccess<'a>, { let mut height: Option = None; - let mut id: Option = None; + let mut id: Option = None; let mut is_mobile: Option = None; let mut name: Option = None; let mut width: Option = None; @@ -100,16 +95,6 @@ impl<'de> Deserialize<'de> for SyntheticsDevice { } "id" => { id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - if let Some(ref _id) = id { - match _id { - crate::datadogV1::model::SyntheticsDeviceID::UnparsedObject( - _id, - ) => { - _unparsed = true; - } - _ => {} - } - } } "isMobile" => { if v.is_null() { diff --git a/src/datadogV1/model/model_synthetics_device_id.rs b/src/datadogV1/model/model_synthetics_device_id.rs deleted file mode 100644 index 76ce0d635..000000000 --- a/src/datadogV1/model/model_synthetics_device_id.rs +++ /dev/null @@ -1,81 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -use serde::{Deserialize, Deserializer, Serialize, Serializer}; - -#[non_exhaustive] -#[derive(Clone, Debug, Eq, PartialEq)] -pub enum SyntheticsDeviceID { - LAPTOP_LARGE, - TABLET, - MOBILE_SMALL, - CHROME_LAPTOP_LARGE, - CHROME_TABLET, - CHROME_MOBILE_SMALL, - FIREFOX_LAPTOP_LARGE, - FIREFOX_TABLET, - FIREFOX_MOBILE_SMALL, - EDGE_LAPTOP_LARGE, - EDGE_TABLET, - EDGE_MOBILE_SMALL, - UnparsedObject(crate::datadog::UnparsedObject), -} - -impl ToString for SyntheticsDeviceID { - fn to_string(&self) -> String { - match self { - Self::LAPTOP_LARGE => String::from("laptop_large"), - Self::TABLET => String::from("tablet"), - Self::MOBILE_SMALL => String::from("mobile_small"), - Self::CHROME_LAPTOP_LARGE => String::from("chrome.laptop_large"), - Self::CHROME_TABLET => String::from("chrome.tablet"), - Self::CHROME_MOBILE_SMALL => String::from("chrome.mobile_small"), - Self::FIREFOX_LAPTOP_LARGE => String::from("firefox.laptop_large"), - Self::FIREFOX_TABLET => String::from("firefox.tablet"), - Self::FIREFOX_MOBILE_SMALL => String::from("firefox.mobile_small"), - Self::EDGE_LAPTOP_LARGE => String::from("edge.laptop_large"), - Self::EDGE_TABLET => String::from("edge.tablet"), - Self::EDGE_MOBILE_SMALL => String::from("edge.mobile_small"), - Self::UnparsedObject(v) => v.value.to_string(), - } - } -} - -impl Serialize for SyntheticsDeviceID { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - match self { - Self::UnparsedObject(v) => v.serialize(serializer), - _ => serializer.serialize_str(self.to_string().as_str()), - } - } -} - -impl<'de> Deserialize<'de> for SyntheticsDeviceID { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s: String = String::deserialize(deserializer)?; - Ok(match s.as_str() { - "laptop_large" => Self::LAPTOP_LARGE, - "tablet" => Self::TABLET, - "mobile_small" => Self::MOBILE_SMALL, - "chrome.laptop_large" => Self::CHROME_LAPTOP_LARGE, - "chrome.tablet" => Self::CHROME_TABLET, - "chrome.mobile_small" => Self::CHROME_MOBILE_SMALL, - "firefox.laptop_large" => Self::FIREFOX_LAPTOP_LARGE, - "firefox.tablet" => Self::FIREFOX_TABLET, - "firefox.mobile_small" => Self::FIREFOX_MOBILE_SMALL, - "edge.laptop_large" => Self::EDGE_LAPTOP_LARGE, - "edge.tablet" => Self::EDGE_TABLET, - "edge.mobile_small" => Self::EDGE_MOBILE_SMALL, - _ => Self::UnparsedObject(crate::datadog::UnparsedObject { - value: serde_json::Value::String(s.into()), - }), - }) - } -} diff --git a/src/datadogV1/model/model_synthetics_test_options.rs b/src/datadogV1/model/model_synthetics_test_options.rs index 34d1864f6..cbd475f9a 100644 --- a/src/datadogV1/model/model_synthetics_test_options.rs +++ b/src/datadogV1/model/model_synthetics_test_options.rs @@ -26,7 +26,7 @@ pub struct SyntheticsTestOptions { pub ci: Option, /// For browser test, array with the different device IDs used to run the test. #[serde(rename = "device_ids")] - pub device_ids: Option>, + pub device_ids: Option>, /// Whether or not to disable CORS mechanism. #[serde(rename = "disableCors")] pub disable_cors: Option, @@ -162,7 +162,7 @@ impl SyntheticsTestOptions { } #[allow(deprecated)] - pub fn device_ids(mut self, value: Vec) -> Self { + pub fn device_ids(mut self, value: Vec) -> Self { self.device_ids = Some(value); self } @@ -329,7 +329,7 @@ impl<'de> Deserialize<'de> for SyntheticsTestOptions { let mut allow_insecure: Option = None; let mut check_certificate_revocation: Option = None; let mut ci: Option = None; - let mut device_ids: Option> = None; + let mut device_ids: Option> = None; let mut disable_cors: Option = None; let mut disable_csp: Option = None; let mut enable_profiling: Option = None; diff --git a/src/datadogV1/model/model_synthetics_trigger_ci_test_run_result.rs b/src/datadogV1/model/model_synthetics_trigger_ci_test_run_result.rs index 15d5a6ecf..0a68970e9 100644 --- a/src/datadogV1/model/model_synthetics_trigger_ci_test_run_result.rs +++ b/src/datadogV1/model/model_synthetics_trigger_ci_test_run_result.rs @@ -13,7 +13,7 @@ use std::fmt::{self, Formatter}; pub struct SyntheticsTriggerCITestRunResult { /// The device ID. #[serde(rename = "device")] - pub device: Option, + pub device: Option, /// The location ID of the test run. #[serde(rename = "location")] pub location: Option, @@ -42,7 +42,7 @@ impl SyntheticsTriggerCITestRunResult { } } - pub fn device(mut self, value: crate::datadogV1::model::SyntheticsDeviceID) -> Self { + pub fn device(mut self, value: String) -> Self { self.device = Some(value); self } @@ -94,7 +94,7 @@ impl<'de> Deserialize<'de> for SyntheticsTriggerCITestRunResult { where M: MapAccess<'a>, { - let mut device: Option = None; + let mut device: Option = None; let mut location: Option = None; let mut public_id: Option = None; let mut result_id: Option = None; @@ -111,16 +111,6 @@ impl<'de> Deserialize<'de> for SyntheticsTriggerCITestRunResult { continue; } device = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - if let Some(ref _device) = device { - match _device { - crate::datadogV1::model::SyntheticsDeviceID::UnparsedObject( - _device, - ) => { - _unparsed = true; - } - _ => {} - } - } } "location" => { if v.is_null() { diff --git a/tests/scenarios/features/v1/synthetics.feature b/tests/scenarios/features/v1/synthetics.feature index fb90d0949..bb3c4ad9b 100644 --- a/tests/scenarios/features/v1/synthetics.feature +++ b/tests/scenarios/features/v1/synthetics.feature @@ -128,7 +128,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-ct Scenario: Create a mobile test returns "- JSON format is wrong" response Given new "CreateSyntheticsMobileTest" request - And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} + And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["chrome.laptop_large"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -147,7 +147,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-ct Scenario: Create a mobile test returns "Test quota is reached" response Given new "CreateSyntheticsMobileTest" request - And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} + And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["chrome.laptop_large"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} When the request is sent Then the response status is 402 Test quota is reached @@ -361,7 +361,7 @@ Feature: Synthetics Scenario: Edit a Mobile test returns "- JSON format is wrong" response Given new "UpdateMobileTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} + And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["chrome.laptop_large"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -369,7 +369,7 @@ Feature: Synthetics Scenario: Edit a Mobile test returns "- Synthetic Monitoring is not activated for the user" response Given new "UpdateMobileTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} + And body with value {"config": {"variables": [{"name": "VARIABLE_NAME", "secure": false, "type": "text"}]}, "device_ids": ["chrome.laptop_large"], "message": "Notification message", "name": "Example test name", "options": {"bindings": [{"principals": [], "relation": "editor"}], "ci": {"executionRule": "blocking"}, "device_ids": ["synthetics:mobile:device:apple_ipad_10th_gen_2022_ios_16"], "mobileApplication": {"applicationId": "00000000-0000-0000-0000-aaaaaaaaaaaa", "referenceId": "00000000-0000-0000-0000-aaaaaaaaaaab", "referenceType": "latest"}, "monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}, "tick_every": 300}, "status": "live", "steps": [{"name": "", "params": {"check": "equals", "direction": "up", "element": {"contextType": "native", "relativePosition": {}, "userLocator": {"values": [{"type": "accessibility-id"}]}}, "positions": [{}], "variable": {"example": "", "name": "VAR_NAME"}}, "publicId": "pub-lic-id0", "type": "assertElementContent"}], "tags": ["env:production"], "type": "mobile"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user