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?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api
.get_webhooks_integration_custom_variable("custom_variable_name".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
More examples
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "webhook" in the system
let webhook_name = std::env::var("WEBHOOK_NAME").unwrap();
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api.get_webhooks_integration(webhook_name.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "webhook" in the system
let webhook_name = std::env::var("WEBHOOK_NAME").unwrap();
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api.delete_webhooks_integration(webhook_name.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
7 8 9 10 11 12 13 14 15 16 17 18 19 20
async fn main() {
let body = WebhooksIntegration::new(
"Example-Webhooks-Integration".to_string(),
"https://example.com/webhook".to_string(),
);
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api.create_webhooks_integration(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
async fn main() {
let body = WebhooksIntegrationCustomVariable::new(
true,
"EXAMPLEWEBHOOKSINTEGRATION".to_string(),
"CUSTOM_VARIABLE_VALUE".to_string(),
);
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api.create_webhooks_integration_custom_variable(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "webhook_custom_variable" in the system
let webhook_custom_variable_name = std::env::var("WEBHOOK_CUSTOM_VARIABLE_NAME").unwrap();
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api
.delete_webhooks_integration_custom_variable(webhook_custom_variable_name.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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?
7 8 9 10 11 12 13 14 15 16 17 18 19 20
async fn main() {
let body = WebhooksIntegration::new(
"Example-Webhooks-Integration".to_string(),
"https://example.com/webhook".to_string(),
);
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api.create_webhooks_integration(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
async fn main() {
let body = WebhooksIntegrationCustomVariable::new(
true,
"EXAMPLEWEBHOOKSINTEGRATION".to_string(),
"CUSTOM_VARIABLE_VALUE".to_string(),
);
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api.create_webhooks_integration_custom_variable(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "webhook" in the system
let webhook_name = std::env::var("WEBHOOK_NAME").unwrap();
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api.delete_webhooks_integration(webhook_name.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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?
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "webhook_custom_variable" in the system
let webhook_custom_variable_name = std::env::var("WEBHOOK_CUSTOM_VARIABLE_NAME").unwrap();
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api
.delete_webhooks_integration_custom_variable(webhook_custom_variable_name.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "webhook" in the system
let webhook_name = std::env::var("WEBHOOK_NAME").unwrap();
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api.get_webhooks_integration(webhook_name.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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?
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api
.get_webhooks_integration_custom_variable("custom_variable_name".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
// there is a valid "webhook" in the system
let webhook_name = std::env::var("WEBHOOK_NAME").unwrap();
let body = WebhooksIntegrationUpdateRequest::new()
.url("https://example.com/webhook-updated".to_string());
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api
.update_webhooks_integration(webhook_name.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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?
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
async fn main() {
// there is a valid "webhook_custom_variable" in the system
let webhook_custom_variable_name = std::env::var("WEBHOOK_CUSTOM_VARIABLE_NAME").unwrap();
let body =
WebhooksIntegrationCustomVariableUpdateRequest::new().value("variable-updated".to_string());
let configuration = datadog::Configuration::new();
let api = WebhooksIntegrationAPI::with_config(configuration);
let resp = api
.update_webhooks_integration_custom_variable(webhook_custom_variable_name.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WebhooksIntegrationAPI
impl Debug for WebhooksIntegrationAPI
Auto Trait Implementations§
impl Freeze for WebhooksIntegrationAPI
impl !RefUnwindSafe for WebhooksIntegrationAPI
impl Send for WebhooksIntegrationAPI
impl Sync for WebhooksIntegrationAPI
impl Unpin for WebhooksIntegrationAPI
impl !UnwindSafe for WebhooksIntegrationAPI
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)