pub struct WebhooksIntegrationAPI { /* private fields */ }
Expand description
Configure your Datadog-Webhooks integration directly through the Datadog API. See the Webhooks integration page for more information.
Implementations§
Source§impl WebhooksIntegrationAPI
impl WebhooksIntegrationAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
6async fn main() {
7 let configuration = datadog::Configuration::new();
8 let api = WebhooksIntegrationAPI::with_config(configuration);
9 let resp = api
10 .get_webhooks_integration_custom_variable("custom_variable_name".to_string())
11 .await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
More examples
6async fn main() {
7 // there is a valid "webhook" in the system
8 let webhook_name = std::env::var("WEBHOOK_NAME").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = WebhooksIntegrationAPI::with_config(configuration);
11 let resp = api.get_webhooks_integration(webhook_name.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
6async fn main() {
7 // there is a valid "webhook" in the system
8 let webhook_name = std::env::var("WEBHOOK_NAME").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = WebhooksIntegrationAPI::with_config(configuration);
11 let resp = api.delete_webhooks_integration(webhook_name.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
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}
7async fn main() {
8 let body = WebhooksIntegrationCustomVariable::new(
9 true,
10 "EXAMPLEWEBHOOKSINTEGRATION".to_string(),
11 "CUSTOM_VARIABLE_VALUE".to_string(),
12 );
13 let configuration = datadog::Configuration::new();
14 let api = WebhooksIntegrationAPI::with_config(configuration);
15 let resp = api.create_webhooks_integration_custom_variable(body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
6async fn main() {
7 // there is a valid "webhook_custom_variable" in the system
8 let webhook_custom_variable_name = std::env::var("WEBHOOK_CUSTOM_VARIABLE_NAME").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = WebhooksIntegrationAPI::with_config(configuration);
11 let resp = api
12 .delete_webhooks_integration_custom_variable(webhook_custom_variable_name.clone())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_webhooks_integration(
&self,
body: WebhooksIntegration,
) -> Result<WebhooksIntegration, Error<CreateWebhooksIntegrationError>>
pub async fn create_webhooks_integration( &self, body: WebhooksIntegration, ) -> Result<WebhooksIntegration, Error<CreateWebhooksIntegrationError>>
Creates an endpoint with the name <WEBHOOK_NAME>
.
Examples found in repository?
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}
Sourcepub async fn create_webhooks_integration_with_http_info(
&self,
body: WebhooksIntegration,
) -> Result<ResponseContent<WebhooksIntegration>, Error<CreateWebhooksIntegrationError>>
pub async fn create_webhooks_integration_with_http_info( &self, body: WebhooksIntegration, ) -> Result<ResponseContent<WebhooksIntegration>, Error<CreateWebhooksIntegrationError>>
Creates an endpoint with the name <WEBHOOK_NAME>
.
Sourcepub async fn create_webhooks_integration_custom_variable(
&self,
body: WebhooksIntegrationCustomVariable,
) -> Result<WebhooksIntegrationCustomVariableResponse, Error<CreateWebhooksIntegrationCustomVariableError>>
pub async fn create_webhooks_integration_custom_variable( &self, body: WebhooksIntegrationCustomVariable, ) -> Result<WebhooksIntegrationCustomVariableResponse, Error<CreateWebhooksIntegrationCustomVariableError>>
Creates an endpoint with the name <CUSTOM_VARIABLE_NAME>
.
Examples found in repository?
7async fn main() {
8 let body = WebhooksIntegrationCustomVariable::new(
9 true,
10 "EXAMPLEWEBHOOKSINTEGRATION".to_string(),
11 "CUSTOM_VARIABLE_VALUE".to_string(),
12 );
13 let configuration = datadog::Configuration::new();
14 let api = WebhooksIntegrationAPI::with_config(configuration);
15 let resp = api.create_webhooks_integration_custom_variable(body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
Sourcepub async fn create_webhooks_integration_custom_variable_with_http_info(
&self,
body: WebhooksIntegrationCustomVariable,
) -> Result<ResponseContent<WebhooksIntegrationCustomVariableResponse>, Error<CreateWebhooksIntegrationCustomVariableError>>
pub async fn create_webhooks_integration_custom_variable_with_http_info( &self, body: WebhooksIntegrationCustomVariable, ) -> Result<ResponseContent<WebhooksIntegrationCustomVariableResponse>, Error<CreateWebhooksIntegrationCustomVariableError>>
Creates an endpoint with the name <CUSTOM_VARIABLE_NAME>
.
Sourcepub async fn delete_webhooks_integration(
&self,
webhook_name: String,
) -> Result<(), Error<DeleteWebhooksIntegrationError>>
pub async fn delete_webhooks_integration( &self, webhook_name: String, ) -> Result<(), Error<DeleteWebhooksIntegrationError>>
Deletes the endpoint with the name <WEBHOOK NAME>
.
Examples found in repository?
6async fn main() {
7 // there is a valid "webhook" in the system
8 let webhook_name = std::env::var("WEBHOOK_NAME").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = WebhooksIntegrationAPI::with_config(configuration);
11 let resp = api.delete_webhooks_integration(webhook_name.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn delete_webhooks_integration_with_http_info(
&self,
webhook_name: String,
) -> Result<ResponseContent<()>, Error<DeleteWebhooksIntegrationError>>
pub async fn delete_webhooks_integration_with_http_info( &self, webhook_name: String, ) -> Result<ResponseContent<()>, Error<DeleteWebhooksIntegrationError>>
Deletes the endpoint with the name <WEBHOOK NAME>
.
Sourcepub async fn delete_webhooks_integration_custom_variable(
&self,
custom_variable_name: String,
) -> Result<(), Error<DeleteWebhooksIntegrationCustomVariableError>>
pub async fn delete_webhooks_integration_custom_variable( &self, custom_variable_name: String, ) -> Result<(), Error<DeleteWebhooksIntegrationCustomVariableError>>
Deletes the endpoint with the name <CUSTOM_VARIABLE_NAME>
.
Examples found in repository?
6async fn main() {
7 // there is a valid "webhook_custom_variable" in the system
8 let webhook_custom_variable_name = std::env::var("WEBHOOK_CUSTOM_VARIABLE_NAME").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = WebhooksIntegrationAPI::with_config(configuration);
11 let resp = api
12 .delete_webhooks_integration_custom_variable(webhook_custom_variable_name.clone())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
Sourcepub async fn delete_webhooks_integration_custom_variable_with_http_info(
&self,
custom_variable_name: String,
) -> Result<ResponseContent<()>, Error<DeleteWebhooksIntegrationCustomVariableError>>
pub async fn delete_webhooks_integration_custom_variable_with_http_info( &self, custom_variable_name: String, ) -> Result<ResponseContent<()>, Error<DeleteWebhooksIntegrationCustomVariableError>>
Deletes the endpoint with the name <CUSTOM_VARIABLE_NAME>
.
Sourcepub async fn get_webhooks_integration(
&self,
webhook_name: String,
) -> Result<WebhooksIntegration, Error<GetWebhooksIntegrationError>>
pub async fn get_webhooks_integration( &self, webhook_name: String, ) -> Result<WebhooksIntegration, Error<GetWebhooksIntegrationError>>
Gets the content of the webhook with the name <WEBHOOK_NAME>
.
Examples found in repository?
6async fn main() {
7 // there is a valid "webhook" in the system
8 let webhook_name = std::env::var("WEBHOOK_NAME").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = WebhooksIntegrationAPI::with_config(configuration);
11 let resp = api.get_webhooks_integration(webhook_name.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn get_webhooks_integration_with_http_info(
&self,
webhook_name: String,
) -> Result<ResponseContent<WebhooksIntegration>, Error<GetWebhooksIntegrationError>>
pub async fn get_webhooks_integration_with_http_info( &self, webhook_name: String, ) -> Result<ResponseContent<WebhooksIntegration>, Error<GetWebhooksIntegrationError>>
Gets the content of the webhook with the name <WEBHOOK_NAME>
.
Sourcepub async fn get_webhooks_integration_custom_variable(
&self,
custom_variable_name: String,
) -> Result<WebhooksIntegrationCustomVariableResponse, Error<GetWebhooksIntegrationCustomVariableError>>
pub async fn get_webhooks_integration_custom_variable( &self, custom_variable_name: String, ) -> Result<WebhooksIntegrationCustomVariableResponse, Error<GetWebhooksIntegrationCustomVariableError>>
Shows the content of the custom variable with the name <CUSTOM_VARIABLE_NAME>
.
If the custom variable is secret, the value does not return in the response payload.
Examples found in repository?
6async fn main() {
7 let configuration = datadog::Configuration::new();
8 let api = WebhooksIntegrationAPI::with_config(configuration);
9 let resp = api
10 .get_webhooks_integration_custom_variable("custom_variable_name".to_string())
11 .await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn get_webhooks_integration_custom_variable_with_http_info(
&self,
custom_variable_name: String,
) -> Result<ResponseContent<WebhooksIntegrationCustomVariableResponse>, Error<GetWebhooksIntegrationCustomVariableError>>
pub async fn get_webhooks_integration_custom_variable_with_http_info( &self, custom_variable_name: String, ) -> Result<ResponseContent<WebhooksIntegrationCustomVariableResponse>, Error<GetWebhooksIntegrationCustomVariableError>>
Shows the content of the custom variable with the name <CUSTOM_VARIABLE_NAME>
.
If the custom variable is secret, the value does not return in the response payload.
Sourcepub async fn update_webhooks_integration(
&self,
webhook_name: String,
body: WebhooksIntegrationUpdateRequest,
) -> Result<WebhooksIntegration, Error<UpdateWebhooksIntegrationError>>
pub async fn update_webhooks_integration( &self, webhook_name: String, body: WebhooksIntegrationUpdateRequest, ) -> Result<WebhooksIntegration, Error<UpdateWebhooksIntegrationError>>
Updates the endpoint with the name <WEBHOOK_NAME>
.
Examples found in repository?
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}
Sourcepub async fn update_webhooks_integration_with_http_info(
&self,
webhook_name: String,
body: WebhooksIntegrationUpdateRequest,
) -> Result<ResponseContent<WebhooksIntegration>, Error<UpdateWebhooksIntegrationError>>
pub async fn update_webhooks_integration_with_http_info( &self, webhook_name: String, body: WebhooksIntegrationUpdateRequest, ) -> Result<ResponseContent<WebhooksIntegration>, Error<UpdateWebhooksIntegrationError>>
Updates the endpoint with the name <WEBHOOK_NAME>
.
Sourcepub async fn update_webhooks_integration_custom_variable(
&self,
custom_variable_name: String,
body: WebhooksIntegrationCustomVariableUpdateRequest,
) -> Result<WebhooksIntegrationCustomVariableResponse, Error<UpdateWebhooksIntegrationCustomVariableError>>
pub async fn update_webhooks_integration_custom_variable( &self, custom_variable_name: String, body: WebhooksIntegrationCustomVariableUpdateRequest, ) -> Result<WebhooksIntegrationCustomVariableResponse, Error<UpdateWebhooksIntegrationCustomVariableError>>
Updates the endpoint with the name <CUSTOM_VARIABLE_NAME>
.
Examples found in repository?
7async fn main() {
8 // there is a valid "webhook_custom_variable" in the system
9 let webhook_custom_variable_name = std::env::var("WEBHOOK_CUSTOM_VARIABLE_NAME").unwrap();
10 let body =
11 WebhooksIntegrationCustomVariableUpdateRequest::new().value("variable-updated".to_string());
12 let configuration = datadog::Configuration::new();
13 let api = WebhooksIntegrationAPI::with_config(configuration);
14 let resp = api
15 .update_webhooks_integration_custom_variable(webhook_custom_variable_name.clone(), body)
16 .await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
Sourcepub async fn update_webhooks_integration_custom_variable_with_http_info(
&self,
custom_variable_name: String,
body: WebhooksIntegrationCustomVariableUpdateRequest,
) -> Result<ResponseContent<WebhooksIntegrationCustomVariableResponse>, Error<UpdateWebhooksIntegrationCustomVariableError>>
pub async fn update_webhooks_integration_custom_variable_with_http_info( &self, custom_variable_name: String, body: WebhooksIntegrationCustomVariableUpdateRequest, ) -> Result<ResponseContent<WebhooksIntegrationCustomVariableResponse>, Error<UpdateWebhooksIntegrationCustomVariableError>>
Updates the endpoint with the name <CUSTOM_VARIABLE_NAME>
.
Trait Implementations§
Source§impl Clone for WebhooksIntegrationAPI
impl Clone for WebhooksIntegrationAPI
Source§fn clone(&self) -> WebhooksIntegrationAPI
fn clone(&self) -> WebhooksIntegrationAPI
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more