#[non_exhaustive]pub struct WebhooksIntegrationUpdateRequest {
pub custom_headers: Option<String>,
pub encode_as: Option<WebhooksIntegrationEncoding>,
pub name: Option<String>,
pub payload: Option<Option<String>>,
pub url: Option<String>,
pub additional_properties: BTreeMap<String, Value>,
/* private fields */
}
Expand description
Update request of a Webhooks integration object.
All properties are optional.
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<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: Option<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: Option<String>
URL of the webhook.
additional_properties: BTreeMap<String, Value>
Implementations§
Source§impl WebhooksIntegrationUpdateRequest
impl WebhooksIntegrationUpdateRequest
Sourcepub fn new() -> WebhooksIntegrationUpdateRequest
pub fn new() -> WebhooksIntegrationUpdateRequest
Examples found in repository?
examples/v1_webhooks-integration_UpdateWebhooksIntegration.rs (line 10)
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}
pub fn custom_headers(self, value: String) -> Self
pub fn encode_as(self, value: WebhooksIntegrationEncoding) -> Self
pub fn name(self, value: String) -> Self
pub fn payload(self, value: Option<String>) -> Self
Sourcepub fn url(self, value: String) -> Self
pub fn url(self, value: String) -> Self
Examples found in repository?
examples/v1_webhooks-integration_UpdateWebhooksIntegration.rs (line 11)
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}
pub fn additional_properties(self, value: BTreeMap<String, Value>) -> Self
Trait Implementations§
Source§impl Clone for WebhooksIntegrationUpdateRequest
impl Clone for WebhooksIntegrationUpdateRequest
Source§fn clone(&self) -> WebhooksIntegrationUpdateRequest
fn clone(&self) -> WebhooksIntegrationUpdateRequest
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<'de> Deserialize<'de> for WebhooksIntegrationUpdateRequest
impl<'de> Deserialize<'de> for WebhooksIntegrationUpdateRequest
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 WebhooksIntegrationUpdateRequest
impl PartialEq for WebhooksIntegrationUpdateRequest
Source§fn eq(&self, other: &WebhooksIntegrationUpdateRequest) -> bool
fn eq(&self, other: &WebhooksIntegrationUpdateRequest) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.impl StructuralPartialEq for WebhooksIntegrationUpdateRequest
Auto Trait Implementations§
impl Freeze for WebhooksIntegrationUpdateRequest
impl RefUnwindSafe for WebhooksIntegrationUpdateRequest
impl Send for WebhooksIntegrationUpdateRequest
impl Sync for WebhooksIntegrationUpdateRequest
impl Unpin for WebhooksIntegrationUpdateRequest
impl UnwindSafe for WebhooksIntegrationUpdateRequest
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