diff --git a/pkg/jmap/jmap_model.go b/pkg/jmap/jmap_model.go index 49b4b7a96a..6ee0d1b2b3 100644 --- a/pkg/jmap/jmap_model.go +++ b/pkg/jmap/jmap_model.go @@ -18,22 +18,21 @@ type ObjectType string type UTCDate string // Where `LocalDate` is given as a type, it means a string in the same format as `Date` -// (see [RFC8620, Section 1.4]), but with the time-offset omitted from the end. +// (see [RFC8620, Section 1.4](https://www.rfc-editor.org/rfc/rfc8620.html#section-1.4)), +// but with the time-offset omitted from the end. // // For example, `2014-10-30T14:12:00`. // // The interpretation in absolute time depends upon the time zone for the event, which // may not be a fixed offset (for example when daylight saving time occurs). -// -// [RFC8620, Section 1.4]: https://www.rfc-editor.org/rfc/rfc8620.html#section-1.4 type LocalDate string // Should the calendar’s events be used as part of availability calculation? // // This MUST be one of: -// !- `all“: all events are considered. -// !- `attending“: events the user is a confirmed or tentative participant of are considered. -// !- `none“: all events are ignored (but may be considered if also in another calendar). +// * `all“: all events are considered. +// * `attending“: events the user is a confirmed or tentative participant of are considered. +// * `none“: all events are ignored (but may be considered if also in another calendar). // // This should default to “all” for the calendars in the user’s own account, and “none” for calendars shared with the user. type IncludeInAvailability string @@ -43,28 +42,26 @@ type TypeOfCalendarAlert string // `CalendarEventNotification` type. // // This MUST be one of -// !- `created` -// !- `updated` -// !- `destroyed` +// * `created` +// * `updated` +// * `destroyed` type CalendarEventNotificationTypeOption string // `Principal` type. // // This MUST be one of the following values: -// !- `individual`: This represents a single person. -// !- `group`: This represents a group of people. -// !- `resource`: This represents some resource, e.g. a projector. -// !- `location`: This represents a location. -// !- `other`: This represents some other undefined principal. +// * `individual`: This represents a single person. +// * `group`: This represents a group of people. +// * `resource`: This represents some resource, e.g. a projector. +// * `location`: This represents a location. +// * `other`: This represents some other undefined principal. type PrincipalTypeOption string -// Algorithms in this list MUST be present in the ["HTTP Digest Algorithm Values" registry] -// defined by [RFC3230]; however, in JMAP, they must be lowercased, e.g., "md5" rather than +// Algorithms in this list MUST be present in the ["HTTP Digest Algorithm Values" registry](https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml) +// defined by [RFC3230](https://www.rfc-editor.org/rfc/rfc3230.html); however, in JMAP, they must be lowercased, e.g., "md5" rather than // "MD5". // // Clients SHOULD prefer algorithms listed earlier in this list. -// -// ["HTTP Digest Algorithm Values" registry]: https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml type HttpDigestAlgorithm string // The ResourceType data type is used to act as a unit of measure for the quota usage. @@ -75,16 +72,16 @@ type Scope string // Determines which action must be performed by the MUA or MTA upon receiption. // -// !- `manual-action`: the disposition described by the disposition type was a result of an +// * `manual-action`: the disposition described by the disposition type was a result of an // explicit instruction by the user rather than some sort of automatically performed action. // (This might include the case when the user has manually configured her MUA to automatically // respond to valid MDN requests.) Unless prescribed otherwise in a particular mail environment, // in order to preserve the user's privacy, this MUST be the default for MUAs. -// !- `automatic-action`: the disposition described by the disposition type was a result of an +// * `automatic-action`: the disposition described by the disposition type was a result of an // automatic action rather than an explicit instruction by the user for this message. This // is typically generated by a Mail Delivery Agent (e.g., MDN generations by Sieve reject action -// [RFC5429], Fax-over-Email [RFC3249], voice message system (see Voice Profile for Internet -// Mail (VPIM) [RFC3801]), or upon delivery to a mailing list). +// (RFC5429), Fax-over-Email (RFC3249), voice message system (see Voice Profile for Internet +// Mail (VPIM) (RFC3801)), or upon delivery to a mailing list). type ActionMode string type SendingMode string @@ -216,8 +213,8 @@ const ( // an explicit instruction by the user for this message. // // This is typically generated by a Mail Delivery Agent (e.g., MDN generations by Sieve reject - // action [RFC5429], Fax-over-Email [RFC3249], voice message system (see Voice Profile - // for Internet Mail (VPIM) [RFC3801]), or upon delivery to a mailing list). + // action (RFC5429), Fax-over-Email (RFC3249), voice message system (see Voice Profile + // for Internet Mail (VPIM) (RFC3801)), or upon delivery to a mailing list). ActionModeAutomaticAction = ActionMode("automatic-action") // The user explicitly gave permission for this particular MDN to be sent. @@ -384,14 +381,12 @@ type SessionMailAccountCapabilities struct { // This is the unencoded size they see on their hard drive, so this capability matches that // and allows the client to consistently enforce what the user understands as the limit. // - // The server may separately have a limit for the total size of the message [RFC5322], + // The server may separately have a limit for the total size of the message [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html), // created by combining the attachments (often base64 encoded) with the message headers and bodies. // // For example, suppose the server advertises maxSizeAttachmentsPerEmail: 50000000 (50 MB). // The enforced server limit may be for a message size of 70000000 octets. // Even with base64 encoding and a 2 MB HTML body, 50 MB attachments would fit under this limit. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html MaxSizeAttachmentsPerEmail int `json:"maxSizeAttachmentsPerEmail"` // A list of all the values the server supports for the “property” field of the Comparator @@ -419,9 +414,9 @@ type SessionSubmissionAccountCapabilities struct { // // Each key in the object is the ehlo-name, and the value is a list of ehlo-args. // - // A JMAP implementation that talks to a submission server [RFC6409] SHOULD have a configuration - // setting that allows an administrator to modify the set of submission EHLO capabilities it may - // expose on this property. + // A JMAP implementation that talks to a submission server [RFC6409](https://www.rfc-editor.org/rfc/rfc6409.html) + // SHOULD have a configuration setting that allows an administrator to modify the set of submission + // EHLO capabilities it may expose on this property. // // This allows a JMAP server to easily add access to a new submission extension without code changes. // @@ -429,31 +424,23 @@ type SessionSubmissionAccountCapabilities struct { // mechanism and thus are only relevant to the JMAP server (for example, PIPELINING, CHUNKING, or STARTTLS). // // Examples of Submission extensions to include: - // - FUTURERELEASE [RFC4865] - // - SIZE [RFC1870] - // - DSN [RFC3461] - // - DELIVERYBY [RFC2852] - // - MT-PRIORITY [RFC6710] + // - FUTURERELEASE [RFC4865](https://www.rfc-editor.org/rfc/rfc4865.html) + // - SIZE [RFC1870](https://www.rfc-editor.org/rfc/rfc1870.html) + // - DSN [RFC3461](https://www.rfc-editor.org/rfc/rfc3461.html) + // - DELIVERYBY [RFC2852](https://www.rfc-editor.org/rfc/rfc2852.html) + // - MT-PRIORITY [RFC6710](https://www.rfc-editor.org/rfc/rfc6710.html) // // A JMAP server MAY advertise an extension and implement the semantics of that extension locally // on the JMAP server even if a submission server used by JMAP doesn’t implement it. // - // The full IANA registry of submission extensions can be found at [iana.org]. - // - // [RFC6409]: https://www.rfc-editor.org/rfc/rfc6409.html - // [RFC4865]: https://www.rfc-editor.org/rfc/rfc4865.html - // [RFC1870]: https://www.rfc-editor.org/rfc/rfc1870.html - // [RFC3461]: https://www.rfc-editor.org/rfc/rfc3461.html - // [RFC2852]: https://www.rfc-editor.org/rfc/rfc2852.html - // [RFC6710]: https://www.rfc-editor.org/rfc/rfc6710.html - // [iana.org]: https://www.iana.org/assignments/mail-parameters + // The full IANA registry of submission extensions can be found at [iana.org](https://www.iana.org/assignments/mail-parameters). SubmissionExtensions map[string][]string `json:"submissionExtensions"` } // This represents support for the VacationResponse data type and associated API methods. // // The value of this property is an empty object in both the JMAP session capabilities -// property and an account’s accountCapabilities property. +// property and an account’s `accountCapabilities` property. type SessionVacationResponseAccountCapabilities struct { } @@ -477,23 +464,18 @@ type SessionSieveAccountCapabilities struct { MaxNumberRedirects int `json:"maxNumberRedirects"` // A list of case-sensitive Sieve capability strings (as listed in the Sieve "require" action; - // see [RFC5228, Section 3.2]) indicating the extensions supported by the Sieve engine. - // - // [RFC5228, Section 3.2]: https://www.rfc-editor.org/rfc/rfc5228.html#section-3.2 + // see [RFC5228, Section 3.2](https://www.rfc-editor.org/rfc/rfc5228.html#section-3.2)) + // indicating the extensions supported by the Sieve engine. SieveExtensions []string `json:"sieveExtensions"` - // A list of URI scheme parts [RFC3986] for notification methods supported by the Sieve "enotify" - // extension [RFC5435], or null if the extension is not supported by the Sieve engine. - // - // [RFC3986]: https://www.rfc-editor.org/rfc/rfc3986.html - // [RFC5435]: https://www.rfc-editor.org/rfc/rfc5435.html + // A list of URI scheme parts [RFC3986](https://www.rfc-editor.org/rfc/rfc3986.html) for notification + // methods supported by the Sieve "enotify" extension [RFC5435](https://www.rfc-editor.org/rfc/rfc5435.html), + // or null if the extension is not supported by the Sieve engine. NotificationMethods []string `json:"notificationMethods"` - // A list of URI scheme parts [RFC3986] for externally stored list types supported by the - // Sieve "extlists" extension [RFC6134], or null if the extension is not supported by the Sieve engine. - // - // [RFC3986]: https://www.rfc-editor.org/rfc/rfc3986.html - // [RFC6134]: https://www.rfc-editor.org/rfc/rfc6134.html + // A list of URI scheme parts [RFC3986](https://www.rfc-editor.org/rfc/rfc3986.html) for externally stored + // list types supported by the Sieve "extlists" extension [RFC6134](https://www.rfc-editor.org/rfc/rfc6134.html), + // or null if the extension is not supported by the Sieve engine. ExternalLists []string `json:"externalLists"` } @@ -508,12 +490,12 @@ type SessionBlobAccountCapabilities struct { // size, e.g., due to lack of disk space or per-user rate limits. MaxSizeBlobSet int `json:"maxSizeBlobSet"` - // The maximum number of DataSourceObjects allowed per creation in a Blob/upload. + // The maximum number of `DataSourceObjects` allowed per creation in a `Blob/upload`. // - // Servers MUST allow at least 64 DataSourceObjects per creation. + // Servers MUST allow at least 64 `DataSourceObjects` per creation. MaxDataSources int `json:"maxDataSources"` - // An array of data type names that are supported for Blob/lookup. + // An array of data type names that are supported for `Blob/lookup`. // // If the server does not support lookups, then this will be the empty list. // @@ -523,18 +505,16 @@ type SessionBlobAccountCapabilities struct { // Clients MUST ignore type names they do not recognise. SupportedTypeNames []string `json:"supportedTypeNames"` - // An array of supported digest algorithms that are supported for Blob/get. + // An array of supported digest algorithms that are supported for `Blob/get`. // // If the server does not support calculating blob digests, then this will be the empty // list. // - // Algorithms in this list MUST be present in the ["HTTP Digest Algorithm Values" registry] - // defined by [RFC3230]; however, in JMAP, they must be lowercased, e.g., "md5" rather than - // "MD5". + // Algorithms in this list MUST be present in the ["HTTP Digest Algorithm Values" registry](https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml) + // defined by [RFC3230](https://www.rfc-editor.org/rfc/rfc3230.html); however, in JMAP, + // they must be lowercased, e.g., `"md5"` rather than `"MD5"`. // // Clients SHOULD prefer algorithms listed earlier in this list. - // - // ["HTTP Digest Algorithm Values" registry]: https://www.iana.org/assignments/http-dig-alg/http-dig-alg.xhtml SupportedDigestAlgorithms []HttpDigestAlgorithm `json:"supportedDigestAlgorithms"` } @@ -704,16 +684,12 @@ type SessionQuotaCapabilities struct { } type SessionWebsocketCapabilities struct { - // The wss-URI (see [Section 3 of RFC6455]) to use for initiating a JMAP-over-WebSocket - // handshake (the "WebSocket URL endpoint" colloquially). - // - // [Section 3 of RFC6455]: https://www.rfc-editor.org/rfc/rfc6455.html#section-3 + // The wss-URI (see [Section 3 of RFC6455](https://www.rfc-editor.org/rfc/rfc6455.html#section-3)) to use + // for initiating a JMAP-over-WebSocket handshake (the "WebSocket URL endpoint" colloquially). Url string `json:"url"` // This is true if the server supports push notifications over the WebSocket, - // as described in [Section 4.3.5 of RFC 8887]. - // - // [Section 4.3.5 of RFC 8887]: https://www.rfc-editor.org/rfc/rfc8887.html#name-jmap-push-notifications + // as described in [Section 4.3.5 of RFC 8887](https://www.rfc-editor.org/rfc/rfc8887.html#name-jmap-push-notifications). SupportsPush bool `json:"supportsPush"` } @@ -751,7 +727,7 @@ type SessionPrincipalCapabilities struct { // (with the exception of free/busy, which is governed by the "mayGetAvailability" property). // // The corresponding Account object can be found in the Principal's "accounts" property, as - // per Section 2 of [RFC9670]. + // per Section 2 of [RFC9670](https://www.rfc-editor.org/rfc/rfc9670.html). AccountId string `json:"accountId,omitempty"` // If true, the user may call the "Principal/getAvailability" method with this Principal. @@ -761,7 +737,7 @@ type SessionPrincipalCapabilities struct { // "shareWith" property of a calendar, see Section 4). MayShareWith *bool `json:"mayShareWith,omitzero"` - // If this Principal may be added as a participant to an event, this is the calendarAddress to + // If this Principal may be added as a participant to an event, this is the `calendarAddress` to // use to receive iTIP scheduling messages. CalendarAddress string `json:"calendarAddress,omitempty"` } @@ -992,15 +968,16 @@ const ( // (update). SetErrorTypeWillDestroy = "willDestroy" - // The record given is invalid in some way. For example: + // The record given is invalid in some way. // - // - It contains properties that are invalid according to the type specification of this record type. - // - It contains a property that may only be set by the server (e.g., “id”) and is different to the current value. - // Note, to allow clients to pass whole objects back, it is not an error to include a server-set property in an - // update as long as the value is identical to the current value on the server. - // - There is a reference to another record (foreign key), and the given id does not correspond to a valid record. + // For example: + // - It contains properties that are invalid according to the type specification of this record type. + // - It contains a property that may only be set by the server (e.g., “id”) and is different to the current value. + // Note, to allow clients to pass whole objects back, it is not an error to include a server-set property in an + // update as long as the value is identical to the current value on the server. + // - There is a reference to another record (foreign key), and the given id does not correspond to a valid record. // - // The SetError object SHOULD also have a property called properties of type String[] that lists all the properties + // The SetError object SHOULD also have a property called properties of type `String[]` that lists all the properties // that were invalid. // // Individual methods MAY specify more specific errors for certain conditions that would otherwise result in an @@ -1157,7 +1134,7 @@ type Mailbox struct { // The id of the Mailbox. Id string `json:"id,omitempty"` - // User-visible name for the Mailbox, e.g., “Inbox”. + // User-visible name for the Mailbox, e.g., "Inbox". // // This MUST be a Net-Unicode string [@!RFC5198] of at least 1 character in length, subject to the maximum size // given in the capability object. @@ -1172,10 +1149,10 @@ type Mailbox struct { // Mailboxes form acyclic graphs (forests) directed by the child-to-parent relationship. There MUST NOT be a loop. ParentId string `json:"parentId,omitempty"` - // Identifies Mailboxes that have a particular common purpose (e.g., the “inbox”), regardless of the name property + // Identifies Mailboxes that have a particular common purpose (e.g., the "inbox"), regardless of the name property // (which may be localised). // - // This value is shared with IMAP (exposed in IMAP via the SPECIAL-USE extension [RFC6154]). + // This value is shared with IMAP (exposed in IMAP via the SPECIAL-USE extension [RFC6154](https://www.rfc-editor.org/rfc/rfc6154.html)). // However, unlike in IMAP, a Mailbox MUST only have a single role, and there MUST NOT be two Mailboxes in the same // account with the same role. // @@ -1183,12 +1160,10 @@ type Mailbox struct { // Otherwise, modifying the IMAP attributes to ensure compliance when exposing the data over JMAP is implementation dependent. // // The value MUST be one of the Mailbox attribute names listed in the IANA IMAP Mailbox Name Attributes registry, - // as established in [RFC8457], converted to lowercase. New roles may be established here in the future. + // as established in [RFC8457](https://www.rfc-editor.org/rfc/rfc8457.html), converted to lowercase. New roles may be + // established here in the future. // // An account is not required to have Mailboxes with any particular roles. - // - // [RFC6154]: https://www.rfc-editor.org/rfc/rfc6154.html - // [RFC8457]: https://www.rfc-editor.org/rfc/rfc8457.html Role string `json:"role,omitempty"` // Defines the sort order of Mailboxes when presented in the client’s UI, so it is consistent between devices. @@ -1217,9 +1192,7 @@ type Mailbox struct { // The set of rights (Access Control Lists (ACLs)) the user has in relation to this Mailbox. // - // These are backwards compatible with IMAP ACLs, as defined in [RFC4314]. - // - // [RFC4314]: https://www.rfc-editor.org/rfc/rfc4314.html + // These are backwards compatible with IMAP ACLs, as defined in [RFC4314](https://www.rfc-editor.org/rfc/rfc4314.html). MyRights *MailboxRights `json:"myRights,omitempty"` // Has the user indicated they wish to see this Mailbox in their client? @@ -1238,9 +1211,7 @@ type Mailbox struct { // However, clients MAY choose to ignore this property, either entirely for ease of implementation or just // for an account where isPersonal is true (indicating it is the user’s own rather than a shared account). // - // This property corresponds to IMAP [RFC3501] Mailbox subscriptions. - // - // [RFC3501]: https://www.rfc-editor.org/rfc/rfc3501.html + // This property corresponds to IMAP [RFC3501](https://www.rfc-editor.org/rfc/rfc3501.html) Mailbox subscriptions. IsSubscribed *bool `json:"isSubscribed,omitempty"` } @@ -1263,7 +1234,7 @@ type MailboxChange struct { // Identifies Mailboxes that have a particular common purpose (e.g., the “inbox”), regardless of the name property // (which may be localised). // - // This value is shared with IMAP (exposed in IMAP via the SPECIAL-USE extension [RFC6154]). + // This value is shared with IMAP (exposed in IMAP via the SPECIAL-USE extension [RFC6154](https://www.rfc-editor.org/rfc/rfc6154.html)). // However, unlike in IMAP, a Mailbox MUST only have a single role, and there MUST NOT be two Mailboxes in the same // account with the same role. // @@ -1271,12 +1242,10 @@ type MailboxChange struct { // Otherwise, modifying the IMAP attributes to ensure compliance when exposing the data over JMAP is implementation dependent. // // The value MUST be one of the Mailbox attribute names listed in the IANA IMAP Mailbox Name Attributes registry, - // as established in [RFC8457], converted to lowercase. New roles may be established here in the future. + // as established in [RFC8457](https://www.rfc-editor.org/rfc/rfc8457.html), converted to lowercase. + // New roles may be established here in the future. // // An account is not required to have Mailboxes with any particular roles. - // - // [RFC6154]: https://www.rfc-editor.org/rfc/rfc6154.html - // [RFC8457]: https://www.rfc-editor.org/rfc/rfc8457.html Role string `json:"role,omitempty"` // Defines the sort order of Mailboxes when presented in the client’s UI, so it is consistent between devices. @@ -1307,9 +1276,7 @@ type MailboxChange struct { // However, clients MAY choose to ignore this property, either entirely for ease of implementation or just // for an account where isPersonal is true (indicating it is the user’s own rather than a shared account). // - // This property corresponds to IMAP [RFC3501] Mailbox subscriptions. - // - // [RFC3501]: https://www.rfc-editor.org/rfc/rfc3501.html + // This property corresponds to IMAP [RFC3501](https://www.rfc-editor.org/rfc/rfc3501.html) Mailbox subscriptions. IsSubscribed *bool `json:"isSubscribed,omitempty"` } @@ -1621,15 +1588,14 @@ type EmailComparator struct { // If false, reverse the comparator’s results to sort in descending order. IsAscending bool `json:"isAscending,omitempty"` - // The identifier, as registered in the collation registry defined in [RFC4790], - // for the algorithm to use when comparing the order of strings. + // The identifier, as registered in the collation registry defined in + // [RFC4790](https://www.rfc-editor.org/rfc/rfc4790.html), for the algorithm + // to use when comparing the order of strings. // // Optional; default is server dependent. // // The algorithms the server supports are advertised in the capabilities object returned // with the Session object. - // - // [RFC4790]: https://www.rfc-editor.org/rfc/rfc4790.html Collation string `json:"collation,omitempty"` // Email-specific: keyword that must be included in the Email object. @@ -1692,13 +1658,11 @@ type EmailQueryCommand struct { // The index of the first result to return relative to the index of the anchor, // if an anchor is given. // - // Default: 0. - // // This MAY be negative. // // For example, -1 means the Email immediately preceding the anchor is the first result in // the list returned. - AnchorOffset int `json:"anchorOffset,omitzero"` + AnchorOffset int `json:"anchorOffset,omitzero" doc:"opt" default:"0"` // The maximum number of results to return. // @@ -1731,10 +1695,12 @@ type EmailGetCommand struct { // // If null, the following properties are returned: // - // [ "id", "blobId", "threadId", "mailboxIds", "keywords", "size", - // "receivedAt", "messageId", "inReplyTo", "references", "sender", "from", - // "to", "cc", "bcc", "replyTo", "subject", "sentAt", "hasAttachment", - // "preview", "bodyValues", "textBody", "htmlBody", "attachments" ] + // ```json + // [ "id", "blobId", "threadId", "mailboxIds", "keywords", "size", + // "receivedAt", "messageId", "inReplyTo", "references", "sender", "from", + // "to", "cc", "bcc", "replyTo", "subject", "sentAt", "hasAttachment", + // "preview", "bodyValues", "textBody", "htmlBody", "attachments" ] + // ``` // // The id property of the object is always returned, even if not explicitly requested. // @@ -1745,18 +1711,20 @@ type EmailGetCommand struct { // // If omitted, this defaults to: // - // [ "partId", "blobId", "size", "name", "type", "charset", "disposition", "cid", "language", "location" ] + // ```json + // [ "partId", "blobId", "size", "name", "type", "charset", "disposition", "cid", "language", "location" ] + // ``` // BodyProperties []string `json:"bodyProperties,omitempty"` // (default: false) If true, the bodyValues property includes any text/* part in the textBody property. - FetchTextBodyValues bool `json:"fetchTextBodyValues,omitzero"` + FetchTextBodyValues bool `json:"fetchTextBodyValues,omitzero" default:"false"` // (default: false) If true, the bodyValues property includes any text/* part in the htmlBody property. - FetchHTMLBodyValues bool `json:"fetchHTMLBodyValues,omitzero"` + FetchHTMLBodyValues bool `json:"fetchHTMLBodyValues,omitzero" default:"false"` // (default: false) If true, the bodyValues property includes any text/* part in the bodyStructure property. - FetchAllBodyValues bool `json:"fetchAllBodyValues,omitzero"` + FetchAllBodyValues bool `json:"fetchAllBodyValues,omitzero" default:"false"` // If greater than zero, the value property of any EmailBodyValue object returned in bodyValues // MUST be truncated if necessary so it does not exceed this number of octets in size. @@ -1778,7 +1746,7 @@ type EmailGetCommand struct { // To allow clients to make more efficient use of the network and avoid round trips, an argument to one method // can be taken from the result of a previous method call in the same request. // -// To do this, the client prefixes the argument name with # (an [octothorpe]). +// To do this, the client prefixes the argument name with # (an [octothorpe](https://en.wiktionary.org/wiki/octothorpe)). // // When processing a method call, the server MUST first check the arguments object for any names beginning with #. // @@ -1798,16 +1766,14 @@ type EmailGetCommand struct { // If none, evaluation fails. // 2. If the response name is not identical to the name property of the ResultReference, evaluation fails. // 3. Apply the path to the arguments object of the response (the second item in the response array) -// following the JSON Pointer algorithm [RFC6901], except with the following addition in “Evaluation” (see Section 4): +// following the JSON Pointer algorithm [RFC6901](https://datatracker.ietf.org/doc/html/rfc6901), +// except with the following addition in “Evaluation” (see Section 4): // 4. If the currently referenced value is a JSON array, the reference token may be exactly the single character *, // making the new referenced value the result of applying the rest of the JSON Pointer tokens to every item in the // array and returning the results in the same order in a new array. // 5. If the result of applying the rest of the pointer tokens to each item was itself an array, the contents of this // array are added to the output rather than the array itself (i.e., the result is flattened from an array of // arrays to a single array). -// -// [octothorpe]; https://en.wiktionary.org/wiki/octothorpe -// [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 type ResultReference struct { // The method call id of a previous method call in the current request. ResultOf string `json:"resultOf"` @@ -1817,9 +1783,8 @@ type ResultReference struct { // A pointer into the arguments of the response selected via the name and resultOf properties. // - // This is a JSON Pointer [RFC6901], except it also allows the use of * to map through an array. - // - // [RFC6901]: https://datatracker.ietf.org/doc/html/rfc6901 + // This is a JSON Pointer [RFC6901](https://datatracker.ietf.org/doc/html/rfc6901), except it also allows + // the use of * to map through an array. Path string `json:"path,omitempty"` } @@ -1836,12 +1801,12 @@ type EmailGetRefCommand struct { // If supplied, only the properties listed in the array are returned for each Email object. // // If null, the following properties are returned: - // - // [ "id", "blobId", "threadId", "mailboxIds", "keywords", "size", - // "receivedAt", "messageId", "inReplyTo", "references", "sender", "from", - // "to", "cc", "bcc", "replyTo", "subject", "sentAt", "hasAttachment", - // "preview", "bodyValues", "textBody", "htmlBody", "attachments" ] - // + // ```json + // [ "id", "blobId", "threadId", "mailboxIds", "keywords", "size", + // "receivedAt", "messageId", "inReplyTo", "references", "sender", "from", + // "to", "cc", "bcc", "replyTo", "subject", "sentAt", "hasAttachment", + // "preview", "bodyValues", "textBody", "htmlBody", "attachments" ] + // ``` // The id property of the object is always returned, even if not explicitly requested. // // If an invalid property is requested, the call MUST be rejected with an invalidArguments error. @@ -1850,19 +1815,19 @@ type EmailGetRefCommand struct { // A list of properties to fetch for each EmailBodyPart returned. // // If omitted, this defaults to: - // - // [ "partId", "blobId", "size", "name", "type", "charset", "disposition", "cid", "language", "location" ] - // + // ```json + // [ "partId", "blobId", "size", "name", "type", "charset", "disposition", "cid", "language", "location" ] + // ``` BodyProperties []string `json:"bodyProperties,omitempty"` // (default: false) If true, the bodyValues property includes any text/* part in the textBody property. - FetchTextBodyValues bool `json:"fetchTextBodyValues,omitzero"` + FetchTextBodyValues bool `json:"fetchTextBodyValues,omitzero" default:"false"` // (default: false) If true, the bodyValues property includes any text/* part in the htmlBody property. - FetchHTMLBodyValues bool `json:"fetchHTMLBodyValues,omitzero"` + FetchHTMLBodyValues bool `json:"fetchHTMLBodyValues,omitzero" default:"false"` // (default: false) If true, the bodyValues property includes any text/* part in the bodyStructure property. - FetchAllBodyValues bool `json:"fetchAllBodyValues,omitzero"` + FetchAllBodyValues bool `json:"fetchAllBodyValues,omitzero" default:"false"` // If greater than zero, the value property of any EmailBodyValue object returned in bodyValues // MUST be truncated if necessary so it does not exceed this number of octets in size. @@ -1872,7 +1837,7 @@ type EmailGetRefCommand struct { // The server MUST ensure the truncation results in valid UTF-8 and does not occur mid-codepoint. // // If the part is of type text/html, the server SHOULD NOT truncate inside an HTML tag, e.g., in - // the middle of . + // the middle of ``. // // There is no requirement for the truncated form to be a balanced tree or valid HTML (indeed, the original // source may well be neither of these things). @@ -1898,58 +1863,46 @@ type EmailChangesCommand struct { } type EmailAddress struct { - // The display-name of the mailbox [RFC5322]. + // The display-name of the mailbox [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html). // // If this is a quoted-string: - // 1. The surrounding DQUOTE characters are removed. - // 2. Any quoted-pair is decoded. - // 3. White space is unfolded, and then any leading and trailing white space is removed. + // 1. The surrounding DQUOTE characters are removed. + // 2. Any quoted-pair is decoded. + // 3. White space is unfolded, and then any leading and trailing white space is removed. + // // If there is no display-name but there is a comment immediately following the addr-spec, the value of this // SHOULD be used instead. Otherwise, this property is null. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html - // - // example: $emailAddressName Name string `json:"name,omitempty"` - // The addr-spec of the mailbox [RFC5322]. + // The addr-spec of the mailbox [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html). // - // Any syntactically correct encoded sections [RFC2047] with a known encoding MUST be decoded, - // following the same rules as for the Text form. + // Any syntactically correct encoded sections [RFC2047](https://www.rfc-editor.org/rfc/rfc2047.html) with + // a known encoding MUST be decoded, following the same rules as for the Text form. // // Parsing SHOULD be best effort in the face of invalid structure to accommodate invalid messages and // semi-complete drafts. EmailAddress objects MAY have an email property that does not conform to the // addr-spec form (for example, may not contain an @ symbol). - // - // [RFC2047]: https://www.rfc-editor.org/rfc/rfc2047.html - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html - // - // example: $emailAddressEmail Email string `json:"email,omitempty"` } type EmailAddressGroup struct { - // The display-name of the group [RFC5322], or null if the addresses are not part of a group. + // The display-name of the group [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html), or `null` + // if the addresses are not part of a group. // // If this is a quoted-string, it is processed the same as the name in the EmailAddress type. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html - Name string `json:"name,omitempty"` - // The mailbox values that belong to this group, represented as EmailAddress objects. + // The mailbox values that belong to this group, represented as `EmailAddress` objects. Addresses []EmailAddress `json:"addresses,omitempty"` } type EmailHeader struct { - // The header field name as defined in [RFC5322], with the same capitalization that it has in the message. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html + // The header field name as defined in [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html), + // with the same capitalization that it has in the message. Name string `json:"name"` - // The header field value as defined in [RFC5322], in Raw form. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html + // The header field value as defined in [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html), + // in Raw form. Value string `json:"value"` } @@ -1976,21 +1929,16 @@ type EmailBodyPart struct { PartId string `json:"partId,omitempty"` // The id representing the raw octets of the contents of the part, after decoding any known - // `Content-Transfer-Encoding` (as defined in [RFC2045]), or null if, and only if, the part is of type `multipart/*`. + // `Content-Transfer-Encoding` (as defined in [RFC2045](https://www.rfc-editor.org/rfc/rfc2045.html)), or + // `null` if, and only if, the part is of type `multipart/*`. // // Note that two parts may be transfer-encoded differently but have the same blob id if their decoded octets are identical // and the server is using a secure hash of the data for the blob id. // If the transfer encoding is unknown, it is treated as though it had no transfer encoding. - // - // [RFC2045]: https://www.rfc-editor.org/rfc/rfc2045.html - // - // example: $blobId BlobId string `json:"blobId,omitempty"` // The size, in octets, of the raw data after content transfer decoding (as referenced by the `blobId`, i.e., // the number of octets in the file the user would download). - // - // example: 31219 Size int `json:"size,omitempty"` // This is a list of all header fields in the part, in the order they appear in the message. @@ -1998,24 +1946,16 @@ type EmailBodyPart struct { // The values are in Raw form. Headers []EmailHeader `json:"headers,omitempty"` - // This is the decoded filename parameter of the `Content-Disposition` header field per [RFC2231], or - // (for compatibility with existing systems) if not present, then it’s the decoded name parameter of - // the `Content-Type` header field per [RFC2047]. - // - // [RFC2231]: https://www.rfc-editor.org/rfc/rfc2231.html - // [RFC2047]: https://www.rfc-editor.org/rfc/rfc2047.html - // - // name: $attachmentName + // This is the decoded filename parameter of the `Content-Disposition` header field per + // [RFC2231](https://www.rfc-editor.org/rfc/rfc2231.html), or (for compatibility with existing systems) + // if not present, then it’s the decoded name parameter of the `Content-Type` header field per + // [RFC2047](https://www.rfc-editor.org/rfc/rfc2047.html). Name string `json:"name,omitempty"` // The value of the `Content-Type` header field of the part, if present; otherwise, the implicit type as per // the MIME standard (`text/plain` or `message/rfc822` if inside a `multipart/digest`). // - // [CFWS] is removed and any parameters are stripped. - // - // [CFWS]: https://www.rfc-editor.org/rfc/rfc5322#section-3.2.2 - // - // example: $attachmentType + // [CFWS](https://www.rfc-editor.org/rfc/rfc5322#section-3.2.2) is removed and any parameters are stripped. Type string `json:"type,omitempty"` // The value of the `charset` parameter of the `Content-Type` header field, if present, or null if the header @@ -2023,42 +1963,28 @@ type EmailBodyPart struct { // // If there is no `Content-Type` header field, or it exists and is of type `text/*` but has no `charset` parameter, // this is the implicit charset as per the MIME standard: `us-ascii`. - // - // example: $attachmentCharset Charset string `json:"charset,omitempty"` // The value of the `Content-Disposition` header field of the part, if present; // otherwise, it’s null. // - // [CFWS] is removed and any parameters are stripped. - // - // [CFWS]: https://www.rfc-editor.org/rfc/rfc5322#section-3.2.2 - // - // example: $attachmentDisposition + // [CFWS](https://www.rfc-editor.org/rfc/rfc5322#section-3.2.2) is removed and any parameters are stripped. Disposition string `json:"disposition,omitempty"` // The value of the `Content-Id` header field of the part, if present; otherwise it’s null. // - // [CFWS] and surrounding angle brackets (`<>`) are removed. + // [CFWS](https://www.rfc-editor.org/rfc/rfc5322#section-3.2.2) and surrounding angle brackets (`<>`) are removed. // // This may be used to reference the content from within a `text/html` body part HTML using the `cid:` protocol, - // as defined in [RFC2392]. - // - // [RFC2392]: https://www.rfc-editor.org/rfc/rfc2392.html - // [CFWS]: https://www.rfc-editor.org/rfc/rfc5322#section-3.2.2 - // - // example: $attachmentCid + // as defined in [RFC2392](https://www.rfc-editor.org/rfc/rfc2392.html). Cid string `json:"cid,omitempty"` - // The list of language tags, as defined in [RFC3282], in the `Content-Language` header field of the part, - // if present. - // - // [RFC3282]: https://www.rfc-editor.org/rfc/rfc3282.html + // The list of language tags, as defined in [RFC3282](https://www.rfc-editor.org/rfc/rfc3282.html), + // in the `Content-Language` header field of the part, if present. Language string `json:"language,omitempty"` - // The URI, as defined in [RFC2557], in the `Content-Location` header field of the part, if present. - // - // [RFC2557]: https://www.rfc-editor.org/rfc/rfc2557.html + // The URI, as defined in [RFC2557](https://www.rfc-editor.org/rfc/rfc2557.html), in the + // `Content-Location` header field of the part, if present. Location string `json:"location,omitempty"` // If the type is `multipart/*`, this contains the body parts of each child. @@ -2159,26 +2085,17 @@ var EmailProperties = []string{ type Email struct { // The id of the Email object. // - // Note that this is the JMAP object id, NOT the `Message-ID` header field value of the message [RFC5322]. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html - // - // required: true - // example: $emailId - Id string `json:"id,omitempty"` + // Note that this is the JMAP object id, NOT the `Message-ID` header field value of the message + // [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html). + Id string `json:"id,omitempty" doc:"req,!request"` - // The id representing the raw octets of the message [RFC5322] for this Email. + // The id representing the raw octets of the message [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html) + // for this Email. // // This may be used to download the raw original message or to attach it directly to another Email, etc. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html - // - // example: $blobId BlobId string `json:"blobId,omitempty"` // The id of the Thread to which this Email belongs. - // - // example: $threadId ThreadId string `json:"threadId,omitempty"` // The number of emails (this one included) that are in the thread this email is in. @@ -2195,8 +2112,6 @@ type Email struct { // The set is represented as an object, with each key being a Mailbox id. // // The value for each key in the object MUST be true. - // - // example: {"a": true} MailboxIds map[string]bool `json:"mailboxIds,omitempty"` // A set of keywords that apply to the Email. @@ -2211,10 +2126,10 @@ type Email struct { // // The following four keywords have their first character changed from \ in IMAP to $ in JMAP and have particular semantic meaning: // - // - $draft: The Email is a draft the user is composing. - // - $seen: The Email has been read. - // - $flagged: The Email has been flagged for urgent/special attention. - // - $answered: The Email has been replied to. + // - `$draft`: The Email is a draft the user is composing. + // - `$seen`: The Email has been read. + // - `$flagged`: The Email has been flagged for urgent/special attention. + // - `$answered`: The Email has been replied to. // // The IMAP \Recent keyword is not exposed via JMAP. The IMAP \Deleted keyword is also not present: IMAP uses a delete+expunge model, // which JMAP does not. Any message with the \Deleted keyword MUST NOT be visible via JMAP (and so are not counted in the @@ -2224,115 +2139,112 @@ type Email struct { // For compatibility with IMAP, a keyword is a case-insensitive string of 1–255 characters in the ASCII subset // %x21–%x7e (excludes control chars and space), and it MUST NOT include any of these characters: // + // ``` // ( ) { ] % * " \ + // ``` // // Because JSON is case sensitive, servers MUST return keywords in lowercase. // - // The [IMAP and JMAP Keywords] registry as established in [RFC5788] assigns semantic meaning to some other + // The [IMAP and JMAP Keywords](https://www.iana.org/assignments/imap-jmap-keywords/) registry as established + // in [RFC5788](https://www.rfc-editor.org/rfc/rfc5788.html) assigns semantic meaning to some other // keywords in common use. // // New keywords may be established here in the future. In particular, note: // - // - $forwarded: The Email has been forwarded. - // - $phishing: The Email is highly likely to be phishing. - // Clients SHOULD warn users to take care when viewing this Email and disable links and attachments. - // - $junk: The Email is definitely spam. - // Clients SHOULD set this flag when users report spam to help train automated spam-detection systems. - // - $notjunk: The Email is definitely not spam. - // Clients SHOULD set this flag when users indicate an Email is legitimate, to help train automated spam-detection systems. - // - // [IMAP and JMAP Keywords]: https://www.iana.org/assignments/imap-jmap-keywords/ - // [RFC5788]: https://www.rfc-editor.org/rfc/rfc5788.html + // - `$forwarded`: The Email has been forwarded. + // - `$phishing`: The Email is highly likely to be phishing. + // Clients SHOULD warn users to take care when viewing this Email and disable links and attachments. + // - `$junk`: The Email is definitely spam. + // Clients SHOULD set this flag when users report spam to help train automated spam-detection systems. + // - `$notjunk`: The Email is definitely not spam. + // Clients SHOULD set this flag when users indicate an Email is legitimate, to help train automated spam-detection systems. Keywords map[string]bool `json:"keywords,omitempty"` - // The size, in octets, of the raw data for the message [RFC5322] + // The size, in octets, of the raw data for the message [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html) // (as referenced by the blobId, i.e., the number of octets in the file the user would download). - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html Size int `json:"size,omitzero"` // The date the Email was received by the message store. // - // This is the internal date in IMAP [RFC3501]. - // - // [RFC3501]: https://www.rfc-editor.org/rfc/rfc3501.html + // This is the internal date in IMAP [RFC3501](https://www.rfc-editor.org/rfc/rfc3501.html). ReceivedAt time.Time `json:"receivedAt,omitzero"` - // This is a list of all header fields [RFC5322], in the same order they appear in the message. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html + // This is a list of all header fields [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html), + // in the same order they appear in the message. Headers []EmailHeader `json:"headers,omitempty"` - // The value is identical to the value of header:Message-ID:asMessageIds. + // The value is identical to the value of `header:Message-ID:asMessageIds`. // - // For messages conforming to [RFC5322] this will be an array with a single entry. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html + // For messages conforming to [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html) this will be an array with + // a single entry. MessageId []string `json:"messageId,omitempty"` - // The value is identical to the value of header:In-Reply-To:asMessageIds. + // The value is identical to the value of `header:In-Reply-To:asMessageIds`. InReplyTo []string `json:"inReplyTo,omitempty"` - // The value is identical to the value of header:References:asMessageIds. + // The value is identical to the value of `header:References:asMessageIds`. References []string `json:"references,omitempty"` - // The value is identical to the value of header:Sender:asAddresses. + // The value is identical to the value of `header:Sender:asAddresses`. Sender []EmailAddress `json:"sender,omitempty"` - // The value is identical to the value of header:From:asAddresses. + // The value is identical to the value of `header:From:asAddresses`. From []EmailAddress `json:"from,omitempty"` - // The value is identical to the value of header:To:asAddresses. + // The value is identical to the value of `header:To:asAddresses`. To []EmailAddress `json:"to,omitempty"` - // The value is identical to the value of header:Cc:asAddresses. + // The value is identical to the value of `header:Cc:asAddresses`. Cc []EmailAddress `json:"cc,omitempty"` - // The value is identical to the value of header:Bcc:asAddresses. + // The value is identical to the value of `header:Bcc:asAddresses`. Bcc []EmailAddress `json:"bcc,omitempty"` - // The value is identical to the value of header:Reply-To:asAddresses. + // The value is identical to the value of `header:Reply-To:asAddresses`. ReplyTo []EmailAddress `json:"replyTo,omitempty"` - // The value is identical to the value of header:Subject:asText. + // The value is identical to the value of `header:Subject:asText`. Subject string `json:"subject,omitempty"` - // The value is identical to the value of header:Date:asDate. + // The value is identical to the value of `header:Date:asDate`. SentAt time.Time `json:"sentAt,omitzero"` - // This is the full MIME structure of the message body, without recursing into message/rfc822 or message/global parts. + // This is the full MIME structure of the message body, without recursing into + // `message/rfc822` or `message/global` parts. // - // Note that EmailBodyParts may have subParts if they are of type multipart/*. + // Note that EmailBodyParts may have subParts if they are of type `multipart/*`. BodyStructure *EmailBodyPart `json:"bodyStructure,omitzero"` - // This is a map of partId to an EmailBodyValue object for none, some, or all text/* parts. + // This is a map of partId to an EmailBodyValue object for none, some, or all `text/*` parts. // - // Which parts are included and whether the value is truncated is determined by various arguments to Email/get and Email/parse. + // Which parts are included and whether the value is truncated is determined by + // various arguments to `Email/get` and `Email/parse`. BodyValues map[string]EmailBodyValue `json:"bodyValues,omitempty"` - // A list of text/plain, text/html, image/*, audio/*, and/or video/* parts to display (sequentially) as the - // message body, with a preference for text/plain when alternative versions are available. + // A list of `text/plain`, `text/html`, `image/*`, `audio/*`, and/or `video/*` parts to display + // (sequentially) as the message body, with a preference for `text/plain` when alternative + // versions are available. TextBody []EmailBodyPart `json:"textBody,omitempty"` - // A list of text/plain, text/html, image/*, audio/*, and/or video/* parts to display (sequentially) as the - // message body, with a preference for text/html when alternative versions are available. + // A list of `text/plain`, `text/html`, `image/*`, `audio/*`, and/or `video/*` parts to display + // (sequentially) as the message body, with a preference for `text/html` when alternative + // versions are available. HtmlBody []EmailBodyPart `json:"htmlBody,omitempty"` // A list, traversing depth-first, of all parts in bodyStructure. // // They must satisfy either of the following conditions: // - // - not of type multipart/* and not included in textBody or htmlBody - // - of type image/*, audio/*, or video/* and not in both textBody and htmlBody + // - not of type `multipart/*` and not included in textBody or htmlBody + // - of type `image/*`, `audio/*`, or `video/*` and not in both textBody and htmlBody // // None of these parts include subParts, including message/* types. // // Attached messages may be fetched using the Email/parse method and the blobId. // // Note that a text/html body part HTML may reference image parts in attachments by using cid: - // links to reference the Content-Id, as defined in [RFC2392], or by referencing the Content-Location. - // - // [RFC2392]: https://www.rfc-editor.org/rfc/rfc2392.html + // links to reference the Content-Id, as defined in [RFC2392](https://www.rfc-editor.org/rfc/rfc2392.html), + // or by referencing the Content-Location. Attachments []EmailBodyPart `json:"attachments,omitempty"` // This is true if there are one or more parts in the message that a client UI should offer as downloadable. @@ -2371,18 +2283,15 @@ type AddressParameters struct { type Address struct { // The email address being represented by the object. // - // This is a “Mailbox” as used in the Reverse-path or Forward-path of the MAIL FROM or RCPT TO command in [RFC5321]. - // - // [RFC5321]: https://datatracker.ietf.org/doc/html/rfc5321 + // This is a “Mailbox” as used in the Reverse-path or Forward-path of the MAIL FROM or RCPT TO + // command in [RFC5321](https://datatracker.ietf.org/doc/html/rfc5321). Email string `json:"email,omitempty"` // Any parameters to send with the email address (either mail-parameter or rcpt-parameter as appropriate, - // as specified in [RFC5321]). + // as specified in [RFC5321](https://datatracker.ietf.org/doc/html/rfc5321)). // // If supplied, each key in the object is a parameter name, and the value is either the parameter value (type String) // or null if the parameter does not take a value. - // - // [RFC5321]: https://datatracker.ietf.org/doc/html/rfc5321 Parameters *AddressParameters `json:"parameters,omitempty"` } @@ -2450,40 +2359,40 @@ const ( type DeliveryStatus struct { // The SMTP reply string returned for this recipient when the server last tried to // relay the message, or in a later Delivery Status Notification (DSN, as defined in - // [RFC3464]) response for the message. + // [RFC3464](https://datatracker.ietf.org/doc/html/rfc3464)) response for the message. // // This SHOULD be the response to the RCPT TO stage, unless this was accepted and the // message as a whole was rejected at the end of the DATA stage, in which case the // DATA stage reply SHOULD be used instead. - // - // [RFC3464]: https://datatracker.ietf.org/doc/html/rfc3464 SmtpReply string `json:"smtpReply"` // Represents whether the message has been successfully delivered to the recipient. // // This MUST be one of the following values: - // - queued: The message is in a local mail queue and status will change once it exits - // the local mail queues. The smtpReply property may still change. - // - yes: The message was successfully delivered to the mail store of the recipient. - // The smtpReply property is final. - // - no: Delivery to the recipient permanently failed. The smtpReply property is final. - // - unknown: The final delivery status is unknown, (e.g., it was relayed to an external - // machine and no further information is available). - // The smtpReply property may still change if a DSN arrives. + // - `queued`: The message is in a local mail queue and status will change once it exits + // the local mail queues. The smtpReply property may still change. + // - `yes`: The message was successfully delivered to the mail store of the recipient. + // The smtpReply property is final. + // - `no`: Delivery to the recipient permanently failed. The smtpReply property is final. + // - `unknown`: The final delivery status is unknown, (e.g., it was relayed to an external + // machine and no further information is available). + // + // The smtpReply property may still change if a DSN arrives. Delivered DeliveryStatusDelivered `json:"delivered"` // Represents whether the message has been displayed to the recipient. // // This MUST be one of the following values: - // - unknown: The display status is unknown. This is the initial value. - // - yes: The recipient’s system claims the message content has been displayed to the recipient. - // Note that there is no guarantee that the recipient has noticed, read, or understood the content. + // - `unknown`: The display status is unknown. This is the initial value. + // - `yes`: The recipient’s system claims the message content has been displayed to the recipient. + // + // Note that there is no guarantee that the recipient has noticed, read, or understood the content. Displayed DeliveryStatusDisplayed `json:"displayed"` } type EmailSubmission struct { // The id of the EmailSubmission (server-set). - Id string `json:"id"` + Id string `json:"id" doc:"req,!request"` // The id of the Identity to associate with this submission. IdentityId string `json:"identityId"` @@ -2504,11 +2413,11 @@ type EmailSubmission struct { // If the envelope property is null or omitted on creation, the server MUST generate this from the // referenced Email as follows: // - // - mailFrom: The email address in the Sender header field, if present; otherwise, - // it’s the email address in the From header field, if present. - // In either case, no parameters are added. - // - rcptTo: The deduplicated set of email addresses from the To, Cc, and Bcc header fields, - // if present, with no parameters for any of them. + // - `mailFrom`: The email address in the Sender header field, if present; otherwise, + // it’s the email address in the From header field, if present. + // In either case, no parameters are added. + // - `rcptTo`: The deduplicated set of email addresses from the To, Cc, and Bcc header fields, + // if present, with no parameters for any of them. Envelope *Envelope `json:"envelope,omitempty"` // The date the submission was/will be released for delivery (server-set). @@ -2518,10 +2427,10 @@ type EmailSubmission struct { // // This is server set on create and MUST be one of the following values: // - // - pending: It may be possible to cancel this submission. - // - final: The message has been relayed to at least one recipient in a manner that cannot be - // recalled. It is no longer possible to cancel this submission. - // - canceled: The submission was canceled and will not be delivered to any recipient. + // - `pending`: It may be possible to cancel this submission. + // - `final`: The message has been relayed to at least one recipient in a manner that cannot be + // recalled. It is no longer possible to cancel this submission. + // - `canceled`: The submission was canceled and will not be delivered to any recipient. UndoStatus EmailSubmissionUndoStatus `json:"undoStatus"` // This represents the delivery status for each of the submission’s recipients, if known (server-set). @@ -2534,20 +2443,16 @@ type EmailSubmission struct { // This value is a map from the email address of each recipient to a DeliveryStatus object. DeliveryStatus map[string]DeliveryStatus `json:"deliveryStatus"` - // A list of blob ids for DSNs [RFC3464] received for this submission, - // in order of receipt, oldest first (server-set) . + // A list of blob ids for DSNs [RFC3464](https://datatracker.ietf.org/doc/html/rfc3464) + // received for this submission, in order of receipt, oldest first (server-set) . // // The blob is the whole MIME message (with a top-level content-type of multipart/report), as received. - // - // [RFC3464]: https://datatracker.ietf.org/doc/html/rfc3464 DsnBlobIds []string `json:"dsnBlobIds,omitempty"` - // A list of blob ids for MDNs [RFC8098] received for this submission, - // in order of receipt, oldest first (server-set). + // A list of blob ids for MDNs [RFC8098](https://datatracker.ietf.org/doc/html/rfc8098) + // received for this submission, in order of receipt, oldest first (server-set). // // The blob is the whole MIME message (with a top-level content-type of multipart/report), as received. - // - // [RFC8098]: https://datatracker.ietf.org/doc/html/rfc8098 MdnBlobIds []string `json:"mdnBlobIds,omitempty"` } @@ -2623,16 +2528,19 @@ type EmailSubmissionGetResponse struct { // // Example: // -// - moves it from the drafts folder (which has Mailbox id “7cb4e8ee-df87-4757-b9c4-2ea1ca41b38e”) -// to the sent folder (which we presume has Mailbox id “73dbcb4b-bffc-48bd-8c2a-a2e91ca672f6”) +// - moves it from the drafts folder (which has Mailbox id `"7cb4e8ee-df87-4757-b9c4-2ea1ca41b38e"“) +// to the sent folder (which we presume has Mailbox id `"73dbcb4b-bffc-48bd-8c2a-a2e91ca672f6"“) +// - removes the `$draft` flag // -// - removes the $draft flag and +// ```json // -// { -// "mailboxIds/7cb4e8ee-df87-4757-b9c4-2ea1ca41b38e": null, -// "mailboxIds/73dbcb4b-bffc-48bd-8c2a-a2e91ca672f6": true, -// "keywords/$draft": null -// } +// { +// "mailboxIds/7cb4e8ee-df87-4757-b9c4-2ea1ca41b38e": null, +// "mailboxIds/73dbcb4b-bffc-48bd-8c2a-a2e91ca672f6": true, +// "keywords/$draft": null +// } +// +// ``` type PatchObject map[string]any // same as EmailSubmission but without the server-set attributes @@ -2725,10 +2633,8 @@ type Request struct { // The set of capabilities the client wishes to use. // // The client MAY include capability identifiers even if the method calls it makes do not utilise those capabilities. - // The server advertises the set of specifications it supports in the Session object (see [Section 2]), as keys on - // the capabilities property. - // - // [Section 2]: https://jmap.io/spec-core.html#the-jmap-session-resource + // The server advertises the set of specifications it supports in the Session object + // (see [Section 2](https://jmap.io/spec-core.html#the-jmap-session-resource)), as keys on the capabilities property. Using []string `json:"using"` // An array of method calls to process on the server. @@ -2764,10 +2670,8 @@ type Response struct { // additional ones added for newly created records. CreatedIds map[string]string `json:"createdIds,omitempty"` - // The current value of the “state” string on the Session object, as described in [Section 2]. + // The current value of the “state” string on the Session object, as described in [Section 2](https://jmap.io/spec-core.html#the-jmap-session-resource). // Clients may use this to detect if this object has changed and needs to be refetched. - // - // [Section 2]: https://jmap.io/spec-core.html#the-jmap-session-resource SessionState SessionState `json:"sessionState"` // This MUST be the string "Response". @@ -2997,36 +2901,34 @@ type EmailCreate struct { // The value for each key in the object MUST be true. Keywords map[string]bool `json:"keywords,omitempty"` - // This is a list of all header fields [RFC5322], in the same order they appear in the message. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html + // This is a list of all header fields [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html), + // in the same order they appear in the message. Headers []EmailHeader `json:"headers,omitempty"` - // The value is identical to the value of header:In-Reply-To:asMessageIds. + // The value is identical to the value of `header:In-Reply-To:asMessageIds`. InReplyTo []string `json:"inReplyTo,omitempty"` - // The value is identical to the value of header:References:asMessageIds. + // The value is identical to the value of `header:References:asMessageIds`. References []string `json:"references,omitempty"` - // The value is identical to the value of header:Sender:asAddresses. + // The value is identical to the value of `header:Sender:asAddresses`. Sender []EmailAddress `json:"sender,omitempty"` - // The ["From:" field] specifies the author(s) of the message, that is, the mailbox(es) - // of the person(s) or system(s) responsible for the writing of the message - // - // ["From:" field]: https://www.rfc-editor.org/rfc/rfc5322.html#section-3.6.2 + // The ["From:" field](https://www.rfc-editor.org/rfc/rfc5322.html#section-3.6.2) specifies + // the author(s) of the message, that is, the mailbox(es) of the person(s) or system(s) + // responsible for the writing of the message From []EmailAddress `json:"from,omitempty"` - // The value is identical to the value of header:To:asAddresses. + // The value is identical to the value of `header:To:asAddresses`. To []EmailAddress `json:"to,omitempty"` - // The value is identical to the value of header:Cc:asAddresses. + // The value is identical to the value of `header:Cc:asAddresses`. Cc []EmailAddress `json:"cc,omitempty"` - // The value is identical to the value of header:Bcc:asAddresses. + // The value is identical to the value of `header:Bcc:asAddresses`. Bcc []EmailAddress `json:"bcc,omitempty"` - // The value is identical to the value of header:Reply-To:asAddresses. + // The value is identical to the value of `header:Reply-To:asAddresses`. ReplyTo []EmailAddress `json:"replyTo,omitempty"` // The "Subject:" field contains a short string identifying the topic of the message. @@ -3035,7 +2937,7 @@ type EmailCreate struct { // The date the Email was received by the message store. // // (default: time of most recent Received header, or time of import on server if none). - ReceivedAt time.Time `json:"receivedAt,omitzero"` + ReceivedAt time.Time `json:"receivedAt,omitzero" doc:"opt"` // The origination date specifies the date and time at which the creator of the message indicated that // the message was complete and ready to enter the mail delivery system. @@ -3072,17 +2974,16 @@ type EmailCreate struct { // // They must satisfy either of the following conditions: // - // - not of type multipart/* and not included in textBody or htmlBody - // - of type image/*, audio/*, or video/* and not in both textBody and htmlBody + // - not of type `multipart/*` and not included in textBody or htmlBody + // - of type `image/*`, `audio/*`, or `video/*` and not in both textBody and htmlBody // - // None of these parts include subParts, including message/* types. + // None of these parts include subParts, including `message/*` types. // // Attached messages may be fetched using the Email/parse method and the blobId. // - // Note that a text/html body part HTML may reference image parts in attachments by using cid: - // links to reference the Content-Id, as defined in [RFC2392], or by referencing the Content-Location. - // - // [RFC2392]: https://www.rfc-editor.org/rfc/rfc2392.html + // Note that a `text/html` body part HTML may reference image parts in attachments by using cid: + // links to reference the `Content-Id`, as defined in [RFC2392](https://www.rfc-editor.org/rfc/rfc2392.html), + // or by referencing the `Content-Location`. Attachments []EmailBodyPart `json:"attachments,omitempty"` } @@ -3120,13 +3021,13 @@ type EmailSetCommand struct { // // All paths MUST also conform to the following restrictions; if there is any violation, the update // MUST be rejected with an `invalidPatch` error: - // !- The pointer MUST NOT reference inside an array (i.e., you MUST NOT insert/delete from an array; the array MUST be replaced in its entirety instead). - // !- All parts prior to the last (i.e., the value after the final slash) MUST already exist on the object being patched. - // !- There MUST NOT be two patches in the `PatchObject` where the pointer of one is the prefix of the pointer of the other, e.g., `"alerts/1/offset"` and `"alerts"`. + // * The pointer MUST NOT reference inside an array (i.e., you MUST NOT insert/delete from an array; the array MUST be replaced in its entirety instead). + // * All parts prior to the last (i.e., the value after the final slash) MUST already exist on the object being patched. + // * There MUST NOT be two patches in the `PatchObject` where the pointer of one is the prefix of the pointer of the other, e.g., `"alerts/1/offset"` and `"alerts"`. // // The value associated with each pointer determines how to apply that patch: - // !- If null, set to the default value if specified for this property; otherwise, remove the property from the patched object. If the key is not present in the parent, this a no-op. - // !- Anything else: The value to set for this property (this may be a replacement or addition to the object being patched). + // * If null, set to the default value if specified for this property; otherwise, remove the property from the patched object. If the key is not present in the parent, this a no-op. + // * Anything else: The value to set for this property (this may be a replacement or addition to the object being patched). // // Any server-set properties MAY be included in the patch if their value is identical to the current server value // (before applying the patches to the object). Otherwise, the update MUST be rejected with an `invalidProperties` `SetError`. @@ -3193,9 +3094,7 @@ const ( ) type EmailImport struct { - // The id of the blob containing the raw message [RFC5322]. - // - // [RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html + // The id of the blob containing the raw message [RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html). BlobId string `json:"blobId"` // The ids of the Mailboxes to assign this Email to. @@ -3208,7 +3107,7 @@ type EmailImport struct { // (default: time of most recent Received header, or time of import // on server if none) The receivedAt date to set on the Email. - ReceivedAt time.Time `json:"receivedAt"` + ReceivedAt time.Time `json:"receivedAt" doc:"opt"` } type EmailImportCommand struct { @@ -3754,9 +3653,7 @@ type AddressBook struct { // AddressBooks with equal order SHOULD be sorted in alphabetical order by name. // // The sorting should take into account locale-specific character order convention. - // - // Default: 0 - SortOrder uint `json:"sortOrder,omitzero"` + SortOrder uint `json:"sortOrder,omitzero" default:"0" doc:"opt"` // This SHOULD be true for exactly one AddressBook in any account, and MUST NOT be true for more than one // AddressBook within an account. @@ -3826,12 +3723,12 @@ type CalendarRights struct { // to one of the user's `ParticipantIdentity` objects in the account, even if they would not // otherwise have permission to modify that event. // - // !- `participationStatus` - // !- `participationComment` - // !- `expectReply` - // !- `scheduleAgent` - // !- `scheduleSequence` - // !- `scheduleUpdated` + // * `participationStatus` + // * `participationComment` + // * `expectReply` + // * `scheduleAgent` + // * `scheduleSequence` + // * `scheduleUpdated` // // If the event has its `mayInviteSelf` property set to `true`, then the user may also add a // new `Participant` to the event with `scheduleId`/`sendTo` properties that are the same as @@ -3922,9 +3819,7 @@ type Calendar struct { // // If an event is in multiple calendars, it should be displayed if `isVisible` is `true` // for any of those calendars. - // - // default: true - IsVisible bool `json:"isVisible"` + IsVisible bool `json:"isVisible" default:"true" doc:"opt"` // This SHOULD be true for exactly one calendar in any account, and MUST NOT be true for more // than one calendar within an account (server-set). @@ -3940,9 +3835,9 @@ type Calendar struct { // Should the calendar’s events be used as part of availability calculation? // // This MUST be one of: - // !- `all``: all events are considered. - // !- `attending``: events the user is a confirmed or tentative participant of are considered. - // !- `none``: all events are ignored (but may be considered if also in another calendar). + // * `all`: all events are considered. + // * `attending`: events the user is a confirmed or tentative participant of are considered. + // * `none`: all events are ignored (but may be considered if also in another calendar). // // This should default to “all” for the calendars in the user’s own account, and “none” for calendars shared with the user. IncludeInAvailability IncludeInAvailability `json:"includeInAvailability,omitempty"` @@ -4000,10 +3895,10 @@ type Calendar struct { // The set of access rights the user has in relation to this Calendar. // // If any event is in multiple calendars, the user has the following rights: - // !- The user may fetch the event if they have the mayReadItems right on any calendar the event is in. - // !- The user may remove an event from a calendar (by modifying the event’s “calendarIds” property) if the user + // * The user may fetch the event if they have the mayReadItems right on any calendar the event is in. + // * The user may remove an event from a calendar (by modifying the event’s “calendarIds” property) if the user // has the appropriate permission for that calendar. - // !- The user may make other changes to the event if they have the right to do so in all calendars to which the + // * The user may make other changes to the event if they have the right to do so in all calendars to which the // event belongs. MyRights *CalendarRights `json:"myRights,omitempty"` } @@ -4013,7 +3908,6 @@ type Calendar struct { // // It is a JSCalendar Event object, as defined in [@!RFC8984], with additional properties. type CalendarEvent struct { - // The id of the CalendarEvent (immutable; server-set). // // The id uniquely identifies a JSCalendar Event with a particular `uid` and @@ -4051,8 +3945,8 @@ type CalendarEvent struct { // this event; the event has not been added as a result of an invitation from another calendar system)? // // This is true if, and only if: - // !- the event’s `replyTo` property is null; or - // !- the account will receive messages sent to at least one of the methods specified in the `replyTo` property of the event. + // * the event’s `replyTo` property is null; or + // * the account will receive messages sent to at least one of the methods specified in the `replyTo` property of the event. IsOrigin bool `json:"isOrigin,omitzero"` // For simple clients that do not implement time zone support. @@ -4202,8 +4096,6 @@ type ParticipantIdentity struct { Id string `json:"id"` // The display name of the participant to use when adding this participant to an event, e.g. "Joe Bloggs". - // - // default: Name string `json:"name,omitempty"` // The URI that represents this participant for scheduling. @@ -4290,9 +4182,9 @@ type CalendarEventNotification struct { // `CalendarEventNotification` type. // // This MUST be one of - // !- `created` - // !- `updated` - // !- `destroyed` + // * `created` + // * `updated` + // * `destroyed` Type CalendarEventNotificationTypeOption `json:"type"` // The id of the CalendarEvent that this notification is about. @@ -4317,8 +4209,8 @@ type CalendarEventNotification struct { // Denotes the task list has a special purpose. // // This MUST be one of the following: -// !- `inbox`: This is the principal’s default task list; -// !- `trash`: This task list holds messages the user has discarded; +// * `inbox`: This is the principal’s default task list; +// * `trash`: This task list holds messages the user has discarded; type TaskListRole string const ( @@ -4369,9 +4261,9 @@ type TaskRights struct { // The user may modify the following properties of any `Participant` object that corresponds // to one of the user’s `ParticipantIdentity` objects in the account, even if they would not // otherwise have permission to modify that task - // !- `participationStatus` - // !- `participationComment` - // !- `expectReply` + // * `participationStatus` + // * `participationComment` + // * `expectReply` // // If the task has its `mayInviteSelf` property set to true, then the user may also add a new // `Participant` to the task with a `sendTo` property that is the same as the `sendTo` property @@ -4404,8 +4296,8 @@ type TaskList struct { // Denotes the task list has a special purpose. // // This MUST be one of the following: - // !- `inbox`: This is the principal’s default task list; - // !- `trash`: This task list holds messages the user has discarded; + // * `inbox`: This is the principal’s default task list; + // * `trash`: This task list holds messages the user has discarded; Role TaskListRole `json:"role,omitempty"` // The user-visible name of the task list. @@ -4482,10 +4374,10 @@ type TaskList struct { // // In case of uncertainty, here are some recommendations for mapping commonly observed values that can help // during implementation: - // !- `completed`: `done` (most simple case), `closed`, `verified`, … - // !- `in-process`: `in-progress`, `active`, `assigned`, … - // !- `needs-action`: `not-done` (most simple case), `not-started`, `new`, … - // !- `pending`: `waiting`, `deferred`, `on-hold`, `paused`, … + // * `completed`: `done` (most simple case), `closed`, `verified`, … + // * `in-process`: `in-progress`, `active`, `assigned`, … + // * `needs-action`: `not-done` (most simple case), `not-started`, `new`, … + // * `pending`: `waiting`, `deferred`, `on-hold`, `paused`, … WorkflowStatuses []string `json:"workflowStatuses,omitempty"` // A map of `Principal` id to rights for principals this task list is shared with. @@ -4700,8 +4592,8 @@ type Task struct { // task management system)? // // This is `true` if, and only if: - // !- the task’s “replyTo” property is null; or - // !- the account will receive messages sent to at least one of the methods specified in + // * the task’s “replyTo” property is null; or + // * the account will receive messages sent to at least one of the methods specified in // the `replyTo` property of the task. IsOrigin bool `json:"isOrigin,omitzero"` @@ -4713,24 +4605,20 @@ type Task struct { // This indicates the task will accept “party crasher” RSVPs via iTIP, subject to any other domain-specific // restrictions, and users may add themselves to the task via JMAP as long as they have the `mayRSVP` // permission for the task list. - // - // default: false - MayInviteSelf bool `json:"mayInviteSelf,omitzero"` + MayInviteSelf bool `json:"mayInviteSelf,omitzero" doc:"opt" default:"false"` // If true, any current participant with the `attendee` role may add new participants with // the `attendee` role to the task. // // This property MUST NOT be altered in the `recurrenceOverrides`; it may only be set on the master object. - // - // default: false - MayInviteOthers bool `json:"mayInviteOthers,omitzero"` + MayInviteOthers bool `json:"mayInviteOthers,omitzero" doc:"opt" default:"false"` // If true, only the owners of the task may see the full set of participants. // // Other sharees of the task may only see the owners and themselves. // // This property MUST NOT be altered in the `recurrenceOverrides`; it may only be set on the master object. - HideAttendees bool `json:"hideAttendees,omitzero"` + HideAttendees bool `json:"hideAttendees,omitzero" doc:"opt" default:"false"` } // The `TaskNotification` data type records changes made by external entities to tasks in task lists @@ -4753,9 +4641,9 @@ type TaskNotification struct { Comment string `json:"comment,omitempty"` // This MUST be one of - // !- `created` - // !- `updated` - // !- `destroyed` + // * `created` + // * `updated` + // * `destroyed` Type TaskNotificationTypeOption `json:"type"` // The id of the Task that this notification is about. @@ -4788,11 +4676,11 @@ type Principal struct { // `Principal` type. // // This MUST be one of the following values: - // !- `individual`: This represents a single person. - // !- `group`: This represents a group of people. - // !- `resource`: This represents some resource, e.g. a projector. - // !- `location`: This represents a location. - // !- `other`: This represents some other undefined principal. + // * `individual`: This represents a single person. + // * `group`: This represents a group of people. + // * `resource`: This represents some resource, e.g. a projector. + // * `location`: This represents a location. + // * `other`: This represents some other undefined principal. Type PrincipalTypeOption `json:"type"` // The name of the principal, e.g. `"Jane Doe"`, or `"Room 4B"`. @@ -5077,10 +4965,8 @@ type ContactCardComparator struct { // If true, sort in ascending order. // - // Optional; default value: true. - // // If false, reverse the comparator’s results to sort in descending order. - IsAscending bool `json:"isAscending,omitempty"` + IsAscending bool `json:"isAscending,omitempty" default:"true" doc:"opt"` // The identifier, as registered in the collation registry defined in [RFC4790], // for the algorithm to use when comparing the order of strings. @@ -5089,9 +4975,7 @@ type ContactCardComparator struct { // // The algorithms the server supports are advertised in the capabilities object returned // with the Session object. - // - // [RFC4790]: https://www.rfc-editor.org/rfc/rfc4790.html - Collation string `json:"collation,omitempty"` + Collation string `json:"collation,omitempty" doc:"opt"` // ContactCard-specific: The “created” date on the ContactCard. Created time.Time `json:"created,omitzero"` @@ -5277,25 +5161,23 @@ type ContactCardQueryCommand struct { // // If the index is greater than or equal to the total number of objects in the results // list, then the ids array in the response will be empty, but this is not an error. - Position uint `json:"position,omitempty"` + Position uint `json:"position,omitzero" default:"0" doc:"opt"` // An Email id. // // If supplied, the position argument is ignored. // The index of this id in the results will be used in combination with the anchorOffset // argument to determine the index of the first result to return. - Anchor string `json:"anchor,omitempty"` + Anchor string `json:"anchor,omitempty" doc:"opt"` // The index of the first result to return relative to the index of the anchor, // if an anchor is given. // - // Default: 0. - // // This MAY be negative. // // For example, -1 means the Email immediately preceding the anchor is the first result in // the list returned. - AnchorOffset int `json:"anchorOffset,omitzero"` + AnchorOffset int `json:"anchorOffset,omitzero" default:"0" doc:"opt"` // The maximum number of results to return. // @@ -5305,13 +5187,13 @@ type ContactCardQueryCommand struct { // to the maximum; the new limit is returned with the response so the client is aware. // // If a negative value is given, the call MUST be rejected with an invalidArguments error. - Limit uint `json:"limit,omitempty"` + Limit uint `json:"limit,omitzero" doc:"opt"` // Does the client wish to know the total number of results in the query? // // This may be slow and expensive for servers to calculate, particularly with complex filters, // so clients should take care to only request the total when needed. - CalculateTotal bool `json:"calculateTotal,omitempty"` + CalculateTotal bool `json:"calculateTotal,omitzero"` } type ContactCardQueryResponse struct { @@ -5456,18 +5338,18 @@ type ContactCardSetCommand struct { // // A `PatchObject` is of type `String[*]` and represents an unordered set of patches. // - // The keys are a path in JSON Pointer Format [@!RFC6901], with an implicit leading `/` (i.e., prefix each key + // The keys are a path in JSON Pointer Format [RFC6901], with an implicit leading `/` (i.e., prefix each key // with `/` before applying the JSON Pointer evaluation algorithm). // // All paths MUST also conform to the following restrictions; if there is any violation, the update // MUST be rejected with an `invalidPatch` error: - // !- The pointer MUST NOT reference inside an array (i.e., you MUST NOT insert/delete from an array; the array MUST be replaced in its entirety instead). - // !- All parts prior to the last (i.e., the value after the final slash) MUST already exist on the object being patched. - // !- There MUST NOT be two patches in the `PatchObject` where the pointer of one is the prefix of the pointer of the other, e.g., `"alerts/1/offset"` and `"alerts"`. + // * The pointer MUST NOT reference inside an array (i.e., you MUST NOT insert/delete from an array; the array MUST be replaced in its entirety instead). + // * All parts prior to the last (i.e., the value after the final slash) MUST already exist on the object being patched. + // * There MUST NOT be two patches in the `PatchObject` where the pointer of one is the prefix of the pointer of the other, e.g., `"alerts/1/offset"` and `"alerts"`. // // The value associated with each pointer determines how to apply that patch: - // !- If null, set to the default value if specified for this property; otherwise, remove the property from the patched object. If the key is not present in the parent, this a no-op. - // !- Anything else: The value to set for this property (this may be a replacement or addition to the object being patched). + // * If null, set to the default value if specified for this property; otherwise, remove the property from the patched object. If the key is not present in the parent, this a no-op. + // * Anything else: The value to set for this property (this may be a replacement or addition to the object being patched). // // Any server-set properties MAY be included in the patch if their value is identical to the current server value // (before applying the patches to the object). Otherwise, the update MUST be rejected with an `invalidProperties` `SetError`. @@ -5576,10 +5458,8 @@ type CalendarEventComparator struct { // If true, sort in ascending order. // - // Optional; default value: true. - // // If false, reverse the comparator’s results to sort in descending order. - IsAscending bool `json:"isAscending,omitempty"` + IsAscending bool `json:"isAscending,omitempty" default:"true" doc:"opt"` // The identifier, as registered in the collation registry defined in [RFC4790], // for the algorithm to use when comparing the order of strings. @@ -5590,18 +5470,16 @@ type CalendarEventComparator struct { // with the Session object. // // [RFC4790]: https://www.rfc-editor.org/rfc/rfc4790.html - Collation string `json:"collation,omitempty"` + Collation string `json:"collation,omitempty" doc:"opt"` // CalendarEvent-specific: If true, the server will expand any recurring event. // // If true, the filter MUST be just a FilterCondition (not a FilterOperator) and MUST include both // a “before” and “after” property. This ensures the server is not asked to return an infinite number of results. - // default: false - ExpandRecurrences bool `json:"expandRecurrences,omitzero"` + ExpandRecurrences bool `json:"expandRecurrences,omitzero" doc:"opt" default:"false"` // CalendarEvent-specific: The time zone for before/after filter conditions. - // default: “Etc/UTC” - TimeZone string `json:"timeZone,omitempty"` + TimeZone string `json:"timeZone,omitempty" doc:"opt" default:"Etc/UTC"` } type CalendarEventFilterElement interface { @@ -5612,48 +5490,48 @@ type CalendarEventFilterElement interface { type CalendarEventFilterCondition struct { // A calendar id. // An event must be in this calendar to match the condition. - InCalendar string `json:"inCalendar,omitempty"` + InCalendar string `json:"inCalendar,omitempty" doc:"opt"` // The end of the event, or any recurrence of the event, in the time zone given as // the timeZone argument, must be after this date to match the condition. - After LocalDate `json:"after,omitzero"` + After LocalDate `json:"after,omitzero" doc:"opt"` // The start of the event, or any recurrence of the event, in the time zone given // as the timeZone argument, must be before this date to match the condition. - Before LocalDate `json:"before,omitzero"` + Before LocalDate `json:"before,omitzero" doc:"opt"` // Looks for the text in the title, description, locations (matching name/description), // participants (matching name/email) and any other textual properties of the event // or any recurrence of the event. - Text string `json:"text,omitempty"` + Text string `json:"text,omitempty" doc:"opt"` // Looks for the text in the title property of the event, or the overridden title // property of a recurrence. - Title string `json:"title,omitempty"` + Title string `json:"title,omitempty" doc:"opt"` // Looks for the text in the description property of the event, or the overridden // description property of a recurrence. - Description string `json:"description,omitempty"` + Description string `json:"description,omitempty" doc:"opt"` // Looks for the text in the locations property of the event (matching name/description // of a location), or the overridden locations property of a recurrence. - Location string `json:"location,omitempty"` + Location string `json:"location,omitempty" doc:"opt"` // Looks for the text in the name or email fields of a participant in the participants // property of the event, or the overridden participants property of a recurrence, // where the participant has a role of “owner”. - Owner string `json:"owner,omitempty"` + Owner string `json:"owner,omitempty" doc:"opt"` // Looks for the text in the name or email fields of a participant in the participants // property of the event, or the overridden participants property of a recurrence, // where the participant has a role of “attendee”. - Attendee string `json:"attendee,omitempty"` + Attendee string `json:"attendee,omitempty" doc:"opt"` // Must match. If owner/attendee condition, status must be of that participant. Otherwise any. - ParticipationStatus string `json:"participationStatus,omitempty"` + ParticipationStatus string `json:"participationStatus,omitempty" doc:"opt"` // The uid of the event is exactly the given string. - Uid string `json:"uid,omitempty"` + Uid string `json:"uid,omitempty" doc:"opt"` } func (f CalendarEventFilterCondition) _isACalendarEventFilterElement() { @@ -5728,25 +5606,23 @@ type CalendarEventQueryCommand struct { // // If the index is greater than or equal to the total number of objects in the results // list, then the ids array in the response will be empty, but this is not an error. - Position uint `json:"position,omitempty"` + Position uint `json:"position,omitempty" doc:"opt"` // An Email id. // // If supplied, the position argument is ignored. // The index of this id in the results will be used in combination with the anchorOffset // argument to determine the index of the first result to return. - Anchor string `json:"anchor,omitempty"` + Anchor string `json:"anchor,omitempty" doc:"opt"` // The index of the first result to return relative to the index of the anchor, // if an anchor is given. // - // Default: 0. - // // This MAY be negative. // // For example, -1 means the Email immediately preceding the anchor is the first result in // the list returned. - AnchorOffset int `json:"anchorOffset,omitzero"` + AnchorOffset int `json:"anchorOffset,omitzero" doc:"opt" default:"0"` // The maximum number of results to return. // @@ -5756,13 +5632,13 @@ type CalendarEventQueryCommand struct { // to the maximum; the new limit is returned with the response so the client is aware. // // If a negative value is given, the call MUST be rejected with an invalidArguments error. - Limit uint `json:"limit,omitempty"` + Limit uint `json:"limit,omitempty" doc:"opt" default:"0"` // Does the client wish to know the total number of results in the query? // // This may be slow and expensive for servers to calculate, particularly with complex filters, // so clients should take care to only request the total when needed. - CalculateTotal bool `json:"calculateTotal,omitempty"` + CalculateTotal bool `json:"calculateTotal,omitempty" doc:"opt" default:"false"` } type CalendarEventQueryResponse struct { @@ -5907,18 +5783,18 @@ type CalendarEventSetCommand struct { // // A `PatchObject` is of type `String[*]` and represents an unordered set of patches. // - // The keys are a path in JSON Pointer Format [@!RFC6901], with an implicit leading `/` (i.e., prefix each key + // The keys are a path in JSON Pointer Format [RFC6901], with an implicit leading `/` (i.e., prefix each key // with `/` before applying the JSON Pointer evaluation algorithm). // // All paths MUST also conform to the following restrictions; if there is any violation, the update // MUST be rejected with an `invalidPatch` error: - // !- The pointer MUST NOT reference inside an array (i.e., you MUST NOT insert/delete from an array; the array MUST be replaced in its entirety instead). - // !- All parts prior to the last (i.e., the value after the final slash) MUST already exist on the object being patched. - // !- There MUST NOT be two patches in the `PatchObject` where the pointer of one is the prefix of the pointer of the other, e.g., `"alerts/1/offset"` and `"alerts"`. + // * The pointer MUST NOT reference inside an array (i.e., you MUST NOT insert/delete from an array; the array MUST be replaced in its entirety instead). + // * All parts prior to the last (i.e., the value after the final slash) MUST already exist on the object being patched. + // * There MUST NOT be two patches in the `PatchObject` where the pointer of one is the prefix of the pointer of the other, e.g., `"alerts/1/offset"` and `"alerts"`. // // The value associated with each pointer determines how to apply that patch: - // !- If null, set to the default value if specified for this property; otherwise, remove the property from the patched object. If the key is not present in the parent, this a no-op. - // !- Anything else: The value to set for this property (this may be a replacement or addition to the object being patched). + // * If null, set to the default value if specified for this property; otherwise, remove the property from the patched object. If the key is not present in the parent, this a no-op. + // * Anything else: The value to set for this property (this may be a replacement or addition to the object being patched). // // Any server-set properties MAY be included in the patch if their value is identical to the current server value // (before applying the patches to the object). Otherwise, the update MUST be rejected with an `invalidProperties` `SetError`. diff --git a/pkg/jmap/jscontact_model_examples_test.go b/pkg/jmap/jscontact_model_examples_test.go new file mode 100644 index 0000000000..1bd0aae18b --- /dev/null +++ b/pkg/jmap/jscontact_model_examples_test.go @@ -0,0 +1,28 @@ +//go:build groupware_examples + +package jmap + +import c "github.com/opencloud-eu/opencloud/pkg/jscontact" + +func JSContactExample() { + SerializeExamples(JSContactExemplarInstance) + //Output: +} + +type JSContactExemplar struct { +} + +var JSContactExemplarInstance = JSContactExemplar{} + +func (e JSContactExemplar) Name() c.Name { + return c.Name{ + Type: c.NameType, + Components: []c.NameComponent{ + {Type: c.NameComponentType, Value: "Drummer", Kind: c.NameComponentKindGiven}, + {Type: c.NameComponentType, Value: "Camina", Kind: c.NameComponentKindGiven}, + }, + IsOrdered: true, + DefaultSeparator: ", ", + Full: "Camina Drummer", + } +} diff --git a/pkg/jscalendar/jscalendar_model.go b/pkg/jscalendar/jscalendar_model.go index 9bc86711ce..8c2159958f 100644 --- a/pkg/jscalendar/jscalendar_model.go +++ b/pkg/jscalendar/jscalendar_model.go @@ -756,20 +756,20 @@ func (t *LocalDateTime) UnmarshalJSON(b []byte) error { // JSON Pointer evaluation algorithm. // // A patch within a `PatchObject` is only valid if all of the following conditions apply: -// !1. The pointer MUST NOT reference inside an array (i.e., you MUST NOT insert/delete +// 1. The pointer MUST NOT reference inside an array (i.e., you MUST NOT insert/delete // from an array; the array MUST be replaced in its entirety instead). -// !2. All parts prior to the last (i.e., the value after the final slash) MUST already +// 2. All parts prior to the last (i.e., the value after the final slash) MUST already // exist on the object being patched. -// !3. There MUST NOT be two patches in the `PatchObject` where the pointer of one is +// 3. There MUST NOT be two patches in the `PatchObject` where the pointer of one is // the prefix of the pointer of the other, e.g., `alerts/1/offset` and `alerts`. -// !4. The value for the patch MUST be valid for the property being set (of the correct +// 4. The value for the patch MUST be valid for the property being set (of the correct // type and obeying any other applicable restrictions), or, if null, the property // MUST be optional. // // The value associated with each pointer determines how to apply that patch: -// !- If null, remove the property from the patched object. If the key is not present in the parent, +// * If null, remove the property from the patched object. If the key is not present in the parent, // this a no-op. -// !- If non-null, set the value given as the value for this property (this may be a replacement +// * If non-null, set the value given as the value for this property (this may be a replacement // or addition to the object being patched). // // A `PatchObject` does not define its own `@type` property. @@ -808,10 +808,10 @@ type Relation struct { // // Keys in the set MUST be one of the following values, specified in the // property definition where the `Relation` object is used: - // !- `first`: The linked object is the first in a series the linking object is part of. - // !- `next`: The linked object is next in a series the linking object is part of. - // !- `child`: The linked object is a subpart of the linking object. - // !- `parent`: The linking object is a subpart of the linked object. + // * `first`: The linked object is the first in a series the linking object is part of. + // * `next`: The linked object is next in a series the linking object is part of. + // * `child`: The linked object is a subpart of the linking object. + // * `parent`: The linking object is a subpart of the linked object. // // The value for each key in the map MUST be true. Relation map[Relationship]bool `json:"relation,omitempty"` @@ -850,10 +850,10 @@ type Link struct { // If set, the `rel` property MUST be set to icon. // // The value MUST be one of the following values: - // !- `badge`: an image meant to be displayed alongside the title of the object - // !- `graphic`: a full image replacement for the object itself - // !- `fullsize`: an image that is used to enhance the object - // !- `thumbnail`: a smaller variant of fullsize to be used when space for the image is constrained + // * `badge`: an image meant to be displayed alongside the title of the object + // * `graphic`: a full image replacement for the object itself + // * `fullsize`: an image that is used to enhance the object + // * `thumbnail`: a smaller variant of fullsize to be used when space for the image is constrained Display Display `json:"display,omitempty"` // This is a human-readable, plain-text description of the resource. @@ -909,13 +909,13 @@ type VirtualLocation struct { // // The feature MUST be one of the following values; any value the client or server // doesn't understand should be treated the same as if this feature is omitted: - // !- `audio`: Audio conferencing - // !- `chat`: Chat or instant messaging - // !- `feed`: Blog or atom feed - // !- `moderator`: Provides moderator-specific features - // !- `phone`: Phone conferencing - // !- `screen`: Screen sharing - // !- `video`: Video conferencing + // * `audio`: Audio conferencing + // * `chat`: Chat or instant messaging + // * `feed`: Blog or atom feed + // * `moderator`: Provides moderator-specific features + // * `phone`: Phone conferencing + // * `screen`: Screen sharing + // * `video`: Video conferencing Features map[VirtualLocationFeature]bool `json:"features,omitempty"` } @@ -953,13 +953,13 @@ type RecurrenceRule struct { // This is the time span covered by each iteration of this recurrence rule. // // This MUST be one of the following values: - // !- `yearly` - // !- `monthly` - // !- `weekly` - // !- `daily` - // !- `hourly` - // !- `minutely` - // !- `secondly` + // * `yearly` + // * `monthly` + // * `weekly` + // * `daily` + // * `hourly` + // * `minutely` + // * `secondly` // // This is the `FREQ` part from iCalendar, converted to lowercase. Frequency Frequency `json:"frequency,omitempty"` @@ -969,53 +969,42 @@ type RecurrenceRule struct { // If included, it MUST be an integer >= `1`. // // This is the `INTERVAL` part from iCalendar. - // - // Default: 1 - Interval uint `json:"interval,omitzero"` + Interval uint `json:"interval,omitzero" doc:"opt" default:"1"` // This is the calendar system in which this recurrence rule operates, in lowercase. // - // This MUST be either a CLDR-registered calendar system name [CLDR] or a vendor-specific - // value. + // This MUST be either a CLDR-registered calendar system name [CLDR](https://github.com/unicode-org/cldr/blob/latest/common/bcp47/calendar.xml) + // or a vendor-specific value. // // This is the `RSCALE` part from iCalendar RSCALE [RFC7529], converted to lowercase. - // - // Default: gregorian - // - // [CLDR]: https://github.com/unicode-org/cldr/blob/latest/common/bcp47/calendar.xml - // [RFC7529]: https://www.rfc-editor.org/rfc/rfc7529.html - Rscale string `json:"rscale,omitempty"` + Rscale string `json:"rscale,omitempty" doc:"opt" default:"gregorian"` // This is the behavior to use when the expansion of the recurrence produces invalid dates. // // This property only has an effect if the frequency is `yearly` or `monthly`. // // It MUST be one of the following values: - // !- `omit` - // !- `backward` - // !- `forward` + // * `omit` + // * `backward` + // * `forward` // // This is the `SKIP` part from iCalendar `RSCALE` [RFC7529], converted to lowercase. - // - // Default: omit - Skip Skip `json:"skip,omitempty"` + Skip Skip `json:"skip,omitempty" doc:"opt" default:"omit"` // This is the day on which the week is considered to start, represented as a lowercase, abbreviated, // and two-letter English day of the week. // // If included, it MUST be one of the following values: - // !- `mo` - // !- `tu` - // !- `we` - // !- `th` - // !- `fr` - // !- `sa` - // !- `su` + // * `mo` + // * `tu` + // * `we` + // * `th` + // * `fr` + // * `sa` + // * `su` // // This is the `WKST` part from iCalendar. - // - // Default: mo - FirstDayOfWeek DayOfWeek `json:"firstDayOfWeek,omitempty"` + FirstDayOfWeek DayOfWeek `json:"firstDayOfWeek,omitempty" doc:"opt" default:"mo"` // These are days of the week on which to repeat. ByDay []NDay `json:"byDay,omitempty"` @@ -1043,8 +1032,6 @@ type RecurrenceRule struct { // The array MUST have at least one entry if included. // // This is the `BYMONTH` part from iCalendar. - // - // [RFC7529]: https://www.rfc-editor.org/rfc/rfc7529.html ByMonth []string `json:"byMonth,omitempty"` // These are the days of the year on which to repeat. @@ -1130,10 +1117,10 @@ type RecurrenceRule struct { } type Participant struct { - // This specifies the type of this object. This MUST be ` Participant`. + // This specifies the type of this object. This MUST be `Participant`. Type TypeOfParticipant `json:"@type,omitempty"` - // This is the display name of the participant (e.g., `"Joe Bloggs"``). + // This is the display name of the participant (e.g., `"Joe Bloggs"`). Name string `json:"name,omitempty"` // This is the email address to use to contact the participant or, for example, @@ -1167,10 +1154,10 @@ type Participant struct { // or a vendor-specific value (see Section 3.3). // // Any value the client or server doesn't understand should be treated the same as if this property is omitted. - // !- `individual`: a single person - // !- `group`: a collection of people invited as a whole - // !- `location`: a physical location that needs to be scheduled, e.g., a conference room - // !- `resource`: a non-human resource other than a location, such as a projector + // * `individual`: a single person + // * `group`: a collection of people invited as a whole + // * `location`: a physical location that needs to be scheduled, e.g., a conference room + // * `resource`: a non-human resource other than a location, such as a projector Kind ParticipantKind `json:"kind,omitempty"` // This is a set of roles that this participant fulfills. @@ -1181,15 +1168,15 @@ type Participant struct { // // The keys in the set MUST be one of the following values, another value registered in the IANA "JSCalendar Enum Values" // registry, or a vendor-specific value (see Section 3.3): - // !- `owner`: The participant is an owner of the object. This signifies they have permission to make changes to it + // * `owner`: The participant is an owner of the object. This signifies they have permission to make changes to it // that affect the other participants. Nonowner participants may only change properties that affect only themselves // (for example, setting their own alerts or changing their RSVP status). - // !- `attendee`: The participant is expected to be present at the event. - // !- `optional`: The participant's involvement with the event is optional. This is expected to be primarily combined + // * `attendee`: The participant is expected to be present at the event. + // * `optional`: The participant's involvement with the event is optional. This is expected to be primarily combined // with the `"attendee"` role. - // !- `informational`: The participant is copied for informational reasons and is not expected to attend. - // !- `chair`: The participant is in charge of the event/task when it occurs. - // !- `contact`: The participant is someone that may be contacted for information about the event. + // * `informational`: The participant is copied for informational reasons and is not expected to attend. + // * `chair`: The participant is in charge of the event/task when it occurs. + // * `contact`: The participant is someone that may be contacted for information about the event. // // The value for each key in the map MUST be true. It is expected that no more than one of the roles // `"attendee"` and `"informational"` be present; if more than one are given, `"attendee"` takes precedence @@ -1211,11 +1198,11 @@ type Participant struct { // // The value MUST be one of the following values, another value registered in the IANA "JSCalendar Enum Values" registry, // or a vendor-specific value (see Section 3.3): - // !- `needs-action`: No status has yet been set by the participant. - // !- `accepted`: The invited participant will participate. - // !- `declined`: The invited participant will not participate. - // !- `tentative`: The invited participant may participate. - // !- `delegated`: The invited participant has delegated their attendance to another participant, as specified in the `delegatedTo` property. + // * `needs-action`: No status has yet been set by the participant. + // * `accepted`: The invited participant will participate. + // * `declined`: The invited participant will not participate. + // * `tentative`: The invited participant may participate. + // * `delegated`: The invited participant has delegated their attendance to another participant, as specified in the `delegatedTo` property. ParticipationStatus ParticipationStatus `json:"participationStatus,omitempty"` // This is a note from the participant to explain their participation status. @@ -1230,12 +1217,10 @@ type Participant struct { // // The value MUST be one of the following values, another value registered in the IANA "JSCalendar Enum Values" // registry, or a vendor-specific value (see Section 3.3): - // !- `server`: The calendar server will send the scheduling messages. - // !- `client`: The calendar client will send the scheduling messages. - // !- `none`: No scheduling messages are to be sent to this participant. - // - // Default: server - ScheduleAgent ScheduleAgent `json:"scheduleAgent,omitempty"` + // * `server`: The calendar server will send the scheduling messages. + // * `client`: The calendar client will send the scheduling messages. + // * `none`: No scheduling messages are to be sent to this participant. + ScheduleAgent ScheduleAgent `json:"scheduleAgent,omitempty" doc:"opt" default:"server"` // A client may set the property on a participant to true to request that the server send a scheduling // message to the participant when it would not normally do so (e.g., if no significant change is made @@ -1254,7 +1239,8 @@ type Participant struct { // This is a list of status codes, returned from the processing of the most recent scheduling message sent to this participant. // - // The status codes MUST be valid statcode values as defined in the ABNF in [Section 3.8.8.3 of RFC5545]. + // The status codes MUST be valid statcode values as defined in the ABNF in + // [Section 3.8.8.3 of RFC5545](https://www.rfc-editor.org/rfc/rfc5545#section-3.8.8.3). // // Servers MUST only add or change this property when they send a scheduling message to the participant. // @@ -1263,8 +1249,6 @@ type Participant struct { // Clients MAY add, change, or remove the property for participants where the client is handling the scheduling. // // This property MUST NOT be included in scheduling messages. - // - // [Section 3.8.8.3 of RFC5545]: https://www.rfc-editor.org/rfc/rfc5545#section-3.8.8.3 ScheduleStatus []string `json:"scheduleStatus,omitempty"` // This is the timestamp for the most recent response from this participant. @@ -1342,7 +1326,7 @@ type Participant struct { // The property value MUST be a positive integer between 0 and 100. PercentComplete uint `json:"percentComplete,omitzero"` - // This is a URI as defined by [@!RFC3986] or any other IANA-registered form for a URI. + // This is a URI as defined by [RFC3986] or any other IANA-registered form for a URI. // // It is the same as the `CAL-ADDRESS` value of an `ATTENDEE` or `ORGANIZER` in iCalendar ([@!RFC5545]); // it globally identifies a particular participant, even across different events. @@ -1369,8 +1353,8 @@ type OffsetTrigger struct { // This specifies the time property that the alert offset is relative to. // // The value MUST be one of the following: - // !- `start`: triggers the alert relative to the start of the calendar object - // !- `end`: triggers the alert relative to the end/due time of the calendar object + // * `start`: triggers the alert relative to the start of the calendar object + // * `end`: triggers the alert relative to the end/due time of the calendar object RelativeTo RelativeTo `json:"relativeTo,omitempty"` } @@ -1508,12 +1492,10 @@ type Alert struct { // // The value MUST be at most one of the following values, a value registered in the IANA "JSCalendar Enum Values" // registry, or a vendor-specific value (see Section 3.3): - // !- `display`: The alert should be displayed as appropriate for the current device and user context. - // !- `email`: The alert should trigger an email sent out to the user, notifying them of the alert. This action is + // * `display`: The alert should be displayed as appropriate for the current device and user context. + // * `email`: The alert should trigger an email sent out to the user, notifying them of the alert. This action is // typically only appropriate for server implementations. - // - // Default: display - Action AlertAction `json:"action,omitempty"` + Action AlertAction `json:"action,omitempty" doc:"opt" default:"display"` } func (a *Alert) UnmarshalJSON(b []byte) error { @@ -1574,7 +1556,7 @@ type TimeZoneRule struct { // Mandatory. // // example: -0500 - OffsetFrom string `json:"offsetFrom"` + OffsetFrom string `json:"offsetFrom" doc:"req"` // This is the TZOFFSETTO property from iCalendar: specifies the offset that is in use in this time zone observance. // @@ -1591,7 +1573,7 @@ type TimeZoneRule struct { // Mandatory. // // example: +1245 - OffsetTo string `json:"offsetTo"` + OffsetTo string `json:"offsetTo" doc:"req"` // This is the `RRULE` property mapped. // @@ -1676,10 +1658,10 @@ type CommonObject struct { // This is the identifier for the product that last updated the JSCalendar object. // - // This should be set whenever the data in the object is modified (i.e., whenever the updated property is set) + // This should be set whenever the data in the object is modified (i.e., whenever the updated property is set). // - // .The vendor of the implementation MUST ensure that this is a globally unique identifier, using - // ome technique such as a Formal Public Identifier (FPI) value, as defined in [ISO.9070.1991]. + // The vendor of the implementation MUST ensure that this is a globally unique identifier, using + // ome technique such as a Formal Public Identifier (FPI) value, as defined in [ISO.9070.1991](https://www.iso.org/standard/16645.html). // // This property SHOULD NOT be used to alter the interpretation of a JSCalendar object beyond the semantics // specified in this document. @@ -1711,9 +1693,7 @@ type CommonObject struct { // // Descriptions of type text/html MAY contain cid URLs [RFC2392] to reference links in the calendar // object by use of the cid property of the Link object. - // - // Default: text/plain - DescriptionContentType string `json:"descriptionContentType,omitempty"` + DescriptionContentType string `json:"descriptionContentType,omitempty" doc:"opt" default:"text/plain"` // This is a map of link ids to `Link` objects, representing external resources associated with the object. // @@ -1728,8 +1708,6 @@ type CommonObject struct { // This is the language tag, as defined in [RFC5646], that best describes the locale used for the text in // the calendar object, if known. - // - // [RFC5646]: https://www.rfc-editor.org/rfc/rfc5646.html Locale string `json:"locale,omitempty"` // This is a set of keywords or tags that relate to the object. @@ -1753,16 +1731,13 @@ type CommonObject struct { // This is a color clients MAY use when displaying this calendar object. // - // The value is a color name taken from the set of names defined in [Section 4.3 of CSS Color Module Level 3] - // or an RGB value in hexadecimal notation, as defined in [Section 4.2.1 of CSS Color Module Level 3]. - // - // [Section 4.3 of CSS Color Module Level 3]: https://www.w3.org/TR/css-color-3/#svg-color - // [Section 4.2.1 of CSS Color Module Level 3]: https://www.w3.org/TR/css-color-3/#rgb-color + // The value is a color name taken from the set of names defined in + // [Section 4.3 of CSS Color Module Level 3](https://www.w3.org/TR/css-color-3/#svg-color) + // or an RGB value in hexadecimal notation, as defined in + // [Section 4.2.1 of CSS Color Module Level 3](https://www.w3.org/TR/css-color-3/#rgb-color). Color string `json:"color,omitempty"` } -// TODO -// // ### Recurrence Properties // // Some events and tasks occur at regular or irregular intervals. Rather than having to copy the data for every occurrence, @@ -1770,10 +1745,10 @@ type CommonObject struct { // // The recurrence set is the complete set of instances for an object. It is generated by considering the following properties in // order, all of which are optional: -// !- The `recurrenceRules` property generates a set of extra date-times on which the object occurs. -// !- The `excludedRecurrenceRules` property generates a set of date-times that are to be removed from the previously generated +// * The `recurrenceRules` property generates a set of extra date-times on which the object occurs. +// * The `excludedRecurrenceRules` property generates a set of date-times that are to be removed from the previously generated // set of date-times on which the object occurs. -// !- The `recurrenceOverrides` property defines date-times that are added or excluded to form the final set. (This property +// * The `recurrenceOverrides` property defines date-times that are added or excluded to form the final set. (This property // may also contain changes to the object to apply to particular instances.) type Object struct { CommonObject @@ -1816,9 +1791,7 @@ type Object struct { // enhance the user's view of their schedule. // // Such events are also commonly known as "all-day" events. - // - // Default: false - ShowWithoutTime bool `json:"showWithoutTime,omitzero"` + ShowWithoutTime bool `json:"showWithoutTime,omitzero" doc:"opt" default:"false"` // This is a map of location ids to `Location` objects, representing locations associated with the object. Locations map[string]Location `json:"locations,omitempty"` @@ -1903,20 +1876,20 @@ type Object struct { // object's start or due date. // // A pointer in the `PatchObject` MUST be ignored if it starts with one of the following prefixes: - // !- `@type` - // !- `excludedRecurrenceRules` - // !- `method` - // !- `privacy` - // !- `prodId` - // !- `recurrenceId` - // !- `recurrenceIdTimeZone` - // !- `recurrenceOverrides` - // !- `recurrenceRules` - // !- `relatedTo` - // !- `replyTo` - // !- `sentBy` - // !- `timeZones` - // !- `uid` + // * `@type` + // * `excludedRecurrenceRules` + // * `method` + // * `privacy` + // * `prodId` + // * `recurrenceId` + // * `recurrenceIdTimeZone` + // * `recurrenceOverrides` + // * `recurrenceRules` + // * `relatedTo` + // * `replyTo` + // * `sentBy` + // * `timeZones` + // * `uid` RecurrenceOverrides map[LocalDateTime]PatchObject `json:"recurrenceOverrides,omitempty"` // This defines if this object is an overridden, excluded instance of a recurring JSCalendar object. @@ -1950,9 +1923,9 @@ type Object struct { // // This MUST be one of the following values, another value registered in the IANA // "JSCalendar Enum Values" registry, or a vendor-specific value (see Section 3.3): - // !- `free` - // !- `busy` (default) - FreeBusyStatus FreeBusyStatus `json:"freeBusyStatus,omitempty"` + // * `free` + // * `busy` (default) + FreeBusyStatus FreeBusyStatus `json:"freeBusyStatus,omitempty" doc:"opt" default:"busy"` // Privacy level. // @@ -1970,27 +1943,27 @@ type Object struct { // // Any value the client or server doesn't understand should be preserved but treated as equivalent to private. // - // !- `public`: The full details of the object are visible to those whom the object's calendar is shared with. - // !- `private`: The details of the object are hidden; only the basic time and metadata are shared. - // !- `secret`: The object is hidden completely (as though it did not exist) when the calendar this object is in is shared. + // * `public`: The full details of the object are visible to those whom the object's calendar is shared with. + // * `private`: The details of the object are hidden; only the basic time and metadata are shared. + // * `secret`: The object is hidden completely (as though it did not exist) when the calendar this object is in is shared. // // When the `privacy` property is set to `private`, the following properties MAY be shared; any other // properties MUST NOT be shared: - // !- `@type` - // !- `created` - // !- `due` - // !- `duration` - // !- `estimatedDuration` - // !- `freeBusyStatus` - // !- `privacy` - // !- `recurrenceOverrides` (Only patches that apply to another permissible property are allowed to be shared.) - // !- `sequence` - // !- `showWithoutTime` - // !- `start` - // !- `timeZone` - // !- `timeZones` - // !- `uid` - // !- `updated` + // * `@type` + // * `created` + // * `due` + // * `duration` + // * `estimatedDuration` + // * `freeBusyStatus` + // * `privacy` + // * `recurrenceOverrides` (Only patches that apply to another permissible property are allowed to be shared.) + // * `sequence` + // * `showWithoutTime` + // * `start` + // * `timeZone` + // * `timeZones` + // * `uid` + // * `updated` Privacy Privacy `json:"privacy,omitempty"` // This represents methods by which participants may submit their response to the organizer of the calendar object. @@ -2004,11 +1977,11 @@ type Object struct { // This property MUST be omitted if no method is defined (rather than being specified as an empty object). // // The following methods are defined: - // !- `imip`: The organizer accepts an iCalendar Message-Based Interoperability Protocol (iMIP) + // * `imip`: The organizer accepts an iCalendar Message-Based Interoperability Protocol (iMIP) // [RFC6047] response at this email address. The value MUST be a `mailto:` URI. - // !- `web`: Opening this URI in a web browser will provide the user with a page where they can + // * `web`: Opening this URI in a web browser will provide the user with a page where they can // submit a reply to the organizer. The value MUST be a URL using the `https:` scheme. - // !- `other`: The organizer is identified by this URI, but the method for submitting the response + // * `other`: The organizer is identified by this URI, but the method for submitting the response // is undefined. ReplyTo map[ReplyMethod]string `json:"replyTo,omitempty"` @@ -2051,9 +2024,7 @@ type Object struct { // // If an implementation cannot determine the user's default alerts, or none are set, it MUST process // he alerts property as if `useDefaultAlerts` is set to false. - // - // Default: false - UseDefaultAlerts bool `json:"useDefaultAlerts,omitzero"` + UseDefaultAlerts bool `json:"useDefaultAlerts,omitzero" doc:"opt" default:"false"` // This is a map of alert ids to Alert objects, representing alerts/reminders to display or send // to the user for this calendar object. @@ -2069,9 +2040,9 @@ type Object struct { // // All pointers for patches MUST end with one of the following suffixes; any patch that does not follow // this MUST be ignored unless otherwise specified in a future RFC: - // !- `title` - // !- `description` - // !- `name` + // * `title` + // * `description` + // * `name` // // A patch MUST NOT have the prefix `recurrenceOverrides`; any localization of the override MUST be a // patch to the `localizations` property inside the override instead. @@ -2104,9 +2075,7 @@ type Object struct { // long as they have the mayRSVP permission for the calendar. // // This is a JMAP addition to JSCalendar. - // - // default: false - MayInviteSelf bool `json:"mayInviteSelf,omitzero"` + MayInviteSelf bool `json:"mayInviteSelf,omitzero" doc:"opt" default:"false"` // If true, any current participant with the `attendee` role may add new participants with the // `attendee` role to the event. @@ -2117,9 +2086,7 @@ type Object struct { // for users to be allowed to make this change via JMAP. // // This is a JMAP addition to JSCalendar. - // - // default: false - MayInviteOthers bool `json:"mayInviteOthers,omitzero"` + MayInviteOthers bool `json:"mayInviteOthers,omitzero" doc:"opt" default:"false"` // If true, only the owners of the event may see the full set of participants. // @@ -2128,9 +2095,7 @@ type Object struct { // This property MUST NOT be altered in the `recurrenceOverrides`; it may only be set on the base object. // // This is a JMAP addition to JSCalendar. - // - // default: false - HideAttendees bool `json:"hideAttendees,omitzero"` + HideAttendees bool `json:"hideAttendees,omitzero" doc:"opt" default:"false"` } type Event struct { @@ -2162,9 +2127,9 @@ type Event struct { // // If set, it MUST be one of the following values, another value registered in the IANA // "JSCalendar Enum Values" registry, or a vendor-specific value (see Section 3.3): - // !- `confirmed`: indicates the event is definitely happening - // !- `cancelled`: indicates the event has been cancelled - // !- `tentative`: indicates the event may happen + // * `confirmed`: indicates the event is definitely happening + // * `cancelled`: indicates the event has been cancelled + // * `tentative`: indicates the event may happen Status Status `json:"status,omitempty"` } @@ -2190,18 +2155,18 @@ type Task struct { // This defines the progress of this task. // // If omitted, the default progress (Section 4.4) of a Task is defined as follows (in order of evaluation): - // !- `completed`: if the progress property value of all participants is completed - // !- `failed`: if at least one progress property value of a participant is failed - // !- `in-process`: if at least one progress property value of a participant is in-process - // !- `needs-action`: if none of the other criteria match + // * `completed`: if the progress property value of all participants is completed + // * `failed`: if at least one progress property value of a participant is failed + // * `in-process`: if at least one progress property value of a participant is in-process + // * `needs-action`: if none of the other criteria match // // If set, it MUST be one of the following values, another value registered in the IANA "JSCalendar Enum Values" // registry, or a vendor-specific value (see Section 3.3): - // !- `needs-action`: indicates the task needs action - // !- `in-process`: indicates the task is in process - // !- `completed`: indicates the task is completed - // !- `failed`: indicates the task failed - // !- `cancelled`: indicates the task was cancelled + // * `needs-action`: indicates the task needs action + // * `in-process`: indicates the task is in process + // * `completed`: indicates the task is completed + // * `failed`: indicates the task failed + // * `cancelled`: indicates the task was cancelled Progress Progress `json:"progress,omitempty"` // This specifies the date/time the progress property of either the task overall (Section 5.2.5) or diff --git a/pkg/jscontact/jscontact_model.go b/pkg/jscontact/jscontact_model.go index 36cfbd8739..2db08bbbb5 100644 --- a/pkg/jscontact/jscontact_model.go +++ b/pkg/jscontact/jscontact_model.go @@ -13,37 +13,37 @@ import ( // The kind of the name component. // -// !- `title`: an honorific title or prefix, e.g., `Mr.`, `Ms.`, or `Dr.` -// !- `given`: a given name, also known as "first name" or "personal name" -// !- `given2`: a name that appears between the given and surname such as a middle name or patronymic name -// !- `surname`: a surname, also known as "last name" or "family name" -// !- `surname2`: a secondary surname (used in some cultures), also known as "maternal surname" -// !- `credential`: a credential, also known as "accreditation qualifier" or "honorific suffix", e.g., `B.A.`, `Esq.` -// !- `generation`: a generation marker or qualifier, e.g., `Jr.` or `III` -// !- `separator`: a formatting separator between two ordered name non-separator components; the value property of the component includes the verbatim separator, for example, a hyphen character or even an empty string. This value has higher precedence than the defaultSeparator property of the Name. Implementations MUST NOT insert two consecutive separator components; instead, they SHOULD insert a single separator component with the combined value; this component kind MUST NOT be set if the `Name` `isOrdered` property value is `false` +// * `title`: an honorific title or prefix, e.g., `Mr.`, `Ms.`, or `Dr.` +// * `given`: a given name, also known as "first name" or "personal name" +// * `given2`: a name that appears between the given and surname such as a middle name or patronymic name +// * `surname`: a surname, also known as "last name" or "family name" +// * `surname2`: a secondary surname (used in some cultures), also known as "maternal surname" +// * `credential`: a credential, also known as "accreditation qualifier" or "honorific suffix", e.g., `B.A.`, `Esq.` +// * `generation`: a generation marker or qualifier, e.g., `Jr.` or `III` +// * `separator`: a formatting separator between two ordered name non-separator components; the value property of the component includes the verbatim separator, for example, a hyphen character or even an empty string. This value has higher precedence than the defaultSeparator property of the Name. Implementations MUST NOT insert two consecutive separator components; instead, they SHOULD insert a single separator component with the combined value; this component kind MUST NOT be set if the `Name` `isOrdered` property value is `false` type NameComponentKind string // The kind of the address component. // // The enumerated values are: -// ! `room`: the room, suite number, or identifier -// ! `apartment`: the extension designation such as the apartment number, unit, or box number -// ! `floor`: the floor or level the address is located on -// ! `building`: the building, tower, or condominium the address is located in -// ! `number`: the street number, e.g., `"123"`; this value is not restricted to numeric values and can include any value such +// * `room`: the room, suite number, or identifier +// * `apartment`: the extension designation such as the apartment number, unit, or box number +// * `floor`: the floor or level the address is located on +// * `building`: the building, tower, or condominium the address is located in +// * `number`: the street number, e.g., `"123"`; this value is not restricted to numeric values and can include any value such // as number ranges (`"112-10"`), grid style (`"39.2 RD"`), alphanumerics (`"N6W23001"`), or fractionals (`"123 1/2"`) -// ! `name`: the street name -// ! `block`: the block name or number -// ! `subdistrict`: the subdistrict, ward, or other subunit of a district -// ! `district`: the district name -// ! `locality`: the municipality, city, town, village, post town, or other locality -// ! `region`: the administrative area such as province, state, prefecture, county, or canton -// ! `postcode`: the postal code, post code, ZIP code, or other short code associated with the address by the relevant country's postal system -// ! `country`: the country name -// ! `direction`: the cardinal direction or quadrant, e.g., "north" -// ! `landmark`: the publicly known prominent feature that can substitute the street name and number, e.g., "White House" or "Taj Mahal" -// ! `postOfficeBox`: the post office box number or identifier -// ! `separator`: a formatting separator between two ordered address non-separator components; the value property of the component includes the +// * `name`: the street name +// * `block`: the block name or number +// * `subdistrict`: the subdistrict, ward, or other subunit of a district +// * `district`: the district name +// * `locality`: the municipality, city, town, village, post town, or other locality +// * `region`: the administrative area such as province, state, prefecture, county, or canton +// * `postcode`: the postal code, post code, ZIP code, or other short code associated with the address by the relevant country's postal system +// * `country`: the country name +// * `direction`: the cardinal direction or quadrant, e.g., "north" +// * `landmark`: the publicly known prominent feature that can substitute the street name and number, e.g., "White House" or "Taj Mahal" +// * `postOfficeBox`: the post office box number or identifier +// * `separator`: a formatting separator between two ordered address non-separator components; the value property of the component includes the // verbatim separator, for example, a hyphen character or even an empty string; this value has higher precedence than the `defaultSeparator` property // of the `Address`; implementations MUST NOT insert two consecutive separator components; instead, they SHOULD insert a single separator component // with the combined value; this component kind MUST NOT be set if the `Address` `isOrdered` property value is `false`. @@ -56,39 +56,37 @@ type AddressComponentKind string // The relationship between the two objects is undefined if the set is empty. // // The initial list of enumerated relation types matches the IANA-registered TYPE `IANA-vCard“ -// parameter values of the vCard RELATED property ([Section 6.6.6 of RFC6350]): -// !- `acquaintance` -// !- `agent` -// !- `child` -// !- `co-resident` -// !- `co-worker` -// !- `colleague` -// !- `contact` -// !- `crush` -// !- `date` -// !- `emergency` -// !- `friend` -// !- `kin` -// !- `me` -// !- `met` -// !- `muse` -// !- `neighbor` -// !- `parent` -// !- `sibling` -// !- `spouse` -// !- `sweetheart` -// -// [Section 6.6.6 of RFC6350]: https://www.rfc-editor.org/rfc/rfc6350.html#section-6.6.6 +// parameter values of the vCard RELATED property ([Section 6.6.6 of RFC6350](https://www.rfc-editor.org/rfc/rfc6350.html#section-6.6.6)): +// * `acquaintance` +// * `agent` +// * `child` +// * `co-resident` +// * `co-worker` +// * `colleague` +// * `contact` +// * `crush` +// * `date` +// * `emergency` +// * `friend` +// * `kin` +// * `me` +// * `met` +// * `muse` +// * `neighbor` +// * `parent` +// * `sibling` +// * `spouse` +// * `sweetheart` type Relationship string // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type MediaContext string // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type NicknameContext string // The contexts in which to use this address. @@ -96,38 +94,38 @@ type NicknameContext string // The boolean value MUST be `true`. // // In addition to the common contexts, allowed key values are: -// ! `billing`: an address to be used for billing -// ! `delivery`: an address to be used for delivering physical items +// * `billing`: an address to be used for billing +// * `delivery`: an address to be used for delivering physical items type AddressContext string // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type DirectoryContext string // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type EmailAddressContext string // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type OnlineServiceContext string // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type OrganizationContext string // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type PronounsContext string // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type PhoneContext string // The set of contact features that the phone number may be used for. @@ -137,14 +135,14 @@ type PhoneContext string // The boolean value MUST be `true`. // // The enumerated values are: -// !- `mobile`: this number is for a mobile phone -// !- `voice`: this number supports calling by voice -// !- `text`: this number supports text messages (SMS) -// !- `video`: this number supports video conferencing -// !- `main-number`: this number is a main phone number such as the number of the front desk at a company, as opposed to a direct-dial number of an individual employee -// !- `textphone`: this number is for a device for people with hearing or speech difficulties -// !- `fax`: this number supports sending faxes -// !- `pager`: this number is for a pager or beeper +// * `mobile`: this number is for a mobile phone +// * `voice`: this number supports calling by voice +// * `text`: this number supports text messages (SMS) +// * `video`: this number supports video conferencing +// * `main-number`: this number is a main phone number such as the number of the front desk at a company, as opposed to a direct-dial number of an individual employee +// * `textphone`: this number is for a device for people with hearing or speech difficulties +// * `fax`: this number supports sending faxes +// * `pager`: this number is for a pager or beeper type PhoneFeature string // The organizational or situational kind of the title. @@ -153,8 +151,8 @@ type PhoneFeature string // positions and roles as more temporary assignments such as in project management. // // The enumerated values are: -// !- `title` -// !- `role` +// * `title` +// * `role` type TitleKind string // The grammatical gender to use in salutations and other grammatical constructs. @@ -163,12 +161,12 @@ type TitleKind string // `Sehr geehrte` (feminine) and `Sehr geehrter` (masculine). // // The enumerated values are: -// !- `animate` -// !- `common` -// !- `feminine` -// !- `inanimate` -// !- `masculine` -// !- `neuter` +// * `animate` +// * `common` +// * `feminine` +// * `inanimate` +// * `masculine` +// * `neuter` // // Note that the grammatical gender does not allow inferring the gender identities or assigned // sex of the contact. @@ -177,46 +175,46 @@ type GrammaticalGenderType string // The kind of anniversary. // // The enumerated values are: -// ! `birth`: a birthday anniversary -// ! `death`: a deathday anniversary -// ! `wedding`: a wedding day anniversary +// * `birth`: a birthday anniversary +// * `death`: a deathday anniversary +// * `wedding`: a wedding day anniversary type AnniversaryKind string // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type LanguagePrefContext string // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type SchedulingAddressContext string // The kind of personal information. // // The enumerated values are: -// ! `expertise`: a field of expertise or a credential -// ! `hobby`: a hobby -// ! `interest`: an interest +// * `expertise`: a field of expertise or a credential +// * `hobby`: a hobby +// * `interest`: an interest type PersonalInfoKind string // The level of expertise or engagement in hobby or interest. // // The enumerated values are: -// ! `high` -// ! `medium` -// ! `low` +// * `high` +// * `medium` +// * `low` type PersonalInfoLevel string // The kind of the entity the Card represents (default: `individual“). // // Values are: -// !- `individual`: a single person -// !- `group`: a group of people or entities -// !- `org`: an organization -// !- `location`: a named location -// !- `device`: a device such as an appliance, a computer, or a network element -// !- `application`: a software application +// * `individual`: a single person +// * `group`: a group of people or entities +// * `org`: an organization +// * `location`: a named location +// * `device`: a device such as an appliance, a computer, or a network element +// * `application`: a software application // // example: individual type ContactCardKind string @@ -231,8 +229,8 @@ type ContactCardKind string // // Clients often present these separately from other contact cards. // -// The `members` property, as defined in [RFC 9553, Section 2.1.6], contains a set of UIDs for other -// contacts that are the members of this group. +// The `members` property, as defined in [RFC 9553, Section 2.1.6](https://www.rfc-editor.org/rfc/rfc9553#members), +// contains a set of UIDs for other contacts that are the members of this group. // // Clients should consider the group to contain any `ContactCard` with a matching UID, from // any account they have access to with support for the `urn:ietf:params:jmap:contacts` capability. @@ -243,8 +241,6 @@ type ContactCardKind string // temporarily loses access to this address book. The UIDs cannot be resolved so the contacts will // disappear from the group. However, if they are given permission to access the data again the UIDs // will be found and the contacts will reappear. -// -// [RFC 9553, Section 2.1.8]: https://www.rfc-editor.org/rfc/rfc9553#members type DirectoryKind string // The kind of the `Calendar` resource. @@ -257,8 +253,8 @@ type DirectoryKind string // // Clients often present these separately from other contact cards. // -// The `members` property, as defined in [RFC 9553, Section 2.1.6], contains a set of UIDs for other -// contacts that are the members of this group. +// The `members` property, as defined in [RFC 9553, Section 2.1.6](https://www.rfc-editor.org/rfc/rfc9553#members), +// contains a set of UIDs for other contacts that are the members of this group. // // Clients should consider the group to contain any `ContactCard` with a matching UID, from // any account they have access to with support for the `urn:ietf:params:jmap:contacts` capability. @@ -269,8 +265,6 @@ type DirectoryKind string // temporarily loses access to this address book. The UIDs cannot be resolved so the contacts will // disappear from the group. However, if they are given permission to access the data again the UIDs // will be found and the contacts will reappear. -// -// [RFC 9553, Section 2.1.8]: https://www.rfc-editor.org/rfc/rfc9553#members type CalendarKind string // The kind of the `Link` resource. @@ -283,8 +277,8 @@ type CalendarKind string // // Clients often present these separately from other contact cards. // -// The `members` property, as defined in [RFC 9553, Section 2.1.6], contains a set of UIDs for other -// contacts that are the members of this group. +// The `members` property, as defined in [RFC 9553, Section 2.1.6]( https://www.rfc-editor.org/rfc/rfc9553#members), +// contains a set of UIDs for other contacts that are the members of this group. // // Clients should consider the group to contain any `ContactCard` with a matching UID, from // any account they have access to with support for the `urn:ietf:params:jmap:contacts` capability. @@ -295,8 +289,6 @@ type CalendarKind string // temporarily loses access to this address book. The UIDs cannot be resolved so the contacts will // disappear from the group. However, if they are given permission to access the data again the UIDs // will be found and the contacts will reappear. -// -// [RFC 9553, Section 2.1.8]: https://www.rfc-editor.org/rfc/rfc9553#members type LinkKind string // The kind of the `Media` resource. @@ -309,8 +301,8 @@ type LinkKind string // // Clients often present these separately from other contact cards. // -// The `members` property, as defined in [RFC 9553, Section 2.1.6], contains a set of UIDs for other -// contacts that are the members of this group. +// The `members` property, as defined in [RFC 9553, Section 2.1.6](https://www.rfc-editor.org/rfc/rfc9553#members), +// contains a set of UIDs for other contacts that are the members of this group. // // Clients should consider the group to contain any `ContactCard` with a matching UID, from // any account they have access to with support for the `urn:ietf:params:jmap:contacts` capability. @@ -321,8 +313,6 @@ type LinkKind string // temporarily loses access to this address book. The UIDs cannot be resolved so the contacts will // disappear from the group. However, if they are given permission to access the data again the UIDs // will be found and the contacts will reappear. -// -// [RFC 9553, Section 2.1.8]: https://www.rfc-editor.org/rfc/rfc9553#members type MediaKind string // The contexts in which to use this resource. @@ -337,8 +327,8 @@ type MediaKind string // Additional contexts may be defined in the properties or data types that make use of this property. // // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type CalendarContext string // The contexts in which to use this resource. @@ -353,8 +343,8 @@ type CalendarContext string // Additional contexts may be defined in the properties or data types that make use of this property. // // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type CryptoKeyContext string // The contexts in which to use this resource. @@ -369,8 +359,8 @@ type CryptoKeyContext string // Additional contexts may be defined in the properties or data types that make use of this property. // // The enumerated common context values are: -// !- `private`: the contact information that may be used in a private context. -// !- `work`: the contact information that may be used in a professional context. +// * `private`: the contact information that may be used in a private context. +// * `work`: the contact information that may be used in a professional context. type LinkContext string // The JSContact version of this Card. @@ -811,21 +801,21 @@ var ( // JSON Pointer evaluation algorithm. // // A patch within a `PatchObject` is only valid if all the following conditions apply: -// !1. The pointer MAY reference inside an array, but if the last reference token in the pointer is an array index, +// 1. The pointer MAY reference inside an array, but if the last reference token in the pointer is an array index, // then the patch value MUST NOT be null. The pointer MUST NOT use `"-"` as an array index in any of its reference // tokens (i.e., you MUST NOT insert/delete from an array, but you MAY replace the contents of its existing members. // To add or remove members, one needs to replace the complete array value). -// !2. All reference tokens prior to the last (i.e., the value after the final slash) MUST already exist as values +// 2. All reference tokens prior to the last (i.e., the value after the final slash) MUST already exist as values // in the object being patched. If the last reference token is an array index, then a member at this index MUST // already exist in the referenced array. -// !3. There MUST NOT be two patches in the `PatchObject` where the pointer of +// 3. There MUST NOT be two patches in the `PatchObject` where the pointer of // one is the prefix of the pointer of the other, e.g., `"addresses/1/city"` and `"addresses"`. -// !4. The value for the patch MUST be valid for the property being set (of the correct type and obeying any +// 4. The value for the patch MUST be valid for the property being set (of the correct type and obeying any // other applicable restrictions), or if null, the property MUST be optional. // // The value associated with each pointerdetermines how to apply that patch: -// !- If null, remove the property from the patched object. If the key is not present in the parent, this is a no-op. -// !- If non-null, set the value given as the value for this property (this may be a replacement or addition to the +// * If null, remove the property from the patched object. If the key is not present in the parent, this is a no-op. +// * If non-null, set the value given as the value for this property (this may be a replacement or addition to the // object being patched). // // A `PatchObject` does not define its own `@type` property. Instead, the `@type` property in a patch MUST be handled @@ -834,8 +824,6 @@ var ( // Implementations MUST reject a `PatchObject` in its entirety if any of its patches are invalid. // // Implementations MUST NOT apply partial patches. -// -// [RFC6901]: https://www.rfc-editor.org/rfc/rfc6901.html type PatchObject map[string]any type Calendar struct { @@ -854,8 +842,8 @@ type Calendar struct { // // Clients often present these separately from other contact cards. // - // The `members` property, as defined in [RFC 9553, Section 2.1.6], contains a set of UIDs for other - // contacts that are the members of this group. + // The `members` property, as defined in [RFC 9553, Section 2.1.6](https://www.rfc-editor.org/rfc/rfc9553#members), + // contains a set of UIDs for other contacts that are the members of this group. // // Clients should consider the group to contain any `ContactCard` with a matching UID, from // any account they have access to with support for the `urn:ietf:params:jmap:contacts` capability. @@ -866,20 +854,14 @@ type Calendar struct { // temporarily loses access to this address book. The UIDs cannot be resolved so the contacts will // disappear from the group. However, if they are given permission to access the data again the UIDs // will be found and the contacts will reappear. - // - // [RFC 9553, Section 2.1.8]: https://www.rfc-editor.org/rfc/rfc9553#members Kind CalendarKind `json:"kind,omitempty"` // The resource value. // - // This MUST be a URI as defined in [Section 3 of RFC3986]. - // - // [Section 3 of RFC3986]: https://www.rfc-editor.org/rfc/rfc3986.html#section-3 + // This MUST be a URI as defined in [Section 3 of RFC3986](https://www.rfc-editor.org/rfc/rfc3986.html#section-3). Uri string `json:"uri,omitempty"` - // The [RFC2046 media type] of the resource identified by the uri property value. - // - // [RFC2046 media type]: https://www.rfc-editor.org/rfc/rfc2046.html + // The [RFC2046 media type](https://www.rfc-editor.org/rfc/rfc2046.html) of the resource identified by the uri property value. MediaType string `json:"mediaType,omitempty"` // The contexts in which to use this resource. @@ -894,11 +876,11 @@ type Calendar struct { // Additional contexts may be defined in the properties or data types that make use of this property. // // The enumerated common context values are: - // !- `private`: the contact information that may be used in a private context. - // !- `work`: the contact information that may be used in a professional context. + // * `private`: the contact information that may be used in a private context. + // * `work`: the contact information that may be used in a professional context. Contexts map[CalendarContext]bool `json:"contexts,omitempty"` - // The [preference] of the resource in relation to other resources. + // The [preference](https://www.rfc-editor.org/rfc/rfc9553.html#prop-pref) of the resource in relation to other resources. // // A preference order for contact information. // @@ -912,11 +894,9 @@ type Calendar struct { // Note that the preference is only defined in relation to contact information of the same type. // // For example, the preference orders within emails and phone numbers are independent of each other. - // - // [preference]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-pref Pref uint `json:"pref,omitzero"` - // A [custom label] for the value. + // A [custom label](https://www.rfc-editor.org/rfc/rfc9553.html#prop-label) for the value. // // The labels associated with the contact data. // @@ -925,8 +905,6 @@ type Calendar struct { // Typically, these labels are displayed along with their associated contact data in graphical user interfaces. // // Note that succinct labels are best for proper display on small graphical interfaces and screens. - // - // [custom label]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-label Label string `json:"label,omitempty"` } @@ -938,14 +916,10 @@ type CryptoKey struct { // The resource value. // - // This MUST be a URI as defined in [Section 3 of RFC3986]. - // - // [Section 3 of RFC3986]: https://www.rfc-editor.org/rfc/rfc3986.html#section-3 + // This MUST be a URI as defined in [Section 3 of RFC3986](https://www.rfc-editor.org/rfc/rfc3986.html#section-3). Uri string `json:"uri,omitempty"` - // The [RFC2046 media type] of the resource identified by the uri property value. - // - // [RFC2046 media type]: https://www.rfc-editor.org/rfc/rfc2046.html + // The [RFC2046 media type](https://www.rfc-editor.org/rfc/rfc2046.html) of the resource identified by the uri property value. MediaType string `json:"mediaType,omitempty"` // The contexts in which to use this resource. @@ -960,11 +934,11 @@ type CryptoKey struct { // Additional contexts may be defined in the properties or data types that make use of this property. // // The enumerated common context values are: - // !- `private`: the contact information that may be used in a private context. - // !- `work`: the contact information that may be used in a professional context. + // * `private`: the contact information that may be used in a private context. + // * `work`: the contact information that may be used in a professional context. Contexts map[CryptoKeyContext]bool `json:"contexts,omitempty"` - // The [preference] of the resource in relation to other resources. + // The [preference](https://www.rfc-editor.org/rfc/rfc9553.html#prop-pref) of the resource in relation to other resources. // // A preference order for contact information. // @@ -978,11 +952,9 @@ type CryptoKey struct { // Note that the preference is only defined in relation to contact information of the same type. // // For example, the preference orders within emails and phone numbers are independent of each other. - // - // [preference]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-pref Pref uint `json:"pref,omitzero"` - // A [custom label] for the value. + // A [custom label](https://www.rfc-editor.org/rfc/rfc9553.html#prop-label) for the value. // // The labels associated with the contact data. // @@ -991,8 +963,6 @@ type CryptoKey struct { // Typically, these labels are displayed along with their associated contact data in graphical user interfaces. // // Note that succinct labels are best for proper display on small graphical interfaces and screens. - // - // [custom label]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-label Label string `json:"label,omitempty"` } @@ -1012,8 +982,8 @@ type Link struct { // // Clients often present these separately from other contact cards. // - // The `members` property, as defined in [RFC 9553, Section 2.1.6], contains a set of UIDs for other - // contacts that are the members of this group. + // The `members` property, as defined in [RFC 9553, Section 2.1.6](https://www.rfc-editor.org/rfc/rfc9553#members), + // contains a set of UIDs for other contacts that are the members of this group. // // Clients should consider the group to contain any `ContactCard` with a matching UID, from // any account they have access to with support for the `urn:ietf:params:jmap:contacts` capability. @@ -1024,20 +994,14 @@ type Link struct { // temporarily loses access to this address book. The UIDs cannot be resolved so the contacts will // disappear from the group. However, if they are given permission to access the data again the UIDs // will be found and the contacts will reappear. - // - // [RFC 9553, Section 2.1.8]: https://www.rfc-editor.org/rfc/rfc9553#members Kind LinkKind `json:"kind,omitempty"` // The resource value. // - // This MUST be a URI as defined in [Section 3 of RFC3986]. - // - // [Section 3 of RFC3986]: https://www.rfc-editor.org/rfc/rfc3986.html#section-3 + // This MUST be a URI as defined in [Section 3 of RFC3986](https://www.rfc-editor.org/rfc/rfc3986.html#section-3). Uri string `json:"uri,omitempty"` - // The [RFC2046 media type] of the resource identified by the uri property value. - // - // [RFC2046 media type]: https://www.rfc-editor.org/rfc/rfc2046.html + // The [RFC2046 media type](https://www.rfc-editor.org/rfc/rfc2046.html) of the resource identified by the uri property value. MediaType string `json:"mediaType,omitempty"` // The contexts in which to use this resource. @@ -1052,11 +1016,11 @@ type Link struct { // Additional contexts may be defined in the properties or data types that make use of this property. // // The enumerated common context values are: - // !- `private`: the contact information that may be used in a private context. - // !- `work`: the contact information that may be used in a professional context. + // * `private`: the contact information that may be used in a private context. + // * `work`: the contact information that may be used in a professional context. Contexts map[LinkContext]bool `json:"contexts,omitempty"` - // The [preference] of the resource in relation to other resources. + // The [preference](https://www.rfc-editor.org/rfc/rfc9553.html#prop-pref) of the resource in relation to other resources. // // A preference order for contact information. // @@ -1070,11 +1034,9 @@ type Link struct { // Note that the preference is only defined in relation to contact information of the same type. // // For example, the preference orders within emails and phone numbers are independent of each other. - // - // [preference]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-pref Pref uint `json:"pref,omitzero"` - // A [custom label] for the value. + // A [custom label](https://www.rfc-editor.org/rfc/rfc9553.html#prop-label) for the value. // // The labels associated with the contact data. // @@ -1083,8 +1045,6 @@ type Link struct { // Typically, these labels are displayed along with their associated contact data in graphical user interfaces. // // Note that succinct labels are best for proper display on small graphical interfaces and screens. - // - // [custom label]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-label Label string `json:"label,omitempty"` } @@ -1104,8 +1064,8 @@ type Directory struct { // // Clients often present these separately from other contact cards. // - // The `members` property, as defined in [RFC 9553, Section 2.1.6], contains a set of UIDs for other - // contacts that are the members of this group. + // The `members` property, as defined in [RFC 9553, Section 2.1.6](https://www.rfc-editor.org/rfc/rfc9553#members), + // contains a set of UIDs for other contacts that are the members of this group. // // Clients should consider the group to contain any `ContactCard` with a matching UID, from // any account they have access to with support for the `urn:ietf:params:jmap:contacts` capability. @@ -1116,20 +1076,14 @@ type Directory struct { // temporarily loses access to this address book. The UIDs cannot be resolved so the contacts will // disappear from the group. However, if they are given permission to access the data again the UIDs // will be found and the contacts will reappear. - // - // [RFC 9553, Section 2.1.8]: https://www.rfc-editor.org/rfc/rfc9553#members Kind DirectoryKind `json:"kind,omitempty"` // The resource value. // - // This MUST be a URI as defined in Section 3 of [RFC3986-section3]. - // - // [RFC3986-section3]: https://www.rfc-editor.org/rfc/rfc3986.html#section-3 + // This MUST be a URI as defined in Section 3 of [RFC3986-section3](https://www.rfc-editor.org/rfc/rfc3986.html#section-3). Uri string `json:"uri,omitempty"` - // The [RFC2046 media type] of the resource identified by the uri property value. - // - // [RFC2046 media type]: https://www.rfc-editor.org/rfc/rfc2046.html + // The [RFC2046 media type](https://www.rfc-editor.org/rfc/rfc2046.html) of the resource identified by the uri property value. MediaType string `json:"mediaType,omitempty"` // The contexts in which to use this resource. @@ -1144,11 +1098,11 @@ type Directory struct { // Additional contexts may be defined in the properties or data types that make use of this property. // // The enumerated common context values are: - // !- `private`: the contact information that may be used in a private context. - // !- `work`: the contact information that may be used in a professional context. + // * `private`: the contact information that may be used in a private context. + // * `work`: the contact information that may be used in a professional context. Contexts map[DirectoryContext]bool `json:"contexts,omitempty"` - // The [preference] of the resource in relation to other resources. + // The [preference](https://www.rfc-editor.org/rfc/rfc9553.html#prop-pref) of the resource in relation to other resources. // // A preference order for contact information. // @@ -1162,11 +1116,9 @@ type Directory struct { // Note that the preference is only defined in relation to contact information of the same type. // // For example, the preference orders within emails and phone numbers are independent of each other. - // - // [preference]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-pref Pref uint `json:"pref,omitzero"` - // A [custom label] for the value. + // A [custom label](https://www.rfc-editor.org/rfc/rfc9553.html#prop-label) for the value. // // The labels associated with the contact data. // @@ -1175,8 +1127,6 @@ type Directory struct { // Typically, these labels are displayed along with their associated contact data in graphical user interfaces. // // Note that succinct labels are best for proper display on small graphical interfaces and screens. - // - // [custom label]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-label Label string `json:"label,omitempty"` // The position of the directory resource in the list of all `Directory` objects having the same kind property @@ -1208,8 +1158,8 @@ type Media struct { // // Clients often present these separately from other contact cards. // - // The `members` property, as defined in [RFC 9553, Section 2.1.6], contains a set of UIDs for other - // contacts that are the members of this group. + // The `members` property, as defined in [RFC 9553, Section 2.1.6](https://www.rfc-editor.org/rfc/rfc9553#members), + // contains a set of UIDs for other contacts that are the members of this group. // // Clients should consider the group to contain any `ContactCard` with a matching UID, from // any account they have access to with support for the `urn:ietf:params:jmap:contacts` capability. @@ -1220,20 +1170,14 @@ type Media struct { // temporarily loses access to this address book. The UIDs cannot be resolved so the contacts will // disappear from the group. However, if they are given permission to access the data again the UIDs // will be found and the contacts will reappear. - // - // [RFC 9553, Section 2.1.8]: https://www.rfc-editor.org/rfc/rfc9553#members Kind MediaKind `json:"kind,omitempty"` // The resource value. // - // This MUST be a URI as defined in Section 3 of [RFC3986-section3]. - // - // [RFC3986-section3]: https://www.rfc-editor.org/rfc/rfc3986.html#section-3 + // This MUST be a URI as defined in Section 3 of [RFC3986-section3](https://www.rfc-editor.org/rfc/rfc3986.html#section-3). Uri string `json:"uri,omitempty"` - // The [RFC2046 media type] of the resource identified by the uri property value. - // - // [RFC2046 media type]: https://www.rfc-editor.org/rfc/rfc2046.html + // The [RFC2046 media type](https://www.rfc-editor.org/rfc/rfc2046.html) of the resource identified by the uri property value. MediaType string `json:"mediaType,omitempty"` // The contexts in which to use this resource. @@ -1248,11 +1192,11 @@ type Media struct { // Additional contexts may be defined in the properties or data types that make use of this property. // // The enumerated common context values are: - // !- `private`: the contact information that may be used in a private context. - // !- `work`: the contact information that may be used in a professional context. + // * `private`: the contact information that may be used in a private context. + // * `work`: the contact information that may be used in a professional context. Contexts map[MediaContext]bool `json:"contexts,omitempty"` - // The [preference] of the resource in relation to other resources. + // The [preference](https://www.rfc-editor.org/rfc/rfc9553.html#prop-pref) of the resource in relation to other resources. // // A preference order for contact information. // @@ -1266,11 +1210,9 @@ type Media struct { // Note that the preference is only defined in relation to contact information of the same type. // // For example, the preference orders within emails and phone numbers are independent of each other. - // - // [preference]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-pref Pref uint `json:"pref,omitzero"` - // A [custom label] for the value. + // A [custom label](https://www.rfc-editor.org/rfc/rfc9553.html#prop-label) for the value. // // The labels associated with the contact data. // @@ -1279,8 +1221,6 @@ type Media struct { // Typically, these labels are displayed along with their associated contact data in graphical user interfaces. // // Note that succinct labels are best for proper display on small graphical interfaces and screens. - // - // [custom label]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-label Label string `json:"label,omitempty"` // An id for the Blob representing the binary contents of the resource. @@ -1307,30 +1247,28 @@ type Relation struct { // // The relationship between the two objects is undefined if the set is empty. // - // The initial list of enumerated relation types matches the IANA-registered TYPE `IANA-vCard`` - // parameter values of the vCard RELATED property ([Section 6.6.6 of RFC6350]): - // !- `acquaintance` - // !- `agent` - // !- `child` - // !- `co-resident` - // !- `co-worker` - // !- `colleague` - // !- `contact` - // !- `crush` - // !- `date` - // !- `emergency` - // !- `friend` - // !- `kin` - // !- `me` - // !- `met` - // !- `muse` - // !- `neighbor` - // !- `parent` - // !- `sibling` - // !- `spouse` - // !- `sweetheart` - // - // [Section 6.6.6 of RFC6350]: https://www.rfc-editor.org/rfc/rfc6350.html#section-6.6.6 + // The initial list of enumerated relation types matches the IANA-registered TYPE `IANA-vCard` + // parameter values of the vCard RELATED property ([Section 6.6.6 of RFC6350](https://www.rfc-editor.org/rfc/rfc6350.html#section-6.6.6)): + // * `acquaintance` + // * `agent` + // * `child` + // * `co-resident` + // * `co-worker` + // * `colleague` + // * `contact` + // * `crush` + // * `date` + // * `emergency` + // * `friend` + // * `kin` + // * `me` + // * `met` + // * `muse` + // * `neighbor` + // * `parent` + // * `sibling` + // * `spouse` + // * `sweetheart` Relation map[Relationship]bool `json:"relation,omitempty"` } @@ -1345,14 +1283,14 @@ type NameComponent struct { // The kind of the name component. // - // !- `title`: an honorific title or prefix, e.g., `Mr.`, `Ms.`, or `Dr.` - // !- `given`: a given name, also known as "first name" or "personal name" - // !- `given2`: a name that appears between the given and surname such as a middle name or patronymic name - // !- `surname`: a surname, also known as "last name" or "family name" - // !- `surname2`: a secondary surname (used in some cultures), also known as "maternal surname" - // !- `credential`: a credential, also known as "accreditation qualifier" or "honorific suffix", e.g., `B.A.`, `Esq.` - // !- `generation`: a generation marker or qualifier, e.g., `Jr.` or `III` - // !- `separator`: a formatting separator between two ordered name non-separator components; the value property of the component includes the verbatim separator, for example, a hyphen character or even an empty string. This value has higher precedence than the defaultSeparator property of the Name. Implementations MUST NOT insert two consecutive separator components; instead, they SHOULD insert a single separator component with the combined value; this component kind MUST NOT be set if the `Name` `isOrdered` property value is `false` + // * `title`: an honorific title or prefix, e.g., `Mr.`, `Ms.`, or `Dr.` + // * `given`: a given name, also known as "first name" or "personal name" + // * `given2`: a name that appears between the given and surname such as a middle name or patronymic name + // * `surname`: a surname, also known as "last name" or "family name" + // * `surname2`: a secondary surname (used in some cultures), also known as "maternal surname" + // * `credential`: a credential, also known as "accreditation qualifier" or "honorific suffix", e.g., `B.A.`, `Esq.` + // * `generation`: a generation marker or qualifier, e.g., `Jr.` or `III` + // * `separator`: a formatting separator between two ordered name non-separator components; the value property of the component includes the verbatim separator, for example, a hyphen character or even an empty string. This value has higher precedence than the defaultSeparator property of the Name. Implementations MUST NOT insert two consecutive separator components; instead, they SHOULD insert a single separator component with the combined value; this component kind MUST NOT be set if the `Name` `isOrdered` property value is `false` Kind NameComponentKind `json:"kind"` // The pronunciation of the name component. @@ -1482,8 +1420,8 @@ type Title struct { // positions and roles as more temporary assignments such as in project management. // // The enumerated values are: - // !- `title` - // !- `role` + // * `title` + // * `role` Kind TitleKind `json:"kind,omitempty"` // The identifier of the organization in which this title is held. @@ -1500,12 +1438,12 @@ type SpeakToAs struct { // `Sehr geehrte` (feminine) and `Sehr geehrter` (masculine). // // The enumerated values are: - // !- `animate` - // !- `common` - // !- `feminine` - // !- `inanimate` - // !- `masculine` - // !- `neuter` + // * `animate` + // * `common` + // * `feminine` + // * `inanimate` + // * `masculine` + // * `neuter` // // Note that the grammatical gender does not allow inferring the gender identities or assigned // sex of the contact. @@ -1540,9 +1478,7 @@ type Name struct { Components []NameComponent `json:"components,omitempty"` // The indicator if the name components in the components property are ordered. - // - // default: false - IsOrdered bool `json:"isOrdered,omitzero"` + IsOrdered bool `json:"isOrdered,omitzero" doc:"opt" default:"false"` // The default separator to insert between name component values when concatenating all name component values to a single String. // @@ -1550,15 +1486,11 @@ type Name struct { // // The `defaultSeparator` property MUST NOT be set if the `Name` `isOrdered` property value is `false` or if // the components property is not set. - // - // example: {"name": { "components": [{ "kind": "given", "value": "Diego" }, { "kind": "surname", "value": "Rivera" }, { "kind": "surname2", "value": "Barrientos" }], "isOrdered": true} DefaultSeparator string `json:"defaultSeparator,omitempty"` // The full name representation of the `Name`. // // The `full` property MUST be set if the components property is not set. - // - // example: Mr. John Q. Public, Esq. Full string `json:"full,omitempty"` // The value to lexicographically sort the name in relation to other names when compared by a name component type. @@ -1594,9 +1526,7 @@ type EmailAddress struct { // The email address. // - // This MUST be an addr-spec value as defined in [Section 3.4.1 of RFC5322]. - // - // [Section 3.4.1 of RFC5322]: https://www.rfc-editor.org/rfc/rfc5322.html#section-3.4.1 + // This MUST be an addr-spec value as defined in [Section 3.4.1 of RFC5322](https://www.rfc-editor.org/rfc/rfc5322.html#section-3.4.1). Address string `json:"address"` // The contexts in which to use this email address. @@ -1682,9 +1612,6 @@ type Phone struct { // The phone number as either a URI or free text. // // Typical URI schemes are `tel` [RFC3966] or `sip` [RFC3261], but any URI scheme is allowed. - // - // [RFC3966]: https://www.rfc-editor.org/rfc/rfc3966.html - // [RFC3261]: https://www.rfc-editor.org/rfc/rfc3261.html Number string `json:"number"` // The set of contact features that the phone number may be used for. @@ -1694,14 +1621,14 @@ type Phone struct { // The boolean value MUST be `true`. // // The enumerated values are: - // !- `mobile`: this number is for a mobile phone - // !- `voice`: this number supports calling by voice - // !- `text`: this number supports text messages (SMS) - // !- `video`: this number supports video conferencing - // !- `main-number`: this number is a main phone number such as the number of the front desk at a company, as opposed to a direct-dial number of an individual employee - // !- `textphone`: this number is for a device for people with hearing or speech difficulties - // !- `fax`: this number supports sending faxes - // !- `pager`: this number is for a pager or beeper + // * `mobile`: this number is for a mobile phone + // * `voice`: this number supports calling by voice + // * `text`: this number supports text messages (SMS) + // * `video`: this number supports video conferencing + // * `main-number`: this number is a main phone number such as the number of the front desk at a company, as opposed to a direct-dial number of an individual employee + // * `textphone`: this number is for a device for people with hearing or speech difficulties + // * `fax`: this number supports sending faxes + // * `pager`: this number is for a pager or beeper Features map[PhoneFeature]bool `json:"features,omitempty"` // The contexts in which to use the number. @@ -1739,8 +1666,6 @@ type LanguagePref struct { // The preferred language. // // This MUST be a language tag as defined in [RFC5646]. - // - // [RFC5646]: https://www.rfc-editor.org/rfc/rfc5646.html Language string `json:"language"` // The contexts in which to use the language. @@ -1807,24 +1732,24 @@ type AddressComponent struct { // The kind of the address component. // // The enumerated values are: - // ! `room`: the room, suite number, or identifier - // ! `apartment`: the extension designation such as the apartment number, unit, or box number - // ! `floor`: the floor or level the address is located on - // ! `building`: the building, tower, or condominium the address is located in - // ! `number`: the street number, e.g., `"123"`; this value is not restricted to numeric values and can include any value such + // * `room`: the room, suite number, or identifier + // * `apartment`: the extension designation such as the apartment number, unit, or box number + // * `floor`: the floor or level the address is located on + // * `building`: the building, tower, or condominium the address is located in + // * `number`: the street number, e.g., `"123"`; this value is not restricted to numeric values and can include any value such // as number ranges (`"112-10"`), grid style (`"39.2 RD"`), alphanumerics (`"N6W23001"`), or fractionals (`"123 1/2"`) - // ! `name`: the street name - // ! `block`: the block name or number - // ! `subdistrict`: the subdistrict, ward, or other subunit of a district - // ! `district`: the district name - // ! `locality`: the municipality, city, town, village, post town, or other locality - // ! `region`: the administrative area such as province, state, prefecture, county, or canton - // ! `postcode`: the postal code, post code, ZIP code, or other short code associated with the address by the relevant country's postal system - // ! `country`: the country name - // ! `direction`: the cardinal direction or quadrant, e.g., "north" - // ! `landmark`: the publicly known prominent feature that can substitute the street name and number, e.g., "White House" or "Taj Mahal" - // ! `postOfficeBox`: the post office box number or identifier - // ! `separator`: a formatting separator between two ordered address non-separator components; the value property of the component includes the + // * `name`: the street name + // * `block`: the block name or number + // * `subdistrict`: the subdistrict, ward, or other subunit of a district + // * `district`: the district name + // * `locality`: the municipality, city, town, village, post town, or other locality + // * `region`: the administrative area such as province, state, prefecture, county, or canton + // * `postcode`: the postal code, post code, ZIP code, or other short code associated with the address by the relevant country's postal system + // * `country`: the country name + // * `direction`: the cardinal direction or quadrant, e.g., "north" + // * `landmark`: the publicly known prominent feature that can substitute the street name and number, e.g., "White House" or "Taj Mahal" + // * `postOfficeBox`: the post office box number or identifier + // * `separator`: a formatting separator between two ordered address non-separator components; the value property of the component includes the // verbatim separator, for example, a hyphen character or even an empty string; this value has higher precedence than the `defaultSeparator` property // of the `Address`; implementations MUST NOT insert two consecutive separator components; instead, they SHOULD insert a single separator component // with the combined value; this component kind MUST NOT be set if the `Address` `isOrdered` property value is `false`. @@ -1861,25 +1786,17 @@ type Address struct { Components []AddressComponent `json:"components,omitempty"` // The indicator if the address components in the components property are ordered - // - // default: false - IsOrdered bool `json:"isOrdered,omitzero"` + IsOrdered bool `json:"isOrdered,omitzero" doc:"opt" default:"false"` - // The Alpha-2 country code as of [ISO.3166-1]. - // - // [ISO.3166-1]: https://www.iso.org/iso-3166-country-codes.html + // The Alpha-2 country code as of [ISO.3166-1](https://www.iso.org/iso-3166-country-codes.html). CountryCode string `json:"countryCode,omitempty"` // A "geo:" URI [RFC5870] for the address. - // - // [RFC5870]: https://www.rfc-editor.org/rfc/rfc5870.html Coordinates string `json:"coordinates,omitempty"` // The time zone in which the address is located. // - // This MUST be a time zone name registered in the IANA Time Zone Database [IANA-TZ]. - // - // [IANA-TZ]: https://www.iana.org/time-zones + // This MUST be a time zone name registered in the IANA Time Zone Database [IANA-TZ](https://www.iana.org/time-zones). TimeZone string `json:"timeZone,omitempty"` // The contexts in which to use this address. @@ -1887,8 +1804,8 @@ type Address struct { // The boolean value MUST be `true`. // // In addition to the common contexts, allowed key values are: - // ! `billing`: an address to be used for billing - // ! `delivery`: an address to be used for delivering physical items + // * `billing`: an address to be used for billing + // * `delivery`: an address to be used for delivering physical items Contexts map[AddressContext]bool `json:"contexts,omitempty"` // The full address, including street, region, or country. @@ -1980,16 +1897,14 @@ type PartialDate struct { // The calendar system in which this date occurs, in lowercase. // - // This MUST be either a calendar system name registered as a Common Locale Data Repository [CLDR] [RFC7529] + // This MUST be either a calendar system name registered as a Common Locale Data Repository + // [CLDR](https://github.com/unicode-org/cldr/blob/latest/common/bcp47/calendar.xml); [RFC7529] // or a vendor-specific value. // // The year, month, and day still MUST be represented in the Gregorian calendar. // // Note that the year property might be required to convert the date between the Gregorian calendar // and the respective calendar system. - // - // [CLDR]: https://github.com/unicode-org/cldr/blob/latest/common/bcp47/calendar.xml - // [RFC7529]: https://www.rfc-editor.org/rfc/rfc7529.html CalendarScale string `json:"calendarScale,omitempty"` } @@ -2018,9 +1933,9 @@ type Anniversary struct { // The kind of anniversary. // // The enumerated values are: - // ! `birth`: a birthday anniversary - // ! `death`: a deathday anniversary - // ! `wedding`: a wedding day anniversary + // * `birth`: a birthday anniversary + // * `death`: a deathday anniversary + // * `wedding`: a wedding day anniversary Kind AnniversaryKind `json:"kind"` // The date of the anniversary in the Gregorian calendar. @@ -2062,9 +1977,9 @@ type PersonalInfo struct { // The kind of personal information. // // The enumerated values are: - // ! `expertise`: a field of expertise or a credential - // ! `hobby`: a hobby - // ! `interest`: an interest + // * `expertise`: a field of expertise or a credential + // * `hobby`: a hobby + // * `interest`: an interest Kind PersonalInfoKind `json:"kind"` // The actual information. @@ -2073,9 +1988,9 @@ type PersonalInfo struct { // The level of expertise or engagement in hobby or interest. // // The enumerated values are: - // ! `high` - // ! `medium` - // ! `low` + // * `high` + // * `medium` + // * `low` Level PersonalInfoLevel `json:"level,omitempty"` // The position of the personal information in the list of all `PersonalInfo` objects that @@ -2088,7 +2003,7 @@ type PersonalInfo struct { // Sorting such same-valued entries is implementation-specific. ListAs uint `json:"listAs,omitzero"` - // A [custom label]. + // A [custom label](https://www.rfc-editor.org/rfc/rfc9553.html#prop-label). // // The labels associated with the contact data. // @@ -2097,8 +2012,6 @@ type PersonalInfo struct { // Typically, these labels are displayed along with their associated contact data in graphical user interfaces. // // Note that succinct labels are best for proper display on small graphical interfaces and screens. - // - // [custom label]: https://www.rfc-editor.org/rfc/rfc9553.html#prop-label Label string `json:"label,omitempty"` } @@ -2119,16 +2032,12 @@ type PersonalInfo struct { // this address book. // The UIDs cannot be resolved so the contacts will disappear from the group. // However, if they are given permission to access the data again the UIDs will be found and the contacts will reappear. -// -// [RFC9553]: https://www.rfc-editor.org/rfc/rfc9553.html type ContactCard struct { // The id of the Card (immutable; server-set). // // The id uniquely identifies a Card with a particular “uid” within a particular account. // // This is a JMAP extension and not part of [RFC9553]. - // - // [RFC9553]: https://www.rfc-editor.org/rfc/rfc9553.html Id string `json:"id,omitempty"` // The set of AddressBook ids this Card belongs to. @@ -2140,8 +2049,6 @@ type ContactCard struct { // The value for each key in the object MUST be true. // // This is a JMAP extension and not part of [RFC9553]. - // - // [RFC9553]: https://www.rfc-editor.org/rfc/rfc9553.html AddressBookIds map[string]bool `json:"addressBookIds,omitempty"` // The JSContact type of the Card object: the value MUST be "Card". @@ -2150,26 +2057,20 @@ type ContactCard struct { // The JSContact version of this Card. // // The value MUST be one of the IANA-registered JSContact Version values for the version property. - // - // example: 1.0 Version JSContactVersion `json:"version"` // The date and time when the Card was created (UTCDateTime). - // - // example: 2022-09-30T14:35:10Z Created time.Time `json:"created,omitzero"` - // The kind of the entity the Card represents (default: `individual``). + // The kind of the entity the Card represents (default: `individual`). // // Values are: - // !- `individual``: a single person - // !- group: a group of people or entities - // !- org: an organization - // !- location: a named location - // !- device: a device such as an appliance, a computer, or a network element - // !- application: a software application - // - // example: individual + // * `individual`: a single person + // * `group`: a group of people or entities + // * `org`: an organization + // * `location`: a named location + // * `device`: a device such as an appliance, a computer, or a network element + // * `application`: a software application Kind ContactCardKind `json:"kind,omitempty"` // The language tag, as defined in [RFC5646]. @@ -2178,10 +2079,6 @@ type ContactCard struct { // additional information such as the script. // // Note that values MAY be localized in the `localizations` property. - // - // [RFC5646]: https://www.rfc-editor.org/rfc/rfc5646.html - // - // example: de-AT Language string `json:"language,omitempty"` // The set of Cards that are members of this group Card. @@ -2199,8 +2096,6 @@ type ContactCard struct { // The identifier for the product that created the Card. // // If set, the value MUST be at least one character long. - // - // example: ACME Contacts App version 1.23.5 ProdId string `json:"prodId,omitempty"` // The set of Card objects that relate to the Card. @@ -2230,17 +2125,9 @@ type ContactCard struct { // The value of the URN SHOULD be in the "uuid" namespace [RFC9562]. // // [RFC9562] describes multiple versions of Universally Unique IDentifiers (UUIDs); UUID version 4 is RECOMMENDED. - // - // [RFC8141]: https://www.rfc-editor.org/rfc/rfc8141.html - // [RFC6350]: https://www.rfc-editor.org/rfc/rfc6350.html - // [RFC9562]: https://www.rfc-editor.org/rfc/rfc9562.html - // - // example: urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6 Uid string `json:"uid,omitempty"` // The date and time when the data in the Card was last modified (UTCDateTime). - // - // example: 2021-10-31T22:27:10Z Updated time.Time `json:"updated,omitzero"` // The name of the entity represented by the Card. @@ -2277,10 +2164,10 @@ type ContactCard struct { // The calendaring resources of the entity represented by the Card, such as to look up free-busy information. // // A Calendar object has all properties of the Resource data type, with the following additional definitions: - // !- The `@type` property value MUST be `Calendar`, if set - // !- The `kind` property is mandatory. Its enumerated values are: - // !- `calendar`: The resource is a calendar that contains entries such as calendar events or tasks - // !- `freeBusy`: The resource allows for free-busy lookups, for example, to schedule group events + // * The `@type` property value MUST be `Calendar`, if set + // * The `kind` property is mandatory. Its enumerated values are: + // * `calendar`: The resource is a calendar that contains entries such as calendar events or tasks + // * `freeBusy`: The resource allows for free-busy lookups, for example, to schedule group events Calendars map[string]Calendar `json:"calendars,omitempty"` // The scheduling addresses by which the entity may receive calendar scheduling invitations. @@ -2295,7 +2182,7 @@ type ContactCard struct { // the `@type` property value MUST be `CryptoKey`, if set. // // The following example shows how to refer to an external cryptographic resource: - // ``` + // ```json // "cryptoKeys": { // "mykey1": { // "uri": "https://www.example.com/keys/jdoe.cer" @@ -2307,32 +2194,32 @@ type ContactCard struct { // The directories containing information about the entity represented by the Card. // // A Directory object has all properties of the `Resource` data type, with the following additional definitions: - // !- The `@type` property value MUST be `Directory`, if set - // !- The `kind` property is mandatory; tts enumerated values are: - // !- `directory`: the resource is a directory service that the entity represented by the Card is a part of; this + // * The `@type` property value MUST be `Directory`, if set + // * The `kind` property is mandatory; tts enumerated values are: + // * `directory`: the resource is a directory service that the entity represented by the Card is a part of; this // typically is an organizational directory that also contains associated entities, e.g., co-workers and management // in a company directory - // !- `entry`: the resource is a directory entry of the entity represented by the Card; in contrast to the `directory` + // * `entry`: the resource is a directory entry of the entity represented by the Card; in contrast to the `directory` // type, this is the specific URI for the entity within a directory Directories map[string]Directory `json:"directories,omitempty"` // The links to resources that do not fit any of the other use-case-specific resource properties. // // A Link object has all properties of the `Resource` data type, with the following additional definitions: - // !- The `@type` property value MUST be `Link`, if set - // !- The `kind` property is optional; tts enumerated values are: - // !- `contact``: the resource is a URI by which the entity represented by the Card may be contacted; + // * The `@type` property value MUST be `Link`, if set + // * The `kind` property is optional; tts enumerated values are: + // * `contact`: the resource is a URI by which the entity represented by the Card may be contacted; // this includes web forms or other media that require user interaction Links map[string]Link `json:"links,omitempty"` // The media resources such as photographs, avatars, or sounds that are associated with the entity represented by the Card. // // A Media object has all properties of the Resource data type, with the following additional definitions: - // !- the `@type` property value MUST be `Media`, if set - // !- the `kind` property is mandatory; its enumerated values are: - // !- `photo`: the resource is a photograph or avatar - // !- `sound`: the resource is audio media, e.g., to specify the proper pronunciation of the name property contents - // !- `logo`: the resource is a graphic image or logo associated with the entity represented by the Card + // * the `@type` property value MUST be `Media`, if set + // * the `kind` property is mandatory; its enumerated values are: + // * `photo`: the resource is a photograph or avatar + // * `sound`: the resource is audio media, e.g., to specify the proper pronunciation of the name property contents + // * `logo`: the resource is a graphic image or logo associated with the entity represented by the Card Media map[string]Media `json:"media,omitempty"` // The property values localized to languages other than the main `language` of the Card. @@ -2347,19 +2234,17 @@ type ContactCard struct { // A patch MUST NOT target the localizations property. // // Conceptually, a Card is localized as follows: - // !- Determine the language tag in which the Card should be localized. - // !- If the localizations property includes a key for that language, obtain the PatchObject value; + // * Determine the language tag in which the Card should be localized. + // * If the localizations property includes a key for that language, obtain the PatchObject value; // if there is no such key, stop. - // !- Create a copy of the Card, but do not copy the localizations property. - // !- Apply all patches in the PatchObject to the copy of the Card. - // !- Optionally, set the language property in the copy of the Card. - // !- Use the patched copy of the Card as the localized variant of the original Card. + // * Create a copy of the Card, but do not copy the localizations property. + // * Apply all patches in the PatchObject to the copy of the Card. + // * Optionally, set the language property in the copy of the Card. + // * Use the patched copy of the Card as the localized variant of the original Card. // // A patch in the `PatchObject` may contain any value type. // // Its value MUST be a valid value according to the definition of the patched property. - // - // [RFC5646]: https://www.rfc-editor.org/rfc/rfc5646.html Localizations map[string]PatchObject `json:"localizations,omitempty"` // The memorable dates and events for the entity represented by the Card.