slackline/api/users

This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.

Slack Web API methods for users, their profiles and presence.

Types

Identifies users.conversations in the slackline.Call that conversations returns.

pub type Conversations

A successful response from users.conversations.

pub type ConversationsResponse {
  ConversationsResponse(
    channels: option.Option(List(conversation.Conversation)),
    response_metadata: option.Option(slackline.ResponseMetadata),
  )
}

Constructors

Identifies users.deletePhoto in the slackline.Call that delete_photo returns.

pub type DeletePhoto

Identifies users.discoverableContacts.lookup in the slackline.Call that discoverable_contacts_lookup returns.

pub type DiscoverableContactsLookup

A successful response from users.discoverableContacts.lookup.

pub type DiscoverableContactsLookupResponse {
  DiscoverableContactsLookupResponse(is_discoverable: Bool)
}

Constructors

  • DiscoverableContactsLookupResponse(is_discoverable: Bool)

    Arguments

    is_discoverable

    Whether there is a discoverable Slack user with this email address.

Identifies users.getPresence in the slackline.Call that get_presence returns.

pub type GetPresence

A successful response from users.getPresence.

pub type GetPresenceResponse {
  GetPresenceResponse(
    presence: Presence,
    online: option.Option(Bool),
    auto_away: option.Option(Bool),
    manual_away: option.Option(Bool),
    connection_count: option.Option(Int),
    last_activity: option.Option(Int),
  )
}

Constructors

  • GetPresenceResponse(
      presence: Presence,
      online: option.Option(Bool),
      auto_away: option.Option(Bool),
      manual_away: option.Option(Bool),
      connection_count: option.Option(Int),
      last_activity: option.Option(Int),
    )

    Arguments

    presence

    The user’s overall presence.

    online

    Whether the user has a client connected to Slack. Only for the authed user.

    auto_away

    Whether no activity was detected in the last 10 minutes. Only for the authed user.

    manual_away

    Whether the user manually set their presence to away. Only for the authed user.

    connection_count

    The total number of connections. Only for the authed user.

    last_activity

    Unix timestamp of the last activity. Absent when the user has no connected clients.

Identifies users.identity in the slackline.Call that identity returns.

pub type Identity

A successful response from users.identity.

pub type IdentityResponse {
  IdentityResponse(
    user: option.Option(IdentityUser),
    team: option.Option(IdentityTeam),
  )
}

Constructors

The workspace returned by users.identity.

pub type IdentityTeam {
  IdentityTeam(id: String, name: option.Option(String))
}

Constructors

  • IdentityTeam(id: String, name: option.Option(String))

    Arguments

    id

    The workspace ID.

    name

    The workspace name, with the identity.team scope.

The user returned by users.identity. Fields beyond id and name depend on the identity.* scopes granted.

pub type IdentityUser {
  IdentityUser(
    id: String,
    name: option.Option(String),
    email: option.Option(String),
    image_24: option.Option(String),
    image_32: option.Option(String),
    image_48: option.Option(String),
    image_72: option.Option(String),
    image_192: option.Option(String),
  )
}

Constructors

Identifies users.info in the slackline.Call that info returns.

pub type Info

A successful response from users.info.

pub type InfoResponse {
  InfoResponse(user: option.Option(user.User))
}

Constructors

Identifies users.list in the slackline.Call that list returns.

pub type ListMethod

A successful response from users.list.

pub type ListResponse {
  ListResponse(
    members: option.Option(List(user.User)),
    cache_ts: option.Option(Int),
    response_metadata: option.Option(slackline.ResponseMetadata),
  )
}

Constructors

Identifies users.lookupByEmail in the slackline.Call that lookup_by_email returns.

pub type LookupByEmail

A successful response from users.lookupByEmail.

pub type LookupByEmailResponse {
  LookupByEmailResponse(user: option.Option(user.User))
}

Constructors

A user’s presence.

pub type Presence {
  Active
  Away
  UnknownPresence(String)
}

