mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 21:42:34 +00:00
Add namespaces to props
This commit is contained in:
@@ -39,7 +39,9 @@ pub struct CalendarResourceService<C: CalendarStore + ?Sized> {
|
||||
)]
|
||||
pub enum CalendarProp {
|
||||
// WebDAV (RFC 2518)
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
Displayname(Option<String>),
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
Getcontenttype(String),
|
||||
|
||||
// WebDav Push
|
||||
@@ -47,24 +49,24 @@ pub enum CalendarProp {
|
||||
// in DAVx5 yet
|
||||
// https://github.com/bitfireAT/webdav-push/commit/461259a2f2174454b2b00033419b11fac52b79e3
|
||||
#[xml(skip_deserializing)]
|
||||
// #[serde(rename = "P:push-transports", alias = "push-transports")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAVPUSH")]
|
||||
Transports(Transports),
|
||||
Topic(String),
|
||||
|
||||
// CalDAV (RFC 4791)
|
||||
// #[serde(rename = "IC:calendar-color", alias = "calendar-color")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_ICAL")]
|
||||
CalendarColor(Option<String>),
|
||||
// #[serde(rename = "C:calendar-description", alias = "calendar-description")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||
CalendarDescription(Option<String>),
|
||||
// #[serde(rename = "C:calendar-timezone", alias = "calendar-timezone")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||
CalendarTimezone(Option<String>),
|
||||
// #[serde(rename = "IC:calendar-order", alias = "calendar-order")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_ICAL")]
|
||||
CalendarOrder(Option<i64>),
|
||||
// #[serde(rename = "C:supported-calendar-component-set")]
|
||||
// TODO: Re-add
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||
#[xml(skip_deserializing)]
|
||||
SupportedCalendarComponentSet(SupportedCalendarComponentSet),
|
||||
// #[serde(rename = "C:supported-calendar-data")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||
#[xml(skip_deserializing)]
|
||||
SupportedCalendarData(SupportedCalendarData),
|
||||
MaxResourceSize(i64),
|
||||
@@ -72,12 +74,13 @@ pub enum CalendarProp {
|
||||
SupportedReportSet(SupportedReportSet),
|
||||
|
||||
// Collection Synchronization (RFC 6578)
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
SyncToken(String),
|
||||
|
||||
// CalendarServer
|
||||
// #[serde(rename = "CS:getctag", alias = "getctag")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CALENDARSERVER")]
|
||||
Getctag(String),
|
||||
// #[serde(rename = "CS:source", alias = "source")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CALENDARSERVER")]
|
||||
Source(Option<HrefElement>),
|
||||
}
|
||||
|
||||
|
||||
@@ -28,11 +28,13 @@ pub struct CalendarObjectResourceService<C: CalendarStore + ?Sized> {
|
||||
)]
|
||||
pub enum CalendarObjectProp {
|
||||
// WebDAV (RFC 2518)
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
Getetag(String),
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
Getcontenttype(String),
|
||||
|
||||
// CalDAV (RFC 4791)
|
||||
// #[serde(rename = "C:calendar-data")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||
CalendarData(String),
|
||||
}
|
||||
|
||||
|
||||
@@ -32,12 +32,13 @@ pub struct PrincipalResource {
|
||||
pub enum PrincipalProp {
|
||||
// WebDAV Access Control (RFC 3744)
|
||||
#[strum_discriminants(strum(serialize = "principal-URL"))]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
PrincipalUrl(HrefElement),
|
||||
|
||||
// CalDAV (RFC 4791)
|
||||
// #[serde(rename = "C:calendar-home-set")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||
CalendarHomeSet(HrefElement),
|
||||
// #[serde(rename = "C:calendar-user-address-set")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CALDAV")]
|
||||
CalendarUserAddressSet(HrefElement),
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ pub struct AddressObjectResourceService<AS: AddressbookStore + ?Sized> {
|
||||
)]
|
||||
pub enum AddressObjectProp {
|
||||
// WebDAV (RFC 2518)
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
Getetag(String),
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
Getcontenttype(String),
|
||||
|
||||
// CalDAV (RFC 4791)
|
||||
|
||||
@@ -33,7 +33,9 @@ pub struct AddressbookResourceService<AS: AddressbookStore + ?Sized> {
|
||||
)]
|
||||
pub enum AddressbookProp {
|
||||
// WebDAV (RFC 2518)
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
Displayname(Option<String>),
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
Getcontenttype(String),
|
||||
|
||||
// CardDAV (RFC 6352)
|
||||
@@ -43,10 +45,13 @@ pub enum AddressbookProp {
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CARDDAV")]
|
||||
SupportedAddressData(SupportedAddressData),
|
||||
#[xml(skip_deserializing)]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_CARDDAV")]
|
||||
SupportedReportSet(SupportedReportSet),
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
MaxResourceSize(i64),
|
||||
|
||||
// Collection Synchronization (RFC 6578)
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
SyncToken(String),
|
||||
|
||||
// Didn't find the spec
|
||||
|
||||
@@ -31,8 +31,9 @@ pub struct PrincipalResource {
|
||||
)]
|
||||
pub enum PrincipalProp {
|
||||
// WebDAV Access Control (RFC 3744)
|
||||
#[xml(rename = b"principal-URL")]
|
||||
#[strum_discriminants(strum(serialize = "principal-URL"))]
|
||||
#[xml(rename = b"principal-URL")]
|
||||
#[xml(ns = "rustical_dav::namespace::NS_DAV")]
|
||||
PrincipalUrl(HrefElement),
|
||||
|
||||
// CardDAV (RFC 6352)
|
||||
|
||||
@@ -27,14 +27,18 @@ impl<T: FromStr + VariantNames> ResourcePropName for T {}
|
||||
pub enum CommonPropertiesProp {
|
||||
// WebDAV (RFC 2518)
|
||||
#[xml(skip_deserializing)]
|
||||
#[xml(ns = "crate::namespace::NS_DAV")]
|
||||
Resourcetype(Resourcetype),
|
||||
|
||||
// WebDAV Current Principal Extension (RFC 5397)
|
||||
#[xml(ns = "crate::namespace::NS_DAV")]
|
||||
CurrentUserPrincipal(HrefElement),
|
||||
|
||||
// WebDAV Access Control Protocol (RFC 3477)
|
||||
#[xml(skip_deserializing)]
|
||||
#[xml(ns = "crate::namespace::NS_DAV")]
|
||||
CurrentUserPrivilegeSet(UserPrivilegeSet),
|
||||
#[xml(ns = "crate::namespace::NS_DAV")]
|
||||
Owner(Option<HrefElement>),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user