SyntheticsBasicAuthOauthROP

Struct SyntheticsBasicAuthOauthROP 

Source
#[non_exhaustive]
pub struct SyntheticsBasicAuthOauthROP { pub access_token_url: String, pub audience: Option<String>, pub client_id: Option<String>, pub client_secret: Option<String>, pub password: String, pub resource: Option<String>, pub scope: Option<String>, pub token_api_authentication: SyntheticsBasicAuthOauthTokenApiAuthentication, pub type_: SyntheticsBasicAuthOauthROPType, pub username: String, pub additional_properties: BTreeMap<String, Value>, /* private fields */ }
Expand description

Object to handle oauth rop authentication when performing the test.

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.
§access_token_url: String

Access token URL to use when performing the authentication.

§audience: Option<String>

Audience to use when performing the authentication.

§client_id: Option<String>

Client ID to use when performing the authentication.

§client_secret: Option<String>

Client secret to use when performing the authentication.

§password: String

Password to use when performing the authentication.

§resource: Option<String>

Resource to use when performing the authentication.

§scope: Option<String>

Scope to use when performing the authentication.

§token_api_authentication: SyntheticsBasicAuthOauthTokenApiAuthentication

Type of token to use when performing the authentication.

§type_: SyntheticsBasicAuthOauthROPType

The type of basic authentication to use when performing the test.

§username: String

Username to use when performing the authentication.

§additional_properties: BTreeMap<String, Value>

Implementations§

Source§

impl SyntheticsBasicAuthOauthROP

Source

pub fn new( access_token_url: String, password: String, token_api_authentication: SyntheticsBasicAuthOauthTokenApiAuthentication, type_: SyntheticsBasicAuthOauthROPType, username: String, ) -> SyntheticsBasicAuthOauthROP