Constructors

  • Active

    active

  • Away

    away

  • UnknownPresence(String)

    A value that this version of slackline does not know.

A custom profile field value to set, keyed by field ID in ProfileUpdate.fields.

pub type ProfileFieldUpdate {
  ProfileFieldUpdate(
    value: ProfileFieldValue,
    alt: option.Option(String),
  )
}

Constructors

  • ProfileFieldUpdate(
      value: ProfileFieldValue,
      alt: option.Option(String),
    )

    Arguments

    value

    The value of the field.

    alt

    Text displayed instead of value when set. Up to 256 characters.

The value of a custom profile field: text for most field types, a list for tags fields.

pub type ProfileFieldValue {
  ProfileFieldText(String)
  ProfileFieldTags(List(String))
}

Constructors

  • ProfileFieldText(String)
  • ProfileFieldTags(List(String))

Identifies users.profile.get in the slackline.Call that profile_get returns.

pub type ProfileGet

A successful response from users.profile.get.

pub type ProfileGetResponse {
  ProfileGetResponse(profile: option.Option(user.UserProfile))
}

Constructors

Identifies users.profile.set in the slackline.Call that profile_set returns.

pub type ProfileSet

A successful response from users.profile.set.

pub type ProfileSetResponse {
  ProfileSetResponse(profile: option.Option(user.UserProfile))
}

Constructors

Profile fields to set with users.profile.set. Unset fields are left unchanged.

pub type ProfileUpdate {
  ProfileUpdate(
    display_name: option.Option(String),
    email: option.Option(String),
    first_name: option.Option(String),
    last_name: option.Option(String),
    phone: option.Option(String),
    pronouns: option.Option(String),
    real_name: option.Option(String),
    start_date: option.Option(String),
    title: option.Option(String),
    status_emoji: option.Option(String),
    status_expiration: option.Option(Int),
    status_text: option.Option(String),
    fields: option.Option(dict.Dict(String, ProfileFieldUpdate)),
  )
}

Constructors

  • ProfileUpdate(
      display_name: option.Option(String),
      email: option.Option(String),
      first_name: option.Option(String),
      last_name: option.Option(String),
      phone: option.Option(String),
      pronouns: option.Option(String),
      real_name: option.Option(String),
      start_date: option.Option(String),
      title: option.Option(String),
      status_emoji: option.Option(String),
      status_expiration: option.Option(Int),
      status_text: option.Option(String),
      fields: option.Option(dict.Dict(String, ProfileFieldUpdate)),
    )

    Arguments

    display_name

    The display name. Maximum of 80 characters.

    email

    A valid email address. Only admins can change it, for users on paid teams.

    first_name

    The user’s first name. Updates the first name within real_name.

    last_name

    The user’s last name. Updates the second name within real_name.

    phone

    The user’s phone number, in any format.

    pronouns

    The user’s pronouns.

    real_name

    The user’s first and last name. Maximum of 50 characters.

    start_date

    The date the person joined the organization, such as 2022-10-22.

    title

    The user’s title.

    status_emoji

    The status emoji, such as :train:. Set it and status_text to "" to clear the status.

    status_expiration

    Unix timestamp of when the status expires. 0 means it never expires.

    status_text

    The status text, up to 100 characters.

    fields

    Custom profile fields by field ID. Use team.profile.get to find the IDs.

Identifies users.setActive in the slackline.Call that set_active returns.

pub type SetActive

Identifies users.setPhoto in the slackline.Call that set_photo returns.

pub type SetPhoto

The presence a user can set: auto lets Slack decide.

pub type SetPresence {
  Auto
  SetAway
}

Constructors

  • Auto

    auto

  • SetAway

    away

Identifies users.setPresence in the slackline.Call that set_presence returns.

pub type SetPresenceMethod

Values

pub fn conversations() -> slackline.Call(
  Conversations,
  ConversationsResponse,
)

users.conversations: List conversations the calling user is a member of.

users.Conversations identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/users/conversations.

