slackline/api/entity

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

Work Objects: flexpane details and bidirectional comments for unfurled entities.

Types

Identifies entity.acknowledgeCommentAction in the slackline.Call that acknowledge_comment_action returns.

pub type AcknowledgeCommentAction

The content of a comment. Provide one of blocks or value.

pub type CommentContent {
  CommentContent(
    blocks: option.Option(block.Block),
    value: option.Option(String),
    format: option.Option(String),
  )
}

Constructors

  • CommentContent(
      blocks: option.Option(block.Block),
      value: option.Option(String),
      format: option.Option(String),
    )

    Arguments

    blocks

    A rich text block containing the comment content.

    value

    Plain or markdown string, used if blocks is not present.

    format

    Set to markdown to format value as markdown.

An action button shown with an entity error.

pub type EntityActionButton {
  EntityActionButton(
    action_id: String,
    text: String,
    accessibility_label: option.Option(String),
    processing_state: option.Option(EntityProcessingState),
    style: option.Option(String),
    url: option.Option(String),
    value: option.Option(String),
  )
}

Constructors

A comment on an external entity, presented in the Work Object flexpane.

pub type EntityComment {
  EntityComment(
    id: String,
    sender: EntityUser,
    timestamp: Int,
    comment: CommentContent,
    url: option.Option(String),
    can_edit: option.Option(Bool),
    can_delete: option.Option(Bool),
    can_reply: option.Option(Bool),
    reply_count: option.Option(Int),
    reply_users: option.Option(List(EntityUser)),
    latest_reply_ts: option.Option(Int),
    last_edit_ts: option.Option(Int),
    thread_root_id: option.Option(String),
    cursor: option.Option(String),
  )
}

Constructors

  • EntityComment(
      id: String,
      sender: EntityUser,
      timestamp: Int,
      comment: CommentContent,
      url: option.Option(String),
      can_edit: option.Option(Bool),
      can_delete: option.Option(Bool),
      can_reply: option.Option(Bool),
      reply_count: option.Option(Int),
      reply_users: option.Option(List(EntityUser)),
      latest_reply_ts: option.Option(Int),
      last_edit_ts: option.Option(Int),
      thread_root_id: option.Option(String),
      cursor: option.Option(String),
    )

    Arguments

    id

    A unique ID from your app. Use it to edit the comment.

    sender

    Who wrote the comment.

    timestamp

    Epoch timestamp in seconds.

    comment

    The comment content.

    url

    URL which directs to the comment.

    can_edit

    If true, the comment is editable in the user’s flexpane.

    can_delete

    If true, renders the delete button on the comment.

    can_reply

    If true, users may reply to the comment in a thread.

    reply_count

    Number of replies in the thread under the comment.

    reply_users

    Up to two users who have replied to the thread.

    latest_reply_ts

    Epoch timestamp in seconds of the most recent reply.

    last_edit_ts

    Epoch timestamp in seconds of the last edit.

    thread_root_id

    The id of the parent comment, if this comment is a threaded reply.

    cursor

    Pagination cursor for this comment’s position in the list.

Why an entity’s details could not be presented.

pub type EntityError {
  EntityError(
    status: String,
    custom_message: option.Option(String),
    custom_title: option.Option(String),
    message_format: option.Option(String),
    actions: option.Option(List(EntityActionButton)),
  )
}

Constructors

  • EntityError(
      status: String,
      custom_message: option.Option(String),
      custom_title: option.Option(String),
      message_format: option.Option(String),
      actions: option.Option(List(EntityActionButton)),
    )

    Arguments

    status

    restricted, internal_error, not_found, custom, custom_partial_view, timeout or edit_error.

    custom_message

    Message shown when status is custom.

    custom_title

    Title shown when status is custom.

    message_format

    Format of custom_message: markdown.

    actions

    Action buttons shown with the error.

An image shown as an avatar or icon in a Work Object.

pub type EntityIcon {
  EntityIcon(
    alt_text: option.Option(String),
    url: option.Option(String),
    slack_file: option.Option(EntitySlackFile),
  )
}

Constructors

  • EntityIcon(
      alt_text: option.Option(String),
      url: option.Option(String),
      slack_file: option.Option(EntitySlackFile),
    )

    Arguments

    alt_text

    Summary of the image’s content.

    url

    Publicly accessible URL of the image. Provide this or slack_file.

    slack_file

    A Slack file to use as the image. Provide this or url.

Loading state of an entity action button.

pub type EntityProcessingState {
  EntityProcessingState(
    enabled: Bool,
    interstitial_text: option.Option(String),
  )
}

Constructors

  • EntityProcessingState(
      enabled: Bool,
      interstitial_text: option.Option(String),
    )

A reference to an image uploaded to Slack.

pub type EntitySlackFile {
  EntitySlackFile(
    id: option.Option(String),
    url: option.Option(String),
  )
}

