datadog-api-client 0.20.0

Rust client for the Datadog API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.
use serde::de::{Error, MapAccess, Visitor};
use serde::{Deserialize, Deserializer, Serialize};
use serde_with::skip_serializing_none;
use std::fmt::{self, Formatter};

/// Object describing the Synthetic test request.
#[non_exhaustive]
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Serialize)]
pub struct SyntheticsTestRequest {
    /// Allows loading insecure content for an HTTP request in a multistep test step.
    #[serde(rename = "allow_insecure")]
    pub allow_insecure: Option<bool>,
    /// Object to handle basic authentication when performing the test.
    #[serde(rename = "basicAuth")]
    pub basic_auth: Option<crate::datadogV1::model::SyntheticsBasicAuth>,
    /// Body to include in the test.
    #[serde(rename = "body")]
    pub body: Option<String>,
    /// Type of the request body.
    #[serde(rename = "bodyType")]
    pub body_type: Option<crate::datadogV1::model::SyntheticsTestRequestBodyType>,
    /// The type of gRPC call to perform.
    #[serde(rename = "callType")]
    pub call_type: Option<crate::datadogV1::model::SyntheticsTestCallType>,
    /// Client certificate to use when performing the test request.
    #[serde(rename = "certificate")]
    pub certificate: Option<crate::datadogV1::model::SyntheticsTestRequestCertificate>,
    /// By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in `certificateDomains`.
    #[serde(rename = "certificateDomains")]
    pub certificate_domains: Option<Vec<String>>,
    /// Check for certificate revocation.
    #[serde(rename = "checkCertificateRevocation")]
    pub check_certificate_revocation: Option<bool>,
    /// A protobuf JSON descriptor that needs to be gzipped first then base64 encoded.
    #[serde(rename = "compressedJsonDescriptor")]
    pub compressed_json_descriptor: Option<String>,
    /// A protobuf file that needs to be gzipped first then base64 encoded.
    #[serde(rename = "compressedProtoFile")]
    pub compressed_proto_file: Option<String>,
    /// Disable fetching intermediate certificates from AIA.
    #[serde(rename = "disableAiaIntermediateFetching")]
    pub disable_aia_intermediate_fetching: Option<bool>,
    /// DNS server to use for DNS tests.
    #[serde(rename = "dnsServer")]
    pub dns_server: Option<String>,
    /// DNS server port to use for DNS tests.
    #[serde(rename = "dnsServerPort")]
    pub dns_server_port: Option<crate::datadogV1::model::SyntheticsTestRequestDNSServerPort>,
    /// Files to be used as part of the request in the test. Only valid if `bodyType` is `multipart/form-data`.
    #[serde(rename = "files")]
    pub files: Option<Vec<crate::datadogV1::model::SyntheticsTestRequestBodyFile>>,
    /// Specifies whether or not the request follows redirects.
    #[serde(rename = "follow_redirects")]
    pub follow_redirects: Option<bool>,
    /// Form to be used as part of the request in the test. Only valid if `bodyType` is `multipart/form-data`.
    #[serde(rename = "form")]
    pub form: Option<std::collections::BTreeMap<String, String>>,
    /// Headers to include when performing the test.
    #[serde(rename = "headers")]
    pub headers: Option<std::collections::BTreeMap<String, String>>,
    /// Host name to perform the test with.
    #[serde(rename = "host")]
    pub host: Option<String>,
    /// HTTP version to use for a Synthetic test.
    #[serde(rename = "httpVersion")]
    pub http_version: Option<crate::datadogV1::model::SyntheticsTestOptionsHTTPVersion>,
    /// Whether the message is base64 encoded.
    #[serde(rename = "isMessageBase64Encoded")]
    pub is_message_base64_encoded: Option<bool>,
    /// Message to send for UDP or WebSocket tests.
    #[serde(rename = "message")]
    pub message: Option<String>,
    /// Metadata to include when performing the gRPC test.
    #[serde(rename = "metadata")]
    pub metadata: Option<std::collections::BTreeMap<String, String>>,
    /// Either the HTTP method/verb to use or a gRPC method available on the service set in the `service` field. Required if `subtype` is `HTTP` or if `subtype` is `grpc` and `callType` is `unary`.
    #[serde(rename = "method")]
    pub method: Option<String>,
    /// Determines whether or not to save the response body.
    #[serde(rename = "noSavingResponseBody")]
    pub no_saving_response_body: Option<bool>,
    /// Number of pings to use per test.
    #[serde(rename = "numberOfPackets")]
    pub number_of_packets: Option<i32>,
    /// Persist cookies across redirects.
    #[serde(rename = "persistCookies")]
    pub persist_cookies: Option<bool>,
    /// Port to use when performing the test.
    #[serde(rename = "port")]
    pub port: Option<crate::datadogV1::model::SyntheticsTestRequestPort>,
    /// The proxy to perform the test.
    #[serde(rename = "proxy")]
    pub proxy: Option<crate::datadogV1::model::SyntheticsTestRequestProxy>,
    /// Query to use for the test.
    #[serde(rename = "query")]
    pub query: Option<std::collections::BTreeMap<String, serde_json::Value>>,
    /// For SSL tests, it specifies on which server you want to initiate the TLS handshake,
    /// allowing the server to present one of multiple possible certificates on
    /// the same IP address and TCP port number.
    #[serde(rename = "servername")]
    pub servername: Option<String>,
    /// The gRPC service on which you want to perform the gRPC call.
    #[serde(rename = "service")]
    pub service: Option<String>,
    /// Turns on a traceroute probe to discover all gateways along the path to the host destination.
    #[serde(rename = "shouldTrackHops")]
    pub should_track_hops: Option<bool>,
    /// Timeout in seconds for the test.
    #[serde(rename = "timeout")]
    pub timeout: Option<f64>,
    /// URL to perform the test with.
    #[serde(rename = "url")]
    pub url: Option<String>,
    #[serde(flatten)]
    pub additional_properties: std::collections::BTreeMap<String, serde_json::Value>,
    #[serde(skip)]
    #[serde(default)]
    pub(crate) _unparsed: bool,
}

