pub struct Users {
pub client: Client,
}Fields§
§client: ClientImplementations§
Source§impl Users
impl Users
Sourcepub async fn conversation(
&self,
user: &str,
types: &str,
exclude_archived: bool,
limit: i64,
cursor: &str,
) -> Result<Response<UsersConversationsSuccessSchema>, ClientError>
pub async fn conversation( &self, user: &str, types: &str, exclude_archived: bool, limit: i64, cursor: &str, ) -> Result<Response<UsersConversationsSuccessSchema>, ClientError>
This function performs a GET to the /users.conversations endpoint.
List conversations the calling user may access.
FROM: https://api.slack.com/methods/users.conversations
Parameters:
token: &str– Authentication token. Requires scope:conversations:read.user: &str– Browse conversations by a specific user ID’s membership. Non-public channels are restricted to those where the calling user shares membership.types: &str– Mix and match channel types by providing a comma-separated list of any combination ofpublic_channel,private_channel,mpim,im.exclude_archived: bool– Set totrueto exclude archived channels from the list.limit: i64– The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn’t been reached. Must be an integer no larger than 1000.cursor: &str– Paginate through collections of data by setting thecursorparameter to anext_cursorattribute returned by a previous request’sresponse_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.
Sourcepub async fn delete_photo(&self) -> Result<Response<DndEndSchema>, ClientError>
pub async fn delete_photo(&self) -> Result<Response<DndEndSchema>, ClientError>
This function performs a POST to the /users.deletePhoto endpoint.
Delete the user profile photo
Sourcepub async fn get_presence(
&self,
user: &str,
) -> Result<Response<ApiMethodUsersGetPresence>, ClientError>
pub async fn get_presence( &self, user: &str, ) -> Result<Response<ApiMethodUsersGetPresence>, ClientError>
This function performs a GET to the /users.getPresence endpoint.
Gets user presence information.
FROM: https://api.slack.com/methods/users.getPresence
Parameters:
token: &str– Authentication token. Requires scope:users:read.user: &str– User to get presence info on. Defaults to the authed user.
Sourcepub async fn identity(
&self,
) -> Result<Response<Vec<UsersIdentityResponseAnyOf>>, ClientError>
pub async fn identity( &self, ) -> Result<Response<Vec<UsersIdentityResponseAnyOf>>, ClientError>
This function performs a GET to the /users.identity endpoint.
Get a user’s identity.
FROM: https://api.slack.com/methods/users.identity
Parameters:
token: &str– Authentication token. Requires scope:identity.basic.
Sourcepub async fn get_all_identity(
&self,
) -> Result<Response<Vec<UsersIdentityResponseAnyOf>>, ClientError>
pub async fn get_all_identity( &self, ) -> Result<Response<Vec<UsersIdentityResponseAnyOf>>, ClientError>
This function performs a GET to the /users.identity endpoint.
As opposed to identity, this function returns all the pages of the request at once.
Get a user’s identity.
Sourcepub async fn info(
&self,
include_locale: bool,
user: &str,
) -> Result<Response<UsersInfoSuccessSchema>, ClientError>
pub async fn info( &self, include_locale: bool, user: &str, ) -> Result<Response<UsersInfoSuccessSchema>, ClientError>
This function performs a GET to the /users.info endpoint.
Gets information about a user.
FROM: https://api.slack.com/methods/users.info
Parameters:
token: &str– Authentication token. Requires scope:users:read.include_locale: bool– Set this totrueto receive the locale for this user. Defaults tofalse.user: &str– User to get info on.
Sourcepub async fn list(
&self,
limit: i64,
cursor: &str,
include_locale: bool,
) -> Result<Response<UsersListSchema>, ClientError>
pub async fn list( &self, limit: i64, cursor: &str, include_locale: bool, ) -> Result<Response<UsersListSchema>, ClientError>
This function performs a GET to the /users.list endpoint.
Lists all users in a Slack team.
FROM: https://api.slack.com/methods/users.list
Parameters:
token: &str– Authentication token. Requires scope:users:read.limit: i64– The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the users list hasn’t been reached. Providing nolimitvalue will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experiencelimit_requiredor HTTP 500 errors.cursor: &str– Paginate through collections of data by setting thecursorparameter to anext_cursorattribute returned by a previous request’sresponse_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.include_locale: bool– Set this totrueto receive the locale for users. Defaults tofalse.
Sourcepub async fn lookup_email(
&self,
email: &str,
) -> Result<Response<UsersInfoSuccessSchema>, ClientError>
pub async fn lookup_email( &self, email: &str, ) -> Result<Response<UsersInfoSuccessSchema>, ClientError>
This function performs a GET to the /users.lookupByEmail endpoint.
Find a user with an email address.
FROM: https://api.slack.com/methods/users.lookupByEmail
Parameters:
token: &str– Authentication token. Requires scope:users:read.email.email: &str– An email address belonging to a user in the workspace.
Sourcepub async fn set_active(&self) -> Result<Response<DndEndSchema>, ClientError>
pub async fn set_active(&self) -> Result<Response<DndEndSchema>, ClientError>
This function performs a POST to the /users.setActive endpoint.
Marked a user as active. Deprecated and non-functional.
FROM: https://api.slack.com/methods/users.setActive
Parameters:
token: &str– Authentication token. Requires scope:users:write.
Sourcepub async fn set_photo(
&self,
) -> Result<Response<UsersSetPhotoSchema>, ClientError>
pub async fn set_photo( &self, ) -> Result<Response<UsersSetPhotoSchema>, ClientError>
This function performs a POST to the /users.setPhoto endpoint.
Set the user profile photo
Sourcepub async fn set_presence(&self) -> Result<Response<DndEndSchema>, ClientError>
pub async fn set_presence(&self) -> Result<Response<DndEndSchema>, ClientError>
This function performs a POST to the /users.setPresence endpoint.
Manually sets user presence.
FROM: https://api.slack.com/methods/users.setPresence
Parameters:
token: &str– Authentication token. Requires scope:users:write.