sendinblue_v3/models/update_webhook.rs
1/*
2 * SendinBlue API
3 *
4 * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at https://github.com/orgs/sendinblue **Possible responses** | Code | Message | | :-------------: | ------------- | | 200 | OK. Successful Request | | 201 | OK. Successful Creation | | 202 | OK. Request accepted | | 204 | OK. Successful Update/Deletion | | 400 | Error. Bad Request | | 401 | Error. Authentication Needed | | 402 | Error. Not enough credit, plan upgrade needed | | 403 | Error. Permission denied | | 404 | Error. Object does not exist | | 405 | Error. Method not allowed | | 406 | Error. Not Acceptable |
5 *
6 * The version of the OpenAPI document: 3.0.0
7 * Contact: contact@sendinblue.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct UpdateWebhook {
16 /// URL of the webhook
17 #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
18 pub url: Option<String>,
19 /// Description of the webhook
20 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21 pub description: Option<String>,
22 /// Events triggering the webhook. Possible values for Transactional type webhook – `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` and possible values for Marketing type webhook – `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` and `delivered`
23 #[serde(rename = "events", skip_serializing_if = "Option::is_none")]
24 pub events: Option<Vec<Events>>,
25}
26
27impl UpdateWebhook {
28 pub fn new() -> UpdateWebhook {
29 UpdateWebhook {
30 url: None,
31 description: None,
32 events: None,
33 }
34 }
35}
36
37/// Events triggering the webhook. Possible values for Transactional type webhook – `sent` OR `request`, `delivered`, `hardBounce`, `softBounce`, `blocked`, `spam`, `invalid`, `deferred`, `click`, `opened`, `uniqueOpened` and `unsubscribed` and possible values for Marketing type webhook – `spam`, `opened`, `click`, `hardBounce`, `softBounce`, `unsubscribed`, `listAddition` and `delivered`
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum Events {
40 #[serde(rename = "hardBounce")]
41 HardBounce,
42 #[serde(rename = "softBounce")]
43 SoftBounce,
44 #[serde(rename = "blocked")]
45 Blocked,
46 #[serde(rename = "spam")]
47 Spam,
48 #[serde(rename = "delivered")]
49 Delivered,
50 #[serde(rename = "request")]
51 Request,
52 #[serde(rename = "click")]
53 Click,
54 #[serde(rename = "invalid")]
55 Invalid,
56 #[serde(rename = "deferred")]
57 Deferred,
58 #[serde(rename = "opened")]
59 Opened,
60 #[serde(rename = "uniqueOpened")]
61 UniqueOpened,
62 #[serde(rename = "unsubscribed")]
63 Unsubscribed,
64 #[serde(rename = "listAddition")]
65 ListAddition,
66 #[serde(rename = "contactUpdated")]
67 ContactUpdated,
68 #[serde(rename = "contactDeleted")]
69 ContactDeleted,
70}
71
72impl Default for Events {
73 fn default() -> Events {
74 Self::HardBounce
75 }
76}
77