Skip to main content

Contacts

Struct Contacts 

Source
pub struct Contacts<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Contacts<'a>

Source

pub fn client(&self) -> &'a Client

The client this service sends through.

Source

pub async fn bundle(&self, contact_id: i64) -> Result<(), Error>

Bundle a contact so their mail arrives grouped

Source

pub async fn create( &self, body: &CreateContactRequestContent, ) -> Result<CreateContactResponseContent, Error>

Add a contact. Answers the contact that was created.

Source

pub async fn delete_note(&self, contact_id: i64) -> Result<(), Error>

Clear the private note on a contact

Source

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

Source

pub async fn get_note( &self, contact_id: i64, ) -> Result<GetContactNoteResponseContent, Error>

Read the private note kept on a contact

Source

pub async fn hide(&self, contact_id: i64) -> Result<(), Error>

Hide a contact. Nothing is deleted — RevealContact brings them back.

Source

pub async fn list( &self, params: &ListContactsParams, ) -> Result<Page<ListContactsResponseContent>, Error>

List contacts

Source

pub async fn reveal( &self, contact_id: i64, ) -> Result<RevealContactResponseContent, Error>

Put a hidden contact back in the contact list

Source

pub async fn unbundle(&self, contact_id: i64) -> Result<(), Error>

Stop bundling a contact’s mail

Source

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.

Source

pub async fn update_clearance( &self, contact_id: i64, body: &UpdateContactClearanceRequestContent, ) -> Result<(), Error>

Screen a contact in or out. Status is “approved” or “denied”.

Source

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<'_>

Source

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.

Source

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.

Source

pub async fn screen( &self, contact_id: i64, status: ClearanceStatus, ) -> Result<(), Error>

Answers the Screener for a contact.

Source

pub async fn set_note( &self, contact_id: i64, note: &str, ) -> Result<ContactNote, Error>

Writes the private note kept on a contact, replacing whatever was there, and answers the note as it now reads.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Contacts<'a>

§

impl<'a> !UnwindSafe for Contacts<'a>

§

impl<'a> Freeze for Contacts<'a>

§

impl<'a> Send for Contacts<'a>

§

impl<'a> Sync for Contacts<'a>

§

impl<'a> Unpin for Contacts<'a>

§

impl<'a> UnsafeUnpin for Contacts<'a>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more