1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
/*
 * MailSlurp API
 *
 * MailSlurp is an API for sending and receiving emails from dynamically allocated email addresses. It's designed for developers and QA teams to test applications, process inbound emails, send templated notifications, attachments, and more.  ## Resources  - [Homepage](https://www.mailslurp.com) - Get an [API KEY](https://app.mailslurp.com/sign-up/) - Generated [SDK Clients](https://www.mailslurp.com/docs/) - [Examples](https://github.com/mailslurp/examples) repository 
 *
 * The version of the OpenAPI document: 6.5.2
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookResultEntity {
    #[serde(rename = "createdAt")]
    pub created_at: String,
    #[serde(rename = "httpMethod")]
    pub http_method: HttpMethod,
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "inboxId")]
    pub inbox_id: String,
    #[serde(rename = "messageId")]
    pub message_id: String,
    #[serde(rename = "responseBodyExtract", skip_serializing_if = "Option::is_none")]
    pub response_body_extract: Option<String>,
    #[serde(rename = "responseStatus", skip_serializing_if = "Option::is_none")]
    pub response_status: Option<i32>,
    #[serde(rename = "responseTimeMillis")]
    pub response_time_millis: i64,
    #[serde(rename = "resultType", skip_serializing_if = "Option::is_none")]
    pub result_type: Option<ResultType>,
    #[serde(rename = "updatedAt")]
    pub updated_at: String,
    #[serde(rename = "userId")]
    pub user_id: String,
    #[serde(rename = "webhookEvent")]
    pub webhook_event: WebhookEvent,
    #[serde(rename = "webhookId")]
    pub webhook_id: String,
    #[serde(rename = "webhookUrl")]
    pub webhook_url: String,
}

impl WebhookResultEntity {
    pub fn new(created_at: String, http_method: HttpMethod, inbox_id: String, message_id: String, response_time_millis: i64, updated_at: String, user_id: String, webhook_event: WebhookEvent, webhook_id: String, webhook_url: String) -> WebhookResultEntity {
        WebhookResultEntity {
            created_at,
            http_method,
            id: None,
            inbox_id,
            message_id,
            response_body_extract: None,
            response_status: None,
            response_time_millis,
            result_type: None,
            updated_at,
            user_id,
            webhook_event,
            webhook_id,
            webhook_url,
        }
    }
}

/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum HttpMethod {
    #[serde(rename = "GET")]
    GET,
    #[serde(rename = "HEAD")]
    HEAD,
    #[serde(rename = "POST")]
    POST,
    #[serde(rename = "PUT")]
    PUT,
    #[serde(rename = "PATCH")]
    PATCH,
    #[serde(rename = "DELETE")]
    DELETE,
    #[serde(rename = "OPTIONS")]
    OPTIONS,
    #[serde(rename = "TRACE")]
    TRACE,
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ResultType {
    #[serde(rename = "BAD_RESPONSE")]
    BADRESPONSE,
    #[serde(rename = "EXCEPTION")]
    EXCEPTION,
    #[serde(rename = "SUCCESS")]
    SUCCESS,
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum WebhookEvent {
    #[serde(rename = "EMAIL_RECEIVED")]
    EMAILRECEIVED,
    #[serde(rename = "NEW_EMAIL")]
    NEWEMAIL,
    #[serde(rename = "NEW_CONTACT")]
    NEWCONTACT,
    #[serde(rename = "NEW_ATTACHMENT")]
    NEWATTACHMENT,
    #[serde(rename = "EMAIL_OPENED")]
    EMAILOPENED,
}