/*
* 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.597.0
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// OrgConnection : A Google Workspace domain or Microsoft 365 tenant whose administrator granted Zernio access to its mailboxes once.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrgConnection {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
pub provider: Option<Provider>,
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
#[serde(rename = "profileId", skip_serializing_if = "Option::is_none")]
pub profile_id: Option<String>,
#[serde(rename = "areas", skip_serializing_if = "Option::is_none")]
pub areas: Option<Vec<Areas>>,
#[serde(
rename = "domain",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub domain: Option<Option<String>>,
#[serde(
rename = "tenantId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub tenant_id: Option<Option<String>>,
#[serde(
rename = "adminEmail",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub admin_email: Option<Option<String>>,
#[serde(
rename = "allowedEmails",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub allowed_emails: Option<Option<Vec<String>>>,
#[serde(
rename = "lastError",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub last_error: Option<Option<String>>,
#[serde(
rename = "verifiedAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub verified_at: Option<Option<String>>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "setup", skip_serializing_if = "Option::is_none")]
pub setup: Option<Box<models::OrgConnectionSetup>>,
}
impl OrgConnection {
/// A Google Workspace domain or Microsoft 365 tenant whose administrator granted Zernio access to its mailboxes once.
pub fn new() -> OrgConnection {
OrgConnection {
id: None,
provider: None,
status: None,
profile_id: None,
areas: None,
domain: None,
tenant_id: None,
admin_email: None,
allowed_emails: None,
last_error: None,
verified_at: None,
created_at: None,
setup: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Provider {
#[serde(rename = "google")]
Google,
#[serde(rename = "microsoft")]
Microsoft,
}
impl Default for Provider {
fn default() -> Provider {
Self::Google
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "active")]
Active,
#[serde(rename = "revoked")]
Revoked,
}
impl Default for Status {
fn default() -> Status {
Self::Pending
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Areas {
#[serde(rename = "email")]
Email,
#[serde(rename = "calendar")]
Calendar,
#[serde(rename = "files")]
Files,
#[serde(rename = "contacts")]
Contacts,
}
impl Default for Areas {
fn default() -> Areas {
Self::Email
}
}