pub struct WebhookNotifier {
pub url: String,
pub url_params: Option<HashMap<String, String>>,
pub title: String,
pub body_template: String,
pub client: Client,
pub method: Option<String>,
pub secret: Option<String>,
pub headers: Option<HashMap<String, String>>,
pub payload_fields: Option<HashMap<String, Value>>,
}
Expand description
Implementation of webhook notifications via webhooks
Fields§
§url: String
Webhook URL for message delivery
url_params: Option<HashMap<String, String>>
URL parameters to use for the webhook request
title: String
Title to display in the message
body_template: String
Message template with variable placeholders
client: Client
HTTP client for webhook requests
method: Option<String>
HTTP method to use for the webhook request
secret: Option<String>
Secret to use for the webhook request
headers: Option<HashMap<String, String>>
Headers to use for the webhook request
payload_fields: Option<HashMap<String, Value>>
Payload fields to use for the webhook request
Implementations§
Source§impl WebhookNotifier
impl WebhookNotifier
Sourcepub fn new(config: WebhookConfig) -> Result<Self, Box<NotificationError>>
pub fn new(config: WebhookConfig) -> Result<Self, Box<NotificationError>>
Sourcepub fn from_config(config: &TriggerTypeConfig) -> Option<Self>
pub fn from_config(config: &TriggerTypeConfig) -> Option<Self>
pub fn sign_request( &self, secret: &str, payload: &WebhookMessage, ) -> Result<(String, String), Box<NotificationError>>
Trait Implementations§
Source§impl Notifier for WebhookNotifier
impl Notifier for WebhookNotifier
Source§fn notify<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn notify<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for WebhookNotifier
impl !RefUnwindSafe for WebhookNotifier
impl Send for WebhookNotifier
impl Sync for WebhookNotifier
impl Unpin for WebhookNotifier
impl !UnwindSafe for WebhookNotifier
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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more