sendinblue_v3/models/
get_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 GetWebhook {
16    /// URL of the webhook
17    #[serde(rename = "url")]
18    pub url: String,
19    /// ID of the webhook
20    #[serde(rename = "id")]
21    pub id: i64,
22    /// Description of the webhook
23    #[serde(rename = "description")]
24    pub description: String,
25    #[serde(rename = "events")]
26    pub events: Vec<String>,
27    /// Type of webhook (marketing or transac)
28    #[serde(rename = "type")]
29    pub r#type: RHashType,
30    /// Creation UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ)
31    #[serde(rename = "createdAt")]
32    pub created_at: String,
33    /// Last modification UTC date-time of the webhook (YYYY-MM-DDTHH:mm:ss.SSSZ)
34    #[serde(rename = "modifiedAt")]
35    pub modified_at: String,
36}
37
38impl GetWebhook {
39    pub fn new(url: String, id: i64, description: String, events: Vec<String>, r#type: RHashType, created_at: String, modified_at: String) -> GetWebhook {
40        GetWebhook {
41            url,
42            id,
43            description,
44            events,
45            r#type,
46            created_at,
47            modified_at,
48        }
49    }
50}
51
52/// Type of webhook (marketing or transac)
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum RHashType {
55    #[serde(rename = "marketing")]
56    Marketing,
57    #[serde(rename = "transac")]
58    Transac,
59}
60
61impl Default for RHashType {
62    fn default() -> RHashType {
63        Self::Marketing
64    }
65}
66