v1_webhooks_integration_UpdateWebhooksIntegration/
v1_webhooks-integration_UpdateWebhooksIntegration.rs

1// Update a webhook returns "OK" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV1::api_webhooks_integration::WebhooksIntegrationAPI;
4use datadog_api_client::datadogV1::model::WebhooksIntegrationUpdateRequest;
5
6#[tokio::main]
7async fn main() {
8    // there is a valid "webhook" in the system
9    let webhook_name = std::env::var("WEBHOOK_NAME").unwrap();
10    let body = WebhooksIntegrationUpdateRequest::new()
11        .url("https://example.com/webhook-updated".to_string());
12    let configuration = datadog::Configuration::new();
13    let api = WebhooksIntegrationAPI::with_config(configuration);
14    let resp = api
15        .update_webhooks_integration(webhook_name.clone(), body)
16        .await;
17    if let Ok(value) = resp {
18        println!("{:#?}", value);
19    } else {
20        println!("{:#?}", resp.unwrap_err());
21    }
22}