datadog_api_client/datadog/
configuration.rs

1// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2// This product includes software developed at Datadog (https://www.datadoghq.com/).
3// Copyright 2019-Present Datadog, Inc.
4use lazy_static::lazy_static;
5use log::warn;
6use std::collections::HashMap;
7use std::env;
8
9#[derive(Debug, Clone)]
10pub struct ServerVariable {
11    pub description: String,
12    pub default_value: String,
13    pub enum_values: Vec<String>,
14}
15
16#[derive(Debug, Clone)]
17pub struct ServerConfiguration {
18    pub url: String,
19    pub description: String,
20    pub variables: HashMap<String, ServerVariable>,
21}
22
23impl ServerConfiguration {
24    pub fn get_url(&self, variables: &HashMap<String, String>) -> String {
25        let mut url = self.url.clone();
26        for (name, variable) in &self.variables {
27            let value = variables.get(name).unwrap_or(&variable.default_value);
28            if !variable.enum_values.contains(value) && !variable.enum_values.is_empty() {
29                panic!("Value {value} for variable {name} is not in the enum values");
30            }
31            url = url.replace(&format!("{{{name}}}"), &value);
32        }
33        url
34    }
35}
36
37#[derive(Debug, Clone)]
38pub struct APIKey {
39    pub key: String,
40    pub prefix: String,
41}
42
43#[non_exhaustive]
44#[derive(Debug, Clone)]
45pub struct Configuration {
46    pub(crate) user_agent: String,
47    pub(crate) unstable_operations: HashMap<String, bool>,
48    pub(crate) auth_keys: HashMap<String, APIKey>,
49    pub server_index: usize,
50    pub server_variables: HashMap<String, String>,
51    pub server_operation_index: HashMap<String, usize>,
52    pub server_operation_variables: HashMap<String, HashMap<String, String>>,
53    pub proxy_url: Option<String>,
54    pub enable_retry: bool,
55    pub max_retries: u32,
56}
57
58impl Configuration {
59    pub fn new() -> Self {
60        Self::default()
61    }
62
63    pub fn get_operation_host(&self, operation_str: &str) -> String {
64        let operation = operation_str.to_string();
65        let server_index = self
66            .server_operation_index
67            .get(&operation)
68            .unwrap_or(&self.server_index);
69        let server_variables = self
70            .server_operation_variables
71            .get(&operation)
72            .unwrap_or(&self.server_variables);
73        let servers = OPERATION_SERVERS.get(&operation).unwrap_or(&SERVERS);
74        servers
75            .get(*server_index)
76            .expect(&format!("Server index for operation {operation} not found"))
77            .get_url(&server_variables)
78    }
79
80    pub fn set_unstable_operation_enabled(&mut self, operation: &str, enabled: bool) -> bool {
81        if self.unstable_operations.contains_key(operation) {
82            self.unstable_operations
83                .insert(operation.to_string(), enabled);
84            return true;
85        }
86
87        warn!("Operation {operation} is not an unstable operation, can't enable/disable");
88        false
89    }
90
91    pub fn is_unstable_operation_enabled(&self, operation: &str) -> bool {
92        if self.unstable_operations.contains_key(operation) {
93            return self.unstable_operations.get(operation).unwrap().clone();
94        }
95
96        warn!("Operation {operation} is not an unstable operation, is always enabled");
97        false
98    }
99
100    pub fn is_unstable_operation(&self, operation: &str) -> bool {
101        if self.unstable_operations.contains_key(operation) {
102            return true;
103        }
104
105        false
106    }
107
108    pub fn set_auth_key(&mut self, operation_str: &str, api_key: APIKey) {
109        self.auth_keys.insert(operation_str.to_string(), api_key);
110    }
111
112    pub fn set_proxy_url(&mut self, proxy_url: Option<String>) {
113        self.proxy_url = proxy_url;
114    }
115
116    pub fn set_retry(&mut self, enable_retry: bool, max_retries: u32) {
117        self.enable_retry = enable_retry;
118        self.max_retries = max_retries;
119    }
120}
121
122impl Default for Configuration {
123    fn default() -> Self {
124        let unstable_operations = HashMap::from([
125            ("v2.cancel_fleet_deployment".to_owned(), false),
126            ("v2.create_fleet_deployment_configure".to_owned(), false),
127            ("v2.get_fleet_deployment".to_owned(), false),
128            ("v2.list_fleet_deployments".to_owned(), false),
129            ("v2.create_open_api".to_owned(), false),
130            ("v2.delete_open_api".to_owned(), false),
131            ("v2.get_open_api".to_owned(), false),
132            ("v2.list_apis".to_owned(), false),
133            ("v2.update_open_api".to_owned(), false),
134            ("v2.cancel_historical_job".to_owned(), false),
135            ("v2.convert_job_result_to_signal".to_owned(), false),
136            ("v2.delete_historical_job".to_owned(), false),
137            ("v2.get_finding".to_owned(), false),
138            ("v2.get_historical_job".to_owned(), false),
139            ("v2.get_rule_version_history".to_owned(), false),
140            ("v2.get_sbom".to_owned(), false),
141            ("v2.get_security_monitoring_histsignal".to_owned(), false),
142            (
143                "v2.get_security_monitoring_histsignals_by_job_id".to_owned(),
144                false,
145            ),
146            ("v2.list_assets_sbo_ms".to_owned(), false),
147            ("v2.list_findings".to_owned(), false),
148            ("v2.list_historical_jobs".to_owned(), false),
149            ("v2.list_scanned_assets_metadata".to_owned(), false),
150            ("v2.list_security_monitoring_histsignals".to_owned(), false),
151            ("v2.list_vulnerabilities".to_owned(), false),
152            ("v2.list_vulnerable_assets".to_owned(), false),
153            ("v2.mute_findings".to_owned(), false),
154            ("v2.run_historical_job".to_owned(), false),
155            (
156                "v2.search_security_monitoring_histsignals".to_owned(),
157                false,
158            ),
159            ("v2.create_dataset".to_owned(), false),
160            ("v2.delete_dataset".to_owned(), false),
161            ("v2.get_all_datasets".to_owned(), false),
162            ("v2.get_dataset".to_owned(), false),
163            ("v2.update_dataset".to_owned(), false),
164            ("v2.cancel_data_deletion_request".to_owned(), false),
165            ("v2.create_data_deletion_request".to_owned(), false),
166            ("v2.get_data_deletion_requests".to_owned(), false),
167            ("v2.create_incident".to_owned(), false),
168            ("v2.create_incident_impact".to_owned(), false),
169            ("v2.create_incident_integration".to_owned(), false),
170            ("v2.create_incident_notification_rule".to_owned(), false),
171            ("v2.create_incident_notification_template".to_owned(), false),
172            ("v2.create_incident_todo".to_owned(), false),
173            ("v2.create_incident_type".to_owned(), false),
174            ("v2.delete_incident".to_owned(), false),
175            ("v2.delete_incident_impact".to_owned(), false),
176            ("v2.delete_incident_integration".to_owned(), false),
177            ("v2.delete_incident_notification_rule".to_owned(), false),
178            ("v2.delete_incident_notification_template".to_owned(), false),
179            ("v2.delete_incident_todo".to_owned(), false),
180            ("v2.delete_incident_type".to_owned(), false),
181            ("v2.get_incident".to_owned(), false),
182            ("v2.get_incident_integration".to_owned(), false),
183            ("v2.get_incident_notification_rule".to_owned(), false),
184            ("v2.get_incident_notification_template".to_owned(), false),
185            ("v2.get_incident_todo".to_owned(), false),
186            ("v2.get_incident_type".to_owned(), false),
187            ("v2.list_incident_attachments".to_owned(), false),
188            ("v2.list_incident_impacts".to_owned(), false),
189            ("v2.list_incident_integrations".to_owned(), false),
190            ("v2.list_incident_notification_rules".to_owned(), false),
191            ("v2.list_incident_notification_templates".to_owned(), false),
192            ("v2.list_incidents".to_owned(), false),
193            ("v2.list_incident_todos".to_owned(), false),
194            ("v2.list_incident_types".to_owned(), false),
195            ("v2.search_incidents".to_owned(), false),
196            ("v2.update_incident".to_owned(), false),
197            ("v2.update_incident_attachments".to_owned(), false),
198            ("v2.update_incident_integration".to_owned(), false),
199            ("v2.update_incident_notification_rule".to_owned(), false),
200            ("v2.update_incident_notification_template".to_owned(), false),
201            ("v2.update_incident_todo".to_owned(), false),
202            ("v2.update_incident_type".to_owned(), false),
203            ("v2.create_monitor_user_template".to_owned(), false),
204            ("v2.delete_monitor_user_template".to_owned(), false),
205            ("v2.get_monitor_user_template".to_owned(), false),
206            ("v2.list_monitor_user_templates".to_owned(), false),
207            ("v2.update_monitor_user_template".to_owned(), false),
208            (
209                "v2.validate_existing_monitor_user_template".to_owned(),
210                false,
211            ),
212            ("v2.validate_monitor_user_template".to_owned(), false),
213            ("v2.list_role_templates".to_owned(), false),
214            ("v2.create_pipeline".to_owned(), false),
215            ("v2.delete_pipeline".to_owned(), false),
216            ("v2.get_pipeline".to_owned(), false),
217            ("v2.list_pipelines".to_owned(), false),
218            ("v2.update_pipeline".to_owned(), false),
219            ("v2.validate_pipeline".to_owned(), false),
220            ("v2.create_scorecard_outcomes_batch".to_owned(), false),
221            ("v2.create_scorecard_rule".to_owned(), false),
222            ("v2.delete_scorecard_rule".to_owned(), false),
223            ("v2.list_scorecard_outcomes".to_owned(), false),
224            ("v2.list_scorecard_rules".to_owned(), false),
225            ("v2.update_scorecard_outcomes_async".to_owned(), false),
226            ("v2.update_scorecard_rule".to_owned(), false),
227            ("v2.create_incident_service".to_owned(), false),
228            ("v2.delete_incident_service".to_owned(), false),
229            ("v2.get_incident_service".to_owned(), false),
230            ("v2.list_incident_services".to_owned(), false),
231            ("v2.update_incident_service".to_owned(), false),
232            ("v2.create_slo_report_job".to_owned(), false),
233            ("v2.get_slo_report".to_owned(), false),
234            ("v2.get_slo_report_job_status".to_owned(), false),
235            ("v2.get_spa_recommendations".to_owned(), false),
236            ("v2.create_sca_resolve_vulnerable_symbols".to_owned(), false),
237            ("v2.create_sca_result".to_owned(), false),
238            ("v2.add_member_team".to_owned(), false),
239            ("v2.list_member_teams".to_owned(), false),
240            ("v2.remove_member_team".to_owned(), false),
241            ("v2.sync_teams".to_owned(), false),
242            ("v2.create_incident_team".to_owned(), false),
243            ("v2.delete_incident_team".to_owned(), false),
244            ("v2.get_incident_team".to_owned(), false),
245            ("v2.list_incident_teams".to_owned(), false),
246            ("v2.update_incident_team".to_owned(), false),
247            ("v2.search_flaky_tests".to_owned(), false),
248        ]);
249        let mut auth_keys: HashMap<String, APIKey> = HashMap::new();
250        auth_keys.insert(
251            "apiKeyAuth".to_owned(),
252            APIKey {
253                key: env::var("DD_API_KEY").unwrap_or_default(),
254                prefix: "".to_owned(),
255            },
256        );
257        auth_keys.insert(
258            "appKeyAuth".to_owned(),
259            APIKey {
260                key: env::var("DD_APP_KEY").unwrap_or_default(),
261                prefix: "".to_owned(),
262            },
263        );
264
265        Self {
266            user_agent: DEFAULT_USER_AGENT.clone(),
267            unstable_operations,
268            auth_keys,
269            server_index: 0,
270            server_variables: HashMap::from([(
271                "site".into(),
272                env::var("DD_SITE").unwrap_or("datadoghq.com".into()),
273            )]),
274            server_operation_index: HashMap::new(),
275            server_operation_variables: HashMap::new(),
276            proxy_url: None,
277            enable_retry: false,
278            max_retries: 3,
279        }
280    }
281}
282
283lazy_static! {
284    pub static ref DEFAULT_USER_AGENT: String = format!(
285        "datadog-api-client-rust/{} (rust {}; os {}; arch {})",
286        option_env!("CARGO_PKG_VERSION").unwrap_or("?"),
287        option_env!("DD_RUSTC_VERSION").unwrap_or("?"),
288        env::consts::OS,
289        env::consts::ARCH,
290    );
291    static ref SERVERS: Vec<ServerConfiguration> = {
292        vec![
293            ServerConfiguration {
294                url: "https://{subdomain}.{site}".into(),
295                description: "No description provided".into(),
296                variables: HashMap::from([
297                    (
298                        "site".into(),
299                        ServerVariable {
300                            description: "The regional site for Datadog customers.".into(),
301                            default_value: "datadoghq.com".into(),
302                            enum_values: vec![
303                                "datadoghq.com".into(),
304                                "us3.datadoghq.com".into(),
305                                "us5.datadoghq.com".into(),
306                                "ap1.datadoghq.com".into(),
307                                "ap2.datadoghq.com".into(),
308                                "datadoghq.eu".into(),
309                                "ddog-gov.com".into(),
310                            ],
311                        },
312                    ),
313                    (
314                        "subdomain".into(),
315                        ServerVariable {
316                            description: "The subdomain where the API is deployed.".into(),
317                            default_value: "api".into(),
318                            enum_values: vec![],
319                        },
320                    ),
321                ]),
322            },
323            ServerConfiguration {
324                url: "{protocol}://{name}".into(),
325                description: "No description provided".into(),
326                variables: HashMap::from([
327                    (
328                        "name".into(),
329                        ServerVariable {
330                            description: "Full site DNS name.".into(),
331                            default_value: "api.datadoghq.com".into(),
332                            enum_values: vec![],
333                        },
334                    ),
335                    (
336                        "protocol".into(),
337                        ServerVariable {
338                            description: "The protocol for accessing the API.".into(),
339                            default_value: "https".into(),
340                            enum_values: vec![],
341                        },
342                    ),
343                ]),
344            },
345            ServerConfiguration {
346                url: "https://{subdomain}.{site}".into(),
347                description: "No description provided".into(),
348                variables: HashMap::from([
349                    (
350                        "site".into(),
351                        ServerVariable {
352                            description: "Any Datadog deployment.".into(),
353                            default_value: "datadoghq.com".into(),
354                            enum_values: vec![],
355                        },
356                    ),
357                    (
358                        "subdomain".into(),
359                        ServerVariable {
360                            description: "The subdomain where the API is deployed.".into(),
361                            default_value: "api".into(),
362                            enum_values: vec![],
363                        },
364                    ),
365                ]),
366            },
367        ]
368    };
369    static ref OPERATION_SERVERS: HashMap<String, Vec<ServerConfiguration>> = {
370        HashMap::from([
371            (
372                "v1.get_ip_ranges".into(),
373                vec![
374                    ServerConfiguration {
375                        url: "https://{subdomain}.{site}".into(),
376                        description: "No description provided".into(),
377                        variables: HashMap::from([
378                            (
379                                "site".into(),
380                                ServerVariable {
381                                    description: "The regional site for Datadog customers.".into(),
382                                    default_value: "datadoghq.com".into(),
383                                    enum_values: vec![
384                                        "datadoghq.com".into(),
385                                        "us3.datadoghq.com".into(),
386                                        "us5.datadoghq.com".into(),
387                                        "ap1.datadoghq.com".into(),
388                                        "ap2.datadoghq.com".into(),
389                                        "datadoghq.eu".into(),
390                                        "ddog-gov.com".into(),
391                                    ],
392                                },
393                            ),
394                            (
395                                "subdomain".into(),
396                                ServerVariable {
397                                    description: "The subdomain where the API is deployed.".into(),
398                                    default_value: "ip-ranges".into(),
399                                    enum_values: vec![],
400                                },
401                            ),
402                        ]),
403                    },
404                    ServerConfiguration {
405                        url: "{protocol}://{name}".into(),
406                        description: "No description provided".into(),
407                        variables: HashMap::from([
408                            (
409                                "name".into(),
410                                ServerVariable {
411                                    description: "Full site DNS name.".into(),
412                                    default_value: "ip-ranges.datadoghq.com".into(),
413                                    enum_values: vec![],
414                                },
415                            ),
416                            (
417                                "protocol".into(),
418                                ServerVariable {
419                                    description: "The protocol for accessing the API.".into(),
420                                    default_value: "https".into(),
421                                    enum_values: vec![],
422                                },
423                            ),
424                        ]),
425                    },
426                    ServerConfiguration {
427                        url: "https://{subdomain}.datadoghq.com".into(),
428                        description: "No description provided".into(),
429                        variables: HashMap::from([(
430                            "subdomain".into(),
431                            ServerVariable {
432                                description: "The subdomain where the API is deployed.".into(),
433                                default_value: "ip-ranges".into(),
434                                enum_values: vec![],
435                            },
436                        )]),
437                    },
438                ],
439            ),
440            (
441                "v1.submit_log".into(),
442                vec![
443                    ServerConfiguration {
444                        url: "https://{subdomain}.{site}".into(),
445                        description: "No description provided".into(),
446                        variables: HashMap::from([
447                            (
448                                "site".into(),
449                                ServerVariable {
450                                    description: "The regional site for Datadog customers.".into(),
451                                    default_value: "datadoghq.com".into(),
452                                    enum_values: vec![
453                                        "datadoghq.com".into(),
454                                        "us3.datadoghq.com".into(),
455                                        "us5.datadoghq.com".into(),
456                                        "ap1.datadoghq.com".into(),
457                                        "ap2.datadoghq.com".into(),
458                                        "datadoghq.eu".into(),
459                                        "ddog-gov.com".into(),
460                                    ],
461                                },
462                            ),
463                            (
464                                "subdomain".into(),
465                                ServerVariable {
466                                    description: "The subdomain where the API is deployed.".into(),
467                                    default_value: "http-intake.logs".into(),
468                                    enum_values: vec![],
469                                },
470                            ),
471                        ]),
472                    },
473                    ServerConfiguration {
474                        url: "{protocol}://{name}".into(),
475                        description: "No description provided".into(),
476                        variables: HashMap::from([
477                            (
478                                "name".into(),
479                                ServerVariable {
480                                    description: "Full site DNS name.".into(),
481                                    default_value: "http-intake.logs.datadoghq.com".into(),
482                                    enum_values: vec![],
483                                },
484                            ),
485                            (
486                                "protocol".into(),
487                                ServerVariable {
488                                    description: "The protocol for accessing the API.".into(),
489                                    default_value: "https".into(),
490                                    enum_values: vec![],
491                                },
492                            ),
493                        ]),
494                    },
495                    ServerConfiguration {
496                        url: "https://{subdomain}.{site}".into(),
497                        description: "No description provided".into(),
498                        variables: HashMap::from([
499                            (
500                                "site".into(),
501                                ServerVariable {
502                                    description: "Any Datadog deployment.".into(),
503                                    default_value: "datadoghq.com".into(),
504                                    enum_values: vec![],
505                                },
506                            ),
507                            (
508                                "subdomain".into(),
509                                ServerVariable {
510                                    description: "The subdomain where the API is deployed.".into(),
511                                    default_value: "http-intake.logs".into(),
512                                    enum_values: vec![],
513                                },
514                            ),
515                        ]),
516                    },
517                ],
518            ),
519            (
520                "v2.create_event".into(),
521                vec![
522                    ServerConfiguration {
523                        url: "https://{subdomain}.{site}".into(),
524                        description: "No description provided".into(),
525                        variables: HashMap::from([
526                            (
527                                "site".into(),
528                                ServerVariable {
529                                    description: "The regional site for customers.".into(),
530                                    default_value: "datadoghq.com".into(),
531                                    enum_values: vec![
532                                        "datadoghq.com".into(),
533                                        "us3.datadoghq.com".into(),
534                                        "us5.datadoghq.com".into(),
535                                        "ap1.datadoghq.com".into(),
536                                        "datadoghq.eu".into(),
537                                        "ddog-gov.com".into(),
538                                    ],
539                                },
540                            ),
541                            (
542                                "subdomain".into(),
543                                ServerVariable {
544                                    description: "The subdomain where the API is deployed.".into(),
545                                    default_value: "event-management-intake".into(),
546                                    enum_values: vec![],
547                                },
548                            ),
549                        ]),
550                    },
551                    ServerConfiguration {
552                        url: "{protocol}://{name}".into(),
553                        description: "No description provided".into(),
554                        variables: HashMap::from([
555                            (
556                                "name".into(),
557                                ServerVariable {
558                                    description: "Full site DNS name.".into(),
559                                    default_value: "event-management-intake.datadoghq.com".into(),
560                                    enum_values: vec![],
561                                },
562                            ),
563                            (
564                                "protocol".into(),
565                                ServerVariable {
566                                    description: "The protocol for accessing the API.".into(),
567                                    default_value: "https".into(),
568                                    enum_values: vec![],
569                                },
570                            ),
571                        ]),
572                    },
573                    ServerConfiguration {
574                        url: "https://{subdomain}.{site}".into(),
575                        description: "No description provided".into(),
576                        variables: HashMap::from([
577                            (
578                                "site".into(),
579                                ServerVariable {
580                                    description: "Any Datadog deployment.".into(),
581                                    default_value: "datadoghq.com".into(),
582                                    enum_values: vec![],
583                                },
584                            ),
585                            (
586                                "subdomain".into(),
587                                ServerVariable {
588                                    description: "The subdomain where the API is deployed.".into(),
589                                    default_value: "event-management-intake".into(),
590                                    enum_values: vec![],
591                                },
592                            ),
593                        ]),
594                    },
595                ],
596            ),
597            (
598                "v2.submit_log".into(),
599                vec![
600                    ServerConfiguration {
601                        url: "https://{subdomain}.{site}".into(),
602                        description: "No description provided".into(),
603                        variables: HashMap::from([
604                            (
605                                "site".into(),
606                                ServerVariable {
607                                    description: "The regional site for customers.".into(),
608                                    default_value: "datadoghq.com".into(),
609                                    enum_values: vec![
610                                        "datadoghq.com".into(),
611                                        "us3.datadoghq.com".into(),
612                                        "us5.datadoghq.com".into(),
613                                        "ap1.datadoghq.com".into(),
614                                        "ap2.datadoghq.com".into(),
615                                        "datadoghq.eu".into(),
616                                        "ddog-gov.com".into(),
617                                    ],
618                                },
619                            ),
620                            (
621                                "subdomain".into(),
622                                ServerVariable {
623                                    description: "The subdomain where the API is deployed.".into(),
624                                    default_value: "http-intake.logs".into(),
625                                    enum_values: vec![],
626                                },
627                            ),
628                        ]),
629                    },
630                    ServerConfiguration {
631                        url: "{protocol}://{name}".into(),
632                        description: "No description provided".into(),
633                        variables: HashMap::from([
634                            (
635                                "name".into(),
636                                ServerVariable {
637                                    description: "Full site DNS name.".into(),
638                                    default_value: "http-intake.logs.datadoghq.com".into(),
639                                    enum_values: vec![],
640                                },
641                            ),
642                            (
643                                "protocol".into(),
644                                ServerVariable {
645                                    description: "The protocol for accessing the API.".into(),
646                                    default_value: "https".into(),
647                                    enum_values: vec![],
648                                },
649                            ),
650                        ]),
651                    },
652                    ServerConfiguration {
653                        url: "https://{subdomain}.{site}".into(),
654                        description: "No description provided".into(),
655                        variables: HashMap::from([
656                            (
657                                "site".into(),
658                                ServerVariable {
659                                    description: "Any Datadog deployment.".into(),
660                                    default_value: "datadoghq.com".into(),
661                                    enum_values: vec![],
662                                },
663                            ),
664                            (
665                                "subdomain".into(),
666                                ServerVariable {
667                                    description: "The subdomain where the API is deployed.".into(),
668                                    default_value: "http-intake.logs".into(),
669                                    enum_values: vec![],
670                                },
671                            ),
672                        ]),
673                    },
674                ],
675            ),
676            (
677                "v2.create_on_call_page".into(),
678                vec![
679                    ServerConfiguration {
680                        url: "https://{site}".into(),
681                        description: "No description provided".into(),
682                        variables: HashMap::from([(
683                            "site".into(),
684                            ServerVariable {
685                                description: "The globally available endpoint for On-Call.".into(),
686                                default_value: "navy.oncall.datadoghq.com".into(),
687                                enum_values: vec![
688                                    "lava.oncall.datadoghq.com".into(),
689                                    "saffron.oncall.datadoghq.com".into(),
690                                    "navy.oncall.datadoghq.com".into(),
691                                    "coral.oncall.datadoghq.com".into(),
692                                    "teal.oncall.datadoghq.com".into(),
693                                    "beige.oncall.datadoghq.eu".into(),
694                                ],
695                            },
696                        )]),
697                    },
698                    ServerConfiguration {
699                        url: "{protocol}://{name}".into(),
700                        description: "No description provided".into(),
701                        variables: HashMap::from([
702                            (
703                                "name".into(),
704                                ServerVariable {
705                                    description: "Full site DNS name.".into(),
706                                    default_value: "api.datadoghq.com".into(),
707                                    enum_values: vec![],
708                                },
709                            ),
710                            (
711                                "protocol".into(),
712                                ServerVariable {
713                                    description: "The protocol for accessing the API.".into(),
714                                    default_value: "https".into(),
715                                    enum_values: vec![],
716                                },
717                            ),
718                        ]),
719                    },
720                    ServerConfiguration {
721                        url: "https://{subdomain}.{site}".into(),
722                        description: "No description provided".into(),
723                        variables: HashMap::from([
724                            (
725                                "site".into(),
726                                ServerVariable {
727                                    description: "Any Datadog deployment.".into(),
728                                    default_value: "datadoghq.com".into(),
729                                    enum_values: vec![],
730                                },
731                            ),
732                            (
733                                "subdomain".into(),
734                                ServerVariable {
735                                    description: "The subdomain where the API is deployed.".into(),
736                                    default_value: "api".into(),
737                                    enum_values: vec![],
738                                },
739                            ),
740                        ]),
741                    },
742                ],
743            ),
744            (
745                "v2.acknowledge_on_call_page".into(),
746                vec![
747                    ServerConfiguration {
748                        url: "https://{site}".into(),
749                        description: "No description provided".into(),
750                        variables: HashMap::from([(
751                            "site".into(),
752                            ServerVariable {
753                                description: "The globally available endpoint for On-Call.".into(),
754                                default_value: "navy.oncall.datadoghq.com".into(),
755                                enum_values: vec![
756                                    "lava.oncall.datadoghq.com".into(),
757                                    "saffron.oncall.datadoghq.com".into(),
758                                    "navy.oncall.datadoghq.com".into(),
759                                    "coral.oncall.datadoghq.com".into(),
760                                    "teal.oncall.datadoghq.com".into(),
761                                    "beige.oncall.datadoghq.eu".into(),
762                                ],
763                            },
764                        )]),
765                    },
766                    ServerConfiguration {
767                        url: "{protocol}://{name}".into(),
768                        description: "No description provided".into(),
769                        variables: HashMap::from([
770                            (
771                                "name".into(),
772                                ServerVariable {
773                                    description: "Full site DNS name.".into(),
774                                    default_value: "api.datadoghq.com".into(),
775                                    enum_values: vec![],
776                                },
777                            ),
778                            (
779                                "protocol".into(),
780                                ServerVariable {
781                                    description: "The protocol for accessing the API.".into(),
782                                    default_value: "https".into(),
783                                    enum_values: vec![],
784                                },
785                            ),
786                        ]),
787                    },
788                    ServerConfiguration {
789                        url: "https://{subdomain}.{site}".into(),
790                        description: "No description provided".into(),
791                        variables: HashMap::from([
792                            (
793                                "site".into(),
794                                ServerVariable {
795                                    description: "Any Datadog deployment.".into(),
796                                    default_value: "datadoghq.com".into(),
797                                    enum_values: vec![],
798                                },
799                            ),
800                            (
801                                "subdomain".into(),
802                                ServerVariable {
803                                    description: "The subdomain where the API is deployed.".into(),
804                                    default_value: "api".into(),
805                                    enum_values: vec![],
806                                },
807                            ),
808                        ]),
809                    },
810                ],
811            ),
812            (
813                "v2.escalate_on_call_page".into(),
814                vec![
815                    ServerConfiguration {
816                        url: "https://{site}".into(),
817                        description: "No description provided".into(),
818                        variables: HashMap::from([(
819                            "site".into(),
820                            ServerVariable {
821                                description: "The globally available endpoint for On-Call.".into(),
822                                default_value: "navy.oncall.datadoghq.com".into(),
823                                enum_values: vec![
824                                    "lava.oncall.datadoghq.com".into(),
825                                    "saffron.oncall.datadoghq.com".into(),
826                                    "navy.oncall.datadoghq.com".into(),
827                                    "coral.oncall.datadoghq.com".into(),
828                                    "teal.oncall.datadoghq.com".into(),
829                                    "beige.oncall.datadoghq.eu".into(),
830                                ],
831                            },
832                        )]),
833                    },
834                    ServerConfiguration {
835                        url: "{protocol}://{name}".into(),
836                        description: "No description provided".into(),
837                        variables: HashMap::from([
838                            (
839                                "name".into(),
840                                ServerVariable {
841                                    description: "Full site DNS name.".into(),
842                                    default_value: "api.datadoghq.com".into(),
843                                    enum_values: vec![],
844                                },
845                            ),
846                            (
847                                "protocol".into(),
848                                ServerVariable {
849                                    description: "The protocol for accessing the API.".into(),
850                                    default_value: "https".into(),
851                                    enum_values: vec![],
852                                },
853                            ),
854                        ]),
855                    },
856                    ServerConfiguration {
857                        url: "https://{subdomain}.{site}".into(),
858                        description: "No description provided".into(),
859                        variables: HashMap::from([
860                            (
861                                "site".into(),
862                                ServerVariable {
863                                    description: "Any Datadog deployment.".into(),
864                                    default_value: "datadoghq.com".into(),
865                                    enum_values: vec![],
866                                },
867                            ),
868                            (
869                                "subdomain".into(),
870                                ServerVariable {
871                                    description: "The subdomain where the API is deployed.".into(),
872                                    default_value: "api".into(),
873                                    enum_values: vec![],
874                                },
875                            ),
876                        ]),
877                    },
878                ],
879            ),
880            (
881                "v2.resolve_on_call_page".into(),
882                vec![
883                    ServerConfiguration {
884                        url: "https://{site}".into(),
885                        description: "No description provided".into(),
886                        variables: HashMap::from([(
887                            "site".into(),
888                            ServerVariable {
889                                description: "The globally available endpoint for On-Call.".into(),
890                                default_value: "navy.oncall.datadoghq.com".into(),
891                                enum_values: vec![
892                                    "lava.oncall.datadoghq.com".into(),
893                                    "saffron.oncall.datadoghq.com".into(),
894                                    "navy.oncall.datadoghq.com".into(),
895                                    "coral.oncall.datadoghq.com".into(),
896                                    "teal.oncall.datadoghq.com".into(),
897                                    "beige.oncall.datadoghq.eu".into(),
898                                ],
899                            },
900                        )]),
901                    },
902                    ServerConfiguration {
903                        url: "{protocol}://{name}".into(),
904                        description: "No description provided".into(),
905                        variables: HashMap::from([
906                            (
907                                "name".into(),
908                                ServerVariable {
909                                    description: "Full site DNS name.".into(),
910                                    default_value: "api.datadoghq.com".into(),
911                                    enum_values: vec![],
912                                },
913                            ),
914                            (
915                                "protocol".into(),
916                                ServerVariable {
917                                    description: "The protocol for accessing the API.".into(),
918                                    default_value: "https".into(),
919                                    enum_values: vec![],
920                                },
921                            ),
922                        ]),
923                    },
924                    ServerConfiguration {
925                        url: "https://{subdomain}.{site}".into(),
926                        description: "No description provided".into(),
927                        variables: HashMap::from([
928                            (
929                                "site".into(),
930                                ServerVariable {
931                                    description: "Any Datadog deployment.".into(),
932                                    default_value: "datadoghq.com".into(),
933                                    enum_values: vec![],
934                                },
935                            ),
936                            (
937                                "subdomain".into(),
938                                ServerVariable {
939                                    description: "The subdomain where the API is deployed.".into(),
940                                    default_value: "api".into(),
941                                    enum_values: vec![],
942                                },
943                            ),
944                        ]),
945                    },
946                ],
947            ),
948        ])
949    };
950}