Examples found in repository?
examples/v1_synthetics_CreateSyntheticsAPITest_960766374.rs (lines 129-135)
39async fn main() {
40    let body =
41        SyntheticsAPITest::new(
42            SyntheticsAPITestConfig::new()
43                .assertions(
44                    vec![
45                        SyntheticsAssertion::SyntheticsAssertionTarget(
46                            Box::new(
47                                SyntheticsAssertionTarget::new(
48                                    SyntheticsAssertionOperator::IS,
49                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
50                                        "text/html".to_string(),
51                                    ),
52                                    SyntheticsAssertionType::HEADER,
53                                ).property("{{ PROPERTY }}".to_string()),
54                            ),
55                        ),
56                        SyntheticsAssertion::SyntheticsAssertionTarget(
57                            Box::new(
58                                SyntheticsAssertionTarget::new(
59                                    SyntheticsAssertionOperator::LESS_THAN,
60                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
61                                        2000.0 as f64,
62                                    ),
63                                    SyntheticsAssertionType::RESPONSE_TIME,
64                                ),
65                            ),
66                        ),
67                        SyntheticsAssertion::SyntheticsAssertionJSONPathTarget(
68                            Box::new(
69                                SyntheticsAssertionJSONPathTarget::new(
70                                    SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
71                                    SyntheticsAssertionType::BODY,
72                                ).target(
73                                    SyntheticsAssertionJSONPathTargetTarget::new()
74                                        .json_path("topKey".to_string())
75                                        .operator("isNot".to_string())
76                                        .target_value(
77                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
78                                                "0".to_string(),
79                                            ),
80                                        ),
81                                ),
82                            ),
83                        ),
84                        SyntheticsAssertion::SyntheticsAssertionJSONSchemaTarget(
85                            Box::new(
86                                SyntheticsAssertionJSONSchemaTarget::new(
87                                    SyntheticsAssertionJSONSchemaOperator::VALIDATES_JSON_SCHEMA,
88                                    SyntheticsAssertionType::BODY,
89                                ).target(
90                                    SyntheticsAssertionJSONSchemaTargetTarget::new()
91                                        .json_schema(
92                                            r#"{"type": "object", "properties":{"slideshow":{"type":"object"}}}"#.to_string(),
93                                        )
94                                        .meta_schema(SyntheticsAssertionJSONSchemaMetaSchema::DRAFT_07),
95                                ),
96                            ),
97                        ),
98                        SyntheticsAssertion::SyntheticsAssertionXPathTarget(
99                            Box::new(
100                                SyntheticsAssertionXPathTarget::new(
101                                    SyntheticsAssertionXPathOperator::VALIDATES_X_PATH,
102                                    SyntheticsAssertionType::BODY,
103                                ).target(
104                                    SyntheticsAssertionXPathTargetTarget::new()
105                                        .operator("contains".to_string())
106                                        .target_value(
107                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
108                                                "0".to_string(),
109                                            ),
110                                        )
111                                        .x_path("target-xpath".to_string()),
112                                ),
113                            ),
114                        )
115                    ],
116                )
117                .config_variables(
118                    vec![
119                        SyntheticsConfigVariable::new("PROPERTY".to_string(), SyntheticsConfigVariableType::TEXT)
120                            .example("content-type".to_string())
121                            .pattern("content-type".to_string())
122                    ],
123                )
124                .request(
125                    SyntheticsTestRequest::new()
126                        .basic_auth(
127                            SyntheticsBasicAuth::SyntheticsBasicAuthOauthROP(
128                                Box::new(
129                                    SyntheticsBasicAuthOauthROP::new(
130                                        "https://datadog-token.com".to_string(),
131                                        "oauth-password".to_string(),
132                                        SyntheticsBasicAuthOauthTokenApiAuthentication::BODY,
133                                        SyntheticsBasicAuthOauthROPType::OAUTH_ROP,
134                                        "oauth-usermame".to_string(),
135                                    )
136                                        .audience("audience".to_string())
137                                        .client_id("client-id".to_string())
138                                        .client_secret("client-secret".to_string())
139                                        .resource("resource".to_string())
140                                        .scope("yoyo".to_string()),
141                                ),
142                            ),
143                        )
144                        .certificate(
145                            SyntheticsTestRequestCertificate::new()
146                                .cert(
147                                    SyntheticsTestRequestCertificateItem::new()
148                                        .content("cert-content".to_string())
149                                        .filename("cert-filename".to_string())
150                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
151                                )
152                                .key(
153                                    SyntheticsTestRequestCertificateItem::new()
154                                        .content("key-content".to_string())
155                                        .filename("key-filename".to_string())
156                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
157                                ),
158                        )
159                        .headers(BTreeMap::from([("unique".to_string(), "examplesynthetic".to_string())]))
160                        .method("GET".to_string())
161                        .proxy(
162                            SyntheticsTestRequestProxy::new(
163                                "https://datadoghq.com".to_string(),
164                            ).headers(BTreeMap::from([])),
165                        )
166                        .timeout(10.0 as f64)
167                        .url("https://datadoghq.com".to_string()),
168                ),
169            vec!["aws:us-east-2".to_string()],
170            "BDD test payload: synthetics_api_http_test_payload.json".to_string(),
171            "Example-Synthetic".to_string(),
172            SyntheticsTestOptions::new()
173                .accept_self_signed(false)
174                .allow_insecure(true)
175                .follow_redirects(true)
176                .min_failure_duration(10)
177                .min_location_failed(1)
178                .monitor_name("Example-Synthetic".to_string())
179                .monitor_priority(5)
180                .retry(SyntheticsTestOptionsRetry::new().count(3).interval(10.0 as f64))
181                .tick_every(60),
182            SyntheticsAPITestType::API,
183        )
184            .subtype(SyntheticsTestDetailsSubType::HTTP)
185            .tags(vec!["testing:api".to_string()]);
186    let configuration = datadog::Configuration::new();
187    let api = SyntheticsAPI::with_config(configuration);
188    let resp = api.create_synthetics_api_test(body).await;
189    if let Ok(value) = resp {
190        println!("{:#?}", value);
191    } else {
192        println!("{:#?}", resp.unwrap_err());
193    }
194}
More examples
Hide additional examples
examples/v1_synthetics_CreateSyntheticsAPITest_1717840259.rs (lines 184-190)
35async fn main() {
36    let body = SyntheticsAPITest::new(
37        SyntheticsAPITestConfig::new().steps(vec![
38            SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
39                vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
40                    SyntheticsAssertionTarget::new(
41                        SyntheticsAssertionOperator::IS,
42                        SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
43                            200.0 as f64,
44                        ),
45                        SyntheticsAssertionType::STATUS_CODE,
46                    ),
47                ))],
48                "request is sent".to_string(),
49                SyntheticsTestRequest::new()
50                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
51                        SyntheticsBasicAuthWeb::new()
52                            .password("password".to_string())
53                            .username("username".to_string()),
54                    )))
55                    .method("GET".to_string())
56                    .url("https://httpbin.org/status/200".to_string()),
57                SyntheticsAPITestStepSubtype::HTTP,
58            ))),
59            SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
60                vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
61                    SyntheticsAssertionTarget::new(
62                        SyntheticsAssertionOperator::IS,
63                        SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
64                            200.0 as f64,
65                        ),
66                        SyntheticsAssertionType::STATUS_CODE,
67                    ),
68                ))],
69                "request is sent".to_string(),
70                SyntheticsTestRequest::new()
71                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthWeb(Box::new(
72                        SyntheticsBasicAuthWeb::new()
73                            .password("password".to_string())
74                            .type_(SyntheticsBasicAuthWebType::WEB)
75                            .username("username".to_string()),
76                    )))
77                    .method("GET".to_string())
78                    .url("https://httpbin.org/status/200".to_string()),
79                SyntheticsAPITestStepSubtype::HTTP,
80            ))),
81            SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
82                vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
83                    SyntheticsAssertionTarget::new(
84                        SyntheticsAssertionOperator::IS,
85                        SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
86                            200.0 as f64,
87                        ),
88                        SyntheticsAssertionType::STATUS_CODE,
89                    ),
90                ))],
91                "request is sent".to_string(),
92                SyntheticsTestRequest::new()
93                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthSigv4(Box::new(
94                        SyntheticsBasicAuthSigv4::new(
95                            "accessKey".to_string(),
96                            "secretKey".to_string(),
97                            SyntheticsBasicAuthSigv4Type::SIGV4,
98                        ),
99                    )))
100                    .method("GET".to_string())
101                    .url("https://httpbin.org/status/200".to_string()),
102                SyntheticsAPITestStepSubtype::HTTP,
103            ))),
104            SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
105                vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
106                    SyntheticsAssertionTarget::new(
107                        SyntheticsAssertionOperator::IS,
108                        SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
109                            200.0 as f64,
110                        ),
111                        SyntheticsAssertionType::STATUS_CODE,
112                    ),
113                ))],
114                "request is sent".to_string(),
115                SyntheticsTestRequest::new()
116                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthNTLM(Box::new(
117                        SyntheticsBasicAuthNTLM::new(SyntheticsBasicAuthNTLMType::NTLM),
118                    )))
119                    .method("GET".to_string())
120                    .url("https://httpbin.org/status/200".to_string()),
121                SyntheticsAPITestStepSubtype::HTTP,
122            ))),
123            SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
124                vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
125                    SyntheticsAssertionTarget::new(
126                        SyntheticsAssertionOperator::IS,
127                        SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
128                            200.0 as f64,
129                        ),
130                        SyntheticsAssertionType::STATUS_CODE,
131                    ),
132                ))],
133                "request is sent".to_string(),
134                SyntheticsTestRequest::new()
135                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthDigest(Box::new(
136                        SyntheticsBasicAuthDigest::new(
137                            "password".to_string(),
138                            SyntheticsBasicAuthDigestType::DIGEST,
139                            "username".to_string(),
140                        ),
141                    )))
142                    .method("GET".to_string())
143                    .url("https://httpbin.org/status/200".to_string()),
144                SyntheticsAPITestStepSubtype::HTTP,
145            ))),
146            SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
147                vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
148                    SyntheticsAssertionTarget::new(
149                        SyntheticsAssertionOperator::IS,
150                        SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
151                            200.0 as f64,
152                        ),
153                        SyntheticsAssertionType::STATUS_CODE,
154                    ),
155                ))],
156                "request is sent".to_string(),
157                SyntheticsTestRequest::new()
158                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthOauthClient(
159                        Box::new(SyntheticsBasicAuthOauthClient::new(
160                            "accessTokenUrl".to_string(),
161                            "clientId".to_string(),
162                            "clientSecret".to_string(),
163                            SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
164                            SyntheticsBasicAuthOauthClientType::OAUTH_CLIENT,
165                        )),
166                    ))
167                    .method("GET".to_string())
168                    .url("https://httpbin.org/status/200".to_string()),
169                SyntheticsAPITestStepSubtype::HTTP,
170            ))),
171            SyntheticsAPIStep::SyntheticsAPITestStep(Box::new(SyntheticsAPITestStep::new(
172                vec![SyntheticsAssertion::SyntheticsAssertionTarget(Box::new(
173                    SyntheticsAssertionTarget::new(
174                        SyntheticsAssertionOperator::IS,
175                        SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
176                            200.0 as f64,
177                        ),
178                        SyntheticsAssertionType::STATUS_CODE,
179                    ),
180                ))],
181                "request is sent".to_string(),
182                SyntheticsTestRequest::new()
183                    .basic_auth(SyntheticsBasicAuth::SyntheticsBasicAuthOauthROP(Box::new(
184                        SyntheticsBasicAuthOauthROP::new(
185                            "accessTokenUrl".to_string(),
186                            "password".to_string(),
187                            SyntheticsBasicAuthOauthTokenApiAuthentication::HEADER,
188                            SyntheticsBasicAuthOauthROPType::OAUTH_ROP,
189                            "username".to_string(),
190                        ),
191                    )))
192                    .method("GET".to_string())
193                    .url("https://httpbin.org/status/200".to_string()),
194                SyntheticsAPITestStepSubtype::HTTP,
195            ))),
196        ]),
197        vec!["aws:us-east-2".to_string()],
198        "BDD test payload: synthetics_api_test_multi_step_with_every_type_of_basic_auth.json"
199            .to_string(),
200        "Example-Synthetic".to_string(),
201        SyntheticsTestOptions::new().tick_every(60),
202        SyntheticsAPITestType::API,
203    )
204    .subtype(SyntheticsTestDetailsSubType::MULTI);
205    let configuration = datadog::Configuration::new();
206    let api = SyntheticsAPI::with_config(configuration);
207    let resp = api.create_synthetics_api_test(body).await;
208    if let Ok(value) = resp {
209        println!("{:#?}", value);
210    } else {
211        println!("{:#?}", resp.unwrap_err());
212    }
213}
Source

