pub struct Client { /* private fields */ }
Expand description
Entrypoint for interacting with the API client.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new<T>(token: T) -> Self
pub fn new<T>(token: T) -> Self
Create a new Client struct. It takes a type that can convert into
an &str (String
or Vec<u8>
for example). As long as the function is
given a valid API key your requests will work.
Sourcepub fn set_base_url<H>(&mut self, base_url: H)
pub fn set_base_url<H>(&mut self, base_url: H)
Set the base URL for the client to something other than the default: https://api2.frontapp.com.
Sourcepub fn new_from_env() -> Self
pub fn new_from_env() -> Self
Create a new Client struct from the environment variable: FRONT_API_TOKEN
.
Sourcepub async fn request_raw(
&self,
method: Method,
uri: &str,
body: Option<Body>,
) -> Result<RequestBuilder>
pub async fn request_raw( &self, method: Method, uri: &str, body: Option<Body>, ) -> Result<RequestBuilder>
Create a raw request to our API.
Sourcepub fn accounts(&self) -> Accounts
pub fn accounts(&self) -> Accounts
Return a reference to an interface that provides access to Accounts operations.
Sourcepub fn events(&self) -> Events
pub fn events(&self) -> Events
Return a reference to an interface that provides access to Events operations.
Sourcepub fn analytics(&self) -> Analytics
pub fn analytics(&self) -> Analytics
Return a reference to an interface that provides access to Analytics operations.
Sourcepub fn attachments(&self) -> Attachments
pub fn attachments(&self) -> Attachments
Return a reference to an interface that provides access to Attachments operations.
Sourcepub fn token_identity(&self) -> TokenIdentity
pub fn token_identity(&self) -> TokenIdentity
Return a reference to an interface that provides access to Token Identity operations.
Sourcepub fn message_template_folders(&self) -> MessageTemplateFolders
pub fn message_template_folders(&self) -> MessageTemplateFolders
Return a reference to an interface that provides access to Message Template Folders operations.
Sourcepub fn message_templates(&self) -> MessageTemplates
pub fn message_templates(&self) -> MessageTemplates
Return a reference to an interface that provides access to Message Templates operations.
Sourcepub fn contact_groups(&self) -> ContactGroups
pub fn contact_groups(&self) -> ContactGroups
Return a reference to an interface that provides access to Contact Groups operations.
Sourcepub fn contacts(&self) -> Contacts
pub fn contacts(&self) -> Contacts
Return a reference to an interface that provides access to Contacts operations.
Sourcepub fn contact_handles(&self) -> ContactHandles
pub fn contact_handles(&self) -> ContactHandles
Return a reference to an interface that provides access to Contact Handles operations.
Sourcepub fn contact_notes(&self) -> ContactNotes
pub fn contact_notes(&self) -> ContactNotes
Return a reference to an interface that provides access to Contact Notes operations.
Sourcepub fn channels(&self) -> Channels
pub fn channels(&self) -> Channels
Return a reference to an interface that provides access to Channels operations.
Sourcepub fn inboxes(&self) -> Inboxes
pub fn inboxes(&self) -> Inboxes
Return a reference to an interface that provides access to Inboxes operations.
Sourcepub fn comments(&self) -> Comments
pub fn comments(&self) -> Comments
Return a reference to an interface that provides access to Comments operations.
Sourcepub fn conversations(&self) -> Conversations
pub fn conversations(&self) -> Conversations
Return a reference to an interface that provides access to Conversations operations.
Sourcepub fn messages(&self) -> Messages
pub fn messages(&self) -> Messages
Return a reference to an interface that provides access to Messages operations.
Sourcepub fn custom_fields(&self) -> CustomFields
pub fn custom_fields(&self) -> CustomFields
Return a reference to an interface that provides access to Custom Fields operations.
Sourcepub fn drafts(&self) -> Drafts
pub fn drafts(&self) -> Drafts
Return a reference to an interface that provides access to Drafts operations.
Sourcepub fn rules(&self) -> Rules
pub fn rules(&self) -> Rules
Return a reference to an interface that provides access to Rules operations.
Sourcepub fn shifts(&self) -> Shifts
pub fn shifts(&self) -> Shifts
Return a reference to an interface that provides access to Shifts operations.
Sourcepub fn signatures(&self) -> Signatures
pub fn signatures(&self) -> Signatures
Return a reference to an interface that provides access to Signatures operations.
Return a reference to an interface that provides access to Tags operations.
Sourcepub fn teams(&self) -> Teams
pub fn teams(&self) -> Teams
Return a reference to an interface that provides access to Teams operations.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more