/*
* 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.603.1
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// EmailSendAs : An address the mailbox can send from: listed by the provider, or declared with `POST /v1/email/send-as`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EmailSendAs {
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
/// Display name used when `fromName` is not given.
#[serde(
rename = "name",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub name: Option<Option<String>>,
/// `primary` is the mailbox's own address, `alias` a provider alias, `shared` a declared address (shared mailbox, delegate or alias).
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<Type>,
/// `pending`: Gmail has not verified the alias, so sends from it are refused. `unverified`: declared and not sent from yet; it becomes `accepted` after its first send.
#[serde(rename = "verificationStatus", skip_serializing_if = "Option::is_none")]
pub verification_status: Option<VerificationStatus>,
/// The address the provider picks by default.
#[serde(rename = "isDefault", skip_serializing_if = "Option::is_none")]
pub is_default: Option<bool>,
#[serde(rename = "source", skip_serializing_if = "Option::is_none")]
pub source: Option<Source>,
/// Gmail alias reply-to address, if set.
#[serde(
rename = "replyTo",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub reply_to: Option<Option<String>>,
#[serde(rename = "signature", skip_serializing_if = "Option::is_none")]
pub signature: Option<Box<models::EmailSendAsSignature>>,
}
impl EmailSendAs {
/// An address the mailbox can send from: listed by the provider, or declared with `POST /v1/email/send-as`.
pub fn new() -> EmailSendAs {
EmailSendAs {
email: None,
name: None,
r#type: None,
verification_status: None,
is_default: None,
source: None,
reply_to: None,
signature: None,
}
}
}
/// `primary` is the mailbox's own address, `alias` a provider alias, `shared` a declared address (shared mailbox, delegate or alias).
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "primary")]
Primary,
#[serde(rename = "alias")]
Alias,
#[serde(rename = "shared")]
Shared,
}
impl Default for Type {
fn default() -> Type {
Self::Primary
}
}
/// `pending`: Gmail has not verified the alias, so sends from it are refused. `unverified`: declared and not sent from yet; it becomes `accepted` after its first send.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum VerificationStatus {
#[serde(rename = "accepted")]
Accepted,
#[serde(rename = "pending")]
Pending,
#[serde(rename = "unverified")]
Unverified,
}
impl Default for VerificationStatus {
fn default() -> VerificationStatus {
Self::Accepted
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
#[serde(rename = "provider")]
Provider,
#[serde(rename = "declared")]
Declared,
}
impl Default for Source {
fn default() -> Source {
Self::Provider
}
}