pub fn audience(self, value: String) -> Self

Examples found in repository?
examples/v1_synthetics_CreateSyntheticsAPITest_960766374.rs (line 136)
39async fn main() {
40    let body =
41        SyntheticsAPITest::new(
42            SyntheticsAPITestConfig::new()
43                .assertions(
44                    vec![
45                        SyntheticsAssertion::SyntheticsAssertionTarget(
46                            Box::new(
47                                SyntheticsAssertionTarget::new(
48                                    SyntheticsAssertionOperator::IS,
49                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
50                                        "text/html".to_string(),
51                                    ),
52                                    SyntheticsAssertionType::HEADER,
53                                ).property("{{ PROPERTY }}".to_string()),
54                            ),
55                        ),
56                        SyntheticsAssertion::SyntheticsAssertionTarget(
57                            Box::new(
58                                SyntheticsAssertionTarget::new(
59                                    SyntheticsAssertionOperator::LESS_THAN,
60                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
61                                        2000.0 as f64,
62                                    ),
63                                    SyntheticsAssertionType::RESPONSE_TIME,
64                                ),
65                            ),
66                        ),
67                        SyntheticsAssertion::SyntheticsAssertionJSONPathTarget(
68                            Box::new(
69                                SyntheticsAssertionJSONPathTarget::new(
70                                    SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
71                                    SyntheticsAssertionType::BODY,
72                                ).target(
73                                    SyntheticsAssertionJSONPathTargetTarget::new()
74                                        .json_path("topKey".to_string())
75                                        .operator("isNot".to_string())
76                                        .target_value(
77                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
78                                                "0".to_string(),
79                                            ),
80                                        ),
81                                ),
82                            ),
83                        ),
84                        SyntheticsAssertion::SyntheticsAssertionJSONSchemaTarget(
85                            Box::new(
86                                SyntheticsAssertionJSONSchemaTarget::new(
87                                    SyntheticsAssertionJSONSchemaOperator::VALIDATES_JSON_SCHEMA,
88                                    SyntheticsAssertionType::BODY,
89                                ).target(
90                                    SyntheticsAssertionJSONSchemaTargetTarget::new()
91                                        .json_schema(
92                                            r#"{"type": "object", "properties":{"slideshow":{"type":"object"}}}"#.to_string(),
93                                        )
94                                        .meta_schema(SyntheticsAssertionJSONSchemaMetaSchema::DRAFT_07),
95                                ),
96                            ),
97                        ),
98                        SyntheticsAssertion::SyntheticsAssertionXPathTarget(
99                            Box::new(
100                                SyntheticsAssertionXPathTarget::new(
101                                    SyntheticsAssertionXPathOperator::VALIDATES_X_PATH,
102                                    SyntheticsAssertionType::BODY,
103                                ).target(
104                                    SyntheticsAssertionXPathTargetTarget::new()
105                                        .operator("contains".to_string())
106                                        .target_value(
107                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
108                                                "0".to_string(),
109                                            ),
110                                        )
111                                        .x_path("target-xpath".to_string()),
112                                ),
113                            ),
114                        )
115                    ],
116                )
117                .config_variables(
118                    vec![
119                        SyntheticsConfigVariable::new("PROPERTY".to_string(), SyntheticsConfigVariableType::TEXT)
120                            .example("content-type".to_string())
121                            .pattern("content-type".to_string())
122                    ],
123                )
124                .request(
125                    SyntheticsTestRequest::new()
126                        .basic_auth(
127                            SyntheticsBasicAuth::SyntheticsBasicAuthOauthROP(
128                                Box::new(
129                                    SyntheticsBasicAuthOauthROP::new(
130                                        "https://datadog-token.com".to_string(),
131                                        "oauth-password".to_string(),
132                                        SyntheticsBasicAuthOauthTokenApiAuthentication::BODY,
133                                        SyntheticsBasicAuthOauthROPType::OAUTH_ROP,
134                                        "oauth-usermame".to_string(),
135                                    )
136                                        .audience("audience".to_string())
137                                        .client_id("client-id".to_string())
138                                        .client_secret("client-secret".to_string())
139                                        .resource("resource".to_string())
140                                        .scope("yoyo".to_string()),
141                                ),
142                            ),
143                        )
144                        .certificate(
145                            SyntheticsTestRequestCertificate::new()
146                                .cert(
147                                    SyntheticsTestRequestCertificateItem::new()
148                                        .content("cert-content".to_string())
149                                        .filename("cert-filename".to_string())
150                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
151                                )
152                                .key(
153                                    SyntheticsTestRequestCertificateItem::new()
154                                        .content("key-content".to_string())
155                                        .filename("key-filename".to_string())
156                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
157                                ),
158                        )
159                        .headers(BTreeMap::from([("unique".to_string(), "examplesynthetic".to_string())]))
160                        .method("GET".to_string())
161                        .proxy(
162                            SyntheticsTestRequestProxy::new(
163                                "https://datadoghq.com".to_string(),
164                            ).headers(BTreeMap::from([])),
165                        )
166                        .timeout(10.0 as f64)
167                        .url("https://datadoghq.com".to_string()),
168                ),
169            vec!["aws:us-east-2".to_string()],
170            "BDD test payload: synthetics_api_http_test_payload.json".to_string(),
171            "Example-Synthetic".to_string(),
172            SyntheticsTestOptions::new()
173                .accept_self_signed(false)
174                .allow_insecure(true)
175                .follow_redirects(true)
176                .min_failure_duration(10)
177                .min_location_failed(1)
178                .monitor_name("Example-Synthetic".to_string())
179                .monitor_priority(5)
180                .retry(SyntheticsTestOptionsRetry::new().count(3).interval(10.0 as f64))
181                .tick_every(60),
182            SyntheticsAPITestType::API,
183        )
184            .subtype(SyntheticsTestDetailsSubType::HTTP)
185            .tags(vec!["testing:api".to_string()]);
186    let configuration = datadog::Configuration::new();
187    let api = SyntheticsAPI::with_config(configuration);
188    let resp = api.create_synthetics_api_test(body).await;
189    if let Ok(value) = resp {
190        println!("{:#?}", value);
191    } else {
192        println!("{:#?}", resp.unwrap_err());
193    }
194}
Source