Bot token scopes: groups:read, im:read, mpim:read, channels:read. User token scopes: groups:read, im:read, mpim:read, channels:read.

Rate limit tier: t3.

Documented errors: invalid_cursor, invalid_limit, invalid_types, method_not_supported_for_channel_type.

pub fn conversations_response_decoder() -> decode.Decoder(
  ConversationsResponse,
)

Decodes the response from users.conversations.

pub fn delete_photo() -> slackline.Call(DeletePhoto, Nil)

users.deletePhoto: Delete the user profile photo

users.DeletePhoto identifies this method in slackline.Call.

User token scopes: users.profile:write.

Rate limit tier: t2.

pub fn discoverable_contacts_lookup(
  email email: String,
) -> slackline.Call(
  DiscoverableContactsLookup,
  DiscoverableContactsLookupResponse,
)

users.discoverableContacts.lookup: Look up an email address to see if someone is discoverable on Slack

users.DiscoverableContactsLookup identifies this method in slackline.Call.

Bot token scopes: conversations.connect:manage, team:read.

Rate limit tier: t2.

Documented errors: not_allowed, not_an_enterprise, restricted_action.

pub fn discoverable_contacts_lookup_response_decoder() -> decode.Decoder(
  DiscoverableContactsLookupResponse,
)

Decodes the response from users.discoverableContacts.lookup.

pub fn get_presence() -> slackline.Call(
  GetPresence,
  GetPresenceResponse,
)

users.getPresence: Gets user presence information.

users.GetPresence identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/users/get_presence.

Bot token scopes: users:read. User token scopes: users:read.

Rate limit tier: t3.

pub fn get_presence_response_decoder() -> decode.Decoder(
  GetPresenceResponse,
)

Decodes the response from users.getPresence.

pub fn identity() -> slackline.Call(Identity, IdentityResponse)

users.identity: Get a user’s identity.

users.Identity identifies this method in slackline.Call.

User token scopes: identity:read.

Rate limit tier: t3.

Documented errors: email_not_verified, invalid_user_id.

pub fn identity_response_decoder() -> decode.Decoder(
  IdentityResponse,
)

Decodes the response from users.identity.

pub fn identity_team_decoder() -> decode.Decoder(IdentityTeam)

Decodes IdentityTeam from json.

pub fn identity_team_to_json(it: IdentityTeam) -> json.Json

Encodes IdentityTeam as json.

pub fn identity_user_decoder() -> decode.Decoder(IdentityUser)

Decodes IdentityUser from json.

pub fn identity_user_to_json(it: IdentityUser) -> json.Json

Encodes IdentityUser as json.

pub fn info() -> slackline.Call(Info, InfoResponse)

users.info: Gets information about a user.

users.Info identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/users/info.

Bot token scopes: users:read. User token scopes: users:read.

Rate limit tier: t4.

Documented errors: too_many_users, user_not_found, user_not_visible.

pub fn info_response_decoder() -> decode.Decoder(InfoResponse)

Decodes the response from users.info.

pub fn list() -> slackline.Call(ListMethod, ListResponse)

users.list: Lists all users in a Slack team.

users.ListMethod identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/users/list.

Bot token scopes: users:read. User token scopes: users:read.

Rate limit tier: t2.

Documented errors: invalid_cursor, limit_required.

pub fn list_response_decoder() -> decode.Decoder(ListResponse)

Decodes the response from users.list.

pub fn lookup_by_email(
  email email: String,
) -> slackline.Call(LookupByEmail, LookupByEmailResponse)

users.lookupByEmail: Find a user with an email address.

users.LookupByEmail identifies this method in slackline.Call.

Bot token scopes: users:read.email. User token scopes: users:read.email.

Rate limit tier: t3.

Documented errors: users_not_found.

pub fn lookup_by_email_response_decoder() -> decode.Decoder(
  LookupByEmailResponse,
)

Decodes the response from users.lookupByEmail.

pub fn presence_decoder() -> decode.Decoder(Presence)

Decodes Presence from a json string.

