v1_synthetics_CreateGlobalVariable_3298562511/
v1_synthetics_CreateGlobalVariable_3298562511.rs

1// Create a FIDO global variable returns "OK" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV1::api_synthetics::SyntheticsAPI;
4use datadog_api_client::datadogV1::model::SyntheticsGlobalVariableRequest;
5
6#[tokio::main]
7async fn main() {
8    let body = SyntheticsGlobalVariableRequest::new(
9        "".to_string(),
10        "GLOBAL_VARIABLE_FIDO_PAYLOAD_EXAMPLESYNTHETIC".to_string(),
11        vec![],
12    )
13    .is_fido(true);
14    let configuration = datadog::Configuration::new();
15    let api = SyntheticsAPI::with_config(configuration);
16    let resp = api.create_global_variable(body).await;
17    if let Ok(value) = resp {
18        println!("{:#?}", value);
19    } else {
20        println!("{:#?}", resp.unwrap_err());
21    }
22}