Documentation
¶
Overview ¶
Package contacts implements the JMAP Contacts protocol (RFC 9610), providing AddressBook and ContactCard data types and methods, with the JSContact Card data model (RFC 9553).
Index ¶
- func Register()
- type Address
- type AddressBook
- type AddressBookChanges
- type AddressBookChangesResponse
- type AddressBookGet
- type AddressBookGetResponse
- type AddressBookSet
- type AddressBookSetResponse
- type AddressComponent
- type Anniversary
- type Author
- type Capability
- type ContactCard
- type ContactCardChanges
- type ContactCardChangesResponse
- type ContactCardCopy
- type ContactCardCopyResponse
- type ContactCardFilter
- type ContactCardGet
- type ContactCardGetResponse
- type ContactCardQuery
- type ContactCardQueryChanges
- type ContactCardQueryChangesResponse
- type ContactCardQueryResponse
- type ContactCardSet
- type ContactCardSetResponse
- type ContactCardSort
- type CryptoKey
- type EmailAddress
- type LanguagePref
- type NameComponent
- type NickName
- type Note
- type OnlineService
- type OrgUnit
- type Organization
- type PersonalInfo
- type Phone
- type ShareRights
- type Title
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct {
// Components is the list of address components.
Components []*AddressComponent `json:"components,omitempty"`
// CountryCode is the ISO 3166-1 alpha-2 country code.
CountryCode *string `json:"countryCode,omitempty"`
// Coordinates is the geographic coordinates (e.g. "geo:46.77,7.63").
Coordinates *string `json:"coordinates,omitempty"`
// TimeZone is the IANA time zone identifier.
TimeZone *string `json:"timeZone,omitempty"`
// Contexts maps context labels to true, e.g. "private", "work".
Contexts map[string]bool `json:"contexts,omitempty"`
// Pref is the preference order (1 = highest).
Pref *uint32 `json:"pref,omitempty"`
// IsOrdered indicates whether the components are ordered.
IsOrdered bool `json:"isOrdered,omitempty"`
// DefaultSeparator is the default separator between components.
DefaultSeparator *string `json:"defaultSeparator,omitempty"`
// FullAddress is the full address as a single string.
FullAddress *string `json:"fullAddress,omitempty"`
}
Address represents a postal address (RFC 9553 Section 2.5.1).
type AddressBook ¶
type AddressBook struct {
// ID is the server-assigned identifier.
ID jmap.ID `json:"id,omitempty"`
// Name is the display name of the address book.
Name string `json:"name"`
// Description is an optional longer description of the address book.
Description *string `json:"description,omitempty"`
// SortOrder defines the sort order among address books.
SortOrder uint32 `json:"sortOrder,omitempty"`
// IsDefault indicates whether this is the default address book.
IsDefault bool `json:"isDefault,omitempty"`
// IsSubscribed indicates whether the user has subscribed to this
// address book.
IsSubscribed bool `json:"isSubscribed,omitempty"`
ShareWith map[jmap.ID]*ShareRights `json:"shareWith,omitempty"`
// MyRights is the current user's sharing rights for this address book.
MyRights *ShareRights `json:"myRights,omitempty"`
}
AddressBook represents a JMAP AddressBook object (RFC 9610 Section 3).
type AddressBookChanges ¶
type AddressBookChanges struct {
// AccountID is the account to query.
AccountID jmap.ID `json:"accountId"`
// SinceState is the state to compare against.
SinceState string `json:"sinceState"`
// MaxChanges is the maximum number of changes to return.
MaxChanges *uint64 `json:"maxChanges,omitempty"`
}
AddressBookChanges retrieves changes to AddressBooks since a given state (RFC 9610 Section 3).
func (*AddressBookChanges) Name ¶
func (m *AddressBookChanges) Name() string
Name implements jmap.Method.
func (*AddressBookChanges) Requires ¶
func (m *AddressBookChanges) Requires() []jmap.URI
Requires implements jmap.Method.
type AddressBookChangesResponse ¶
type AddressBookChangesResponse struct {
// OldState is the state before the changes.
OldState string `json:"oldState"`
// NewState is the state after the changes.
NewState string `json:"newState"`
// HasMoreChanges indicates whether there are more changes available.
HasMoreChanges bool `json:"hasMoreChanges"`
// Created contains IDs of AddressBooks that were created.
Created []jmap.ID `json:"created,omitempty"`
// Updated contains IDs of AddressBooks that were updated.
Updated []jmap.ID `json:"updated,omitempty"`
// Destroyed contains IDs of AddressBooks that were destroyed.
Destroyed []jmap.ID `json:"destroyed,omitempty"`
}
AddressBookChangesResponse is the response to AddressBook/changes.
func (*AddressBookChangesResponse) Name ¶
func (r *AddressBookChangesResponse) Name() string
Name implements jmap.MethodResponse.
type AddressBookGet ¶
type AddressBookGet struct {
// AccountID is the account to query.
AccountID jmap.ID `json:"accountId"`
// IDs is the list of AddressBook IDs to retrieve. If nil, all are returned.
IDs []jmap.ID `json:"ids,omitempty"`
// Properties lists the properties to return. If nil, all are returned.
Properties []string `json:"properties,omitempty"`
}
AddressBookGet retrieves AddressBook objects (RFC 9610 Section 3).
func (*AddressBookGet) Requires ¶
func (m *AddressBookGet) Requires() []jmap.URI
Requires implements jmap.Method.
type AddressBookGetResponse ¶
type AddressBookGetResponse struct {
// State is the current state string for this type.
State string `json:"state"`
// List contains the requested AddressBook objects.
List []*AddressBook `json:"list,omitempty"`
// NotFound contains IDs that were not found.
NotFound []jmap.ID `json:"notFound,omitempty"`
}
AddressBookGetResponse is the response to AddressBook/get.
func (*AddressBookGetResponse) Name ¶
func (r *AddressBookGetResponse) Name() string
Name implements jmap.MethodResponse.
type AddressBookSet ¶
type AddressBookSet struct {
// AccountID is the account to modify.
AccountID jmap.ID `json:"accountId"`
// IfInState only applies changes if the current state matches.
IfInState *string `json:"ifInState,omitempty"`
// Create maps creation IDs to AddressBook objects to create.
Create map[jmap.ID]*AddressBook `json:"create,omitempty"`
// Update maps AddressBook IDs to patch objects.
Update map[jmap.ID]*jmap.Patch `json:"update,omitempty"`
// Destroy is a list of AddressBook IDs to destroy.
Destroy []jmap.ID `json:"destroy,omitempty"`
}
AddressBookSet creates, updates, or destroys AddressBooks (RFC 9610 Section 3).
func (*AddressBookSet) Requires ¶
func (m *AddressBookSet) Requires() []jmap.URI
Requires implements jmap.Method.
type AddressBookSetResponse ¶
type AddressBookSetResponse struct {
// OldState is the state before the changes.
OldState string `json:"oldState"`
// NewState is the state after the changes.
NewState string `json:"newState"`
// Created maps creation IDs to created AddressBook objects.
Created map[jmap.ID]*AddressBook `json:"created,omitempty"`
// Updated maps AddressBook IDs to updated AddressBook objects.
Updated map[jmap.ID]*AddressBook `json:"updated,omitempty"`
// Destroyed contains IDs of destroyed AddressBooks.
Destroyed []jmap.ID `json:"destroyed,omitempty"`
// NotCreated maps creation IDs to errors.
NotCreated map[jmap.ID]*jmap.SetError `json:"notCreated,omitempty"`
// NotUpdated maps AddressBook IDs to errors.
NotUpdated map[jmap.ID]*jmap.SetError `json:"notUpdated,omitempty"`
// NotDestroyed maps AddressBook IDs to errors.
NotDestroyed map[jmap.ID]*jmap.SetError `json:"notDestroyed,omitempty"`
}
AddressBookSetResponse is the response to AddressBook/set.
func (*AddressBookSetResponse) Name ¶
func (r *AddressBookSetResponse) Name() string
Name implements jmap.MethodResponse.
type AddressComponent ¶
type AddressComponent struct {
// Type is the component type, e.g. "street", "locality", "region",
// "postcode", "country".
Type string `json:"type"`
// Value is the component value.
Value string `json:"value"`
}
AddressComponent represents a component of a postal address.
type Anniversary ¶
type Anniversary struct {
// Type is the anniversary type, e.g. "birth", "death", "wedding".
Type string `json:"type"`
// Date is the date in ISO 8601 format.
Date string `json:"date"`
// Place is the place associated with the anniversary.
Place *string `json:"place,omitempty"`
}
Anniversary represents a memorable date (RFC 9553 Section 2.5.2).
type Author ¶
type Author struct {
// Name is the author's name.
Name *string `json:"name,omitempty"`
// URI is the author's URI.
URI *string `json:"uri,omitempty"`
}
Author represents the author of a note.
type Capability ¶
type Capability struct{}
Capability represents the urn:ietf:params:jmap:contacts capability (RFC 9610 Section 2).
type ContactCard ¶
type ContactCard struct {
// ID is the server-assigned identifier.
ID jmap.ID `json:"id,omitempty"`
// AddressBookIDs maps AddressBook IDs to true for each address book
// containing this card.
AddressBookIDs map[jmap.ID]bool `json:"addressBookIds,omitempty"`
// UID is the globally unique identifier for this card.
UID string `json:"uid,omitempty"`
// Kind is the kind of entity: "individual", "group", "org",
// "location", "device", "application".
Kind *string `json:"kind,omitempty"`
// Updated is the timestamp when the card was last updated.
Updated *string `json:"updated,omitempty"`
// Created is the timestamp when the card was created.
Created *string `json:"created,omitempty"`
// Language is the default language of the card.
Language *string `json:"language,omitempty"`
// Members maps UIDs to true for group members (when Kind is "group").
Members map[string]bool `json:"members,omitempty"`
// Name is the list of name components.
Name []*NameComponent `json:"name,omitempty"`
// FullName is the full name as a single string.
FullName *string `json:"fullName,omitempty"`
// NickNames maps IDs to nickname objects.
NickNames map[string]*NickName `json:"nickNames,omitempty"`
// Organizations maps IDs to organization objects.
Organizations map[string]*Organization `json:"organizations,omitempty"`
// Titles maps IDs to title or role objects.
Titles map[string]*Title `json:"titles,omitempty"`
// Emails maps IDs to email address objects.
Emails map[string]*EmailAddress `json:"emails,omitempty"`
// Phones maps IDs to phone number objects.
Phones map[string]*Phone `json:"phones,omitempty"`
// OnlineServices maps IDs to online service objects.
OnlineServices map[string]*OnlineService `json:"onlineServices,omitempty"`
// PreferredLanguages maps IDs to language preference objects.
PreferredLanguages map[string]*LanguagePref `json:"preferredLanguages,omitempty"`
// Addresses maps IDs to postal address objects.
Addresses map[string]*Address `json:"addresses,omitempty"`
// CryptoKeys maps IDs to cryptographic key objects.
CryptoKeys map[string]*CryptoKey `json:"cryptoKeys,omitempty"`
// Anniversaries maps IDs to anniversary objects.
Anniversaries map[string]*Anniversary `json:"anniversaries,omitempty"`
// PersonalInfo maps IDs to personal information objects.
PersonalInfo map[string]*PersonalInfo `json:"personalInfo,omitempty"`
// Notes maps IDs to note objects.
Notes map[string]*Note `json:"notes,omitempty"`
// Keywords maps keyword strings to true.
Keywords map[string]bool `json:"keywords,omitempty"`
}
ContactCard represents a JMAP ContactCard object (RFC 9610 Section 4), using the JSContact Card data model (RFC 9553).
type ContactCardChanges ¶
type ContactCardChanges struct {
// AccountID is the account to query.
AccountID jmap.ID `json:"accountId"`
// SinceState is the state to compare against.
SinceState string `json:"sinceState"`
// MaxChanges is the maximum number of changes to return.
MaxChanges *uint64 `json:"maxChanges,omitempty"`
}
ContactCardChanges retrieves changes to ContactCards since a given state (RFC 9610 Section 4).
func (*ContactCardChanges) Name ¶
func (m *ContactCardChanges) Name() string
Name implements jmap.Method.
func (*ContactCardChanges) Requires ¶
func (m *ContactCardChanges) Requires() []jmap.URI
Requires implements jmap.Method.
type ContactCardChangesResponse ¶
type ContactCardChangesResponse struct {
// OldState is the state before the changes.
OldState string `json:"oldState"`
// NewState is the state after the changes.
NewState string `json:"newState"`
// HasMoreChanges indicates whether there are more changes available.
HasMoreChanges bool `json:"hasMoreChanges"`
// Created contains IDs of ContactCards that were created.
Created []jmap.ID `json:"created,omitempty"`
// Updated contains IDs of ContactCards that were updated.
Updated []jmap.ID `json:"updated,omitempty"`
// Destroyed contains IDs of ContactCards that were destroyed.
Destroyed []jmap.ID `json:"destroyed,omitempty"`
}
ContactCardChangesResponse is the response to ContactCard/changes.
func (*ContactCardChangesResponse) Name ¶
func (r *ContactCardChangesResponse) Name() string
Name implements jmap.MethodResponse.
type ContactCardCopy ¶
type ContactCardCopy struct {
// FromAccountID is the source account.
FromAccountID jmap.ID `json:"fromAccountId"`
// IfFromInState only copies if the source account state matches.
IfFromInState *string `json:"ifFromInState,omitempty"`
// AccountID is the destination account.
AccountID jmap.ID `json:"accountId"`
// IfInState only copies if the destination account state matches.
IfInState *string `json:"ifInState,omitempty"`
// Create maps creation IDs to ContactCard objects describing the copy.
Create map[jmap.ID]*ContactCard `json:"create,omitempty"`
// OnSuccessDestroyOriginal destroys the original after a successful copy.
OnSuccessDestroyOriginal *bool `json:"onSuccessDestroyOriginal,omitempty"`
// DestroyFromIfInState only destroys the original if the source state
// matches.
DestroyFromIfInState *string `json:"destroyFromIfInState,omitempty"`
}
ContactCardCopy copies ContactCards from one account to another (RFC 9610 Section 4).
func (*ContactCardCopy) Requires ¶
func (m *ContactCardCopy) Requires() []jmap.URI
Requires implements jmap.Method.
type ContactCardCopyResponse ¶
type ContactCardCopyResponse struct {
// FromAccountID is the source account.
FromAccountID jmap.ID `json:"fromAccountId"`
// AccountID is the destination account.
AccountID jmap.ID `json:"accountId"`
// OldState is the state of the destination account before the copy.
OldState string `json:"oldState"`
// NewState is the state of the destination account after the copy.
NewState string `json:"newState"`
// Created maps creation IDs to created ContactCard objects.
Created map[jmap.ID]*ContactCard `json:"created,omitempty"`
// NotCreated maps creation IDs to errors.
NotCreated map[jmap.ID]*jmap.SetError `json:"notCreated,omitempty"`
}
ContactCardCopyResponse is the response to ContactCard/copy.
func (*ContactCardCopyResponse) Name ¶
func (r *ContactCardCopyResponse) Name() string
Name implements jmap.MethodResponse.
type ContactCardFilter ¶
type ContactCardFilter struct {
// InAddressBook filters by address book ID.
InAddressBook *jmap.ID `json:"inAddressBook,omitempty"`
// UID filters by the card UID.
UID *string `json:"uid,omitempty"`
// HasMember filters group cards by member UID.
HasMember *string `json:"hasMember,omitempty"`
// Kind filters by the card kind.
Kind *string `json:"kind,omitempty"`
// Email filters by email address (substring match).
Email *string `json:"email,omitempty"`
// Phone filters by phone number (substring match).
Phone *string `json:"phone,omitempty"`
// Name filters by name (substring match).
Name *string `json:"name,omitempty"`
// Text filters by any text property (full-text search).
Text *string `json:"text,omitempty"`
}
ContactCardFilter defines filter criteria for ContactCard/query (RFC 9610 Section 4).
type ContactCardGet ¶
type ContactCardGet struct {
// AccountID is the account to query.
AccountID jmap.ID `json:"accountId"`
// IDs is the list of ContactCard IDs to retrieve. If nil, all are returned.
IDs []jmap.ID `json:"ids,omitempty"`
// Properties lists the properties to return. If nil, all are returned.
Properties []string `json:"properties,omitempty"`
}
ContactCardGet retrieves ContactCard objects (RFC 9610 Section 4).
func (*ContactCardGet) Requires ¶
func (m *ContactCardGet) Requires() []jmap.URI
Requires implements jmap.Method.
type ContactCardGetResponse ¶
type ContactCardGetResponse struct {
// State is the current state string for this type.
State string `json:"state"`
// List contains the requested ContactCard objects.
List []*ContactCard `json:"list,omitempty"`
// NotFound contains IDs that were not found.
NotFound []jmap.ID `json:"notFound,omitempty"`
}
ContactCardGetResponse is the response to ContactCard/get.
func (*ContactCardGetResponse) Name ¶
func (r *ContactCardGetResponse) Name() string
Name implements jmap.MethodResponse.
type ContactCardQuery ¶
type ContactCardQuery struct {
// AccountID is the account to query.
AccountID jmap.ID `json:"accountId"`
// Filter specifies the criteria to filter by.
Filter *ContactCardFilter `json:"filter,omitempty"`
// Sort specifies the sort order.
Sort []*ContactCardSort `json:"sort,omitempty"`
// Position is the zero-based index of the first result to return.
Position *int64 `json:"position,omitempty"`
// Anchor is an ID to use as the position reference.
Anchor *jmap.ID `json:"anchor,omitempty"`
// AnchorOffset is the offset from the anchor position.
AnchorOffset *int64 `json:"anchorOffset,omitempty"`
// Limit is the maximum number of results to return.
Limit *uint64 `json:"limit,omitempty"`
// CalculateTotal requests the server to calculate the total count.
CalculateTotal *bool `json:"calculateTotal,omitempty"`
}
ContactCardQuery searches for ContactCard IDs matching criteria (RFC 9610 Section 4).
func (*ContactCardQuery) Name ¶
func (m *ContactCardQuery) Name() string
Name implements jmap.Method.
func (*ContactCardQuery) Requires ¶
func (m *ContactCardQuery) Requires() []jmap.URI
Requires implements jmap.Method.
type ContactCardQueryChanges ¶
type ContactCardQueryChanges struct {
// AccountID is the account to query.
AccountID jmap.ID `json:"accountId"`
// Filter specifies the criteria used in the original query.
Filter *ContactCardFilter `json:"filter,omitempty"`
// Sort specifies the sort order used in the original query.
Sort []*ContactCardSort `json:"sort,omitempty"`
// SinceQueryState is the query state to compare against.
SinceQueryState string `json:"sinceQueryState"`
// MaxChanges is the maximum number of changes to return.
MaxChanges *uint64 `json:"maxChanges,omitempty"`
// UpToID limits results to changes up to this ID.
UpToID *jmap.ID `json:"upToId,omitempty"`
// CalculateTotal requests the server to calculate the total count.
CalculateTotal *bool `json:"calculateTotal,omitempty"`
}
ContactCardQueryChanges retrieves changes to a previous ContactCard/query result (RFC 9610 Section 4).
func (*ContactCardQueryChanges) Name ¶
func (m *ContactCardQueryChanges) Name() string
Name implements jmap.Method.
func (*ContactCardQueryChanges) Requires ¶
func (m *ContactCardQueryChanges) Requires() []jmap.URI
Requires implements jmap.Method.
type ContactCardQueryChangesResponse ¶
type ContactCardQueryChangesResponse struct {
// OldQueryState is the previous query state.
OldQueryState string `json:"oldQueryState"`
// NewQueryState is the new query state.
NewQueryState string `json:"newQueryState"`
// Removed contains IDs removed from the query results.
Removed []jmap.ID `json:"removed,omitempty"`
// Added contains items added to the query results.
Added []jmap.AddedItem `json:"added,omitempty"`
// Total is the total number of results, if calculated.
Total *uint64 `json:"total,omitempty"`
}
ContactCardQueryChangesResponse is the response to ContactCard/queryChanges.
func (*ContactCardQueryChangesResponse) Name ¶
func (r *ContactCardQueryChangesResponse) Name() string
Name implements jmap.MethodResponse.
type ContactCardQueryResponse ¶
type ContactCardQueryResponse struct {
// QueryState is the current query state.
QueryState string `json:"queryState"`
// CanCalculateChanges indicates whether the server supports
// ContactCard/queryChanges for this query.
CanCalculateChanges bool `json:"canCalculateChanges"`
// Position is the zero-based index of the first result.
Position uint64 `json:"position"`
// IDs contains the matching ContactCard IDs.
IDs []jmap.ID `json:"ids,omitempty"`
// Total is the total number of matching results, if calculated.
Total *uint64 `json:"total,omitempty"`
// Limit is the limit applied to the query.
Limit *uint64 `json:"limit,omitempty"`
}
ContactCardQueryResponse is the response to ContactCard/query.
func (*ContactCardQueryResponse) Name ¶
func (r *ContactCardQueryResponse) Name() string
Name implements jmap.MethodResponse.
type ContactCardSet ¶
type ContactCardSet struct {
// AccountID is the account to modify.
AccountID jmap.ID `json:"accountId"`
// IfInState only applies changes if the current state matches.
IfInState *string `json:"ifInState,omitempty"`
// Create maps creation IDs to ContactCard objects to create.
Create map[jmap.ID]*ContactCard `json:"create,omitempty"`
// Update maps ContactCard IDs to patch objects.
Update map[jmap.ID]*jmap.Patch `json:"update,omitempty"`
// Destroy is a list of ContactCard IDs to destroy.
Destroy []jmap.ID `json:"destroy,omitempty"`
}
ContactCardSet creates, updates, or destroys ContactCards (RFC 9610 Section 4).
func (*ContactCardSet) Requires ¶
func (m *ContactCardSet) Requires() []jmap.URI
Requires implements jmap.Method.
type ContactCardSetResponse ¶
type ContactCardSetResponse struct {
// OldState is the state before the changes.
OldState string `json:"oldState"`
// NewState is the state after the changes.
NewState string `json:"newState"`
// Created maps creation IDs to created ContactCard objects.
Created map[jmap.ID]*ContactCard `json:"created,omitempty"`
// Updated maps ContactCard IDs to updated ContactCard objects.
Updated map[jmap.ID]*ContactCard `json:"updated,omitempty"`
// Destroyed contains IDs of destroyed ContactCards.
Destroyed []jmap.ID `json:"destroyed,omitempty"`
// NotCreated maps creation IDs to errors.
NotCreated map[jmap.ID]*jmap.SetError `json:"notCreated,omitempty"`
// NotUpdated maps ContactCard IDs to errors.
NotUpdated map[jmap.ID]*jmap.SetError `json:"notUpdated,omitempty"`
// NotDestroyed maps ContactCard IDs to errors.
NotDestroyed map[jmap.ID]*jmap.SetError `json:"notDestroyed,omitempty"`
}
ContactCardSetResponse is the response to ContactCard/set.
func (*ContactCardSetResponse) Name ¶
func (r *ContactCardSetResponse) Name() string
Name implements jmap.MethodResponse.
type ContactCardSort ¶
type ContactCardSort struct {
// Property is the property name to sort by.
Property string `json:"property"`
// IsAscending determines the sort direction. Default is true.
IsAscending *bool `json:"isAscending,omitempty"`
}
ContactCardSort defines sort criteria for ContactCard/query.
type CryptoKey ¶
type CryptoKey struct {
// URI is the URI of the key resource.
URI *string `json:"uri,omitempty"`
// Contexts maps context labels to true.
Contexts map[string]bool `json:"contexts,omitempty"`
// Pref is the preference order (1 = highest).
Pref *uint32 `json:"pref,omitempty"`
}
CryptoKey represents a cryptographic key or certificate (RFC 9553 Section 2.6.1).
type EmailAddress ¶
type EmailAddress struct {
// Address is the email address.
Address string `json:"address"`
// Contexts maps context labels to true, e.g. "private", "work".
Contexts map[string]bool `json:"contexts,omitempty"`
// Pref is the preference order (1 = highest).
Pref *uint32 `json:"pref,omitempty"`
// Label is a custom label for the email address.
Label *string `json:"label,omitempty"`
}
EmailAddress represents an email address (RFC 9553 Section 2.3.1).
type LanguagePref ¶
type LanguagePref struct {
// Language is the language tag (e.g. "en", "de").
Language string `json:"language"`
// Contexts maps context labels to true.
Contexts map[string]bool `json:"contexts,omitempty"`
// Pref is the preference order (1 = highest).
Pref *uint32 `json:"pref,omitempty"`
}
LanguagePref represents a preferred language (RFC 9553 Section 2.2.7).
type NameComponent ¶
type NameComponent struct {
// Type is the type of name component, e.g. "given", "surname", "prefix", "suffix".
Type string `json:"type"`
// Value is the value of the name component.
Value string `json:"value"`
// Phonetic is the phonetic representation of the name component.
Phonetic *string `json:"phonetic,omitempty"`
}
NameComponent represents a component of a contact's name (RFC 9553 Section 2.2.1).
type NickName ¶
type NickName struct {
// Name is the nickname value.
Name string `json:"name"`
// Contexts maps context labels to true, e.g. "private", "work".
Contexts map[string]bool `json:"contexts,omitempty"`
}
NickName represents a nickname for a contact (RFC 9553 Section 2.2.2).
type Note ¶
type Note struct {
// Note is the note text.
Note string `json:"note"`
// Created is the timestamp when the note was created.
Created *string `json:"created,omitempty"`
// Author is the author of the note.
Author *Author `json:"author,omitempty"`
}
Note represents a free-text note (RFC 9553 Section 2.8.3).
type OnlineService ¶
type OnlineService struct {
// URI is the service URI or handle.
URI string `json:"uri"`
// Type is the service type identifier.
Type string `json:"type"`
// Label is a custom label for the service.
Label *string `json:"label,omitempty"`
// Pref is the preference order (1 = highest).
Pref *uint32 `json:"pref,omitempty"`
// Contexts maps context labels to true, e.g. "private", "work".
Contexts map[string]bool `json:"contexts,omitempty"`
}
OnlineService represents an online service or messaging handle (RFC 9553 Section 2.3.2).
type OrgUnit ¶
type OrgUnit struct {
// Name is the unit name.
Name string `json:"name"`
// SortAs is the sort string for the unit.
SortAs *string `json:"sortAs,omitempty"`
}
OrgUnit represents an organizational unit within an Organization.
type Organization ¶
type Organization struct {
// Name is the organization name.
Name string `json:"name"`
// Units is the list of organizational units.
Units []*OrgUnit `json:"units,omitempty"`
}
Organization represents an organization affiliation (RFC 9553 Section 2.2.3).
type PersonalInfo ¶
type PersonalInfo struct {
// Type is the info type, e.g. "expertise", "hobby", "interest".
Type string `json:"type"`
// Value is the info value.
Value string `json:"value"`
// Level is the proficiency level, e.g. "high", "medium", "low".
Level *string `json:"level,omitempty"`
}
PersonalInfo represents personal information about a contact (RFC 9553 Section 2.8.1).
type Phone ¶
type Phone struct {
// Number is the phone number.
Number string `json:"number"`
// Features maps phone features to true, e.g. "voice", "fax", "text".
Features map[string]bool `json:"features,omitempty"`
// Contexts maps context labels to true, e.g. "private", "work".
Contexts map[string]bool `json:"contexts,omitempty"`
// Pref is the preference order (1 = highest).
Pref *uint32 `json:"pref,omitempty"`
// Label is a custom label for the phone number.
Label *string `json:"label,omitempty"`
}
Phone represents a phone number (RFC 9553 Section 2.3.3).
type ShareRights ¶
type ShareRights struct {
MayRead bool `json:"mayRead"`
// or destroy items.
MayWrite bool `json:"mayWrite"`
MayAdmin bool `json:"mayAdmin"`
MayDelete bool `json:"mayDelete"`
}
ShareRights defines the sharing permissions for an address book.
type Title ¶
type Title struct {
// Type is "title" or "role".
Type string `json:"type"`
// Name is the title or role name.
Name string `json:"name"`
// OrganizationID links this title to an organization entry.
OrganizationID *string `json:"organizationId,omitempty"`
}
Title represents a job title or role (RFC 9553 Section 2.2.4).