pub fn presence_from_string(string: String) -> Presence

Parses Presence from its json string.

pub fn presence_to_json(it: Presence) -> json.Json

Encodes Presence as a json string.

pub fn presence_to_string(it: Presence) -> String

The json string of Presence.

pub fn profile_field_update_decoder() -> decode.Decoder(
  ProfileFieldUpdate,
)

Decodes ProfileFieldUpdate from json.

pub fn profile_field_update_to_json(
  it: ProfileFieldUpdate,
) -> json.Json

Encodes ProfileFieldUpdate as json.

pub fn profile_field_value_decoder() -> decode.Decoder(
  ProfileFieldValue,
)

Decodes ProfileFieldValue from json. It tries each alternative in order.

pub fn profile_field_value_to_json(
  it: ProfileFieldValue,
) -> json.Json

Encodes ProfileFieldValue as json.

pub fn profile_get() -> slackline.Call(
  ProfileGet,
  ProfileGetResponse,
)

users.profile.get: Retrieve a user’s profile information, including their custom status.

users.ProfileGet identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/users/profile_get.

Bot token scopes: users.profile:read. User token scopes: users.profile:read.

Rate limit tier: t4.

Documented errors: user_not_found.

pub fn profile_get_response_decoder() -> decode.Decoder(
  ProfileGetResponse,
)

Decodes the response from users.profile.get.

pub fn profile_set() -> slackline.Call(
  ProfileSet,
  ProfileSetResponse,
)

users.profile.set: Set a user’s profile information, including custom status.

users.ProfileSet identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/users/profile_set.

User token scopes: users.profile:write.

Rate limit tier: t3.

Documented errors: cannot_update_admin_user, email_taken, frontline_member_username_change_not_allowed, invalid_emoji_not_allowed, invalid_ooo_message, invalid_profile, invalid_starts_with_at, must_clear_both_status_text_and_status_emoji, name_not_allowed, not_admin, not_app_admin, partial_profile_set_failed, permission_denied, profile_set_failed, reserved_name, sudo_required, too_long, username_same.

pub fn profile_set_response_decoder() -> decode.Decoder(
  ProfileSetResponse,
)

Decodes the response from users.profile.set.

pub fn profile_update_decoder() -> decode.Decoder(ProfileUpdate)

Decodes ProfileUpdate from json.

pub fn profile_update_to_json(it: ProfileUpdate) -> json.Json

Encodes ProfileUpdate as json.

pub fn set_active() -> slackline.Call(SetActive, Nil)

users.setActive: Marked a user as active. Deprecated and non-functional.

users.SetActive identifies this method in slackline.Call.

Bot token scopes: users:write. User token scopes: users:write.

Rate limit tier: t2.

pub fn set_photo() -> slackline.Call(SetPhoto, Nil)

users.setPhoto: Set the user profile photo

users.SetPhoto identifies this method in slackline.Call.

The image argument is a binary multipart/form-data upload, which slackline cannot send yet, so it is left out.

Set optional arguments with the functions in slackline/api/users/set_photo.

User token scopes: users.profile:write.

Rate limit tier: t2.

Documented errors: bad_image, too_large, too_many_frames.

pub fn set_presence(
  presence presence: SetPresence,
) -> slackline.Call(SetPresenceMethod, Nil)

users.setPresence: Manually sets user presence.

users.SetPresenceMethod identifies this method in slackline.Call.

Bot token scopes: users:write. User token scopes: users:write.

Rate limit tier: t2.

Documented errors: invalid_presence.

pub fn set_presence_decoder() -> decode.Decoder(SetPresence)

Decodes SetPresence from a json string.

pub fn set_presence_from_string(
  string: String,
) -> Result(SetPresence, Nil)

Parses SetPresence from its json string.

pub fn set_presence_to_json(it: SetPresence) -> json.Json

Encodes SetPresence as a json string.

pub fn set_presence_to_string(it: SetPresence) -> String

The json string of SetPresence.

✨ Search Document