late 0.0.1372

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.572.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateEmailDraftRequest {
    #[serde(rename = "accountId")]
    pub account_id: String,
    /// Optional on a draft; needed before it is sent.
    #[serde(rename = "to", skip_serializing_if = "Option::is_none")]
    pub to: Option<Vec<models::EmailAddress>>,
    #[serde(rename = "cc", skip_serializing_if = "Option::is_none")]
    pub cc: Option<Vec<models::EmailAddress>>,
    #[serde(rename = "bcc", skip_serializing_if = "Option::is_none")]
    pub bcc: Option<Vec<models::EmailAddress>>,
    #[serde(rename = "replyTo", skip_serializing_if = "Option::is_none")]
    pub reply_to: Option<Vec<models::EmailAddress>>,
    #[serde(rename = "fromName", skip_serializing_if = "Option::is_none")]
    pub from_name: Option<String>,
    /// Send from another address of the mailbox, as on `POST /v1/email/messages`. Checked when the draft is saved.
    #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
    pub from: Option<String>,
    /// Puts the signature of the sending address in the draft body, where the user sees it: its Zernio default first, else its Gmail signature.
    #[serde(rename = "appendSignature", skip_serializing_if = "Option::is_none")]
    pub append_signature: Option<bool>,
    /// Puts this Zernio signature in the draft body instead. Wins over `appendSignature`.
    #[serde(rename = "signatureId", skip_serializing_if = "Option::is_none")]
    pub signature_id: Option<String>,
    /// On a reply draft, empty keeps the thread subject.
    #[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
    pub subject: Option<String>,
    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    #[serde(rename = "html", skip_serializing_if = "Option::is_none")]
    pub html: Option<String>,
    #[serde(rename = "attachments", skip_serializing_if = "Option::is_none")]
    pub attachments: Option<Vec<models::EmailAttachmentInput>>,
    /// Custom `X-` headers only.
    #[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
    pub headers: Option<std::collections::HashMap<String, String>>,
    /// Kept with the draft and returned on the sent message and its email.* webhooks.
    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<std::collections::HashMap<String, String>>,
    /// Makes a reply draft in that message's thread, addressed and threaded like a reply. Not with `forwardOf`.
    #[serde(rename = "inReplyTo", skip_serializing_if = "Option::is_none")]
    pub in_reply_to: Option<String>,
    /// With `inReplyTo`: address every recipient of the original. Leave out `to`, `cc` and `bcc`.
    #[serde(rename = "replyAll", skip_serializing_if = "Option::is_none")]
    pub reply_all: Option<bool>,
    /// Makes a forward draft of that message, with its attachments. Recipients can come later. Not with `inReplyTo`.
    #[serde(rename = "forwardOf", skip_serializing_if = "Option::is_none")]
    pub forward_of: Option<String>,
    /// With `forwardOf`: false keeps only the inline images of the original.
    #[serde(rename = "includeAttachments", skip_serializing_if = "Option::is_none")]
    pub include_attachments: Option<bool>,
    /// With `forwardOf`: attachment ids (from a read of the original) to leave out.
    #[serde(
        rename = "excludeAttachmentIds",
        skip_serializing_if = "Option::is_none"
    )]
    pub exclude_attachment_ids: Option<Vec<String>>,
    /// Puts the open pixel in the draft html now; fires `email.opened` once it is sent. Needs `html`.
    #[serde(rename = "trackOpens", skip_serializing_if = "Option::is_none")]
    pub track_opens: Option<bool>,
    /// Rewrites the draft's links now; fires `email.link_clicked` once it is sent. Needs `html`.
    #[serde(rename = "trackLinks", skip_serializing_if = "Option::is_none")]
    pub track_links: Option<bool>,
    /// Fires `email.thread_replied` once it is sent.
    #[serde(rename = "trackReplies", skip_serializing_if = "Option::is_none")]
    pub track_replies: Option<bool>,
}

impl CreateEmailDraftRequest {
    pub fn new(account_id: String) -> CreateEmailDraftRequest {
        CreateEmailDraftRequest {
            account_id,
            to: None,
            cc: None,
            bcc: None,
            reply_to: None,
            from_name: None,
            from: None,
            append_signature: None,
            signature_id: None,
            subject: None,
            text: None,
            html: None,
            attachments: None,
            headers: None,
            metadata: None,
            in_reply_to: None,
            reply_all: None,
            forward_of: None,
            include_attachments: None,
            exclude_attachment_ids: None,
            track_opens: None,
            track_links: None,
            track_replies: None,
        }
    }
}