/*
* 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.587.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 CalendarEvent {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "accountId", skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
pub provider: Option<Provider>,
#[serde(rename = "calendarId", skip_serializing_if = "Option::is_none")]
pub calendar_id: Option<String>,
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(
rename = "description",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub description: Option<Option<String>>,
#[serde(
rename = "location",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub location: Option<Option<String>>,
/// ISO date-time with the rendered offset, or a date for all-day events.
#[serde(rename = "start", skip_serializing_if = "Option::is_none")]
pub start: Option<String>,
#[serde(rename = "end", skip_serializing_if = "Option::is_none")]
pub end: Option<String>,
#[serde(rename = "allDay", skip_serializing_if = "Option::is_none")]
pub all_day: Option<bool>,
#[serde(
rename = "timezone",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub timezone: Option<Option<String>>,
#[serde(rename = "participants", skip_serializing_if = "Option::is_none")]
pub participants: Option<Vec<models::CalendarEventParticipantsInner>>,
#[serde(
rename = "organizer",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub organizer: Option<Option<Box<models::EmailAddress>>>,
#[serde(
rename = "recurrence",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub recurrence: Option<Option<Vec<String>>>,
#[serde(rename = "reminders", skip_serializing_if = "Option::is_none")]
pub reminders: Option<Box<models::CalendarEventReminders>>,
#[serde(rename = "conferencing", skip_serializing_if = "Option::is_none")]
pub conferencing: Option<Box<models::CalendarEventConferencing>>,
#[serde(rename = "busy", skip_serializing_if = "Option::is_none")]
pub busy: Option<bool>,
#[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
pub visibility: Option<Visibility>,
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<Status>,
#[serde(
rename = "icalUid",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub ical_uid: Option<Option<String>>,
#[serde(
rename = "masterEventId",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub master_event_id: Option<Option<String>>,
/// `series` is a recurring master, `occurrence` one of its instances, and `exception` an instance changed on its own. Google flags an instance as an exception only when it was moved off its slot.
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<Type>,
/// For an occurrence or exception, the start it has in the series pattern.
#[serde(
rename = "originalStart",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub original_start: Option<Option<String>>,
#[serde(
rename = "htmlLink",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub html_link: Option<Option<String>>,
#[serde(rename = "readOnly", skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, String>>,
#[serde(
rename = "createdAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub created_at: Option<Option<String>>,
#[serde(
rename = "updatedAt",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub updated_at: Option<Option<String>>,
}
impl CalendarEvent {
pub fn new() -> CalendarEvent {
CalendarEvent {
id: None,
account_id: None,
provider: None,
calendar_id: None,
title: None,
description: None,
location: None,
start: None,
end: None,
all_day: None,
timezone: None,
participants: None,
organizer: None,
recurrence: None,
reminders: None,
conferencing: None,
busy: None,
visibility: None,
status: None,
ical_uid: None,
master_event_id: None,
r#type: None,
original_start: None,
html_link: None,
read_only: None,
metadata: None,
created_at: None,
updated_at: 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 Visibility {
#[serde(rename = "default")]
Default,
#[serde(rename = "public")]
Public,
#[serde(rename = "private")]
Private,
}
impl Default for Visibility {
fn default() -> Visibility {
Self::Default
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "confirmed")]
Confirmed,
#[serde(rename = "tentative")]
Tentative,
#[serde(rename = "cancelled")]
Cancelled,
}
impl Default for Status {
fn default() -> Status {
Self::Confirmed
}
}
/// `series` is a recurring master, `occurrence` one of its instances, and `exception` an instance changed on its own. Google flags an instance as an exception only when it was moved off its slot.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "single")]
Single,
#[serde(rename = "series")]
Series,
#[serde(rename = "occurrence")]
Occurrence,
#[serde(rename = "exception")]
Exception,
}
impl Default for Type {
fn default() -> Type {
Self::Single
}
}