pub struct Users {
pub client: Client,
}
Fields§
§client: Client
Implementations§
Source§impl Users
impl Users
Sourcepub async fn get(&self, id: &str) -> Result<Response<User>, ClientError>
pub async fn get(&self, id: &str) -> Result<Response<User>, ClientError>
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<Response<()>, ClientError>
pub async fn delete(&self, id: &str) -> Result<Response<()>, ClientError>
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<Response<()>, ClientError>
pub async fn patch( &self, id: &str, body: &PatchUsersRequest, ) -> Result<Response<()>, ClientError>
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<Response<Vec<User>>, ClientError>
pub async fn get_page( &self, start: &str, page_size: f64, department_id: &str, location_id: &str, ) -> Result<Response<Vec<User>>, ClientError>
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<Response<Vec<User>>, ClientError>
pub async fn get_all( &self, department_id: &str, location_id: &str, ) -> Result<Response<Vec<User>>, ClientError>
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<Response<User>, ClientError>
pub async fn post_deferred( &self, body: &PostUsersDeferredRequest, ) -> Result<Response<User>, ClientError>
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<Response<GetUsersDeferredStatusResponse>, ClientError>
pub async fn get_deferred_status( &self, id: &str, ) -> Result<Response<GetUsersDeferredStatusResponse>, ClientError>
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