impl SyntheticsTestRequest {
    pub fn new() -> SyntheticsTestRequest {
        SyntheticsTestRequest {
            allow_insecure: None,
            basic_auth: None,
            body: None,
            body_type: None,
            call_type: None,
            certificate: None,
            certificate_domains: None,
            check_certificate_revocation: None,
            compressed_json_descriptor: None,
            compressed_proto_file: None,
            disable_aia_intermediate_fetching: None,
            dns_server: None,
            dns_server_port: None,
            files: None,
            follow_redirects: None,
            form: None,
            headers: None,
            host: None,
            http_version: None,
            is_message_base64_encoded: None,
            message: None,
            metadata: None,
            method: None,
            no_saving_response_body: None,
            number_of_packets: None,
            persist_cookies: None,
            port: None,
            proxy: None,
            query: None,
            servername: None,
            service: None,
            should_track_hops: None,
            timeout: None,
            url: None,
            additional_properties: std::collections::BTreeMap::new(),
            _unparsed: false,
        }
    }

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

    pub fn basic_auth(mut self, value: crate::datadogV1::model::SyntheticsBasicAuth) -> Self {
        self.basic_auth = Some(value);
        self
    }

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

    pub fn body_type(
        mut self,
        value: crate::datadogV1::model::SyntheticsTestRequestBodyType,
    ) -> Self {
        self.body_type = Some(value);
        self
    }

    pub fn call_type(mut self, value: crate::datadogV1::model::SyntheticsTestCallType) -> Self {
        self.call_type = Some(value);
        self
    }