pub fn client_id(self, value: String) -> Self

Examples found in repository?
examples/v1_synthetics_CreateSyntheticsAPITest_960766374.rs (line 137)
39async fn main() {
40    let body =
41        SyntheticsAPITest::new(
42            SyntheticsAPITestConfig::new()
43                .assertions(
44                    vec![
45                        SyntheticsAssertion::SyntheticsAssertionTarget(
46                            Box::new(
47                                SyntheticsAssertionTarget::new(
48                                    SyntheticsAssertionOperator::IS,
49                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
50                                        "text/html".to_string(),
51                                    ),
52                                    SyntheticsAssertionType::HEADER,
53                                ).property("{{ PROPERTY }}".to_string()),
54                            ),
55                        ),
56                        SyntheticsAssertion::SyntheticsAssertionTarget(
57                            Box::new(
58                                SyntheticsAssertionTarget::new(
59                                    SyntheticsAssertionOperator::LESS_THAN,
60                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
61                                        2000.0 as f64,
62                                    ),
63                                    SyntheticsAssertionType::RESPONSE_TIME,
64                                ),
65                            ),
66                        ),
67                        SyntheticsAssertion::SyntheticsAssertionJSONPathTarget(
68                            Box::new(
69                                SyntheticsAssertionJSONPathTarget::new(
70                                    SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
71                                    SyntheticsAssertionType::BODY,
72                                ).target(
73                                    SyntheticsAssertionJSONPathTargetTarget::new()
74                                        .json_path("topKey".to_string())
75                                        .operator("isNot".to_string())
76                                        .target_value(
77                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
78                                                "0".to_string(),
79                                            ),
80                                        ),
81                                ),
82                            ),
83                        ),
84                        SyntheticsAssertion::SyntheticsAssertionJSONSchemaTarget(
85                            Box::new(
86                                SyntheticsAssertionJSONSchemaTarget::new(
87                                    SyntheticsAssertionJSONSchemaOperator::VALIDATES_JSON_SCHEMA,
88                                    SyntheticsAssertionType::BODY,
89                                ).target(
90                                    SyntheticsAssertionJSONSchemaTargetTarget::new()
91                                        .json_schema(
92                                            r#"{"type": "object", "properties":{"slideshow":{"type":"object"}}}"#.to_string(),
93                                        )
94                                        .meta_schema(SyntheticsAssertionJSONSchemaMetaSchema::DRAFT_07),
95                                ),
96                            ),
97                        ),
98                        SyntheticsAssertion::SyntheticsAssertionXPathTarget(
99                            Box::new(
100                                SyntheticsAssertionXPathTarget::new(
101                                    SyntheticsAssertionXPathOperator::VALIDATES_X_PATH,
102                                    SyntheticsAssertionType::BODY,
103                                ).target(
104                                    SyntheticsAssertionXPathTargetTarget::new()
105                                        .operator("contains".to_string())
106                                        .target_value(
107                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
108                                                "0".to_string(),
109                                            ),
110                                        )
111                                        .x_path("target-xpath".to_string()),
112                                ),
113                            ),
114                        )
115                    ],
116                )
117                .config_variables(
118                    vec![
119                        SyntheticsConfigVariable::new("PROPERTY".to_string(), SyntheticsConfigVariableType::TEXT)
120                            .example("content-type".to_string())
121                            .pattern("content-type".to_string())
122                    ],
123                )
124                .request(
125                    SyntheticsTestRequest::new()
126                        .basic_auth(
127                            SyntheticsBasicAuth::SyntheticsBasicAuthOauthROP(
128                                Box::new(
129                                    SyntheticsBasicAuthOauthROP::new(
130                                        "https://datadog-token.com".to_string(),
131                                        "oauth-password".to_string(),
132                                        SyntheticsBasicAuthOauthTokenApiAuthentication::BODY,
133                                        SyntheticsBasicAuthOauthROPType::OAUTH_ROP,
134                                        "oauth-usermame".to_string(),
135                                    )
136                                        .audience("audience".to_string())
137                                        .client_id("client-id".to_string())
138                                        .client_secret("client-secret".to_string())
139                                        .resource("resource".to_string())
140                                        .scope("yoyo".to_string()),
141                                ),
142                            ),
143                        )
144                        .certificate(
145                            SyntheticsTestRequestCertificate::new()
146                                .cert(
147                                    SyntheticsTestRequestCertificateItem::new()
148                                        .content("cert-content".to_string())
149                                        .filename("cert-filename".to_string())
150                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
151                                )
152                                .key(
153                                    SyntheticsTestRequestCertificateItem::new()
154                                        .content("key-content".to_string())
155                                        .filename("key-filename".to_string())
156                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
157                                ),
158                        )
159                        .headers(BTreeMap::from([("unique".to_string(), "examplesynthetic".to_string())]))
160                        .method("GET".to_string())
161                        .proxy(
162                            SyntheticsTestRequestProxy::new(
163                                "https://datadoghq.com".to_string(),
164                            ).headers(BTreeMap::from([])),
165                        )
166                        .timeout(10.0 as f64)
167                        .url("https://datadoghq.com".to_string()),
168                ),
169            vec!["aws:us-east-2".to_string()],
170            "BDD test payload: synthetics_api_http_test_payload.json".to_string(),
171            "Example-Synthetic".to_string(),
172            SyntheticsTestOptions::new()
173                .accept_self_signed(false)
174                .allow_insecure(true)
175                .follow_redirects(true)
176                .min_failure_duration(10)
177                .min_location_failed(1)
178                .monitor_name("Example-Synthetic".to_string())
179                .monitor_priority(5)
180                .retry(SyntheticsTestOptionsRetry::new().count(3).interval(10.0 as f64))
181                .tick_every(60),
182            SyntheticsAPITestType::API,
183        )
184            .subtype(SyntheticsTestDetailsSubType::HTTP)
185            .tags(vec!["testing:api".to_string()]);
186    let configuration = datadog::Configuration::new();
187    let api = SyntheticsAPI::with_config(configuration);
188    let resp = api.create_synthetics_api_test(body).await;
189    if let Ok(value) = resp {
190        println!("{:#?}", value);
191    } else {
192        println!("{:#?}", resp.unwrap_err());
193    }
194}
Source

