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