v2_fastly_integration_CreateFastlyAccount/
v2_fastly-integration_CreateFastlyAccount.rs

1// Add Fastly account returns "CREATED" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV2::api_fastly_integration::FastlyIntegrationAPI;
4use datadog_api_client::datadogV2::model::FastlyAccountCreateRequest;
5use datadog_api_client::datadogV2::model::FastlyAccountCreateRequestAttributes;
6use datadog_api_client::datadogV2::model::FastlyAccountCreateRequestData;
7use datadog_api_client::datadogV2::model::FastlyAccountType;
8
9#[tokio::main]
10async fn main() {
11    let body = FastlyAccountCreateRequest::new(FastlyAccountCreateRequestData::new(
12        FastlyAccountCreateRequestAttributes::new(
13            "ExampleFastlyIntegration".to_string(),
14            "Example-Fastly-Integration".to_string(),
15        )
16        .services(vec![]),
17        FastlyAccountType::FASTLY_ACCOUNTS,
18    ));
19    let configuration = datadog::Configuration::new();
20    let api = FastlyIntegrationAPI::with_config(configuration);
21    let resp = api.create_fastly_account(body).await;
22    if let Ok(value) = resp {
23        println!("{:#?}", value);
24    } else {
25        println!("{:#?}", resp.unwrap_err());
26    }
27}