pub fn client_secret(self, value: String) -> Self

Examples found in repository?
examples/v1_synthetics_CreateSyntheticsAPITest_960766374.rs (line 138)
39async fn main() {
40    let body =
41        SyntheticsAPITest::new(
42            SyntheticsAPITestConfig::new()
43                .assertions(
44                    vec![
45                        SyntheticsAssertion::SyntheticsAssertionTarget(
46                            Box::new(
47                                SyntheticsAssertionTarget::new(
48                                    SyntheticsAssertionOperator::IS,
49                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
50                                        "text/html".to_string(),
51                                    ),
52                                    SyntheticsAssertionType::HEADER,
53                                ).property("{{ PROPERTY }}".to_string()),
54                            ),
55                        ),
56                        SyntheticsAssertion::SyntheticsAssertionTarget(
57                            Box::new(
58                                SyntheticsAssertionTarget::new(
59                                    SyntheticsAssertionOperator::LESS_THAN,
60                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
61                                        2000.0 as f64,
62                                    ),
63                                    SyntheticsAssertionType::RESPONSE_TIME,
64                                ),
65                            ),
66                        ),
67                        SyntheticsAssertion::SyntheticsAssertionJSONPathTarget(
68                            Box::new(
69                                SyntheticsAssertionJSONPathTarget::new(
70                                    SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
71                                    SyntheticsAssertionType::BODY,
72                                ).target(
73                                    SyntheticsAssertionJSONPathTargetTarget::new()
74                                        .json_path("topKey".to_string())
75                                        .operator("isNot".to_string())
76                                        .target_value(
77                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
78                                                "0".to_string(),
79                                            ),
80                                        ),
81                                ),
82                            ),
83                        ),
84                        SyntheticsAssertion::SyntheticsAssertionJSONSchemaTarget(
85                            Box::new(
86                                SyntheticsAssertionJSONSchemaTarget::new(
87                                    SyntheticsAssertionJSONSchemaOperator::VALIDATES_JSON_SCHEMA,
88                                    SyntheticsAssertionType::BODY,
89                                ).target(
90                                    SyntheticsAssertionJSONSchemaTargetTarget::new()
91                                        .json_schema(
92                                            r#"{"type": "object", "properties":{"slideshow":{"type":"object"}}}"#.to_string(),
93                                        )
94                                        .meta_schema(SyntheticsAssertionJSONSchemaMetaSchema::DRAFT_07),
95                                ),
96                            ),
97                        ),
98                        SyntheticsAssertion::SyntheticsAssertionXPathTarget(
99                            Box::new(
100                                SyntheticsAssertionXPathTarget::new(
101                                    SyntheticsAssertionXPathOperator::VALIDATES_X_PATH,
102                                    SyntheticsAssertionType::BODY,
103                                ).target(
104                                    SyntheticsAssertionXPathTargetTarget::new()
105                                        .operator("contains".to_string())
106                                        .target_value(
107                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
108                                                "0".to_string(),
109                                            ),
110                                        )
111                                        .x_path("target-xpath".to_string()),
112                                ),
113                            ),
114                        )
115                    ],
116                )
117                .config_variables(
118                    vec![
119                        SyntheticsConfigVariable::new("PROPERTY".to_string(), SyntheticsConfigVariableType::TEXT)
120                            .example("content-type".to_string())
121                            .pattern("content-type".to_string())
122                    ],
123                )
124                .request(
125                    SyntheticsTestRequest::new()
126                        .basic_auth(
127                            SyntheticsBasicAuth::SyntheticsBasicAuthOauthROP(
128                                Box::new(
129                                    SyntheticsBasicAuthOauthROP::new(
130                                        "https://datadog-token.com".to_string(),
131                                        "oauth-password".to_string(),
132                                        SyntheticsBasicAuthOauthTokenApiAuthentication::BODY,
133                                        SyntheticsBasicAuthOauthROPType::OAUTH_ROP,
134                                        "oauth-usermame".to_string(),
135                                    )
136                                        .audience("audience".to_string())
137                                        .client_id("client-id".to_string())
138                                        .client_secret("client-secret".to_string())
139                                        .resource("resource".to_string())
140                                        .scope("yoyo".to_string()),
141                                ),
142                            ),
143                        )
144                        .certificate(
145                            SyntheticsTestRequestCertificate::new()
146                                .cert(
147                                    SyntheticsTestRequestCertificateItem::new()
148                                        .content("cert-content".to_string())
149                                        .filename("cert-filename".to_string())
150                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
151                                )
152                                .key(
153                                    SyntheticsTestRequestCertificateItem::new()
154                                        .content("key-content".to_string())
155                                        .filename("key-filename".to_string())
156                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
157                                ),
158                        )
159                        .headers(BTreeMap::from([("unique".to_string(), "examplesynthetic".to_string())]))
160                        .method("GET".to_string())
161                        .proxy(
162                            SyntheticsTestRequestProxy::new(
163                                "https://datadoghq.com".to_string(),
164                            ).headers(BTreeMap::from([])),
165                        )
166                        .timeout(10.0 as f64)
167                        .url("https://datadoghq.com".to_string()),
168                ),
169            vec!["aws:us-east-2".to_string()],
170            "BDD test payload: synthetics_api_http_test_payload.json".to_string(),
171            "Example-Synthetic".to_string(),
172            SyntheticsTestOptions::new()
173                .accept_self_signed(false)
174                .allow_insecure(true)
175                .follow_redirects(true)
176                .min_failure_duration(10)
177                .min_location_failed(1)
178                .monitor_name("Example-Synthetic".to_string())
179                .monitor_priority(5)
180                .retry(SyntheticsTestOptionsRetry::new().count(3).interval(10.0 as f64))
181                .tick_every(60),
182            SyntheticsAPITestType::API,
183        )
184            .subtype(SyntheticsTestDetailsSubType::HTTP)
185            .tags(vec!["testing:api".to_string()]);
186    let configuration = datadog::Configuration::new();
187    let api = SyntheticsAPI::with_config(configuration);
188    let resp = api.create_synthetics_api_test(body).await;
189    if let Ok(value) = resp {
190        println!("{:#?}", value);
191    } else {
192        println!("{:#?}", resp.unwrap_err());
193    }
194}
Source

