libdav 0.10.3

CalDAV and CardDAV client implementations.
Documentation
// Copyright 2023-2024 Hugo Osvaldo Barrera
//
// SPDX-License-Identifier: ISC

//! Names of common dav attributes and properties.

use crate::PropertyName;

/// Namespace for properties defined in the WebDAV specifications.
pub const DAV: &str = "DAV:";
/// Namespace for properties defined in the CalDAV specifications.
pub const CALDAV: &str = "urn:ietf:params:xml:ns:caldav";
/// Namespace for properties defined in the CardDAV specifications.
pub const CARDDAV: &str = "urn:ietf:params:xml:ns:carddav";
/// Namespace for properties defined by Apple / ical.
pub const APPLE: &str = "http://apple.com/ns/ical/";

// WEBDAV PROPERTIES ==========================================================

/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.3>
pub const COLLECTION: PropertyName = PropertyName::new(DAV, "collection");
/// Property name for collections display name.
///
/// Defined in: <https://www.rfc-editor.org/rfc/rfc4918#section-15.2>
///
/// Also, from <https://www.rfc-editor.org/rfc/rfc3744#section-4>:
///
/// > A principal MUST have a non-empty DAV:displayname property
pub const DISPLAY_NAME: PropertyName = PropertyName::new(DAV, "displayname");
/// Contains the Content-Type header value.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-15.5>
pub const GETCONTENTTYPE: PropertyName = PropertyName::new(DAV, "getcontenttype");
/// Contains the etag header value.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-15.6>
pub const GETETAG: PropertyName = PropertyName::new(DAV, "getetag");
/// An URI or relative reference.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.7>
pub const HREF: PropertyName = PropertyName::new(DAV, "href");
/// Contains types for a resource. Types can be from any namespace.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-15.9>
pub const RESOURCETYPE: PropertyName = PropertyName::new(DAV, "resourcetype");
/// A response container.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.24>
pub const RESPONSE: PropertyName = PropertyName::new(DAV, "response");
/// Holds a single HTTP status-line.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.28>
pub const STATUS: PropertyName = PropertyName::new(DAV, "status");
/// MUST contain one prop XML element and one status XML element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.22>
pub const PROPSTAT: PropertyName = PropertyName::new(DAV, "propstat");
/// Reports supported by a resource.
///
/// From: <https://www.rfc-editor.org/rfc/rfc3253#section-3.1.5>
pub const SUPPORTED_REPORT_SET: PropertyName = PropertyName::new(DAV, "supported-report-set");
/// Report use to synchronise data. It includes a `sync-token`.
///
/// From: <https://www.rfc-editor.org/rfc/rfc6578#section-3.2>
pub const SYNC_COLLECTION: PropertyName = PropertyName::new(DAV, "sync-collection");
/// Synchronisation token provided by a server.
///
/// From: <https://www.rfc-editor.org/rfc/rfc6578#section-3.2>
pub const SYNC_TOKEN: PropertyName = PropertyName::new(DAV, "sync-token");
/// Scope of a synchronisation report.
///
/// From: <https://www.rfc-editor.org/rfc/rfc6578#section-6.3>
pub const SYNC_LEVEL: PropertyName = PropertyName::new(DAV, "sync-level");
/// From: <https://www.rfc-editor.org/rfc/rfc5397>
pub const CURRENT_USER_PRINCIPAL: PropertyName = PropertyName::new(DAV, "current-user-principal");
/// DAV prop (property) element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.18>
pub const PROP: PropertyName = PropertyName::new(DAV, "prop");
/// DAV propfind (find property) element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.20>
pub const PROPFIND: PropertyName = PropertyName::new(DAV, "propfind");

/// DAV allprop (all properties) element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.2>
pub const ALLPROP: PropertyName = PropertyName::new(DAV, "allprop");
/// DAV update element for PROPPATCH.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.19>
pub const PROPERTYUPDATE: PropertyName = PropertyName::new(DAV, "propertyupdate");
/// DAV set element for PROPPATCH.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.26>
pub const SET: PropertyName = PropertyName::new(DAV, "set");
/// DAV remove element for PROPPATCH.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4918#section-14.23>
pub const REMOVE: PropertyName = PropertyName::new(DAV, "remove");

/// Extended MKCOL element for creating collections with properties.
///
/// From: <https://www.rfc-editor.org/rfc/rfc5689#section-5.1>
pub const MKCOL: PropertyName = PropertyName::new(DAV, "mkcol");

