brevo/models/
get_email_event_report_events_inner.rs

1/*
2 * Brevo API
3 *
4 * Brevo 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/brevo  **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  |   | 422  | Error. Unprocessable Entity |
5 *
6 * The version of the OpenAPI document: 3.0.0
7 * Contact: contact@brevo.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct GetEmailEventReportEventsInner {
16    /// Email address which generates the event
17    #[serde(rename = "email")]
18    pub email: String,
19    /// UTC date-time on which the event has been generated
20    #[serde(rename = "date")]
21    pub date: String,
22    /// Subject of the event
23    #[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
24    pub subject: Option<String>,
25    /// Message ID which generated the event
26    #[serde(rename = "messageId")]
27    pub message_id: String,
28    /// Event which occurred
29    #[serde(rename = "event")]
30    pub event: Event,
31    /// Reason of bounce (only available if the event is hardbounce or softbounce)
32    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
33    pub reason: Option<String>,
34    /// Tag of the email which generated the event
35    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
36    pub tag: Option<String>,
37    /// IP from which the user has opened the email or clicked on the link (only available if the event is opened or clicks)
38    #[serde(rename = "ip", skip_serializing_if = "Option::is_none")]
39    pub ip: Option<String>,
40    /// The link which is sent to the user (only available if the event is requests or opened or clicks)
41    #[serde(rename = "link", skip_serializing_if = "Option::is_none")]
42    pub link: Option<String>,
43    /// Sender email from which the emails are sent
44    #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
45    pub from: Option<String>,
46    /// ID of the template (only available if the email is template based)
47    #[serde(rename = "templateId", skip_serializing_if = "Option::is_none")]
48    pub template_id: Option<i64>,
49}
50
51impl GetEmailEventReportEventsInner {
52    pub fn new(
53        email: String,
54        date: String,
55        message_id: String,
56        event: Event,
57    ) -> GetEmailEventReportEventsInner {
58        GetEmailEventReportEventsInner {
59            email,
60            date,
61            subject: None,
62            message_id,
63            event,
64            reason: None,
65            tag: None,
66            ip: None,
67            link: None,
68            from: None,
69            template_id: None,
70        }
71    }
72}
73/// Event which occurred
74#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
75pub enum Event {
76    #[serde(rename = "bounces")]
77    Bounces,
78    #[serde(rename = "hardBounces")]
79    HardBounces,
80    #[serde(rename = "softBounces")]
81    SoftBounces,
82    #[serde(rename = "delivered")]
83    Delivered,
84    #[serde(rename = "spam")]
85    Spam,
86    #[serde(rename = "requests")]
87    Requests,
88    #[serde(rename = "opened")]
89    Opened,
90    #[serde(rename = "clicks")]
91    Clicks,
92    #[serde(rename = "invalid")]
93    Invalid,
94    #[serde(rename = "deferred")]
95    Deferred,
96    #[serde(rename = "blocked")]
97    Blocked,
98    #[serde(rename = "unsubscribed")]
99    Unsubscribed,
100    #[serde(rename = "error")]
101    Error,
102    #[serde(rename = "loadedByProxy")]
103    LoadedByProxy,
104}
105
106impl Default for Event {
107    fn default() -> Event {
108        Self::Bounces
109    }
110}