pub fn resource(self, value: String) -> Self

Examples found in repository?
examples/v1_synthetics_CreateSyntheticsAPITest_960766374.rs (line 139)
39async fn main() {
40    let body =
41        SyntheticsAPITest::new(
42            SyntheticsAPITestConfig::new()
43                .assertions(
44                    vec![
45                        SyntheticsAssertion::SyntheticsAssertionTarget(
46                            Box::new(
47                                SyntheticsAssertionTarget::new(
48                                    SyntheticsAssertionOperator::IS,
49                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
50                                        "text/html".to_string(),
51                                    ),
52                                    SyntheticsAssertionType::HEADER,
53                                ).property("{{ PROPERTY }}".to_string()),
54                            ),
55                        ),
56                        SyntheticsAssertion::SyntheticsAssertionTarget(
57                            Box::new(
58                                SyntheticsAssertionTarget::new(
59                                    SyntheticsAssertionOperator::LESS_THAN,
60                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
61                                        2000.0 as f64,
62                                    ),
63                                    SyntheticsAssertionType::RESPONSE_TIME,
64                                ),
65                            ),
66                        ),
67                        SyntheticsAssertion::SyntheticsAssertionJSONPathTarget(
68                            Box::new(
69                                SyntheticsAssertionJSONPathTarget::new(
70                                    SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
71                                    SyntheticsAssertionType::BODY,
72                                ).target(
73                                    SyntheticsAssertionJSONPathTargetTarget::new()
74                                        .json_path("topKey".to_string())
75                                        .operator("isNot".to_string())
76                                        .target_value(
77                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
78                                                "0".to_string(),
79                                            ),
80                                        ),
81                                ),
82                            ),
83                        ),
84                        SyntheticsAssertion::SyntheticsAssertionJSONSchemaTarget(
85                            Box::new(
86                                SyntheticsAssertionJSONSchemaTarget::new(
87                                    SyntheticsAssertionJSONSchemaOperator::VALIDATES_JSON_SCHEMA,
88                                    SyntheticsAssertionType::BODY,
89                                ).target(
90                                    SyntheticsAssertionJSONSchemaTargetTarget::new()
91                                        .json_schema(
92                                            r#"{"type": "object", "properties":{"slideshow":{"type":"object"}}}"#.to_string(),
93                                        )
94                                        .meta_schema(SyntheticsAssertionJSONSchemaMetaSchema::DRAFT_07),
95                                ),
96                            ),
97                        ),
98                        SyntheticsAssertion::SyntheticsAssertionXPathTarget(
99                            Box::new(
100                                SyntheticsAssertionXPathTarget::new(
101                                    SyntheticsAssertionXPathOperator::VALIDATES_X_PATH,
102                                    SyntheticsAssertionType::BODY,
103                                ).target(
104                                    SyntheticsAssertionXPathTargetTarget::new()
105                                        .operator("contains".to_string())
106                                        .target_value(
107                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
108                                                "0".to_string(),
109                                            ),
110                                        )
111                                        .x_path("target-xpath".to_string()),
112                                ),
113                            ),
114                        )
115                    ],
116                )
117                .config_variables(
118                    vec![
119                        SyntheticsConfigVariable::new("PROPERTY".to_string(), SyntheticsConfigVariableType::TEXT)
120                            .example("content-type".to_string())
121                            .pattern("content-type".to_string())
122                    ],
123                )
124                .request(
125                    SyntheticsTestRequest::new()
126                        .basic_auth(
127                            SyntheticsBasicAuth::SyntheticsBasicAuthOauthROP(
128                                Box::new(
129                                    SyntheticsBasicAuthOauthROP::new(
130                                        "https://datadog-token.com".to_string(),
131                                        "oauth-password".to_string(),
132                                        SyntheticsBasicAuthOauthTokenApiAuthentication::BODY,
133                                        SyntheticsBasicAuthOauthROPType::OAUTH_ROP,
134                                        "oauth-usermame".to_string(),
135                                    )
136                                        .audience("audience".to_string())
137                                        .client_id("client-id".to_string())
138                                        .client_secret("client-secret".to_string())
139                                        .resource("resource".to_string())
140                                        .scope("yoyo".to_string()),
141                                ),
142                            ),
143                        )
144                        .certificate(
145                            SyntheticsTestRequestCertificate::new()
146                                .cert(
147                                    SyntheticsTestRequestCertificateItem::new()
148                                        .content("cert-content".to_string())
149                                        .filename("cert-filename".to_string())
150                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
151                                )
152                                .key(
153                                    SyntheticsTestRequestCertificateItem::new()
154                                        .content("key-content".to_string())
155                                        .filename("key-filename".to_string())
156                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
157                                ),
158                        )
159                        .headers(BTreeMap::from([("unique".to_string(), "examplesynthetic".to_string())]))
160                        .method("GET".to_string())
161                        .proxy(
162                            SyntheticsTestRequestProxy::new(
163                                "https://datadoghq.com".to_string(),
164                            ).headers(BTreeMap::from([])),
165                        )
166                        .timeout(10.0 as f64)
167                        .url("https://datadoghq.com".to_string()),
168                ),
169            vec!["aws:us-east-2".to_string()],
170            "BDD test payload: synthetics_api_http_test_payload.json".to_string(),
171            "Example-Synthetic".to_string(),
172            SyntheticsTestOptions::new()
173                .accept_self_signed(false)
174                .allow_insecure(true)
175                .follow_redirects(true)
176                .min_failure_duration(10)
177                .min_location_failed(1)
178                .monitor_name("Example-Synthetic".to_string())
179                .monitor_priority(5)
180                .retry(SyntheticsTestOptionsRetry::new().count(3).interval(10.0 as f64))
181                .tick_every(60),
182            SyntheticsAPITestType::API,
183        )
184            .subtype(SyntheticsTestDetailsSubType::HTTP)
185            .tags(vec!["testing:api".to_string()]);
186    let configuration = datadog::Configuration::new();
187    let api = SyntheticsAPI::with_config(configuration);
188    let resp = api.create_synthetics_api_test(body).await;
189    if let Ok(value) = resp {
190        println!("{:#?}", value);
191    } else {
192        println!("{:#?}", resp.unwrap_err());
193    }
194}
Source