    pub fn certificate(
        mut self,
        value: crate::datadogV1::model::SyntheticsTestRequestCertificate,
    ) -> Self {
        self.certificate = Some(value);
        self
    }

    pub fn certificate_domains(mut self, value: Vec<String>) -> Self {
        self.certificate_domains = Some(value);
        self
    }

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

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

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

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

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

    pub fn dns_server_port(
        mut self,
        value: crate::datadogV1::model::SyntheticsTestRequestDNSServerPort,
    ) -> Self {
        self.dns_server_port = Some(value);
        self
    }

    pub fn files(
        mut self,
        value: Vec<crate::datadogV1::model::SyntheticsTestRequestBodyFile>,
    ) -> Self {
        self.files = Some(value);
        self
    }

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

    pub fn form(mut self, value: std::collections::BTreeMap<String, String>) -> Self {
        self.form = Some(value);
        self
    }

    pub fn headers(mut self, value: std::collections::BTreeMap<String, String>) -> Self {
        self.headers = Some(value);
        self
    }

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

    pub fn http_version(
        mut self,
        value: crate::datadogV1::model::SyntheticsTestOptionsHTTPVersion,
    ) -> Self {
        self.http_version = Some(value);
        self
    }

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

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

    pub fn metadata(mut self, value: std::collections::BTreeMap<String, String>) -> Self {
        self.metadata = Some(value);
        self
    }

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

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

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

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

    pub fn port(mut self, value: crate::datadogV1::model::SyntheticsTestRequestPort) -> Self {
        self.port = Some(value);
        self
    }

    pub fn proxy(mut self, value: crate::datadogV1::model::SyntheticsTestRequestProxy) -> Self {
        self.proxy = Some(value);
        self
    }

    pub fn query(mut self, value: std::collections::BTreeMap<String, serde_json::Value>) -> Self {
        self.query = Some(value);
        self
    }

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

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

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

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

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

    pub fn additional_properties(
        mut self,
        value: std::collections::BTreeMap<String, serde_json::Value>,
    ) -> Self {
        self.additional_properties = value;
        self
    }
}

impl Default for SyntheticsTestRequest {
    fn default() -> Self {
        Self::new()
    }
}

impl<'de> Deserialize<'de> for SyntheticsTestRequest {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: Deserializer<'de>,
    {
        struct SyntheticsTestRequestVisitor;
        impl<'a> Visitor<'a> for SyntheticsTestRequestVisitor {
            type Value = SyntheticsTestRequest;

            fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result {
                f.write_str("a mapping")
            }

