Skip to main content

MsgraphContact

Struct MsgraphContact 

Source
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: String

The 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

Source

pub fn to_vcard(&self) -> String

Available on crate feature 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.

Source

pub fn from_vcard(vcard: &str) -> Result<Self, MsgraphContactVcardError>

Available on crate feature 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.

Source

pub fn update_from_vcard( vcard: &str, base_vcard: &str, ) -> Result<Self, MsgraphContactVcardError>

Available on crate feature 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).

Source

pub fn create_from_vcard(vcard: &str) -> Result<Self, MsgraphContactVcardError>

Available on crate feature 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

Source

pub fn stashed_uid(&self) -> Option<String>

Available on crate feature 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.

Trait Implementations§

Source§

impl Clone for MsgraphContact

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MsgraphContact

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MsgraphContact

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for MsgraphContact

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for MsgraphContact

Source§

impl PartialEq for MsgraphContact

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for MsgraphContact

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MsgraphContact

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.