pub struct Client { /* private fields */ }
Expand description
Entrypoint for interacting with the API client.
Implementations
sourceimpl Client
impl Client
sourcepub fn new<I, K, R, T, Q>(
client_id: I,
client_secret: K,
redirect_uri: R,
token: T,
refresh_token: Q
) -> Self where
I: ToString,
K: ToString,
R: ToString,
T: ToString,
Q: ToString,
pub fn new<I, K, R, T, Q>(
client_id: I,
client_secret: K,
redirect_uri: R,
token: T,
refresh_token: Q
) -> Self where
I: ToString,
K: ToString,
R: ToString,
T: ToString,
Q: ToString,
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 with_host<H>(&self, host: H) -> Self where
H: ToString,
pub fn with_host<H>(&self, host: H) -> Self where
H: ToString,
Override the default host for the client.
sourcepub fn new_from_env<T, R>(token: T, refresh_token: R) -> Self where
T: ToString,
R: ToString,
pub fn new_from_env<T, R>(token: T, refresh_token: R) -> Self where
T: ToString,
R: ToString,
Create a new Client struct from environment variables. 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 and your requests will work.
We pass in the token and refresh token to the client so if you are storing
it in a database, you can get it first.
sourcepub fn user_consent_url(&self, scopes: &[String]) -> String
pub fn user_consent_url(&self, scopes: &[String]) -> String
Return a user consent url with an optional set of scopes. If no scopes are provided, they will not be passed in the url.
sourcepub async fn refresh_access_token(&mut self) -> Result<AccessToken>
pub async fn refresh_access_token(&mut self) -> Result<AccessToken>
Refresh an access token from a refresh token. Client must have a refresh token for this to work.
sourcepub async fn get_access_token(
&mut self,
code: &str,
state: &str
) -> Result<AccessToken>
pub async fn get_access_token(
&mut self,
code: &str,
state: &str
) -> Result<AccessToken>
Get an access token from the code returned by the URL paramter sent to the redirect URL.
pub fn accounts(&self) -> Accounts
pub fn archiving(&self) -> Archiving
pub fn billing(&self) -> Billing
pub fn chat_channels(&self) -> ChatChannels
pub fn chat_channels_account_level(&self) -> ChatChannelsAccountLevel
pub fn chat_messages(&self) -> ChatMessages
pub fn chatbot_messages(&self) -> ChatbotMessages
pub fn cloud_recording(&self) -> CloudRecording
pub fn common_area_phones(&self) -> CommonAreaPhones
pub fn contacts(&self) -> Contacts
pub fn dashboards(&self) -> Dashboards
pub fn deprecated_api_endpoints(&self) -> DeprecatedApiEndpoints
pub fn devices(&self) -> Devices
pub fn groups(&self) -> Groups
pub fn im_chat(&self) -> ImChat
pub fn im_groups(&self) -> ImGroups
pub fn meetings(&self) -> Meetings
pub fn pac(&self) -> Pac
pub fn phone(&self) -> Phone
pub fn phone_auto_receptionists(&self) -> PhoneAutoReceptionists
pub fn phone_blocked_list(&self) -> PhoneBlockedList
pub fn phone_call_queues(&self) -> PhoneCallQueues
pub fn phone_devices(&self) -> PhoneDevices
pub fn phone_reports(&self) -> PhoneReports
pub fn phone_site(&self) -> PhoneSite
pub fn reports(&self) -> Reports
pub fn roles(&self) -> Roles
pub fn rooms(&self) -> Rooms
pub fn rooms_account(&self) -> RoomsAccount
pub fn rooms_devices(&self) -> RoomsDevices
pub fn rooms_location(&self) -> RoomsLocation
pub fn sip_connected_audio(&self) -> SipConnectedAudio
pub fn sip_phone(&self) -> SipPhone
pub fn tracking_field(&self) -> TrackingField
pub fn tsp(&self) -> Tsp
pub fn users(&self) -> Users
pub fn webinars(&self) -> Webinars
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> FutureExt for T
impl<T> FutureExt for T
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more