Constructors

  • EntitySlackFile(
      id: option.Option(String),
      url: option.Option(String),
    )

    Arguments

    id

    ID of the Slack file.

    url

    URL of the Slack file.

A user in a Work Object: either a Slack user (user_id) or an external one (text).

pub type EntityUser {
  EntityUser(
    user_id: option.Option(String),
    text: option.Option(String),
    url: option.Option(String),
    email: option.Option(String),
    icon: option.Option(EntityIcon),
    caption: option.Option(String),
  )
}

Constructors

  • EntityUser(
      user_id: option.Option(String),
      text: option.Option(String),
      url: option.Option(String),
      email: option.Option(String),
      icon: option.Option(EntityIcon),
      caption: option.Option(String),
    )

    Arguments

    user_id

    A Slack user ID. Do not provide text when user_id is provided.

    text

    The full name of the user. Do not provide user_id when text is provided.

    url

    A link to an external profile for the user.

    email

    The email of the user. Slack shows a matching Slack user instead.

    icon

    An avatar for the user.

    caption

    The title or position of an external user, displayed below their name.

Identifies entity.presentComments in the slackline.Call that present_comments returns.

pub type PresentComments

Identifies entity.presentDetails in the slackline.Call that present_details returns.

pub type PresentDetails

Values

pub fn acknowledge_comment_action(
  trigger_id trigger_id: String,
) -> slackline.Call(AcknowledgeCommentAction, Nil)

entity.acknowledgeCommentAction: Acknowledge a comment post, edit, or delete on a Work Object. Apps call this method to confirm they have processed a comment action.

entity.AcknowledgeCommentAction identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/entity/acknowledge_comment_action.

Rate limit tier: t3.

Documented errors: invalid_action, invalid_app_id, invalid_sender_schema, invalid_trigger_id, method_not_found, missing_comment_data, not_allowed.

pub fn comment_content_decoder() -> decode.Decoder(CommentContent)

Decodes CommentContent from json.

pub fn comment_content_to_json(it: CommentContent) -> json.Json

Encodes CommentContent as json.

pub fn entity_action_button_decoder() -> decode.Decoder(
  EntityActionButton,
)

Decodes EntityActionButton from json.

pub fn entity_action_button_to_json(
  it: EntityActionButton,
) -> json.Json

Encodes EntityActionButton as json.

pub fn entity_comment_decoder() -> decode.Decoder(EntityComment)

Decodes EntityComment from json.

pub fn entity_comment_to_json(it: EntityComment) -> json.Json

Encodes EntityComment as json.

pub fn entity_error_decoder() -> decode.Decoder(EntityError)

Decodes EntityError from json.

pub fn entity_error_to_json(it: EntityError) -> json.Json

Encodes EntityError as json.

pub fn entity_icon_decoder() -> decode.Decoder(EntityIcon)

Decodes EntityIcon from json.

pub fn entity_icon_to_json(it: EntityIcon) -> json.Json

Encodes EntityIcon as json.

pub fn entity_processing_state_decoder() -> decode.Decoder(
  EntityProcessingState,
)

Decodes EntityProcessingState from json.

pub fn entity_processing_state_to_json(
  it: EntityProcessingState,
) -> json.Json

Encodes EntityProcessingState as json.

pub fn entity_slack_file_decoder() -> decode.Decoder(
  EntitySlackFile,
)

Decodes EntitySlackFile from json.

pub fn entity_slack_file_to_json(
  it: EntitySlackFile,
) -> json.Json

Encodes EntitySlackFile as json.

pub fn entity_user_decoder() -> decode.Decoder(EntityUser)

Decodes EntityUser from json.

pub fn entity_user_to_json(it: EntityUser) -> json.Json

Encodes EntityUser as json.

pub fn present_comments(
  comments comments: List(EntityComment),
  trigger_id trigger_id: String,
) -> slackline.Call(PresentComments, Nil)

entity.presentComments: Provide comments for Work Objects. Apps call this method to send per-user flexpane comment data to the client.

entity.PresentComments identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/entity/present_comments.

Rate limit tier: t3.

Documented errors: invalid_app_id, invalid_trigger_id, method_not_found, missing_delete_action_id, user_auth_url_missing.

pub fn present_details(
  trigger_id trigger_id: String,
) -> slackline.Call(PresentDetails, Nil)

entity.presentDetails: Provide custom flexpane behavior for Work Objects. Apps call this method to send per-user flexpane metadata to the client.

entity.PresentDetails identifies this method in slackline.Call.

Set optional arguments with the functions in slackline/api/entity/present_details.

Rate limit tier: t3.

Documented errors: entity_metadata_does_not_match_trigger, feature_not_enabled, invalid_app_id, invalid_metadata, invalid_trigger_id, missing_interactivity_url, missing_options_load_url, user_auth_url_missing.

✨ Search Document