pub fn scope(self, value: String) -> Self

Examples found in repository?
examples/v1_synthetics_CreateSyntheticsAPITest_960766374.rs (line 140)
39async fn main() {
40    let body =
41        SyntheticsAPITest::new(
42            SyntheticsAPITestConfig::new()
43                .assertions(
44                    vec![
45                        SyntheticsAssertion::SyntheticsAssertionTarget(
46                            Box::new(
47                                SyntheticsAssertionTarget::new(
48                                    SyntheticsAssertionOperator::IS,
49                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
50                                        "text/html".to_string(),
51                                    ),
52                                    SyntheticsAssertionType::HEADER,
53                                ).property("{{ PROPERTY }}".to_string()),
54                            ),
55                        ),
56                        SyntheticsAssertion::SyntheticsAssertionTarget(
57                            Box::new(
58                                SyntheticsAssertionTarget::new(
59                                    SyntheticsAssertionOperator::LESS_THAN,
60                                    SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(
61                                        2000.0 as f64,
62                                    ),
63                                    SyntheticsAssertionType::RESPONSE_TIME,
64                                ),
65                            ),
66                        ),
67                        SyntheticsAssertion::SyntheticsAssertionJSONPathTarget(
68                            Box::new(
69                                SyntheticsAssertionJSONPathTarget::new(
70                                    SyntheticsAssertionJSONPathOperator::VALIDATES_JSON_PATH,
71                                    SyntheticsAssertionType::BODY,
72                                ).target(
73                                    SyntheticsAssertionJSONPathTargetTarget::new()
74                                        .json_path("topKey".to_string())
75                                        .operator("isNot".to_string())
76                                        .target_value(
77                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
78                                                "0".to_string(),
79                                            ),
80                                        ),
81                                ),
82                            ),
83                        ),
84                        SyntheticsAssertion::SyntheticsAssertionJSONSchemaTarget(
85                            Box::new(
86                                SyntheticsAssertionJSONSchemaTarget::new(
87                                    SyntheticsAssertionJSONSchemaOperator::VALIDATES_JSON_SCHEMA,
88                                    SyntheticsAssertionType::BODY,
89                                ).target(
90                                    SyntheticsAssertionJSONSchemaTargetTarget::new()
91                                        .json_schema(
92                                            r#"{"type": "object", "properties":{"slideshow":{"type":"object"}}}"#.to_string(),
93                                        )
94                                        .meta_schema(SyntheticsAssertionJSONSchemaMetaSchema::DRAFT_07),
95                                ),
96                            ),
97                        ),
98                        SyntheticsAssertion::SyntheticsAssertionXPathTarget(
99                            Box::new(
100                                SyntheticsAssertionXPathTarget::new(
101                                    SyntheticsAssertionXPathOperator::VALIDATES_X_PATH,
102                                    SyntheticsAssertionType::BODY,
103                                ).target(
104                                    SyntheticsAssertionXPathTargetTarget::new()
105                                        .operator("contains".to_string())
106                                        .target_value(
107                                            SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueString(
108                                                "0".to_string(),
109                                            ),
110                                        )
111                                        .x_path("target-xpath".to_string()),
112                                ),
113                            ),
114                        )
115                    ],
116                )
117                .config_variables(
118                    vec![
119                        SyntheticsConfigVariable::new("PROPERTY".to_string(), SyntheticsConfigVariableType::TEXT)
120                            .example("content-type".to_string())
121                            .pattern("content-type".to_string())
122                    ],
123                )
124                .request(
125                    SyntheticsTestRequest::new()
126                        .basic_auth(
127                            SyntheticsBasicAuth::SyntheticsBasicAuthOauthROP(
128                                Box::new(
129                                    SyntheticsBasicAuthOauthROP::new(
130                                        "https://datadog-token.com".to_string(),
131                                        "oauth-password".to_string(),
132                                        SyntheticsBasicAuthOauthTokenApiAuthentication::BODY,
133                                        SyntheticsBasicAuthOauthROPType::OAUTH_ROP,
134                                        "oauth-usermame".to_string(),
135                                    )
136                                        .audience("audience".to_string())
137                                        .client_id("client-id".to_string())
138                                        .client_secret("client-secret".to_string())
139                                        .resource("resource".to_string())
140                                        .scope("yoyo".to_string()),
141                                ),
142                            ),
143                        )
144                        .certificate(
145                            SyntheticsTestRequestCertificate::new()
146                                .cert(
147                                    SyntheticsTestRequestCertificateItem::new()
148                                        .content("cert-content".to_string())
149                                        .filename("cert-filename".to_string())
150                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
151                                )
152                                .key(
153                                    SyntheticsTestRequestCertificateItem::new()
154                                        .content("key-content".to_string())
155                                        .filename("key-filename".to_string())
156                                        .updated_at("2020-10-16T09:23:24.857Z".to_string()),
157                                ),
158                        )
159                        .headers(BTreeMap::from([("unique".to_string(), "examplesynthetic".to_string())]))
160                        .method("GET".to_string())
161                        .proxy(
162                            SyntheticsTestRequestProxy::new(
163                                "https://datadoghq.com".to_string(),
164                            ).headers(BTreeMap::from([])),
165                        )
166                        .timeout(10.0 as f64)
167                        .url("https://datadoghq.com".to_string()),
168                ),
169            vec!["aws:us-east-2".to_string()],
170            "BDD test payload: synthetics_api_http_test_payload.json".to_string(),
171            "Example-Synthetic".to_string(),
172            SyntheticsTestOptions::new()
173                .accept_self_signed(false)
174                .allow_insecure(true)
175                .follow_redirects(true)
176                .min_failure_duration(10)
177                .min_location_failed(1)
178                .monitor_name("Example-Synthetic".to_string())
179                .monitor_priority(5)
180                .retry(SyntheticsTestOptionsRetry::new().count(3).interval(10.0 as f64))
181                .tick_every(60),
182            SyntheticsAPITestType::API,
183        )
184            .subtype(SyntheticsTestDetailsSubType::HTTP)
185            .tags(vec!["testing:api".to_string()]);
186    let configuration = datadog::Configuration::new();
187    let api = SyntheticsAPI::with_config(configuration);
188    let resp = api.create_synthetics_api_test(body).await;
189    if let Ok(value) = resp {
190        println!("{:#?}", value);
191    } else {
192        println!("{:#?}", resp.unwrap_err());
193    }
194}
Source

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

Trait Implementations§

Source§

impl Clone for SyntheticsBasicAuthOauthROP

Source§

fn clone(&self) -> SyntheticsBasicAuthOauthROP

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 SyntheticsBasicAuthOauthROP

Source§

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

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

impl<'de> Deserialize<'de> for SyntheticsBasicAuthOauthROP

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 SyntheticsBasicAuthOauthROP

Source§

fn eq(&self, other: &SyntheticsBasicAuthOauthROP) -> 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 SyntheticsBasicAuthOauthROP

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 SyntheticsBasicAuthOauthROP

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,