Users

Struct Users 

Source
pub struct Users {
    pub client: Client,
}

Fields§

§client: Client

Implementations§

Source§

impl Users

Source

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 of public_channel, private_channel, mpim, im.
  • exclude_archived: bool – Set to true to 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 the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.
Source

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

FROM: https://api.slack.com/methods/users.deletePhoto

Source

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.
Source

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.
Source

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.

FROM: https://api.slack.com/methods/users.identity

Source

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 to true to receive the locale for this user. Defaults to false.
  • user: &str – User to get info on.
Source

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 no limit value will result in Slack attempting to deliver you the entire result set. If the collection is too large you may experience limit_required or HTTP 500 errors.
  • cursor: &str – Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous request’s response_metadata. Default value fetches the first “page” of the collection. See pagination for more detail.
  • include_locale: bool – Set this to true to receive the locale for users. Defaults to false.
Source

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.
Source

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.
Source

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

FROM: https://api.slack.com/methods/users.setPhoto

Source

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.

Auto Trait Implementations§

§

impl Freeze for Users

§

impl !RefUnwindSafe for Users

§

impl Send for Users

§

impl Sync for Users

§

impl Unpin for Users

§

impl !UnwindSafe for Users

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,