// CALENDAR PROPERTIES ========================================================

/// Resource type of a calendar collection.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-9.1>
pub const CALENDAR: PropertyName = PropertyName::new(CALDAV, "calendar");
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-5.2.1>
pub const CALENDAR_DESCRIPTION: PropertyName = PropertyName::new(CALDAV, "calendar-description");
/// Defined in <https://www.rfc-editor.org/rfc/rfc4791#section-6.2.1>
pub const CALENDAR_HOME_SET: PropertyName = PropertyName::new(CALDAV, "calendar-home-set");
/// A calendar's colour.
///
/// Not a formally standardised property, but is relatively widespread. The value of this
/// property should be an unescaped hex value with a leading pound sign (e.g. `#ff0000`).
pub const CALENDAR_COLOUR: PropertyName = PropertyName::new(APPLE, "calendar-color");
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-9.6>
pub const CALENDAR_DATA: PropertyName = PropertyName::new(CALDAV, "calendar-data");
/// Sorting order for calendars.
///
/// Not documented anywhere. Supported by various clients and servers.
pub const CALENDAR_ORDER: PropertyName = PropertyName::new(APPLE, "calendar-order");
/// Identifies the address of a principal resource.
///
/// From: <https://datatracker.ietf.org/doc/html/rfc6638#section-2.4.1>
pub const CALENDAR_USER_ADDRESS_SET: PropertyName =
    PropertyName::new(CALDAV, "calendar-user-address-set");
/// Supported calendar component.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-5.2.3>
pub const SUPPORTED_CALENDAR_COMPONENT: PropertyName =
    PropertyName::new(CALDAV, "supported-calendar-component");
/// Supported component types in a calendar.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-5.2.3>
pub const SUPPORTED_CALENDAR_COMPONENT_SET: PropertyName =
    PropertyName::new(CALDAV, "supported-calendar-component-set");
/// Supported calendar data types in a calendar.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-5.2.2>
pub const SUPPORTED_CALENDAR_DATA: PropertyName =
    PropertyName::new(CALDAV, "supported-calendar-data");
/// Calendar component type element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-9.1>
pub const COMP: PropertyName = PropertyName::new(CALDAV, "comp");
/// Calendar query element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-7.8>
pub const CALENDAR_QUERY: PropertyName = PropertyName::new(CALDAV, "calendar-query");
/// Filter element for calendar queries.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-9.7>
pub const FILTER: PropertyName = PropertyName::new(CALDAV, "filter");
/// Component filter element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-9.7.1>
pub const COMP_FILTER: PropertyName = PropertyName::new(CALDAV, "comp-filter");
/// Time range filter element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-9.9>
pub const TIME_RANGE: PropertyName = PropertyName::new(CALDAV, "time-range");
/// Calendar multiget report element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc4791#section-7.9>
pub const CALENDAR_MULTIGET: PropertyName = PropertyName::new(CALDAV, "calendar-multiget");

// ADDRESS BOOK PROPERTIES ====================================================

/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-10.1>
pub const ADDRESSBOOK: PropertyName = PropertyName::new(CARDDAV, "addressbook");
/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-6.2.1>
pub const ADDRESSBOOK_DESCRIPTION: PropertyName =
    PropertyName::new(CARDDAV, "addressbook-description");
/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-7.1.1>
pub const ADDRESSBOOK_HOME_SET: PropertyName =
    PropertyName::new("urn:ietf:params:xml:ns:carddav", "addressbook-home-set");
/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-10.4>
pub const ADDRESS_DATA: PropertyName = PropertyName::new(CARDDAV, "address-data");
/// Address book multiget report element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-8.7>
pub const ADDRESSBOOK_MULTIGET: PropertyName = PropertyName::new(CARDDAV, "addressbook-multiget");
/// Address book query report element.
///
/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-8.6>
pub const ADDRESSBOOK_QUERY: PropertyName = PropertyName::new(CARDDAV, "addressbook-query");
/// Filter element for address book queries.
///
/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-10.5>
pub const ADDRESSBOOK_FILTER: PropertyName = PropertyName::new(CARDDAV, "filter");
/// Property filter element for address book queries.
///
/// From: <https://www.rfc-editor.org/rfc/rfc6352#section-10.5.1>
pub const PROP_FILTER: PropertyName = PropertyName::new(CARDDAV, "prop-filter");