SyntheticsTestOptionsScheduling

Struct SyntheticsTestOptionsScheduling 

Source
#[non_exhaustive]
pub struct SyntheticsTestOptionsScheduling { pub timeframes: Vec<SyntheticsTestOptionsSchedulingTimeframe>, pub timezone: String, pub additional_properties: BTreeMap<String, Value>, /* private fields */ }
Expand description

Object containing timeframes and timezone used for advanced scheduling.

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.
§timeframes: Vec<SyntheticsTestOptionsSchedulingTimeframe>

Array containing objects describing the scheduling pattern to apply to each day.

§timezone: String

Timezone in which the timeframe is based.

§additional_properties: BTreeMap<String, Value>

Implementations§

Source§

impl SyntheticsTestOptionsScheduling

Source

pub fn new( timeframes: Vec<SyntheticsTestOptionsSchedulingTimeframe>, timezone: String, ) -> SyntheticsTestOptionsScheduling

Examples found in repository?
examples/v1_synthetics_CreateSyntheticsBrowserTest_397420811.rs (lines 52-66)
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
Hide additional examples
examples/v1_synthetics_CreateSyntheticsAPITest.rs (lines 65-79)
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 93-107)
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}
Source

pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self

Trait Implementations§

Source§

impl Clone for SyntheticsTestOptionsScheduling

Source§

fn clone(&self) -> SyntheticsTestOptionsScheduling

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SyntheticsTestOptionsScheduling

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SyntheticsTestOptionsScheduling

Source§

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 SyntheticsTestOptionsScheduling

Source§

fn eq(&self, other: &SyntheticsTestOptionsScheduling) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for SyntheticsTestOptionsScheduling

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SyntheticsTestOptionsScheduling

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,