pub struct Contacts<'a> { /* private fields */ }Implementations§
Source§impl<'a> Contacts<'a>
impl<'a> Contacts<'a>
Sourcepub async fn bundle(&self, contact_id: i64) -> Result<(), Error>
pub async fn bundle(&self, contact_id: i64) -> Result<(), Error>
Bundle a contact so their mail arrives grouped
Sourcepub async fn create(
&self,
body: &CreateContactRequestContent,
) -> Result<CreateContactResponseContent, Error>
pub async fn create( &self, body: &CreateContactRequestContent, ) -> Result<CreateContactResponseContent, Error>
Add a contact. Answers the contact that was created.
Sourcepub async fn delete_note(&self, contact_id: i64) -> Result<(), Error>
pub async fn delete_note(&self, contact_id: i64) -> Result<(), Error>
Clear the private note on a contact
Sourcepub async fn get(
&self,
contact_id: i64,
params: &GetContactParams,
) -> Result<Page<GetContactResponseContent>, Error>
pub async fn get( &self, contact_id: i64, params: &GetContactParams, ) -> Result<Page<GetContactResponseContent>, Error>
Get a contact, with a page of the threads they are on
Sourcepub async fn get_note(
&self,
contact_id: i64,
) -> Result<GetContactNoteResponseContent, Error>
pub async fn get_note( &self, contact_id: i64, ) -> Result<GetContactNoteResponseContent, Error>
Read the private note kept on a contact
Sourcepub async fn hide(&self, contact_id: i64) -> Result<(), Error>
pub async fn hide(&self, contact_id: i64) -> Result<(), Error>
Hide a contact. Nothing is deleted — RevealContact brings them back.
Sourcepub async fn list(
&self,
params: &ListContactsParams,
) -> Result<Page<ListContactsResponseContent>, Error>
pub async fn list( &self, params: &ListContactsParams, ) -> Result<Page<ListContactsResponseContent>, Error>
List contacts
Sourcepub async fn reveal(
&self,
contact_id: i64,
) -> Result<RevealContactResponseContent, Error>
pub async fn reveal( &self, contact_id: i64, ) -> Result<RevealContactResponseContent, Error>
Put a hidden contact back in the contact list
Sourcepub async fn unbundle(&self, contact_id: i64) -> Result<(), Error>
pub async fn unbundle(&self, contact_id: i64) -> Result<(), Error>
Stop bundling a contact’s mail
Sourcepub async fn update(
&self,
contact_id: i64,
body: &ContactRequestContent,
) -> Result<UpdateContactResponseContent, Error>
pub async fn update( &self, contact_id: i64, body: &ContactRequestContent, ) -> Result<UpdateContactResponseContent, Error>
Edit a contact. HEY rewrites the whole contact, so send every field: a name, address or alias left out is cleared. Answers the contact, which is not always the one addressed — promoting an alias makes the alias primary.
Sourcepub async fn update_clearance(
&self,
contact_id: i64,
body: &UpdateContactClearanceRequestContent,
) -> Result<(), Error>
pub async fn update_clearance( &self, contact_id: i64, body: &UpdateContactClearanceRequestContent, ) -> Result<(), Error>
Screen a contact in or out. Status is “approved” or “denied”.
Sourcepub async fn update_note(
&self,
contact_id: i64,
body: &ContactNoteRequestContent,
) -> Result<UpdateContactNoteResponseContent, Error>
pub async fn update_note( &self, contact_id: i64, body: &ContactNoteRequestContent, ) -> Result<UpdateContactNoteResponseContent, Error>
Write the private note on a contact, replacing whatever was there
Source§impl Contacts<'_>
impl Contacts<'_>
Sourcepub async fn create_contact(
&self,
params: &ContactParams,
) -> Result<Contact, Error>
pub async fn create_contact( &self, params: &ContactParams, ) -> Result<Contact, Error>
Adds a contact and answers it.
On a client scoped to an account the contact is filed under that account, and an
account_user_id naming another one is refused rather than quietly overruled.
Sourcepub async fn update_contact(
&self,
contact_id: i64,
params: &ContactParams,
) -> Result<Contact, Error>
pub async fn update_contact( &self, contact_id: i64, params: &ContactParams, ) -> Result<Contact, Error>
Edits a contact and answers it. Fields left empty are kept, as are the aliases when
alias_email_addresses is None.
HEY’s update is a full replacement — it rewrites the name and address and removes any alias not submitted — so the contact is read first and the unset fields are filled in from it before the write. That read-then-write is not atomic: a change made to the contact in between is overwritten with what was read. Pass every field explicitly when that matters.
The contact that comes back is not always the one addressed: giving a contact one of its own aliases as the main address promotes the alias, and the alias is what is answered.