pub struct Webhook { /* private fields */ }Implementations§
Source§impl Webhook
impl Webhook
pub fn new(mailerlite: MailerLite) -> Self
Sourcepub async fn create(&self, form: Data) -> Response
pub async fn create(&self, form: Data) -> Response
Examples found in repository?
examples/create_webhook.rs (line 14)
4async fn main() {
5 let api_key: String = String::from("Your MailerLite API Key");
6
7 let mailerlite: MailerLite = MailerLite::new(api_key);
8
9 let data: Data = Data::new()
10 .add("name", "Dummy Webhook")
11 .add("events[]", "subscriber.created")
12 .add("url", "https://www.cartwright.info/eligendi-soluta-corporis-in-quod-ullam");
13
14 let response: Response = mailerlite.webhook().create(data.clone()).await;
15
16 println!("{:#?}", response);
17}Sourcepub async fn update(&self, id: String, form: Data) -> Response
pub async fn update(&self, id: String, form: Data) -> Response
Examples found in repository?
examples/update_webhook.rs (line 13)
4async fn main() {
5 let api_key: String = String::from("Your MailerLite API Key");
6
7 let mailerlite: MailerLite = MailerLite::new(api_key);
8
9 let id: String = String::from("Your Webhook ID");
10
11 let data: Data = Data::new().add("name", "Dummy Webhook");
12
13 let response: Response = mailerlite.webhook().update(id, data.clone()).await;
14
15 println!("{:#?}", response);
16}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Webhook
impl !RefUnwindSafe for Webhook
impl Send for Webhook
impl Sync for Webhook
impl Unpin for Webhook
impl !UnwindSafe for Webhook
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