pub struct OAuthClient { /* private fields */ }Implementations§
Source§impl OAuthClient
impl OAuthClient
pub fn new(config: Arc<HighLevelConfig>, inner: Client) -> Self
Build the authorization URL to redirect the user to for consent.
Sourcepub async fn exchange_code(&self, code: &str) -> Result<TokenData>
pub async fn exchange_code(&self, code: &str) -> Result<TokenData>
Exchange an authorization code for an access + refresh token pair.
Sourcepub async fn refresh_token(&self, refresh_token: &str) -> Result<TokenData>
pub async fn refresh_token(&self, refresh_token: &str) -> Result<TokenData>
Use a refresh token to obtain a new access token.
Sourcepub async fn location_token(
&self,
company_id: &str,
location_id: &str,
agency_token: &str,
) -> Result<TokenData>
pub async fn location_token( &self, company_id: &str, location_id: &str, agency_token: &str, ) -> Result<TokenData>
Exchange an agency-level access token for a location-scoped token.
Equivalent to POST /oauth/locationToken with the company and location IDs.
Requires an agency token to be set on the client before calling.
Auto Trait Implementations§
impl !RefUnwindSafe for OAuthClient
impl !UnwindSafe for OAuthClient
impl Freeze for OAuthClient
impl Send for OAuthClient
impl Sync for OAuthClient
impl Unpin for OAuthClient
impl UnsafeUnpin for OAuthClient
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
Mutably borrows from an owned value. Read more