            fn visit_map<M>(self, mut map: M) -> Result<Self::Value, M::Error>
            where
                M: MapAccess<'a>,
            {
                let mut allow_insecure: Option<bool> = None;
                let mut basic_auth: Option<crate::datadogV1::model::SyntheticsBasicAuth> = None;
                let mut body: Option<String> = None;
                let mut body_type: Option<crate::datadogV1::model::SyntheticsTestRequestBodyType> =
                    None;
                let mut call_type: Option<crate::datadogV1::model::SyntheticsTestCallType> = None;
                let mut certificate: Option<
                    crate::datadogV1::model::SyntheticsTestRequestCertificate,
                > = None;
                let mut certificate_domains: Option<Vec<String>> = None;
                let mut check_certificate_revocation: Option<bool> = None;
                let mut compressed_json_descriptor: Option<String> = None;
                let mut compressed_proto_file: Option<String> = None;
                let mut disable_aia_intermediate_fetching: Option<bool> = None;
                let mut dns_server: Option<String> = None;
                let mut dns_server_port: Option<
                    crate::datadogV1::model::SyntheticsTestRequestDNSServerPort,
                > = None;
                let mut files: Option<Vec<crate::datadogV1::model::SyntheticsTestRequestBodyFile>> =
                    None;
                let mut follow_redirects: Option<bool> = None;
                let mut form: Option<std::collections::BTreeMap<String, String>> = None;
                let mut headers: Option<std::collections::BTreeMap<String, String>> = None;
                let mut host: Option<String> = None;
                let mut http_version: Option<
                    crate::datadogV1::model::SyntheticsTestOptionsHTTPVersion,
                > = None;
                let mut is_message_base64_encoded: Option<bool> = None;
                let mut message: Option<String> = None;
                let mut metadata: Option<std::collections::BTreeMap<String, String>> = None;
                let mut method: Option<String> = None;
                let mut no_saving_response_body: Option<bool> = None;
                let mut number_of_packets: Option<i32> = None;
                let mut persist_cookies: Option<bool> = None;
                let mut port: Option<crate::datadogV1::model::SyntheticsTestRequestPort> = None;
                let mut proxy: Option<crate::datadogV1::model::SyntheticsTestRequestProxy> = None;
                let mut query: Option<std::collections::BTreeMap<String, serde_json::Value>> = None;
                let mut servername: Option<String> = None;
                let mut service: Option<String> = None;
                let mut should_track_hops: Option<bool> = None;
                let mut timeout: Option<f64> = None;
                let mut url: Option<String> = None;
                let mut additional_properties: std::collections::BTreeMap<
                    String,
                    serde_json::Value,
                > = std::collections::BTreeMap::new();
                let mut _unparsed = false;

                while let Some((k, v)) = map.next_entry::<String, serde_json::Value>()? {
                    match k.as_str() {
                        "allow_insecure" => {
                            if v.is_null() {
                                continue;
                            }
                            allow_insecure =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "basicAuth" => {
                            if v.is_null() {
                                continue;
                            }
                            basic_auth = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                            if let Some(ref _basic_auth) = basic_auth {
                                match _basic_auth {
                                    crate::datadogV1::model::SyntheticsBasicAuth::UnparsedObject(_basic_auth) => {
                                        _unparsed = true;
                                    },
                                    _ => {}
                                }
                            }
                        }
                        "body" => {
                            if v.is_null() {
                                continue;
                            }
                            body = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "bodyType" => {
                            if v.is_null() {
                                continue;
                            }
                            body_type = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                            if let Some(ref _body_type) = body_type {
                                match _body_type {
                                    crate::datadogV1::model::SyntheticsTestRequestBodyType::UnparsedObject(_body_type) => {
                                        _unparsed = true;
                                    },
                                    _ => {}
                                }
                            }
                        }
                        "callType" => {
                            if v.is_null() {
                                continue;
                            }
                            call_type = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                            if let Some(ref _call_type) = call_type {
                                match _call_type {
                                    crate::datadogV1::model::SyntheticsTestCallType::UnparsedObject(_call_type) => {
                                        _unparsed = true;
                                    },
                                    _ => {}
                                }
                            }
                        }
                        "certificate" => {
                            if v.is_null() {
                                continue;
                            }
                            certificate =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "certificateDomains" => {
                            if v.is_null() {
                                continue;
                            }
                            certificate_domains =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "checkCertificateRevocation" => {
                            if v.is_null() {
                                continue;
                            }
                            check_certificate_revocation =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "compressedJsonDescriptor" => {
                            if v.is_null() {
                                continue;
                            }
                            compressed_json_descriptor =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "compressedProtoFile" => {
                            if v.is_null() {
                                continue;
                            }
                            compressed_proto_file =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "disableAiaIntermediateFetching" => {
                            if v.is_null() {
                                continue;
                            }
                            disable_aia_intermediate_fetching =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "dnsServer" => {
                            if v.is_null() {
                                continue;
                            }
                            dns_server = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "dnsServerPort" => {
                            if v.is_null() {
                                continue;
                            }
                            dns_server_port =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                            if let Some(ref _dns_server_port) = dns_server_port {
                                match _dns_server_port {
                                    crate::datadogV1::model::SyntheticsTestRequestDNSServerPort::UnparsedObject(_dns_server_port) => {
                                        _unparsed = true;
                                    },
                                    _ => {}
                                }
                            }
                        }
                        "files" => {
                            if v.is_null() {
                                continue;
                            }
                            files = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "follow_redirects" => {
                            if v.is_null() {
                                continue;
                            }
                            follow_redirects =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "form" => {
                            if v.is_null() {
                                continue;
                            }
                            form = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "headers" => {
                            if v.is_null() {
                                continue;
                            }
                            headers = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "host" => {
                            if v.is_null() {
                                continue;
                            }
                            host = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "httpVersion" => {
                            if v.is_null() {
                                continue;
                            }
                            http_version =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                            if let Some(ref _http_version) = http_version {
                                match _http_version {
                                    crate::datadogV1::model::SyntheticsTestOptionsHTTPVersion::UnparsedObject(_http_version) => {
                                        _unparsed = true;
                                    },
                                    _ => {}
                                }
                            }
                        }
                        "isMessageBase64Encoded" => {
                            if v.is_null() {
                                continue;
                            }
                            is_message_base64_encoded =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "message" => {
                            if v.is_null() {
                                continue;
                            }
                            message = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "metadata" => {
                            if v.is_null() {
                                continue;
                            }
                            metadata = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "method" => {
                            if v.is_null() {
                                continue;
                            }
                            method = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "noSavingResponseBody" => {
                            if v.is_null() {
                                continue;
                            }
                            no_saving_response_body =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "numberOfPackets" => {
                            if v.is_null() {
                                continue;
                            }
                            number_of_packets =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "persistCookies" => {
                            if v.is_null() {
                                continue;
                            }
                            persist_cookies =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "port" => {
                            if v.is_null() {
                                continue;
                            }
                            port = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                            if let Some(ref _port) = port {
                                match _port {
                                    crate::datadogV1::model::SyntheticsTestRequestPort::UnparsedObject(_port) => {
                                        _unparsed = true;
                                    },
                                    _ => {}
                                }
                            }
                        }
                        "proxy" => {
                            if v.is_null() {
                                continue;
                            }
                            proxy = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "query" => {
                            if v.is_null() {
                                continue;
                            }
                            query = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "servername" => {
                            if v.is_null() {
                                continue;
                            }
                            servername = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "service" => {
                            if v.is_null() {
                                continue;
                            }
                            service = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "shouldTrackHops" => {
                            if v.is_null() {
                                continue;
                            }
                            should_track_hops =
                                Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "timeout" => {
                            if v.is_null() {
                                continue;
                            }
                            timeout = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        "url" => {
                            if v.is_null() {
                                continue;
                            }
                            url = Some(serde_json::from_value(v).map_err(M::Error::custom)?);
                        }
                        &_ => {
                            if let Ok(value) = serde_json::from_value(v.clone()) {
                                additional_properties.insert(k, value);
                            }
                        }
                    }
                }

                let content = SyntheticsTestRequest {
                    allow_insecure,
                    basic_auth,
                    body,
                    body_type,
                    call_type,
                    certificate,
                    certificate_domains,
                    check_certificate_revocation,
                    compressed_json_descriptor,
                    compressed_proto_file,
                    disable_aia_intermediate_fetching,
                    dns_server,
                    dns_server_port,
                    files,
                    follow_redirects,
                    form,
                    headers,
                    host,
                    http_version,
                    is_message_base64_encoded,
                    message,
                    metadata,
                    method,
                    no_saving_response_body,
                    number_of_packets,
                    persist_cookies,
                    port,
                    proxy,
                    query,
                    servername,
                    service,
                    should_track_hops,
                    timeout,
                    url,
                    additional_properties,
                    _unparsed,
                };

                Ok(content)
            }
        }

        deserializer.deserialize_any(SyntheticsTestRequestVisitor)
    }
}