/*
* 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 CalendarAvailabilityRequest {
#[serde(rename = "participants")]
pub participants: Vec<models::CalendarAvailabilityRequestParticipantsInner>,
#[serde(rename = "from")]
pub from: String,
#[serde(rename = "to")]
pub to: String,
#[serde(rename = "durationMinutes")]
pub duration_minutes: i32,
#[serde(rename = "intervalMinutes", skip_serializing_if = "Option::is_none")]
pub interval_minutes: Option<i32>,
/// Rounds the first candidate slot up to this many minutes.
#[serde(rename = "roundTo", skip_serializing_if = "Option::is_none")]
pub round_to: Option<i32>,
#[serde(rename = "buffer", skip_serializing_if = "Option::is_none")]
pub buffer: Option<Box<models::CalendarAvailabilityRequestBuffer>>,
#[serde(rename = "defaultOpenHours", skip_serializing_if = "Option::is_none")]
pub default_open_hours: Option<Vec<models::OpenHoursInner>>,
#[serde(rename = "method", skip_serializing_if = "Option::is_none")]
pub method: Option<Method>,
}
impl CalendarAvailabilityRequest {
pub fn new(
participants: Vec<models::CalendarAvailabilityRequestParticipantsInner>,
from: String,
to: String,
duration_minutes: i32,
) -> CalendarAvailabilityRequest {
CalendarAvailabilityRequest {
participants,
from,
to,
duration_minutes,
interval_minutes: None,
round_to: None,
buffer: None,
default_open_hours: None,
method: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Method {
#[serde(rename = "collective")]
Collective,
#[serde(rename = "max_availability")]
MaxAvailability,
}
impl Default for Method {
fn default() -> Method {
Self::Collective
}
}