pub struct MsgraphContact {Show 34 fields
pub id: String,
pub display_name: MsgraphField<String>,
pub given_name: MsgraphField<String>,
pub middle_name: MsgraphField<String>,
pub surname: MsgraphField<String>,
pub nick_name: MsgraphField<String>,
pub title: MsgraphField<String>,
pub file_as: MsgraphField<String>,
pub email_addresses: MsgraphField<Vec<MsgraphEmailAddress>>,
pub im_addresses: MsgraphField<Vec<String>>,
pub business_phones: MsgraphField<Vec<String>>,
pub home_phones: MsgraphField<Vec<String>>,
pub mobile_phone: MsgraphField<String>,
pub home_address: MsgraphField<MsgraphPhysicalAddress>,
pub business_address: MsgraphField<MsgraphPhysicalAddress>,
pub other_address: MsgraphField<MsgraphPhysicalAddress>,
pub job_title: MsgraphField<String>,
pub company_name: MsgraphField<String>,
pub department: MsgraphField<String>,
pub office_location: MsgraphField<String>,
pub profession: MsgraphField<String>,
pub assistant_name: MsgraphField<String>,
pub manager: MsgraphField<String>,
pub business_home_page: MsgraphField<String>,
pub birthday: MsgraphField<String>,
pub spouse_name: MsgraphField<String>,
pub children: MsgraphField<Vec<String>>,
pub personal_notes: MsgraphField<String>,
pub categories: MsgraphField<Vec<String>>,
pub parent_folder_id: Option<String>,
pub created_date_time: Option<String>,
pub last_modified_date_time: Option<String>,
pub change_key: Option<String>,
pub single_value_extended_properties: MsgraphField<Vec<MsgraphSingleValueExtendedProperty>>,
}Expand description
A contact in a contact folder. Doubles as the create/update body.
Unset fields are left out (an update preserves them), null fields are serialized as explicit nulls (an update clears them), and a set empty collection clears the collection.
Fields§
§id: StringThe unique identifier of the contact.
display_name: MsgraphField<String>The display name of the contact.
given_name: MsgraphField<String>The given name of the contact.
middle_name: MsgraphField<String>The middle name of the contact.
surname: MsgraphField<String>The family name of the contact.
nick_name: MsgraphField<String>The nickname of the contact.
title: MsgraphField<String>The title of the contact.
file_as: MsgraphField<String>How the contact is filed under in the folder listing.
email_addresses: MsgraphField<Vec<MsgraphEmailAddress>>The email addresses of the contact.
im_addresses: MsgraphField<Vec<String>>The instant messaging addresses of the contact.
business_phones: MsgraphField<Vec<String>>The business phone numbers of the contact.
home_phones: MsgraphField<Vec<String>>The home phone numbers of the contact.
mobile_phone: MsgraphField<String>The mobile phone number of the contact.
home_address: MsgraphField<MsgraphPhysicalAddress>The home address of the contact.
business_address: MsgraphField<MsgraphPhysicalAddress>The business address of the contact.
other_address: MsgraphField<MsgraphPhysicalAddress>The alternative address of the contact.
job_title: MsgraphField<String>The job title of the contact.
company_name: MsgraphField<String>The name of the contact’s company.
department: MsgraphField<String>The department the contact works in.
office_location: MsgraphField<String>The office location of the contact.
profession: MsgraphField<String>The profession of the contact.
assistant_name: MsgraphField<String>The name of the contact’s assistant.
manager: MsgraphField<String>The name of the contact’s manager.
business_home_page: MsgraphField<String>The business home page of the contact.
birthday: MsgraphField<String>Birthday as an ISO 8601 date-time (e.g. 1983-04-01T00:00:00Z).
spouse_name: MsgraphField<String>The name of the contact’s spouse or partner.
children: MsgraphField<Vec<String>>The names of the contact’s children.
personal_notes: MsgraphField<String>The free-form notes about the contact.
categories: MsgraphField<Vec<String>>The categories associated with the contact.
parent_folder_id: Option<String>The identifier of the containing contact folder.
created_date_time: Option<String>The creation date, as an ISO 8601 date-time.
last_modified_date_time: Option<String>The last modification date, as an ISO 8601 date-time.
change_key: Option<String>The version marker of the contact, changing on every update.
single_value_extended_properties: MsgraphField<Vec<MsgraphSingleValueExtendedProperty>>Single-value extended MAPI properties attached to the contact.
They ride inline in create and update bodies, but responses
only carry them when the request $expanded them by id.
Implementations§
Source§impl MsgraphContact
impl MsgraphContact
Sourcepub fn to_vcard(&self) -> String
Available on crate feature vcard only.
pub fn to_vcard(&self) -> String
vcard only.Projects an io-msgraph contact onto a fresh vCard 4.0 document.
The UID is the one the stash carries (stashed_uid), else one minted
from the Graph id for a contact Graph created itself. The phone and
address slots become typed TEL and ADR properties (business work, home
home, mobile cell), and spouse and children become RELATED names, their
types being standard in vCard 4.0.
Sourcepub fn from_vcard(vcard: &str) -> Result<Self, MsgraphContactVcardError>
Available on crate feature vcard only.
pub fn from_vcard(vcard: &str) -> Result<Self, MsgraphContactVcardError>
vcard only.Projects a vCard onto an io-msgraph contact, in full state: each managed field is Set from the vCard or Null when absent (collections clear through an empty Set), while unmanaged Graph fields stay Unset.
Graph keeps fixed slots even behind its collection-typed properties, so the first matching vCard property fills a slot and the extras fall to the stash rather than into another slot. Graph has no UID slot, so the UID rides the stash too, which is what keeps a contact’s identity across a sync with another source.
Sourcepub fn update_from_vcard(
vcard: &str,
base_vcard: &str,
) -> Result<Self, MsgraphContactVcardError>
Available on crate feature vcard only.
pub fn update_from_vcard( vcard: &str, base_vcard: &str, ) -> Result<Self, MsgraphContactVcardError>
vcard only.Projects a vCard onto an update body: the fields differing from the base vCard (the state last synced with the server), the unchanged ones turning Unset and staying out of the PATCH.
The Outlook backend rejects the gratuitous nulls of a full-state body with an internal server error (HTTP 500), so a Null survives only when the edit cleared a field the base carried (collections clear through an explicit empty Set instead).
Sourcepub fn create_from_vcard(vcard: &str) -> Result<Self, MsgraphContactVcardError>
Available on crate feature vcard only.
pub fn create_from_vcard(vcard: &str) -> Result<Self, MsgraphContactVcardError>
vcard only.Projects a vCard onto a create body: the full-state projection minus the explicit nulls and empty collections.
They are no-ops on a fresh resource, and the Outlook backend rejects null complex properties on POST with an internal server error (HTTP 500).
Source§impl MsgraphContact
impl MsgraphContact
Sourcepub fn stashed_uid(&self) -> Option<String>
Available on crate feature vcard only.
pub fn stashed_uid(&self) -> Option<String>
vcard only.The vCard UID the stash carries, None for a contact no vCard was
ever written to, Graph having no UID slot of its own.
A sync engine checks it after a write: a server that dropped the stash would hand the contact back with an identity minted from its Graph id rather than the UID it was written under.