#[non_exhaustive]pub struct WebhooksIntegration {
pub custom_headers: Option<Option<String>>,
pub encode_as: Option<WebhooksIntegrationEncoding>,
pub name: String,
pub payload: Option<Option<String>>,
pub url: String,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Datadog-Webhooks integration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.custom_headers: Option<Option<String>>
If null
, uses no header.
If given a JSON payload, these will be headers attached to your webhook.
encode_as: Option<WebhooksIntegrationEncoding>
Encoding type. Can be given either json
or form
.
name: String
The name of the webhook. It corresponds with <WEBHOOK_NAME>
.
Learn more on how to use it in
monitor notifications.
payload: Option<Option<String>>
If null
, uses the default payload.
If given a JSON payload, the webhook returns the payload
specified by the given payload.
Webhooks variable usage.
url: String
URL of the webhook.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl WebhooksIntegration
impl WebhooksIntegration
Sourcepub fn new(name: String, url: String) -> WebhooksIntegration
pub fn new(name: String, url: String) -> WebhooksIntegration
Examples found in repository?
examples/v1_webhooks-integration_CreateWebhooksIntegration.rs (lines 8-11)
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}
pub fn custom_headers(self, value: Option<String>) -> Self
pub fn encode_as(self, value: WebhooksIntegrationEncoding) -> Self
pub fn payload(self, value: Option<String>) -> Self
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for WebhooksIntegration
impl Clone for WebhooksIntegration
Source§fn clone(&self) -> WebhooksIntegration
fn clone(&self) -> WebhooksIntegration
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for WebhooksIntegration
impl Debug for WebhooksIntegration
Source§impl<'de> Deserialize<'de> for WebhooksIntegration
impl<'de> Deserialize<'de> for WebhooksIntegration
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for WebhooksIntegration
impl PartialEq for WebhooksIntegration
Source§impl Serialize for WebhooksIntegration
impl Serialize for WebhooksIntegration
impl StructuralPartialEq for WebhooksIntegration
Auto Trait Implementations§
impl Freeze for WebhooksIntegration
impl RefUnwindSafe for WebhooksIntegration
impl Send for WebhooksIntegration
impl Sync for WebhooksIntegration
impl Unpin for WebhooksIntegration
impl UnwindSafe for WebhooksIntegration
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
Mutably borrows from an owned value. Read more