use crate::components::Parameter;
use std::borrow::Cow;
parameter!(AltRep, "ALTREP");
parameter!(CN, "CN");
parameter!(CUType, "CUTYPE");
parameter!(DelegatedFrom, "DELEGATED-FROM");
parameter!(DelegatedTo, "DELEGATED-TO");
parameter!(Dir, "DIR");
parameter!(FmtType, "FMTTYPE");
parameter!(FBType, "FBTYPE");
parameter!(Language, "LANGUAGE");
parameter!(Member, "MEMBER");
parameter!(PartStat, "PARTSTAT");
parameter!(RelType, "RELTYPE");
parameter!(Role, "ROLE");
parameter!(SentBy, "SENT-BY");
parameter!(TzIDParam, "TZID");
parameter!(Value, "VALUE");
impl CUType<'_> {
pub const INDIVIDUAL: Self = Self {
value: Cow::Borrowed("INDIVIDUAL"),
};
pub const GROUP: Self = Self {
value: Cow::Borrowed("GROUP"),
};
pub const RESOURCE: Self = Self {
value: Cow::Borrowed("RESOURCE"),
};
pub const ROOM: Self = Self {
value: Cow::Borrowed("ROOM"),
};
pub const UNKNOWN: Self = Self {
value: Cow::Borrowed("UNKNOWN"),
};
}
impl FBType<'_> {
pub const FREE: Self = Self {
value: Cow::Borrowed("FREE"),
};
pub const BUSY: Self = Self {
value: Cow::Borrowed("BUSY"),
};
pub const BUSY_UNAVAILABLE: Self = Self {
value: Cow::Borrowed("BUSY-UNAVAILABLE"),
};
pub const BUSY_TENTATIVE: Self = Self {
value: Cow::Borrowed("BUSY-TENTATIVE"),
};
}
impl PartStat<'_> {
pub const NEEDS_ACTION: Self = Self {
value: Cow::Borrowed("NEEDS-ACTION"),
};
pub const ACCEPTED: Self = Self {
value: Cow::Borrowed("ACCEPTED"),
};
pub const DECLINED: Self = Self {
value: Cow::Borrowed("DECLINED"),
};
pub const TENTATIVE: Self = Self {
value: Cow::Borrowed("TENTATIVE"),
};
pub const DELEGATED: Self = Self {
value: Cow::Borrowed("DELEGATED"),
};
pub const COMPLETED: Self = Self {
value: Cow::Borrowed("COMPLETED"),
};
pub const IN_PROCESS: Self = Self {
value: Cow::Borrowed("IN-PROCESS"),
};
}
impl RelType<'_> {
pub const PARENT: Self = Self {
value: Cow::Borrowed("PARENT"),
};
pub const CHILD: Self = Self {
value: Cow::Borrowed("CHILD"),
};
const SIBLING: Self = Self {
value: Cow::Borrowed("SIBLING"),
};
pub const SILBLING: Self = Self::SIBLING;
}
impl Role<'_> {
pub const CHAIR: Self = Self {
value: Cow::Borrowed("CHAIR"),
};
pub const REQ_PARTICIPANT: Self = Self {
value: Cow::Borrowed("REQ-PARTICIPANT"),
};
pub const OPT_PARTICIPANT: Self = Self {
value: Cow::Borrowed("OPT-PARTICIPANT"),
};
pub const NON_PARTICIPANT: Self = Self {
value: Cow::Borrowed("NON-PARTICIPANT"),
};
}
impl Value<'_> {
pub const BINARY: Self = Self {
value: Cow::Borrowed("BINARY"),
};
pub const BOOLEAN: Self = Self {
value: Cow::Borrowed("BOOLEAN"),
};
pub const CAL_ADDRESS: Self = Self {
value: Cow::Borrowed("CAL-ADDRESS"),
};
pub const DATE: Self = Self {
value: Cow::Borrowed("DATE"),
};
pub const DATE_TIME: Self = Self {
value: Cow::Borrowed("DATE-TIME"),
};
pub const DURATION: Self = Self {
value: Cow::Borrowed("DURATION"),
};
pub const FLOAT: Self = Self {
value: Cow::Borrowed("FLOAT"),
};
pub const INTEGER: Self = Self {
value: Cow::Borrowed("INTEGER"),
};
pub const PERIOD: Self = Self {
value: Cow::Borrowed("PERIOD"),
};
pub const RECUR: Self = Self {
value: Cow::Borrowed("RECUR"),
};
pub const TEXT: Self = Self {
value: Cow::Borrowed("TEXT"),
};
pub const TIME: Self = Self {
value: Cow::Borrowed("TIME"),
};
pub const URI: Self = Self {
value: Cow::Borrowed("URI"),
};
pub const UTC_OFFSET: Self = Self {
value: Cow::Borrowed("UTC-OFFSET"),
};
}
impl Default for CUType<'_> {
fn default() -> Self {
Self::INDIVIDUAL
}
}
impl Default for FBType<'_> {
fn default() -> Self {
Self::BUSY
}
}
impl Default for PartStat<'_> {
fn default() -> Self {
PartStat::NEEDS_ACTION
}
}
impl Default for RelType<'_> {
fn default() -> Self {
Self::PARENT
}
}
impl Default for Role<'_> {
fn default() -> Self {
Self::REQ_PARTICIPANT
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum Encoding {
Byte,
Base64,
}
impl<'a> From<Encoding> for Parameter<'a> {
fn from(builder: Encoding) -> Self {
Parameter {
key: "ENCODING".into(),
value: match builder {
Encoding::Byte => Cow::Borrowed("8BIT"),
Encoding::Base64 => Cow::Borrowed("BASE64"),
},
}
}
}
impl Default for Encoding {
fn default() -> Self {
Encoding::Byte
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum Range {
ThisAndFuture,
}
impl<'a> From<Range> for Parameter<'a> {
fn from(builder: Range) -> Self {
Parameter {
key: "RANGE".into(),
value: match builder {
Range::ThisAndFuture => Cow::Borrowed("THISANDFUTURE"),
},
}
}
}
impl Default for Range {
fn default() -> Self {
Range::ThisAndFuture
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum Related {
Start,
End,
}
impl<'a> From<Related> for Parameter<'a> {
fn from(builder: Related) -> Self {
Parameter {
key: "RELATED".into(),
value: match builder {
Related::Start => Cow::Borrowed("START"),
Related::End => Cow::Borrowed("END"),
},
}
}
}
impl Default for Related {
fn default() -> Self {
Related::Start
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum RSVP {
True,
False,
}
impl<'a> From<RSVP> for Parameter<'a> {
fn from(builder: RSVP) -> Self {
Parameter {
key: "RSVP".into(),
value: match builder {
RSVP::True => Cow::Borrowed("TRUE"),
RSVP::False => Cow::Borrowed("FALSE"),
},
}
}
}
impl Default for RSVP {
fn default() -> Self {
RSVP::False
}
}
#[cfg(feature = "rfc7986")]
pub use self::rfc7986::*;
#[cfg(feature = "rfc7986")]
mod rfc7986 {
use crate::components::Parameter;
use std::borrow::Cow;
parameter!(Display, "DISPLAY");
parameter!(Email, "EMAIL");
parameter!(Feature, "FEATURE");
parameter!(Label, "LABEL");
impl Display<'_> {
pub const BADGE: Self = Self {
value: Cow::Borrowed("BADGE"),
};
pub const GRAPHIC: Self = Self {
value: Cow::Borrowed("GRAPHIC"),
};
pub const FULLSIZE: Self = Self {
value: Cow::Borrowed("FULLSIZE"),
};
pub const THUMBNAIL: Self = Self {
value: Cow::Borrowed("THUMBNAIL"),
};
}
impl Feature<'_> {
pub const AUDIO: Self = Self {
value: Cow::Borrowed("AUDIO"),
};
pub const CHAT: Self = Self {
value: Cow::Borrowed("CHAT"),
};
pub const FEED: Self = Self {
value: Cow::Borrowed("FEED"),
};
pub const MODERATOR: Self = Self {
value: Cow::Borrowed("MODERATOR"),
};
pub const PHONE: Self = Self {
value: Cow::Borrowed("PHONE"),
};
pub const SCREEN: Self = Self {
value: Cow::Borrowed("SCREEN"),
};
pub const VIDEO: Self = Self {
value: Cow::Borrowed("VIDEO"),
};
}
impl<'a> Default for Display<'a> {
fn default() -> Self {
Self::BADGE
}
}
}