pub struct Users {
pub client: Client,
}
Fields
client: Client
Implementations
sourceimpl Users
impl Users
sourcepub async fn get(&self, id: &str) -> Result<User>
pub async fn get(&self, id: &str) -> Result<User>
Get User Info by User ID.
This function performs a GET
to the /users/{id}
endpoint.
Retrieve the information of the user with the matching user ID.
Parameters:
authorization: &str
– The OAuth2 token header.
sourcepub async fn delete(&self, id: &str) -> Result<()>
pub async fn delete(&self, id: &str) -> Result<()>
Suspend a user.
This function performs a DELETE
to the /users/{id}
endpoint.
Suspends a user. Does not delete the user’s cards. Currently this action is not reversible.
sourcepub async fn patch(&self, id: &str, body: &PatchUsersRequest) -> Result<()>
pub async fn patch(&self, id: &str, body: &PatchUsersRequest) -> Result<()>
Modify Existing User.
This function performs a PATCH
to the /users/{id}
endpoint.
Modify information about a user.
sourcepub async fn get_page(
&self,
start: &str,
page_size: f64,
department_id: &str,
location_id: &str
) -> Result<Vec<User>>
pub async fn get_page(
&self,
start: &str,
page_size: f64,
department_id: &str,
location_id: &str
) -> Result<Vec<User>>
List users.
This function performs a GET
to the /users
endpoint.
Retrieve all users of the business.
Parameters:
authorization: &str
– The OAuth2 token header.start: &str
– The ID of the last entity of the previous page, used for pagination to get the next page.page_size: f64
– The number of results to be returned in each page. The value must be between 2 and 10,000. If not specified, the default will be 1,000.department_id: &str
– The OAuth2 token header.location_id: &str
– The OAuth2 token header.
sourcepub async fn get_all(
&self,
department_id: &str,
location_id: &str
) -> Result<Vec<User>>
pub async fn get_all(
&self,
department_id: &str,
location_id: &str
) -> Result<Vec<User>>
List users.
This function performs a GET
to the /users
endpoint.
As opposed to get
, this function returns all the pages of the request at once.
Retrieve all users of the business.
sourcepub async fn post_deferred(
&self,
body: &PostUsersDeferredRequest
) -> Result<User>
pub async fn post_deferred(
&self,
body: &PostUsersDeferredRequest
) -> Result<User>
Invite a new user.
This function performs a POST
to the /users/deferred
endpoint.
Creates an invite for the user to accept. Also optionally sets department, location, and manager.
sourcepub async fn get_deferred_status(
&self,
id: &str
) -> Result<GetUsersDeferredStatusResponse>
pub async fn get_deferred_status(
&self,
id: &str
) -> Result<GetUsersDeferredStatusResponse>
Get status of a deferred user task.
This function performs a GET
to the /users/deferred/status/{id}
endpoint.
Gets status of a deferred task for users
Auto Trait Implementations
impl !RefUnwindSafe for Users
impl Send for Users
impl Sync for Users
impl Unpin for Users
impl !UnwindSafe for Users
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>
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