#[non_exhaustive]pub struct SyntheticsTestOptionsSchedulingTimeframe {
pub day: i32,
pub from: String,
pub to: String,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Object describing a timeframe.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.day: i32
Number representing the day of the week.
from: String
The hour of the day on which scheduling starts.
to: String
The hour of the day on which scheduling ends.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl SyntheticsTestOptionsSchedulingTimeframe
impl SyntheticsTestOptionsSchedulingTimeframe
Sourcepub fn new(
day: i32,
from: String,
to: String,
) -> SyntheticsTestOptionsSchedulingTimeframe
pub fn new( day: i32, from: String, to: String, ) -> SyntheticsTestOptionsSchedulingTimeframe
Examples found in repository?
examples/v1_synthetics_CreateSyntheticsBrowserTest_397420811.rs (lines 54-58)
20async fn main() {
21 let body = SyntheticsBrowserTest::new(
22 SyntheticsBrowserTestConfig::new(
23 vec![],
24 SyntheticsTestRequest::new()
25 .method("GET".to_string())
26 .url("https://datadoghq.com".to_string()),
27 )
28 .config_variables(vec![SyntheticsConfigVariable::new(
29 "PROPERTY".to_string(),
30 SyntheticsConfigVariableType::TEXT,
31 )
32 .example("content-type".to_string())
33 .pattern("content-type".to_string())])
34 .set_cookie("name:test".to_string()),
35 vec!["aws:us-east-2".to_string()],
36 "Test message".to_string(),
37 "Example-Synthetic".to_string(),
38 SyntheticsTestOptions::new()
39 .accept_self_signed(false)
40 .allow_insecure(true)
41 .device_ids(vec!["tablet".to_string()])
42 .disable_cors(true)
43 .follow_redirects(true)
44 .min_failure_duration(10)
45 .min_location_failed(1)
46 .no_screenshot(true)
47 .retry(
48 SyntheticsTestOptionsRetry::new()
49 .count(2)
50 .interval(10.0 as f64),
51 )
52 .scheduling(SyntheticsTestOptionsScheduling::new(
53 vec![
54 SyntheticsTestOptionsSchedulingTimeframe::new(
55 1,
56 "07:00".to_string(),
57 "16:00".to_string(),
58 ),
59 SyntheticsTestOptionsSchedulingTimeframe::new(
60 3,
61 "07:00".to_string(),
62 "16:00".to_string(),
63 ),
64 ],
65 "America/New_York".to_string(),
66 ))
67 .tick_every(300),
68 SyntheticsBrowserTestType::BROWSER,
69 )
70 .steps(vec![SyntheticsStep::new()
71 .allow_failure(false)
72 .is_critical(true)
73 .name("Refresh page".to_string())
74 .params(BTreeMap::new())
75 .type_(SyntheticsStepType::REFRESH)])
76 .tags(vec!["testing:browser".to_string()]);
77 let configuration = datadog::Configuration::new();
78 let api = SyntheticsAPI::with_config(configuration);
79 let resp = api.create_synthetics_browser_test(body).await;
80 if let Ok(value) = resp {
81 println!("{:#?}", value);
82 } else {
83 println!("{:#?}", resp.unwrap_err());
84 }
85}
More examples
examples/v1_synthetics_CreateSyntheticsAPITest.rs (lines 67-71)
27async fn main() {
28 let body = SyntheticsAPITest::new(
29 SyntheticsAPITestConfig::new()
30 .assertions(vec![SyntheticsAssertion::SyntheticsAssertionTarget(
31 Box::new(SyntheticsAssertionTarget::new(
32 SyntheticsAssertionOperator::LESS_THAN,
33 SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
34 1000.0 as f64,
35 ),
36 SyntheticsAssertionType::RESPONSE_TIME,
37 )),
38 )])
39 .request(
40 SyntheticsTestRequest::new()
41 .method("GET".to_string())
42 .url("https://example.com".to_string()),
43 ),
44 vec!["aws:eu-west-3".to_string()],
45 "Notification message".to_string(),
46 "Example test name".to_string(),
47 SyntheticsTestOptions::new()
48 .ci(SyntheticsTestCiOptions::new(
49 SyntheticsTestExecutionRule::BLOCKING,
50 ))
51 .device_ids(vec!["chrome.laptop_large".to_string()])
52 .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
53 .monitor_options(
54 SyntheticsTestOptionsMonitorOptions::new().notification_preset_name(
55 SyntheticsTestOptionsMonitorOptionsNotificationPresetName::SHOW_ALL,
56 ),
57 )
58 .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()])
59 .retry(SyntheticsTestOptionsRetry::new())
60 .rum_settings(
61 SyntheticsBrowserTestRumSettings::new(true)
62 .application_id("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string())
63 .client_token_id(12345),
64 )
65 .scheduling(SyntheticsTestOptionsScheduling::new(
66 vec![
67 SyntheticsTestOptionsSchedulingTimeframe::new(
68 1,
69 "07:00".to_string(),
70 "16:00".to_string(),
71 ),
72 SyntheticsTestOptionsSchedulingTimeframe::new(
73 3,
74 "07:00".to_string(),
75 "16:00".to_string(),
76 ),
77 ],
78 "America/New_York".to_string(),
79 )),
80 SyntheticsAPITestType::API,
81 )
82 .status(SyntheticsTestPauseStatus::LIVE)
83 .subtype(SyntheticsTestDetailsSubType::HTTP)
84 .tags(vec!["env:production".to_string()]);
85 let configuration = datadog::Configuration::new();
86 let api = SyntheticsAPI::with_config(configuration);
87 let resp = api.create_synthetics_api_test(body).await;
88 if let Ok(value) = resp {
89 println!("{:#?}", value);
90 } else {
91 println!("{:#?}", resp.unwrap_err());
92 }
93}
examples/v1_synthetics_UpdateBrowserTest.rs (lines 95-99)
36async fn main() {
37 let body = SyntheticsBrowserTest::new(
38 SyntheticsBrowserTestConfig::new(
39 vec![],
40 SyntheticsTestRequest::new()
41 .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
42 SyntheticsBasicAuthWeb::new()
43 .password("PaSSw0RD!".to_string())
44 .type_(SyntheticsBasicAuthWebType::WEB)
45 .username("my_username".to_string()),
46 )))
47 .body_type(SyntheticsTestRequestBodyType::TEXT_PLAIN)
48 .call_type(SyntheticsTestCallType::UNARY)
49 .certificate(
50 SyntheticsTestRequestCertificate::new()
51 .cert(SyntheticsTestRequestCertificateItem::new())
52 .key(SyntheticsTestRequestCertificateItem::new()),
53 )
54 .certificate_domains(vec![])
55 .files(vec![SyntheticsTestRequestBodyFile::new()])
56 .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
57 .proxy(SyntheticsTestRequestProxy::new(
58 "https://example.com".to_string(),
59 ))
60 .service("Greeter".to_string())
61 .url("https://example.com".to_string()),
62 )
63 .config_variables(vec![SyntheticsConfigVariable::new(
64 "VARIABLE_NAME".to_string(),
65 SyntheticsConfigVariableType::TEXT,
66 )
67 .secure(false)])
68 .variables(vec![SyntheticsBrowserVariable::new(
69 "VARIABLE_NAME".to_string(),
70 SyntheticsBrowserVariableType::TEXT,
71 )]),
72 vec!["aws:eu-west-3".to_string()],
73 "".to_string(),
74 "Example test name".to_string(),
75 SyntheticsTestOptions::new()
76 .ci(SyntheticsTestCiOptions::new(
77 SyntheticsTestExecutionRule::BLOCKING,
78 ))
79 .device_ids(vec!["chrome.laptop_large".to_string()])
80 .http_version(SyntheticsTestOptionsHTTPVersion::HTTP1)
81 .monitor_options(
82 SyntheticsTestOptionsMonitorOptions::new().notification_preset_name(
83 SyntheticsTestOptionsMonitorOptionsNotificationPresetName::SHOW_ALL,
84 ),
85 )
86 .restricted_roles(vec!["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string()])
87 .retry(SyntheticsTestOptionsRetry::new())
88 .rum_settings(
89 SyntheticsBrowserTestRumSettings::new(true)
90 .application_id("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".to_string())
91 .client_token_id(12345),
92 )
93 .scheduling(SyntheticsTestOptionsScheduling::new(
94 vec![
95 SyntheticsTestOptionsSchedulingTimeframe::new(
96 1,
97 "07:00".to_string(),
98 "16:00".to_string(),
99 ),
100 SyntheticsTestOptionsSchedulingTimeframe::new(
101 3,
102 "07:00".to_string(),
103 "16:00".to_string(),
104 ),
105 ],
106 "America/New_York".to_string(),
107 )),
108 SyntheticsBrowserTestType::BROWSER,
109 )
110 .status(SyntheticsTestPauseStatus::LIVE)
111 .steps(vec![
112 SyntheticsStep::new().type_(SyntheticsStepType::ASSERT_ELEMENT_CONTENT)
113 ])
114 .tags(vec!["env:prod".to_string()]);
115 let configuration = datadog::Configuration::new();
116 let api = SyntheticsAPI::with_config(configuration);
117 let resp = api.update_browser_test("public_id".to_string(), body).await;
118 if let Ok(value) = resp {
119 println!("{:#?}", value);
120 } else {
121 println!("{:#?}", resp.unwrap_err());
122 }
123}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for SyntheticsTestOptionsSchedulingTimeframe
impl Clone for SyntheticsTestOptionsSchedulingTimeframe
Source§fn clone(&self) -> SyntheticsTestOptionsSchedulingTimeframe
fn clone(&self) -> SyntheticsTestOptionsSchedulingTimeframe
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'de> Deserialize<'de> for SyntheticsTestOptionsSchedulingTimeframe
impl<'de> Deserialize<'de> for SyntheticsTestOptionsSchedulingTimeframe
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SyntheticsTestOptionsSchedulingTimeframe
impl PartialEq for SyntheticsTestOptionsSchedulingTimeframe
Source§fn eq(&self, other: &SyntheticsTestOptionsSchedulingTimeframe) -> bool
fn eq(&self, other: &SyntheticsTestOptionsSchedulingTimeframe) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for SyntheticsTestOptionsSchedulingTimeframe
Auto Trait Implementations§
impl Freeze for SyntheticsTestOptionsSchedulingTimeframe
impl RefUnwindSafe for SyntheticsTestOptionsSchedulingTimeframe
impl Send for SyntheticsTestOptionsSchedulingTimeframe
impl Sync for SyntheticsTestOptionsSchedulingTimeframe
impl Unpin for SyntheticsTestOptionsSchedulingTimeframe
impl UnwindSafe for SyntheticsTestOptionsSchedulingTimeframe
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more