v2_api_management_GetOpenAPI/
v2_api-management_GetOpenAPI.rs

1// Get an API returns "OK" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV2::api_api_management::APIManagementAPI;
4
5#[tokio::main]
6async fn main() {
7    // there is a valid "managed_api" in the system
8    let managed_api_data_id = uuid::Uuid::parse_str(&std::env::var("MANAGED_API_DATA_ID").unwrap())
9        .expect("Invalid UUID");
10    let mut configuration = datadog::Configuration::new();
11    configuration.set_unstable_operation_enabled("v2.GetOpenAPI", true);
12    let api = APIManagementAPI::with_config(configuration);
13    let resp = api.get_open_api(managed_api_data_id.clone()).await;
14    if let Ok(value) = resp {
15        println!("{:#?}", value);
16    } else {
17        println!("{:#?}", resp.unwrap_err());
18    }
19}