v1_webhooks_integration_CreateWebhooksIntegration/
v1_webhooks-integration_CreateWebhooksIntegration.rs

1// Create a webhooks integration returns "OK" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI;
4use datadog_api_client::datadogV1::model::WebhooksIntegration;
5
6#[tokio::main]
7async fn main() {
8    let body = WebhooksIntegration::new(
9        "Example-Webhooks-Integration".to_string(),
10        "https://example.com/webhook".to_string(),
11    );
12    let configuration = datadog::Configuration::new();
13    let api = WebhooksIntegrationAPI::with_config(configuration);
14    let resp = api.create_webhooks_integration(body).await;
15    if let Ok(value) = resp {
16        println!("{:#?}", value);
17    } else {
18        println!("{:#?}", resp.unwrap_err());
19    }
20}