slackline/block

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

Block Kit: blocks, block elements, composition objects and rich text.

Every type here can be sent to Slack (messages, modals, Home tabs) and decoded from what Slack sends back (events, interaction payloads, API responses). Unions dispatch on type. Anything they do not recognize goes in a catch-all variant, so new Slack features do not break decoding.

Build a block with the function named after it. The function takes the required fields and a list of attributes for the optional ones. slackline/element builds elements the same way. The attributes of a block are in a module named after the block. An attribute of another block is a type error:

import slackline/block
import slackline/block/section
import slackline/element
import slackline/element/button

block.section(block.mrkdwn("*Hello*"), [
  section.block_id("intro"),
  section.accessory(element.button("Go", "go", [button.style(block.Primary)])),
])

The records (SectionBlock, ButtonElement, …) are public too, for reading payloads and for building blocks field by field.

Reference: https://docs.slack.dev/reference/block-kit

Types

Holds up to 25 interactive elements. https://docs.slack.dev/reference/block-kit/blocks/actions-block

pub type ActionsBlock {
  ActionsBlock(
    elements: List(Element),
    block_id: option.Option(String),
  )
}

Constructors

  • ActionsBlock(
      elements: List(Element),
      block_id: option.Option(String),
    )

    Arguments

    elements

    Interactive elements: buttons, selects, overflow menus, date pickers…

    block_id

    A unique identifier for the block. Maximum 255 characters.

Displays an alert, warning or informational message. https://docs.slack.dev/reference/block-kit/blocks/alert-block

pub type AlertBlock {
  AlertBlock(
    text: Text,
    level: option.Option(AlertLevel),
    block_id: option.Option(String),
  )
}

Constructors

Alert levels.

pub type AlertLevel {
  AlertDefault
  AlertInfo
  AlertWarning
  AlertError
  AlertSuccess
  UnknownAlertLevel(String)
}

Constructors

  • AlertDefault

    default

  • AlertInfo

    info

  • AlertWarning

    warning

  • AlertError

    error

  • AlertSuccess

    success

  • UnknownAlertLevel(String)

    A value that this version of slackline does not know.

An optional field for a builder. record is the record the builder makes, so each builder only takes its own attributes.

pub opaque type Attr(record)

A Block Kit block. https://docs.slack.dev/reference/block-kit/blocks

pub type Block {
  Actions(ActionsBlock)
  Alert(AlertBlock)
  Call(CallBlock)
  Card(CardBlock)
  Carousel(CarouselBlock)
  Container(ContainerBlock)
  Context(ContextBlock)
  ContextActions(ContextActionsBlock)
  DataTable(DataTableBlock)
  DataVisualization(DataVisualizationBlock)
  Divider(DividerBlock)
  File(FileBlock)
  Header(HeaderBlock)
  Image(ImageBlock)
  Input(InputBlock)
  Layout(LayoutBlock)
  Markdown(MarkdownBlock)
  Plan(PlanBlock)
  RichTextBlock(RichText)
  Section(SectionBlock)
  Table(TableBlock)
  TaskCard(TaskCardBlock)
  Video(VideoBlock)
  UnknownBlock(type_: String, raw: value.Value)
}

Constructors

Who a broadcast mention notifies.

pub type BroadcastRange {
  Here
  Channel
  Everyone
  UnknownBroadcastRange(String)
}

Constructors

  • Here

    Active members of the channel.

  • Channel

    All members of the channel.

  • Everyone

    Every person in the #general channel.

  • UnknownBroadcastRange(String)

    A value that this version of slackline does not know.

A button. Works in section (accessory), actions and data table cells. https://docs.slack.dev/reference/block-kit/block-elements/button-element

pub type ButtonElement {
  ButtonElement(
    text: PlainText,
    action_id: option.Option(String),
    url: option.Option(String),
    value: option.Option(String),
    style: option.Option(ButtonStyle),
    confirm: option.Option(ConfirmationDialog),
    accessibility_label: option.Option(String),
    agent_prompt: option.Option(String),
    agent_prompt_display: option.Option(String),
    visible_to_user_ids: option.Option(List(String)),
  )
}

Constructors

  • ButtonElement(
      text: PlainText,
      action_id: option.Option(String),
      url: option.Option(String),
      value: option.Option(String),
      style: option.Option(ButtonStyle),
      confirm: option.Option(ConfirmationDialog),
      accessibility_label: option.Option(String),
      agent_prompt: option.Option(String),
      agent_prompt_display: option.Option(String),
      visible_to_user_ids: option.Option(List(String)),
    )

    Arguments

    text

    The button text. Slack can truncate it at about 30 characters. Maximum 75.

    action_id

    Identifies the source of the action in interaction payloads. Unique in the containing block. Maximum 255 characters.

    url

    A URL to open in the user’s browser when the button is clicked. You still receive an interaction payload and must acknowledge it.

    value

    The value sent with the interaction payload. Maximum 2000 characters.

    style

    Visual color scheme. Defaults to the default (neutral) style.

    confirm

    A confirmation dialog shown after the button is clicked.

    accessibility_label

    Text read by screen readers instead of text. Maximum 75 characters.

    agent_prompt

    A prompt sent to Slackbot when clicked, if Slackbot AI is available. Up to 4000 characters.

    agent_prompt_display

    Short text shown instead of the full agent_prompt. Requires agent_prompt.

    visible_to_user_ids

    User IDs the button is visible to. Visible to everyone if omitted.

Color scheme for buttons and the confirm button of a confirmation dialog.

pub type ButtonStyle {
  Primary
  Danger
  UnknownButtonStyle(String)
}

Constructors

  • Primary

    Green: affirmation or confirmation. Use for one button at most.

  • Danger

    Red: destructive actions. Use sparingly.

  • UnknownButtonStyle(String)

    A value that this version of slackline does not know.

A Call registered with calls.add. Only messages and chat.unfurl can show it. https://docs.slack.dev/apis/web-api/using-the-calls-api

pub type CallBlock {
  CallBlock(call_id: String, block_id: option.Option(String))
}

Constructors

  • CallBlock(call_id: String, block_id: option.Option(String))

    Arguments

    call_id

    The Call ID that calls.add returned.

Displays content in a card. At least one of hero_image, title, actions or body is required. https://docs.slack.dev/reference/block-kit/blocks/card-block

pub type CardBlock {
  CardBlock(
    block_id: option.Option(String),
    hero_image: option.Option(Element),
    icon: option.Option(Element),
    title: option.Option(Text),
    subtitle: option.Option(Text),
    body: option.Option(Text),
    actions: option.Option(List(Element)),
    slack_icon: option.Option(SlackIcon),
    subtext: option.Option(Text),
  )
}

Constructors

A horizontally scrolling list of 1 to 10 card blocks. https://docs.slack.dev/reference/block-kit/blocks/carousel-block

pub type CarouselBlock {
  CarouselBlock(
    elements: List(Block),
    block_id: option.Option(String),
  )
}

Constructors

  • CarouselBlock(
      elements: List(Block),
      block_id: option.Option(String),
    )

    Arguments

    elements

    The cards (Card blocks).

A select menu listing public channels.

pub type ChannelsSelectElement {
  ChannelsSelectElement(
    action_id: option.Option(String),
    initial_channel: option.Option(String),
    confirm: option.Option(ConfirmationDialog),
    response_url_enabled: option.Option(Bool),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • ChannelsSelectElement(
      action_id: option.Option(String),
      initial_channel: option.Option(String),
      confirm: option.Option(ConfirmationDialog),
      response_url_enabled: option.Option(Bool),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    initial_channel

    The public channel ID selected when the menu loads.

    confirm

    A confirmation dialog shown after an item is selected.

    response_url_enabled

    Include a response_url in the view_submission payload. Only for menus in input blocks in modals.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

The chart of a data visualization block.

pub type Chart {
  PieChart(segments: List(ChartSegment))
  BarChart(
    series: List(ChartDataSeries),
    axis_config: ChartAxisConfig,
  )
  AreaChart(
    series: List(ChartDataSeries),
    axis_config: ChartAxisConfig,
  )
  LineChart(
    series: List(ChartDataSeries),
    axis_config: ChartAxisConfig,
  )
  UnknownChart(type_: String, raw: value.Value)
}

Constructors

X-axis categories and axis titles.

pub type ChartAxisConfig {
  ChartAxisConfig(
    categories: List(String),
    x_label: option.Option(String),
    y_label: option.Option(String),
  )
}

Constructors

  • ChartAxisConfig(
      categories: List(String),
      x_label: option.Option(String),
      y_label: option.Option(String),
    )

    Arguments

    categories

    Category labels, in display order.

One point of a data series.

pub type ChartDataPoint {
  ChartDataPoint(label: String, value: Float)
}

Constructors

  • ChartDataPoint(label: String, value: Float)

    Arguments

    label

    The x-axis category. It must be one of axis_config.categories.

    value

    The y-axis value. Negative values are allowed.

A named series of data points.

pub type ChartDataSeries {
  ChartDataSeries(name: String, data: List(ChartDataPoint))
}

Constructors

  • ChartDataSeries(name: String, data: List(ChartDataPoint))

    Arguments

    name

    Legend name, unique within the chart. Maximum 20 characters.

    data

    One point per category, 1 to 20.

A slice of a pie chart.

pub type ChartSegment {
  ChartSegment(label: String, value: Float)
}

Constructors

  • ChartSegment(label: String, value: Float)

    Arguments

    label

    Legend label. Maximum 20 characters.

    value

    Weight of the slice. Greater than 0.

A group of checkboxes. Works in section, actions and input. https://docs.slack.dev/reference/block-kit/block-elements/checkboxes-element

pub type CheckboxesElement {
  CheckboxesElement(
    action_id: option.Option(String),
    options: List(SelectOption),
    initial_options: option.Option(List(SelectOption)),
    confirm: option.Option(ConfirmationDialog),
    focus_on_load: option.Option(Bool),
    visible_to_user_ids: option.Option(List(String)),
  )
}

Constructors

  • CheckboxesElement(
      action_id: option.Option(String),
      options: List(SelectOption),
      initial_options: option.Option(List(SelectOption)),
      confirm: option.Option(ConfirmationDialog),
      focus_on_load: option.Option(Bool),
      visible_to_user_ids: option.Option(List(String)),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    options

    The options. Maximum 10. mrkdwn text is allowed.

    initial_options

    Options selected when the group first loads. They must match options.

    confirm

    A confirmation dialog shown after clicking a checkbox.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    visible_to_user_ids

    User IDs the element is visible to. Visible to everyone if omitted.

Details about the source of a citation, tagged by citation_type.

pub type CitationDetails {
  CitationFile(
    descriptor: option.Option(String),
    file_id: option.Option(String),
  )
  CitationExternal(
    app_name: option.Option(String),
    app_icon_url: option.Option(String),
  )
  CitationWeb(
    display_name: option.Option(String),
    title: option.Option(String),
    snippet: option.Option(String),
  )
  CitationMessage(
    channel: option.Option(String),
    message_ts: option.Option(String),
  )
  CitationMemory(memory_id: option.Option(String))
  UnknownCitationDetails(citation_type: String, raw: value.Value)
}

Constructors

Column alignment in a table block.

pub type ColumnAlign {
  ColumnLeft
  ColumnCenter
  ColumnRight
  UnknownColumnAlign(String)
}

Constructors

  • ColumnLeft

    left

  • ColumnCenter

    center

  • ColumnRight

    right

  • UnknownColumnAlign(String)

    A value that this version of slackline does not know.

Behavior of one table column.

pub type ColumnSetting {
  ColumnSetting(
    align: option.Option(ColumnAlign),
    is_wrapped: option.Option(Bool),
  )
}

Constructors

A dialog that asks the user to confirm an action before it runs. https://docs.slack.dev/reference/block-kit/composition-objects/confirmation-dialog-object

pub type ConfirmationDialog {
  ConfirmationDialog(
    title: PlainText,
    text: Text,
    confirm: PlainText,
    deny: PlainText,
    style: option.Option(ButtonStyle),
  )
}

Constructors

  • ConfirmationDialog(
      title: PlainText,
      text: Text,
      confirm: PlainText,
      deny: PlainText,
      style: option.Option(ButtonStyle),
    )

    Arguments

    title

    The dialog title. Maximum 100 characters.

    text

    The explanatory text, plain_text or mrkdwn. Maximum 300 characters.

    confirm

    The text of the confirm button. Maximum 30 characters.

    deny

    The text of the cancel button. Maximum 30 characters.

    style

    Color scheme of the confirm button. Defaults to the default style.

Groups up to 10 child blocks. One of title or rich_text_title is required. https://docs.slack.dev/reference/block-kit/blocks/container-block

pub type ContainerBlock {
  ContainerBlock(
    title: option.Option(PlainText),
    rich_text_title: option.Option(RichText),
    subtitle: option.Option(Text),
    child_blocks: List(Block),
    block_id: option.Option(String),
    width: option.Option(ContainerWidth),
    icon: option.Option(Element),
    is_collapsible: option.Option(Bool),
    default_collapsed: option.Option(Bool),
    has_header_divider: option.Option(Bool),
  )
}

Constructors

  • ContainerBlock(
      title: option.Option(PlainText),
      rich_text_title: option.Option(RichText),
      subtitle: option.Option(Text),
      child_blocks: List(Block),
      block_id: option.Option(String),
      width: option.Option(ContainerWidth),
      icon: option.Option(Element),
      is_collapsible: option.Option(Bool),
      default_collapsed: option.Option(Bool),
      has_header_divider: option.Option(Bool),
    )

    Arguments

    title

    Title. Maximum 150 characters.

    rich_text_title

    Title as rich text. It takes precedence over title.

    subtitle

    Subtitle. Maximum 150 characters.

    child_blocks

    The blocks inside: actions, context, divider, file, header, image, input, layout, rich_text, section, table or video.

    width

    Defaults to standard.

    icon

    A small image next to the title. Must be an image element.

    is_collapsible

    Whether it can be collapsed to its title. Defaults to false.

    default_collapsed

    Start collapsed (needs is_collapsible). Defaults to false.

    has_header_divider

    Draw a border below the header. Defaults to false.

Container widths.

pub type ContainerWidth {
  ContainerNarrow
  ContainerStandard
  ContainerWide
  ContainerFull
  UnknownContainerWidth(String)
}

Constructors

  • ContainerNarrow

    narrow

  • ContainerStandard

    standard

  • ContainerWide

    wide

  • ContainerFull

    full

  • UnknownContainerWidth(String)

    A value that this version of slackline does not know.

Feedback and icon buttons shown as contextual info. Maximum 5 elements. https://docs.slack.dev/reference/block-kit/blocks/context-actions-block

pub type ContextActionsBlock {
  ContextActionsBlock(
    elements: List(ContextActionsElement),
    block_id: option.Option(String),
  )
}

Constructors

The elements of a context actions block. https://docs.slack.dev/reference/block-kit/blocks/context-actions-block

pub type ContextActionsElement {
  FeedbackButtons(FeedbackButtonsElement)
  IconButton(IconButtonElement)
  UnknownContextActionsElement(type_: String, raw: value.Value)
}

Constructors

Images and text shown as small contextual info. Maximum 10 elements. https://docs.slack.dev/reference/block-kit/blocks/context-block

pub type ContextBlock {
  ContextBlock(
    elements: List(ContextElement),
    block_id: option.Option(String),
  )
}

Constructors

The elements of a context block: images and text objects. https://docs.slack.dev/reference/block-kit/blocks/context-block

pub type ContextElement {
  ContextImage(ImageElement)
  ContextPlainText(PlainText)
  ContextMrkdwn(Mrkdwn)
  UnknownContextElement(type_: String, raw: value.Value)
}

Constructors

  • ContextImage(ImageElement)
  • ContextPlainText(PlainText)
  • ContextMrkdwn(Mrkdwn)
  • UnknownContextElement(type_: String, raw: value.Value)

    A type that this version of slackline does not know. raw holds the full json.

Filters the conversations offered by conversation select menus. https://docs.slack.dev/reference/block-kit/composition-objects/conversation-filter-object

pub type ConversationFilter {
  ConversationFilter(
    include: option.Option(List(ConversationKind)),
    exclude_external_shared_channels: option.Option(Bool),
    exclude_bot_users: option.Option(Bool),
  )
}

Constructors

  • ConversationFilter(
      include: option.Option(List(ConversationKind)),
      exclude_external_shared_channels: option.Option(Bool),
      exclude_bot_users: option.Option(Bool),
    )

    Arguments

    include

    Conversation types to include. Cannot be empty.

    exclude_external_shared_channels

    Whether to exclude externally shared channels. Defaults to false.

    exclude_bot_users

    Whether to exclude bot users. Defaults to false.

Conversation types for a ConversationFilter.

pub type ConversationKind {
  Im
  Mpim
  Private
  Public
  UnknownConversationKind(String)
}

Constructors

  • Im

    im

  • Mpim

    mpim

  • Private

    private

  • Public

    public

  • UnknownConversationKind(String)

    A value that this version of slackline does not know.

A select menu listing conversations the user can see.

pub type ConversationsSelectElement {
  ConversationsSelectElement(
    action_id: option.Option(String),
    initial_conversation: option.Option(String),
    default_to_current_conversation: option.Option(Bool),
    confirm: option.Option(ConfirmationDialog),
    response_url_enabled: option.Option(Bool),
    filter: option.Option(ConversationFilter),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • ConversationsSelectElement(
      action_id: option.Option(String),
      initial_conversation: option.Option(String),
      default_to_current_conversation: option.Option(Bool),
      confirm: option.Option(ConfirmationDialog),
      response_url_enabled: option.Option(Bool),
      filter: option.Option(ConversationFilter),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    initial_conversation

    The conversation ID selected when the menu loads. Takes precedence over default_to_current_conversation.

    default_to_current_conversation

    Pre-select the conversation the user was viewing. Defaults to false.

    confirm

    A confirmation dialog shown after an item is selected.

    response_url_enabled

    Include a response_url in the view_submission payload. Only for menus in input blocks in modals.

    filter

    Narrows the conversations offered.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A table with pagination, sorting, filtering and buttons. https://docs.slack.dev/reference/block-kit/blocks/data-table-block

pub type DataTableBlock {
  DataTableBlock(
    rows: List(List(TableCell)),
    block_id: option.Option(String),
    page_size: option.Option(Int),
    caption: String,
    row_header_column_index: option.Option(Int),
  )
}

Constructors

  • DataTableBlock(
      rows: List(List(TableCell)),
      block_id: option.Option(String),
      page_size: option.Option(Int),
      caption: String,
      row_header_column_index: option.Option(Int),
    )

    Arguments

    rows

    The rows. The first row is the header.

    page_size

    Rows per page, 1 to 100. Defaults to 5.

    caption

    A caption for the table.

    row_header_column_index

    The 0-based index of the row header column. Defaults to 0.

A pie, bar, area or line chart. https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block

pub type DataVisualizationBlock {
  DataVisualizationBlock(
    title: String,
    chart: Chart,
    block_id: option.Option(String),
  )
}

Constructors

  • DataVisualizationBlock(
      title: String,
      chart: Chart,
      block_id: option.Option(String),
    )

    Arguments

    title

    A label above the chart. Maximum 50 characters.

A calendar date picker. Works in section, actions and input. https://docs.slack.dev/reference/block-kit/block-elements/date-picker-element

pub type DatepickerElement {
  DatepickerElement(
    action_id: option.Option(String),
    initial_date: option.Option(String),
    confirm: option.Option(ConfirmationDialog),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • DatepickerElement(
      action_id: option.Option(String),
      initial_date: option.Option(String),
      confirm: option.Option(ConfirmationDialog),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    initial_date

    The initially selected date, YYYY-MM-DD.

    confirm

    A confirmation dialog shown after a date is selected.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A date and time picker. Works in actions and input. https://docs.slack.dev/reference/block-kit/block-elements/datetime-picker-element

pub type DatetimepickerElement {
  DatetimepickerElement(
    action_id: option.Option(String),
    initial_date_time: option.Option(Int),
    confirm: option.Option(ConfirmationDialog),
    focus_on_load: option.Option(Bool),
  )
}

Constructors

  • DatetimepickerElement(
      action_id: option.Option(String),
      initial_date_time: option.Option(Int),
      confirm: option.Option(ConfirmationDialog),
      focus_on_load: option.Option(Bool),
    )

    Arguments

    action_id

    Identifies the input value on submission. Maximum 255 characters.

    initial_date_time

    The initial date and time as a UNIX timestamp in seconds.

    confirm

    A confirmation dialog shown after a time is selected.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

Determines when a text input element returns a block_actions payload. https://docs.slack.dev/reference/block-kit/composition-objects/dispatch-action-configuration-object

pub type DispatchActionConfig {
  DispatchActionConfig(
    trigger_actions_on: option.Option(List(TriggerAction)),
  )
}

Constructors

  • DispatchActionConfig(
      trigger_actions_on: option.Option(List(TriggerAction)),
    )

    Arguments

    trigger_actions_on

    One or both interaction types to dispatch on.

A visual separator. https://docs.slack.dev/reference/block-kit/blocks/divider-block

pub type DividerBlock {
  DividerBlock(block_id: option.Option(String))
}

Constructors

The interactive block elements.

Where each variant is allowed:

  • section accessory: button, checkboxes, datepicker, image, all selects and multi-selects, overflow, radio_buttons, timepicker, workflow_button
  • actions elements: button, checkboxes, datepicker, datetimepicker, all selects and multi-selects, overflow, radio_buttons, timepicker, workflow_button
  • input element: checkboxes, datepicker, datetimepicker, email_text_input, file_input, all selects and multi-selects, number_input, plain_text_input, radio_buttons, rich_text_input, timepicker, url_text_input
pub type Element {
  Button(ButtonElement)
  Checkboxes(CheckboxesElement)
  Datepicker(DatepickerElement)
  Datetimepicker(DatetimepickerElement)
  EmailTextInput(EmailTextInputElement)
  FileInput(FileInputElement)
  ImageAccessory(ImageElement)
  StaticSelect(StaticSelectElement)
  ExternalSelect(ExternalSelectElement)
  UsersSelect(UsersSelectElement)
  ConversationsSelect(ConversationsSelectElement)
  ChannelsSelect(ChannelsSelectElement)
  MultiStaticSelect(MultiStaticSelectElement)
  MultiExternalSelect(MultiExternalSelectElement)
  MultiUsersSelect(MultiUsersSelectElement)
  MultiConversationsSelect(MultiConversationsSelectElement)
  MultiChannelsSelect(MultiChannelsSelectElement)
  NumberInput(NumberInputElement)
  Overflow(OverflowElement)
  PlainTextInput(PlainTextInputElement)
  RadioButtons(RadioButtonsElement)
  RichTextInput(RichTextInputElement)
  Timepicker(TimepickerElement)
  UrlTextInput(UrlTextInputElement)
  WorkflowButton(WorkflowButtonElement)
  UnknownElement(type_: String, raw: value.Value)
}

Constructors

An email address input. Works in input blocks. https://docs.slack.dev/reference/block-kit/block-elements/email-input-element

pub type EmailTextInputElement {
  EmailTextInputElement(
    action_id: option.Option(String),
    initial_value: option.Option(String),
    dispatch_action_config: option.Option(DispatchActionConfig),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • EmailTextInputElement(
      action_id: option.Option(String),
      initial_value: option.Option(String),
      dispatch_action_config: option.Option(DispatchActionConfig),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the input value on submission. Maximum 255 characters.

    initial_value

    The initial value.

    dispatch_action_config

    When the element dispatches block_actions payloads.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A select menu whose options are loaded from your app’s options URL.

pub type ExternalSelectElement {
  ExternalSelectElement(
    action_id: option.Option(String),
    initial_option: option.Option(SelectOption),
    min_query_length: option.Option(Int),
    confirm: option.Option(ConfirmationDialog),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • ExternalSelectElement(
      action_id: option.Option(String),
      initial_option: option.Option(SelectOption),
      min_query_length: option.Option(Int),
      confirm: option.Option(ConfirmationDialog),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    initial_option

    The option selected when the menu loads.

    min_query_length

    Characters typed before Slack queries your app. Defaults to 3.

    confirm

    A confirmation dialog shown after an item is selected.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

One of the two buttons of a feedback buttons element.

pub type FeedbackButton {
  FeedbackButton(
    text: PlainText,
    value: String,
    accessibility_label: option.Option(String),
  )
}

Constructors

  • FeedbackButton(
      text: PlainText,
      value: String,
      accessibility_label: option.Option(String),
    )

    Arguments

    text

    The button text. Maximum 75 characters.

    value

    The value sent with the interaction payload. Maximum 2000 characters.

    accessibility_label

    Text read by screen readers instead of text. Maximum 75 characters.

Thumbs up / thumbs down style feedback buttons. https://docs.slack.dev/reference/block-kit/block-elements/feedback-buttons-element

pub type FeedbackButtonsElement {
  FeedbackButtonsElement(
    positive_button: FeedbackButton,
    negative_button: FeedbackButton,
    action_id: option.Option(String),
  )
}

Constructors

  • FeedbackButtonsElement(
      positive_button: FeedbackButton,
      negative_button: FeedbackButton,
      action_id: option.Option(String),
    )

    Arguments

    positive_button

    The button for positive feedback.

    negative_button

    The button for negative feedback.

    action_id

    Identifies the source of the action. Maximum 255 characters.

A remote file. https://docs.slack.dev/reference/block-kit/blocks/file-block

pub type FileBlock {
  FileBlock(
    external_id: String,
    source: String,
    block_id: option.Option(String),
  )
}

Constructors

  • FileBlock(
      external_id: String,
      source: String,
      block_id: option.Option(String),
    )

    Arguments

    external_id

    The external unique ID of the file.

    source

    Always remote.

A file upload input. Works in input blocks in modals. https://docs.slack.dev/reference/block-kit/block-elements/file-input-element

pub type FileInputElement {
  FileInputElement(
    action_id: option.Option(String),
    filetypes: option.Option(List(String)),
    max_files: option.Option(Int),
  )
}

Constructors

  • FileInputElement(
      action_id: option.Option(String),
      filetypes: option.Option(List(String)),
      max_files: option.Option(Int),
    )

    Arguments

    action_id

    Identifies the input value on submission. Maximum 255 characters.

    filetypes

    Accepted file extensions. All are accepted if omitted.

    max_files

    Maximum number of files, 1 to 10. Defaults to 10.

Grid lines of a layout block.

pub type GridLines {
  GridNone
  GridRows
  GridOuter
  UnknownGridLines(String)
}

Constructors

  • GridNone

    none

  • GridRows

    rows

  • GridOuter

    outer

  • UnknownGridLines(String)

    A value that this version of slackline does not know.

Larger, bold text. https://docs.slack.dev/reference/block-kit/blocks/header-block

pub type HeaderBlock {
  HeaderBlock(
    text: PlainText,
    block_id: option.Option(String),
    level: option.Option(Int),
  )
}

Constructors

  • HeaderBlock(
      text: PlainText,
      block_id: option.Option(String),
      level: option.Option(Int),
    )

    Arguments

    text

    The header text. Maximum 150 characters.

    level

    Heading level, 1 to 4.

Horizontal alignment of a layout item.

pub type HorizontalAlignment {
  AlignStart
  AlignCenter
  AlignEnd
  UnknownHorizontalAlignment(String)
}

Constructors

  • AlignStart

    start

  • AlignCenter

    center

  • AlignEnd

    end

  • UnknownHorizontalAlignment(String)

    A value that this version of slackline does not know.

A small button showing an icon. https://docs.slack.dev/reference/block-kit/block-elements/icon-button-element

pub type IconButtonElement {
  IconButtonElement(
    icon: String,
    text: PlainText,
    action_id: option.Option(String),
    value: option.Option(String),
    confirm: option.Option(ConfirmationDialog),
    accessibility_label: option.Option(String),
    visible_to_user_ids: option.Option(List(String)),
  )
}

Constructors

  • IconButtonElement(
      icon: String,
      text: PlainText,
      action_id: option.Option(String),
      value: option.Option(String),
      confirm: option.Option(ConfirmationDialog),
      accessibility_label: option.Option(String),
      visible_to_user_ids: option.Option(List(String)),
    )

    Arguments

    icon

    The icon to show. trash is the only icon available at this time.

    text

    The button text.

    action_id

    Identifies the source of the action. Maximum 255 characters.

    value

    The value sent with the interaction payload. Maximum 2000 characters.

    confirm

    A confirmation dialog shown after the button is clicked.

    accessibility_label

    Text read by screen readers instead of text. Maximum 75 characters.

    visible_to_user_ids

    User IDs the button is visible to. Visible to everyone if omitted.

An image. Provide image_url or slack_file. https://docs.slack.dev/reference/block-kit/blocks/image-block

pub type ImageBlock {
  ImageBlock(
    alt_text: String,
    image_url: option.Option(String),
    slack_file: option.Option(SlackFile),
    title: option.Option(PlainText),
    block_id: option.Option(String),
  )
}

Constructors

  • ImageBlock(
      alt_text: String,
      image_url: option.Option(String),
      slack_file: option.Option(SlackFile),
      title: option.Option(PlainText),
      block_id: option.Option(String),
    )

    Arguments

    alt_text

    A plain-text summary of the image. Maximum 2000 characters.

    image_url

    The URL of a publicly hosted image. Maximum 3000 characters.

    slack_file

    A Slack image file.

    title

    A title. Maximum 2000 characters.

An image element. Works as a section accessory and in context blocks. Provide image_url or slack_file. https://docs.slack.dev/reference/block-kit/block-elements/image-element

pub type ImageElement {
  ImageElement(
    alt_text: String,
    image_url: option.Option(String),
    slack_file: option.Option(SlackFile),
  )
}

Constructors

  • ImageElement(
      alt_text: String,
      image_url: option.Option(String),
      slack_file: option.Option(SlackFile),
    )

    Arguments

    alt_text

    A plain-text summary of the image, without markup.

    image_url

    The URL of a publicly hosted image. Maximum 3000 characters.

    slack_file

    A Slack image file.

Collects information from users with a single element. https://docs.slack.dev/reference/block-kit/blocks/input-block

pub type InputBlock {
  InputBlock(
    label: PlainText,
    element: Element,
    dispatch_action: option.Option(Bool),
    block_id: option.Option(String),
    hint: option.Option(PlainText),
    optional: option.Option(Bool),
  )
}

Constructors

  • InputBlock(
      label: PlainText,
      element: Element,
      dispatch_action: option.Option(Bool),
      block_id: option.Option(String),
      hint: option.Option(PlainText),
      optional: option.Option(Bool),
    )

    Arguments

    label

    The label above the element. Maximum 2000 characters.

    element

    An input-compatible element.

    dispatch_action

    Whether using the element dispatches a block_actions payload. Defaults to false. Incompatible with file_input.

    hint

    A hint below the element. Maximum 2000 characters.

    optional

    Whether the element may be empty on submission. Defaults to false.

Arranges blocks in a grid of rows and side-by-side items. https://docs.slack.dev/reference/block-kit/blocks/layout-block

pub type LayoutBlock {
  LayoutBlock(
    label: String,
    rows: List(LayoutRow),
    is_label_visible: option.Option(Bool),
    grid_lines: option.Option(GridLines),
    fallback: option.Option(List(Block)),
    block_id: option.Option(String),
  )
}

Constructors

  • LayoutBlock(
      label: String,
      rows: List(LayoutRow),
      is_label_visible: option.Option(Bool),
      grid_lines: option.Option(GridLines),
      fallback: option.Option(List(Block)),
      block_id: option.Option(String),
    )

    Arguments

    label

    Describes the layout. Maximum 150 characters.

    rows

    1 to 5 rows.

    is_label_visible

    Show label above the grid. Defaults to false.

    grid_lines

    Defaults to none.

    fallback

    Blocks shown by clients without layout support.

One cell of a layout row.

pub type LayoutItem {
  LayoutItem(
    block: Block,
    width: option.Option(LayoutItemWidth),
    horizontal_alignment: option.Option(HorizontalAlignment),
  )
}

Constructors

Widths of layout items.

pub type LayoutItemWidth {
  LayoutNarrow
  LayoutStandard
  LayoutWide
  UnknownLayoutItemWidth(String)
}

Constructors

  • LayoutNarrow

    narrow

  • LayoutStandard

    standard

  • LayoutWide

    wide

  • UnknownLayoutItemWidth(String)

    A value that this version of slackline does not know.

A row of 1 to 3 layout items.

pub type LayoutRow {
  LayoutRow(items: List(LayoutItem))
}

Constructors

Standard markdown text. https://docs.slack.dev/reference/block-kit/blocks/markdown-block

pub type MarkdownBlock {
  MarkdownBlock(text: String, block_id: option.Option(String))
}

Constructors

  • MarkdownBlock(text: String, block_id: option.Option(String))

    Arguments

    text

    The markdown. All markdown blocks in a payload share a 12,000 character limit.

    block_id

    Ignored by Slack and not retained.

A mrkdwn text object: text using Slack’s mrkdwn formatting. https://docs.slack.dev/reference/block-kit/composition-objects/text-object

pub type Mrkdwn {
  Mrkdwn(text: String, verbatim: option.Option(Bool))
}

Constructors

  • Mrkdwn(text: String, verbatim: option.Option(Bool))

    Arguments

    text

    The text, using standard Slack mrkdwn markup.

    verbatim

    When true, URLs, conversation names and mentions are not auto-linked or parsed. Defaults to false.

A multi-select menu listing public channels.

pub type MultiChannelsSelectElement {
  MultiChannelsSelectElement(
    action_id: option.Option(String),
    initial_channels: option.Option(List(String)),
    confirm: option.Option(ConfirmationDialog),
    max_selected_items: option.Option(Int),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • MultiChannelsSelectElement(
      action_id: option.Option(String),
      initial_channels: option.Option(List(String)),
      confirm: option.Option(ConfirmationDialog),
      max_selected_items: option.Option(Int),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    initial_channels

    Public channel IDs selected when the menu loads.

    confirm

    A confirmation dialog shown before the choices are submitted.

    max_selected_items

    Maximum number of selected items. Minimum 1.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A multi-select menu listing conversations the user can see.

pub type MultiConversationsSelectElement {
  MultiConversationsSelectElement(
    action_id: option.Option(String),
    initial_conversations: option.Option(List(String)),
    default_to_current_conversation: option.Option(Bool),
    confirm: option.Option(ConfirmationDialog),
    max_selected_items: option.Option(Int),
    filter: option.Option(ConversationFilter),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • MultiConversationsSelectElement(
      action_id: option.Option(String),
      initial_conversations: option.Option(List(String)),
      default_to_current_conversation: option.Option(Bool),
      confirm: option.Option(ConfirmationDialog),
      max_selected_items: option.Option(Int),
      filter: option.Option(ConversationFilter),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    initial_conversations

    Conversation IDs selected when the menu loads. Ignored when default_to_current_conversation is set.

    default_to_current_conversation

    Pre-select the conversation the user was viewing. Defaults to false.

    confirm

    A confirmation dialog shown before the choices are submitted.

    max_selected_items

    Maximum number of selected items. Minimum 1.

    filter

    Narrows the conversations offered.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A multi-select menu whose options are loaded from your app’s options URL.

pub type MultiExternalSelectElement {
  MultiExternalSelectElement(
    action_id: option.Option(String),
    min_query_length: option.Option(Int),
    initial_options: option.Option(List(SelectOption)),
    confirm: option.Option(ConfirmationDialog),
    max_selected_items: option.Option(Int),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • MultiExternalSelectElement(
      action_id: option.Option(String),
      min_query_length: option.Option(Int),
      initial_options: option.Option(List(SelectOption)),
      confirm: option.Option(ConfirmationDialog),
      max_selected_items: option.Option(Int),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    min_query_length

    Characters typed before Slack queries your app. Defaults to 3.

    initial_options

    Options selected when the menu loads.

    confirm

    A confirmation dialog shown before the choices are submitted.

    max_selected_items

    Maximum number of selected items. Minimum 1.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A multi-select menu with a static list of options. Provide options or option_groups, not both. https://docs.slack.dev/reference/block-kit/block-elements/multi-select-menu-element

pub type MultiStaticSelectElement {
  MultiStaticSelectElement(
    action_id: option.Option(String),
    options: option.Option(List(SelectOption)),
    option_groups: option.Option(List(OptionGroup)),
    initial_options: option.Option(List(SelectOption)),
    confirm: option.Option(ConfirmationDialog),
    max_selected_items: option.Option(Int),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • MultiStaticSelectElement(
      action_id: option.Option(String),
      options: option.Option(List(SelectOption)),
      option_groups: option.Option(List(OptionGroup)),
      initial_options: option.Option(List(SelectOption)),
      confirm: option.Option(ConfirmationDialog),
      max_selected_items: option.Option(Int),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    options

    The options. Maximum 100. Leave it out when you set option_groups.

    option_groups

    Option groups. Maximum 100. Leave it out when you set options.

    initial_options

    Options selected when the menu loads.

    confirm

    A confirmation dialog shown before the choices are submitted.

    max_selected_items

    Maximum number of selected items. Minimum 1.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A multi-select menu listing the users in the workspace.

pub type MultiUsersSelectElement {
  MultiUsersSelectElement(
    action_id: option.Option(String),
    initial_users: option.Option(List(String)),
    confirm: option.Option(ConfirmationDialog),
    max_selected_items: option.Option(Int),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • MultiUsersSelectElement(
      action_id: option.Option(String),
      initial_users: option.Option(List(String)),
      confirm: option.Option(ConfirmationDialog),
      max_selected_items: option.Option(Int),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    initial_users

    User IDs selected when the menu loads.

    confirm

    A confirmation dialog shown before the choices are submitted.

    max_selected_items

    Maximum number of selected items. Minimum 1.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A number input. Works in input blocks. https://docs.slack.dev/reference/block-kit/block-elements/number-input-element

pub type NumberInputElement {
  NumberInputElement(
    is_decimal_allowed: Bool,
    action_id: option.Option(String),
    initial_value: option.Option(String),
    min_value: option.Option(String),
    max_value: option.Option(String),
    dispatch_action_config: option.Option(DispatchActionConfig),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • NumberInputElement(
      is_decimal_allowed: Bool,
      action_id: option.Option(String),
      initial_value: option.Option(String),
      min_value: option.Option(String),
      max_value: option.Option(String),
      dispatch_action_config: option.Option(DispatchActionConfig),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    is_decimal_allowed

    Whether decimal numbers are allowed.

    action_id

    Identifies the input value on submission. Maximum 255 characters.

    initial_value

    The initial value.

    min_value

    The minimum value. It cannot be greater than max_value.

    max_value

    The maximum value. It cannot be less than min_value.

    dispatch_action_config

    When the element dispatches block_actions payloads.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A labelled group of options in a select menu. https://docs.slack.dev/reference/block-kit/composition-objects/option-group-object

pub type OptionGroup {
  OptionGroup(label: PlainText, options: List(SelectOption))
}

Constructors

  • OptionGroup(label: PlainText, options: List(SelectOption))

    Arguments

    label

    The label shown above the group. Maximum 75 characters.

    options

    The options in the group. Maximum 100.

An overflow (“…”) menu. Works in section and actions. https://docs.slack.dev/reference/block-kit/block-elements/overflow-menu-element

pub type OverflowElement {
  OverflowElement(
    action_id: option.Option(String),
    options: List(SelectOption),
    confirm: option.Option(ConfirmationDialog),
  )
}

Constructors

  • OverflowElement(
      action_id: option.Option(String),
      options: List(SelectOption),
      confirm: option.Option(ConfirmationDialog),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    options

    Up to five options. Options may set url.

    confirm

    A confirmation dialog shown after an item is selected.

A plain_text text object, for the many fields that only accept plain text (labels, titles, placeholders, button text, headers). https://docs.slack.dev/reference/block-kit/composition-objects/text-object

pub type PlainText {
  PlainText(text: String, emoji: option.Option(Bool))
}

Constructors

  • PlainText(text: String, emoji: option.Option(Bool))

    Arguments

    text

    The text. Minimum length 1, maximum 3000 characters.

    emoji

    Whether emojis should be escaped into the colon emoji format.

A single or multi-line plain-text input. Works in input blocks. https://docs.slack.dev/reference/block-kit/block-elements/plain-text-input-element

pub type PlainTextInputElement {
  PlainTextInputElement(
    action_id: option.Option(String),
    initial_value: option.Option(String),
    multiline: option.Option(Bool),
    min_length: option.Option(Int),
    max_length: option.Option(Int),
    dispatch_action_config: option.Option(DispatchActionConfig),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • PlainTextInputElement(
      action_id: option.Option(String),
      initial_value: option.Option(String),
      multiline: option.Option(Bool),
      min_length: option.Option(Int),
      max_length: option.Option(Int),
      dispatch_action_config: option.Option(DispatchActionConfig),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the input value on submission. Maximum 255 characters.

    initial_value

    The initial value.

    multiline

    Whether to show a larger textarea. Defaults to false.

    min_length

    Minimum input length, 0 to 3000.

    max_length

    Maximum input length, 1 to 3000.

    dispatch_action_config

    When the element dispatches block_actions payloads.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A collection of related tasks. https://docs.slack.dev/reference/block-kit/blocks/plan-block

pub type PlanBlock {
  PlanBlock(
    title: String,
    tasks: List(PlanTask),
    block_id: option.Option(String),
  )
}

Constructors

  • PlanBlock(
      title: String,
      tasks: List(PlanTask),
      block_id: option.Option(String),
    )

    Arguments

    title

    Title of the plan in plain text.

    tasks

    Up to 50 tasks.

A task inside a plan block. It has the same fields as a TaskCardBlock, without a type. https://docs.slack.dev/reference/block-kit/blocks/plan-block

pub type PlanTask {
  PlanTask(
    task_id: String,
    title: String,
    status: TaskStatus,
    details: option.Option(RichText),
    output: option.Option(RichText),
    sources: option.Option(List(UrlSource)),
    icon: option.Option(value.Value),
    hide_title: option.Option(Bool),
  )
}

Constructors

  • PlanTask(
      task_id: String,
      title: String,
      status: TaskStatus,
      details: option.Option(RichText),
      output: option.Option(RichText),
      sources: option.Option(List(UrlSource)),
      icon: option.Option(value.Value),
      hide_title: option.Option(Bool),
    )

    Arguments

    task_id

    The task ID, unique within a plan.

    title

    Title of the task in plain text.

    details

    Details of the task.

    output

    Output of the task.

    sources

    Sources used to generate a response.

    icon

    Icon associated with the task. The docs only say “Icon”, so this is raw json.

    hide_title

    Hide title so details becomes the top element.

A group of radio buttons. Works in section, actions and input. https://docs.slack.dev/reference/block-kit/block-elements/radio-button-group-element

pub type RadioButtonsElement {
  RadioButtonsElement(
    action_id: option.Option(String),
    options: List(SelectOption),
    initial_option: option.Option(SelectOption),
    confirm: option.Option(ConfirmationDialog),
    focus_on_load: option.Option(Bool),
  )
}

Constructors

  • RadioButtonsElement(
      action_id: option.Option(String),
      options: List(SelectOption),
      initial_option: option.Option(SelectOption),
      confirm: option.Option(ConfirmationDialog),
      focus_on_load: option.Option(Bool),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    options

    The options. Maximum 10. mrkdwn text is allowed.

    initial_option

    The option selected when the group loads. It must match options.

    confirm

    A confirmation dialog shown after clicking a radio button.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

A rich text object. As a block it is the rich_text variant of Block. Rich text inputs, container titles, table cells and task cards use it directly. https://docs.slack.dev/reference/block-kit/blocks/rich-text-block

pub type RichText {
  RichText(
    elements: List(RichTextObject),
    block_id: option.Option(String),
  )
}

Constructors

The inline elements of rich text sections, lists, quotes and preformatted blocks. https://docs.slack.dev/reference/block-kit/blocks/rich-text-block

pub type RichTextElement {
  TextElement(text: String, style: option.Option(RichTextStyle))
  LinkElement(
    url: String,
    text: option.Option(String),
    unsafe: option.Option(Bool),
    from_llm: option.Option(Bool),
    is_slack_url: option.Option(Bool),
    truncated: option.Option(Bool),
    style: option.Option(RichTextStyle),
  )
  EmojiElement(name: String, unicode: option.Option(String))
  UserElement(
    user_id: String,
    style: option.Option(RichTextStyle),
    from_llm: option.Option(Bool),
  )
  ChannelElement(
    channel_id: String,
    tab_id: option.Option(String),
    style: option.Option(RichTextStyle),
    from_llm: option.Option(Bool),
  )
  UsergroupElement(
    usergroup_id: String,
    style: option.Option(RichTextStyle),
  )
  TeamElement(
    team_id: String,
    style: option.Option(RichTextStyle),
  )
  BroadcastElement(
    range: BroadcastRange,
    style: option.Option(RichTextStyle),
  )
  DateElement(
    timestamp: Int,
    format: String,
    timezone: option.Option(String),
    url: option.Option(String),
    fallback: option.Option(String),
    style: option.Option(RichTextStyle),
  )
  ColorElement(
    value: String,
    style: option.Option(RichTextStyle),
  )
  CanvasElement(
    file_id: String,
    label: option.Option(String),
    hide_title: option.Option(Bool),
    section_id: option.Option(String),
    style: option.Option(RichTextStyle),
    text: option.Option(String),
    url: option.Option(String),
    is_skill_invocation: option.Option(Bool),
  )
  CanvasUserMentionElement(
    user_id: String,
    thread_id: option.Option(String),
    style: option.Option(RichTextStyle),
  )
  CanvasMessageUnfurlElement(
    root_message_ts: String,
    root_message_channel: String,
    style: option.Option(RichTextStyle),
  )
  CitationElement(
    url: String,
    text: String,
    index: Int,
    details: CitationDetails,
    from_llm: option.Option(Bool),
    is_slack_url: option.Option(Bool),
  )
  FileElement(
    file_id: String,
    style: option.Option(RichTextStyle),
    text: option.Option(String),
    url: option.Option(String),
    is_skill_invocation: option.Option(Bool),
  )
  ListRecordElement(
    file_id: String,
    record_id: option.Option(String),
    view_id: option.Option(String),
    style: option.Option(RichTextStyle),
    text: option.Option(String),
    url: option.Option(String),
  )
  MessageMentionElement(
    channel_id: String,
    message_ts: String,
    author_id: option.Option(String),
    thread_ts: option.Option(String),
    style: option.Option(RichTextStyle),
    text: option.Option(String),
    url: option.Option(String),
  )
  SalesforceDataFieldElement(
    salesforce_record_id: String,
    salesforce_field_label: option.Option(String),
    salesforce_field_api_name: option.Option(String),
    salesforce_include_field_label: option.Option(Bool),
    style: option.Option(RichTextStyle),
  )
  TagElement(
    text: String,
    color: option.Option(TagColor),
    style: option.Option(RichTextStyle),
  )
  WorkObjectMentionElement(
    entity_id: String,
    app_id: String,
    text: String,
    url: String,
    icon_url: option.Option(String),
    full_size_preview_enabled: option.Option(Bool),
    product_name: option.Option(String),
    style: option.Option(RichTextStyle),
  )
  WorkflowMentionElement(
    workflow_id: String,
    function_trigger_id: String,
    text: String,
    url: option.Option(String),
    channel_id: option.Option(String),
    ts: option.Option(String),
    style: option.Option(RichTextStyle),
  )
  AttachmentMentionElement(
    url: String,
    text: option.Option(String),
    app_id: option.Option(String),
    entity_id: option.Option(String),
    icon_url: option.Option(String),
    channel_id: option.Option(String),
    ts: option.Option(String),
    full_size_preview_enabled: option.Option(Bool),
    icon_name: option.Option(String),
    reference_object_type: option.Option(String),
    product_name: option.Option(String),
    style: option.Option(RichTextStyle),
  )
  UnknownRichTextElement(type_: String, raw: value.Value)
}

Constructors

A rich text editor. Works in input blocks. https://docs.slack.dev/reference/block-kit/block-elements/rich-text-input-element

pub type RichTextInputElement {
  RichTextInputElement(
    action_id: String,
    initial_value: option.Option(RichText),
    dispatch_action_config: option.Option(DispatchActionConfig),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
    min_lines: option.Option(Int),
    max_lines: option.Option(Int),
  )
}

Constructors

  • RichTextInputElement(
      action_id: String,
      initial_value: option.Option(RichText),
      dispatch_action_config: option.Option(DispatchActionConfig),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
      min_lines: option.Option(Int),
      max_lines: option.Option(Int),
    )

    Arguments

    action_id

    Identifies the input value on submission. Maximum 255 characters.

    initial_value

    The initial content.

    dispatch_action_config

    When the element dispatches block_actions payloads.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

    min_lines

    Minimum visible lines before scrolling, 1 to 100.

    max_lines

    Maximum visible lines before scrolling, 1 to 100. Defaults to 8.

Rich text list styles.

pub type RichTextListStyle {
  Bullet
  Ordered
  UnknownRichTextListStyle(String)
}

Constructors

  • Bullet

    bullet

  • Ordered

    A numbered list.

  • UnknownRichTextListStyle(String)

    A value that this version of slackline does not know.

The top-level children of a rich text block.

pub type RichTextObject {
  RichTextSection(elements: List(RichTextElement))
  RichTextList(
    style: option.Option(RichTextListStyle),
    elements: List(RichTextObject),
    indent: option.Option(Int),
    offset: option.Option(Int),
    border: option.Option(Int),
  )
  RichTextPreformatted(
    elements: List(RichTextElement),
    border: option.Option(Int),
    language: option.Option(String),
  )
  RichTextQuote(
    elements: List(RichTextElement),
    border: option.Option(Int),
  )
  UnknownRichTextObject(type_: String, raw: value.Value)
}

Constructors

  • RichTextSection(elements: List(RichTextElement))

    A paragraph of inline elements.

  • RichTextList(
      style: option.Option(RichTextListStyle),
      elements: List(RichTextObject),
      indent: option.Option(Int),
      offset: option.Option(Int),
      border: option.Option(Int),
    )

    A bulleted or numbered list. Each item is a rich_text_section.

    Arguments

    style

    bullet or ordered.

    indent

    Sub-list indent level.

    offset

    Number to offset the first number of an ordered list by.

    border

    Border on (1) or off (0).

  • RichTextPreformatted(
      elements: List(RichTextElement),
      border: option.Option(Int),
      language: option.Option(String),
    )

    A code block of text and link elements.

    Arguments

    language

    Language for syntax highlighting, such as python.

  • RichTextQuote(
      elements: List(RichTextElement),
      border: option.Option(Int),
    )

    A quote.

  • UnknownRichTextObject(type_: String, raw: value.Value)

    A type that this version of slackline does not know. raw holds the full json.

Optional styling of rich text elements. code only applies to text elements. unlink does not apply to color, date and canvas_message_unfurl.

pub type RichTextStyle {
  RichTextStyle(
    bold: option.Option(Bool),
    italic: option.Option(Bool),
    strike: option.Option(Bool),
    code: option.Option(Bool),
    highlight: option.Option(Bool),
    client_highlight: option.Option(Bool),
    underline: option.Option(Bool),
    unlink: option.Option(Bool),
  )
}

Constructors

Displays text, possibly with an accessory element. Provide text, fields, or both. https://docs.slack.dev/reference/block-kit/blocks/section-block

pub type SectionBlock {
  SectionBlock(
    text: option.Option(Text),
    block_id: option.Option(String),
    fields: option.Option(List(Text)),
    accessory: option.Option(Element),
    expand: option.Option(Bool),
  )
}

Constructors

A single selectable item in a select menu, multi-select, overflow menu, checkbox group or radio button group. https://docs.slack.dev/reference/block-kit/composition-objects/option-object

pub type SelectOption {
  SelectOption(
    text: Text,
    value: String,
    description: option.Option(Text),
    url: option.Option(String),
  )
}

Constructors

  • SelectOption(
      text: Text,
      value: String,
      description: option.Option(Text),
      url: option.Option(String),
    )

    Arguments

    text

    The text shown for the option. Menus only accept plain_text. Checkboxes and radio buttons also accept mrkdwn. Maximum 75 characters.

    value

    The value sent to your app when this option is chosen. Maximum 150 characters.

    description

    A line of descriptive text shown below text. mrkdwn is only allowed in checkboxes and radio buttons.

    url

    A URL to open when the option is clicked. Only available in overflow menus.

A reference to an image file hosted on Slack. Provide url or id. https://docs.slack.dev/reference/block-kit/composition-objects/slack-file-object

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

Constructors

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

    Arguments

    url

    The url_private or permalink of the Slack file.

    id

    The Slack ID of the file.

A built-in Slack icon, used in card blocks. https://docs.slack.dev/reference/block-kit/composition-objects/slack-icon-object

pub type SlackIcon {
  SlackIcon(name: SlackIconName)
}

Constructors

  • SlackIcon(name: SlackIconName)

    Arguments

    name

    Which icon to show.

Names of the built-in Slack icons.

pub type SlackIconName {
  IconArchive
  IconBook
  IconBookmark
  IconBot
  IconBug
  IconCalendar
  IconCall
  IconCaretLeft
  IconCaretRight
  IconCheck
  IconClipboard
  IconCode
  IconComment
  IconCompass
  IconCopy
  IconCube
  IconDownload
  IconEdit
  IconEmail
  IconEyeClosed
  IconEyeOpen
  IconFile
  IconFlag
  IconFolder
  IconGear
  IconGlobe
  IconHeart
  IconHelp
  IconImage
  IconInfo
  IconKey
  IconLightbulb
  IconLink
  IconMap
  IconMobile
  IconNewWindow
  IconPin
  IconPlus
  IconRefine
  IconRefresh
  IconRocket
  IconSave
  IconScreen
  IconShare
  IconSparkle
  IconStar
  IconStarFilled
  IconTag
  IconThumbsDown
  IconThumbsUp
  IconTrash
  IconUpload
  IconUser
  IconWarning
  UnknownSlackIconName(String)
}

Constructors

  • IconArchive

    archive

  • IconBook

    book

  • IconBookmark

    bookmark

  • IconBot

    bot

  • IconBug

    bug

  • IconCalendar

    calendar

  • IconCall

    call

  • IconCaretLeft

    caret-left

  • IconCaretRight

    caret-right

  • IconCheck

    check

  • IconClipboard

    clipboard

  • IconCode

    code

  • IconComment

    comment

  • IconCompass

    compass

  • IconCopy

    copy

  • IconCube

    cube

  • IconDownload

    download

  • IconEdit

    edit

  • IconEmail

    email

  • IconEyeClosed

    eye-closed

  • IconEyeOpen

    eye-open

  • IconFile

    file

  • IconFlag

    flag

  • IconFolder

    folder

  • IconGear

    gear

  • IconGlobe

    globe

  • IconHeart

    heart

  • IconHelp

    help

  • IconImage

    image

  • IconInfo

    info

  • IconKey

    key

  • IconLightbulb

    lightbulb

  • IconLink

    link

  • IconMap

    map

  • IconMobile

    mobile

  • IconNewWindow

    new-window

  • IconPin

    pin

  • IconPlus

    plus

  • IconRefine

    refine

  • IconRefresh

    refresh

  • IconRocket

    rocket

  • IconSave

    save

  • IconScreen

    screen

  • IconShare

    share

  • IconSparkle

    sparkle

  • IconStar

    star

  • IconStarFilled

    star-filled

  • IconTag

    tag

  • IconThumbsDown

    thumbs-down

  • IconThumbsUp

    thumbs-up

  • IconTrash

    trash

  • IconUpload

    upload

  • IconUser

    user

  • IconWarning

    warning

  • UnknownSlackIconName(String)

    A value that this version of slackline does not know.

A select menu with a static list of options. Provide options or option_groups, not both. https://docs.slack.dev/reference/block-kit/block-elements/select-menu-element

pub type StaticSelectElement {
  StaticSelectElement(
    action_id: option.Option(String),
    options: option.Option(List(SelectOption)),
    option_groups: option.Option(List(OptionGroup)),
    initial_option: option.Option(SelectOption),
    confirm: option.Option(ConfirmationDialog),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • StaticSelectElement(
      action_id: option.Option(String),
      options: option.Option(List(SelectOption)),
      option_groups: option.Option(List(OptionGroup)),
      initial_option: option.Option(SelectOption),
      confirm: option.Option(ConfirmationDialog),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    options

    The options. Maximum 100. Leave it out when you set option_groups.

    option_groups

    Option groups. Maximum 100. Leave it out when you set options.

    initial_option

    The option selected when the menu loads.

    confirm

    A confirmation dialog shown after an item is selected.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

Structured information in a table. https://docs.slack.dev/reference/block-kit/blocks/table-block

pub type TableBlock {
  TableBlock(
    block_id: option.Option(String),
    rows: List(List(TableCell)),
    column_settings: option.Option(
      List(option.Option(ColumnSetting)),
    ),
  )
}

Constructors

  • TableBlock(
      block_id: option.Option(String),
      rows: List(List(TableCell)),
      column_settings: option.Option(
        List(option.Option(ColumnSetting)),
      ),
    )

    Arguments

    rows

    Up to 100 rows of up to 20 raw_text, raw_number or rich_text cells.

    column_settings

    Column behavior, in column order. null (None) keeps a column’s defaults.

A table cell. action_cell is only allowed in data table blocks.

pub type TableCell {
  RawTextCell(text: String)
  RawNumberCell(
    value: option.Option(Float),
    text: option.Option(String),
  )
  RichTextCell(RichText)
  ActionCell(
    element: Element,
    fallback: option.Option(TableCell),
  )
  UnknownTableCell(type_: String, raw: value.Value)
}

Constructors

  • RawTextCell(text: String)

    Simple text.

  • RawNumberCell(
      value: option.Option(Float),
      text: option.Option(String),
    )

    A numeric value. Numeric columns sort by value.

  • RichTextCell(RichText)

    Rich text. Not allowed in header (first row) cells of data tables.

  • ActionCell(element: Element, fallback: option.Option(TableCell))

    A button. Data table blocks only.

    Arguments

    element

    Must be a button element.

    fallback

    A raw_text or raw_number cell shown on clients without action cells.

  • UnknownTableCell(type_: String, raw: value.Value)

    A type that this version of slackline does not know. raw holds the full json.

Colors for tag elements.

pub type TagColor {
  Gray
  Brown
  Purple
  Indigo
  Blue
  Green
  Yellow
  Orange
  Red
  UnknownTagColor(String)
}

Constructors

  • Gray

    gray

  • Brown

    brown

  • Purple

    purple

  • Indigo

    indigo

  • Blue

    blue

  • Green

    green

  • Yellow

    yellow

  • Orange

    orange

  • Red

    red

  • UnknownTagColor(String)

    A value that this version of slackline does not know.

A single task shown as a block. https://docs.slack.dev/reference/block-kit/blocks/task-card-block

pub type TaskCardBlock {
  TaskCardBlock(
    task_id: String,
    title: String,
    status: TaskStatus,
    details: option.Option(RichText),
    output: option.Option(RichText),
    sources: option.Option(List(UrlSource)),
    block_id: option.Option(String),
    icon: option.Option(value.Value),
    hide_title: option.Option(Bool),
  )
}

Constructors

The state of a task, in a task card, a plan or a streamed message.

pub type TaskStatus {
  TaskPending
  TaskInProgress
  TaskComplete
  TaskError
  UnknownTaskStatus(String)
}

Constructors

  • TaskPending

    pending

  • TaskInProgress

    in_progress

  • TaskComplete

    complete

  • TaskError

    error

  • UnknownTaskStatus(String)

    A value that this version of slackline does not know.

A text object: plain_text or mrkdwn. https://docs.slack.dev/reference/block-kit/composition-objects/text-object

pub type Text {
  PlainTextObject(PlainText)
  MrkdwnObject(Mrkdwn)
  UnknownText(type_: String, raw: value.Value)
}

Constructors

  • PlainTextObject(PlainText)
  • MrkdwnObject(Mrkdwn)
  • UnknownText(type_: String, raw: value.Value)

    A type that this version of slackline does not know. raw holds the full json.

A time picker. Works in section, actions and input. https://docs.slack.dev/reference/block-kit/block-elements/time-picker-element

pub type TimepickerElement {
  TimepickerElement(
    action_id: option.Option(String),
    initial_time: option.Option(String),
    confirm: option.Option(ConfirmationDialog),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
    timezone: option.Option(String),
  )
}

Constructors

  • TimepickerElement(
      action_id: option.Option(String),
      initial_time: option.Option(String),
      confirm: option.Option(ConfirmationDialog),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
      timezone: option.Option(String),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    initial_time

    The initial time, HH:mm in 24-hour format.

    confirm

    A confirmation dialog shown after a time is selected.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

    timezone

    An IANA timezone, such as America/Chicago, shown as hint text.

Information about a workflow’s link trigger. https://docs.slack.dev/reference/block-kit/composition-objects/trigger-object

pub type Trigger {
  Trigger(
    url: String,
    customizable_input_parameters: option.Option(
      List(TriggerInputParameter),
    ),
  )
}

Constructors

  • Trigger(
      url: String,
      customizable_input_parameters: option.Option(
        List(TriggerInputParameter),
      ),
    )

    Arguments

    url

    A link trigger URL. Must be associated with a valid trigger.

    customizable_input_parameters

    Values for input parameters marked customizable: true on the trigger.

When a text input dispatches a block_actions payload.

pub type TriggerAction {
  OnEnterPressed
  OnCharacterEntered
  UnknownTriggerAction(String)
}

Constructors

  • OnEnterPressed

    When the user presses enter while the input is focused.

  • OnCharacterEntered

    When a character is entered or removed.

  • UnknownTriggerAction(String)

    A value that this version of slackline does not know.

A customizable input parameter passed to a workflow trigger.

pub type TriggerInputParameter {
  TriggerInputParameter(name: String, value: value.Value)
}

Constructors

  • TriggerInputParameter(name: String, value: value.Value)

    Arguments

    name

    Must match an input parameter defined on the workflow of the trigger.

    value

    Must match the type of the workflow input parameter.

A URL source shown on a task card. https://docs.slack.dev/reference/block-kit/block-elements/url-source-element

pub type UrlSource {
  UrlSource(url: String, text: String)
}

Constructors

  • UrlSource(url: String, text: String)

    Arguments

    url

    The source URL.

    text

    Display text for the URL.

A URL input. Works in input blocks. https://docs.slack.dev/reference/block-kit/block-elements/url-input-element

pub type UrlTextInputElement {
  UrlTextInputElement(
    action_id: option.Option(String),
    initial_value: option.Option(String),
    dispatch_action_config: option.Option(DispatchActionConfig),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • UrlTextInputElement(
      action_id: option.Option(String),
      initial_value: option.Option(String),
      dispatch_action_config: option.Option(DispatchActionConfig),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the input value on submission. Maximum 255 characters.

    initial_value

    The initial value.

    dispatch_action_config

    When the element dispatches block_actions payloads.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

A select menu listing the users in the workspace.

pub type UsersSelectElement {
  UsersSelectElement(
    action_id: option.Option(String),
    initial_user: option.Option(String),
    confirm: option.Option(ConfirmationDialog),
    focus_on_load: option.Option(Bool),
    placeholder: option.Option(PlainText),
  )
}

Constructors

  • UsersSelectElement(
      action_id: option.Option(String),
      initial_user: option.Option(String),
      confirm: option.Option(ConfirmationDialog),
      focus_on_load: option.Option(Bool),
      placeholder: option.Option(PlainText),
    )

    Arguments

    action_id

    Identifies the source of the action. Maximum 255 characters.

    initial_user

    The user ID selected when the menu loads.

    confirm

    A confirmation dialog shown after an item is selected.

    focus_on_load

    Whether to auto focus this element in a view. Defaults to false.

    placeholder

    Placeholder text. Maximum 150 characters.

An embedded video player. https://docs.slack.dev/reference/block-kit/blocks/video-block

pub type VideoBlock {
  VideoBlock(
    alt_text: String,
    author_name: option.Option(String),
    block_id: option.Option(String),
    description: option.Option(PlainText),
    provider_icon_url: option.Option(String),
    provider_name: option.Option(String),
    title: PlainText,
    title_url: option.Option(String),
    thumbnail_url: String,
    video_url: String,
  )
}

Constructors

  • VideoBlock(
      alt_text: String,
      author_name: option.Option(String),
      block_id: option.Option(String),
      description: option.Option(PlainText),
      provider_icon_url: option.Option(String),
      provider_name: option.Option(String),
      title: PlainText,
      title_url: option.Option(String),
      thumbnail_url: String,
      video_url: String,
    )

    Arguments

    alt_text

    A tooltip for the video.

    author_name

    Author name. Less than 50 characters.

    description

    Description. Less than 200 characters.

    provider_icon_url

    Icon of the video provider.

    provider_name

    The originating application or domain, such as YouTube.

    title

    Video title. Less than 200 characters.

    title_url

    Non-embeddable HTTPS link for the title.

    thumbnail_url

    The thumbnail image URL.

    video_url

    The HTTPS URL to embed. It must match an unfurl domain of the app.

The workflow run by a workflow button. https://docs.slack.dev/reference/block-kit/composition-objects/workflow-object

pub type Workflow {
  Workflow(trigger: Trigger)
}

Constructors

  • Workflow(trigger: Trigger)

    Arguments

    trigger

    The workflow’s trigger.

A button that runs a workflow. Works in section and actions. https://docs.slack.dev/reference/block-kit/block-elements/workflow-button-element

pub type WorkflowButtonElement {
  WorkflowButtonElement(
    text: PlainText,
    workflow: Workflow,
    action_id: String,
    style: option.Option(ButtonStyle),
    accessibility_label: option.Option(String),
  )
}

Constructors

  • WorkflowButtonElement(
      text: PlainText,
      workflow: Workflow,
      action_id: String,
      style: option.Option(ButtonStyle),
      accessibility_label: option.Option(String),
    )

    Arguments

    text

    The button text. Maximum 75 characters.

    workflow

    The workflow to run.

    action_id

    Identifies the source of the action. Maximum 255 characters.

    style

    Visual color scheme.

    accessibility_label

    Text read by screen readers instead of text. Maximum 75 characters.

Values

pub fn actions(
  elements elements: List(Element),
  with attrs: List(Attr(ActionsBlock)),
) -> Block

Holds up to 25 interactive elements. https://docs.slack.dev/reference/block-kit/blocks/actions-block

Attributes: actions.block_id.

pub fn actions_block_decoder() -> decode.Decoder(ActionsBlock)

Decodes ActionsBlock from json.

pub fn actions_block_to_json(it: ActionsBlock) -> json.Json

Encodes ActionsBlock as json.

pub fn alert(
  text text: Text,
  with attrs: List(Attr(AlertBlock)),
) -> Block

Displays an alert, warning or informational message. https://docs.slack.dev/reference/block-kit/blocks/alert-block

Attributes: alert.level, alert.block_id.

pub fn alert_block_decoder() -> decode.Decoder(AlertBlock)

Decodes AlertBlock from json.

pub fn alert_block_to_json(it: AlertBlock) -> json.Json

Encodes AlertBlock as json.

pub fn alert_level_decoder() -> decode.Decoder(AlertLevel)

Decodes AlertLevel from a json string.

pub fn alert_level_from_string(string: String) -> AlertLevel

Parses AlertLevel from its json string.

pub fn alert_level_to_json(it: AlertLevel) -> json.Json

Encodes AlertLevel as a json string.

pub fn alert_level_to_string(it: AlertLevel) -> String

The json string of AlertLevel.

pub fn attr(set: fn(record) -> record) -> Attr(record)

An attribute that updates the record with set. The attribute modules use it, and you can use it for a change that they do not cover.

pub fn block_decoder() -> decode.Decoder(Block)

Decodes Block from json. The type field selects the variant.

pub fn block_to_json(it: Block) -> json.Json

Encodes Block as json.

pub fn broadcast_range_decoder() -> decode.Decoder(BroadcastRange)

Decodes BroadcastRange from a json string.

pub fn broadcast_range_from_string(
  string: String,
) -> BroadcastRange

Parses BroadcastRange from its json string.

pub fn broadcast_range_to_json(it: BroadcastRange) -> json.Json

Encodes BroadcastRange as a json string.

pub fn broadcast_range_to_string(it: BroadcastRange) -> String

The json string of BroadcastRange.

pub fn button_element_decoder() -> decode.Decoder(ButtonElement)

Decodes ButtonElement from json.

pub fn button_element_to_json(it: ButtonElement) -> json.Json

Encodes ButtonElement as json.

pub fn button_style_decoder() -> decode.Decoder(ButtonStyle)

Decodes ButtonStyle from a json string.

pub fn button_style_from_string(string: String) -> ButtonStyle

Parses ButtonStyle from its json string.

pub fn button_style_to_json(it: ButtonStyle) -> json.Json

Encodes ButtonStyle as a json string.

pub fn button_style_to_string(it: ButtonStyle) -> String

The json string of ButtonStyle.

pub fn call(
  call_id call_id: String,
  with attrs: List(Attr(CallBlock)),
) -> Block

A Call registered with calls.add. Only messages and chat.unfurl can show it. https://docs.slack.dev/apis/web-api/using-the-calls-api

Attributes: call.block_id.

pub fn call_block_decoder() -> decode.Decoder(CallBlock)

Decodes CallBlock from json.

pub fn call_block_to_json(it: CallBlock) -> json.Json

Encodes CallBlock as json.

pub fn card(with attrs: List(Attr(CardBlock))) -> Block

Displays content in a card. At least one of hero_image, title, actions or body is required. https://docs.slack.dev/reference/block-kit/blocks/card-block

Attributes: card.block_id, card.hero_image, card.icon, card.title, card.subtitle, card.body, card.actions, card.slack_icon, card.subtext.

pub fn card_block_decoder() -> decode.Decoder(CardBlock)

Decodes CardBlock from json.

pub fn card_block_to_json(it: CardBlock) -> json.Json

Encodes CardBlock as json.

pub fn carousel(
  elements elements: List(Block),
  with attrs: List(Attr(CarouselBlock)),
) -> Block

A horizontally scrolling list of 1 to 10 card blocks. https://docs.slack.dev/reference/block-kit/blocks/carousel-block

Attributes: carousel.block_id.

pub fn carousel_block_decoder() -> decode.Decoder(CarouselBlock)

Decodes CarouselBlock from json.

pub fn carousel_block_to_json(it: CarouselBlock) -> json.Json

Encodes CarouselBlock as json.

pub fn channels_select_element_decoder() -> decode.Decoder(
  ChannelsSelectElement,
)

Decodes ChannelsSelectElement from json.

pub fn channels_select_element_to_json(
  it: ChannelsSelectElement,
) -> json.Json

Encodes ChannelsSelectElement as json.

pub fn chart_axis_config_decoder() -> decode.Decoder(
  ChartAxisConfig,
)

Decodes ChartAxisConfig from json.

pub fn chart_axis_config_to_json(
  it: ChartAxisConfig,
) -> json.Json

Encodes ChartAxisConfig as json.

pub fn chart_data_point_decoder() -> decode.Decoder(
  ChartDataPoint,
)

Decodes ChartDataPoint from json.

pub fn chart_data_point_to_json(it: ChartDataPoint) -> json.Json

Encodes ChartDataPoint as json.

pub fn chart_data_series_decoder() -> decode.Decoder(
  ChartDataSeries,
)

Decodes ChartDataSeries from json.

pub fn chart_data_series_to_json(
  it: ChartDataSeries,
) -> json.Json

Encodes ChartDataSeries as json.

pub fn chart_decoder() -> decode.Decoder(Chart)

Decodes Chart from json. The type field selects the variant.

pub fn chart_segment_decoder() -> decode.Decoder(ChartSegment)

Decodes ChartSegment from json.

pub fn chart_segment_to_json(it: ChartSegment) -> json.Json

Encodes ChartSegment as json.

pub fn chart_to_json(it: Chart) -> json.Json

Encodes Chart as json.

pub fn checkboxes_element_decoder() -> decode.Decoder(
  CheckboxesElement,
)

Decodes CheckboxesElement from json.

pub fn checkboxes_element_to_json(
  it: CheckboxesElement,
) -> json.Json

Encodes CheckboxesElement as json.

pub fn citation_details_decoder() -> decode.Decoder(
  CitationDetails,
)

Decodes CitationDetails from json. The citation_type field selects the variant.

pub fn citation_details_to_json(it: CitationDetails) -> json.Json

Encodes CitationDetails as json.

pub fn column_align_decoder() -> decode.Decoder(ColumnAlign)

Decodes ColumnAlign from a json string.

pub fn column_align_from_string(string: String) -> ColumnAlign

Parses ColumnAlign from its json string.

pub fn column_align_to_json(it: ColumnAlign) -> json.Json

Encodes ColumnAlign as a json string.

pub fn column_align_to_string(it: ColumnAlign) -> String

The json string of ColumnAlign.

pub fn column_setting_decoder() -> decode.Decoder(ColumnSetting)

Decodes ColumnSetting from json.

pub fn column_setting_to_json(it: ColumnSetting) -> json.Json

Encodes ColumnSetting as json.

pub fn confirmation_dialog(
  title title: String,
  text text: Text,
  confirm confirm: String,
  deny deny: String,
) -> ConfirmationDialog

A confirmation dialog with the default style.

pub fn confirmation_dialog_decoder() -> decode.Decoder(
  ConfirmationDialog,
)

Decodes ConfirmationDialog from json.

pub fn confirmation_dialog_to_json(
  it: ConfirmationDialog,
) -> json.Json

Encodes ConfirmationDialog as json.

pub fn container(
  child_blocks child_blocks: List(Block),
  with attrs: List(Attr(ContainerBlock)),
) -> Block

Groups up to 10 child blocks. One of title or rich_text_title is required. https://docs.slack.dev/reference/block-kit/blocks/container-block

Attributes: container.title, container.rich_text_title, container.subtitle, container.block_id, container.width, container.icon, container.is_collapsible, container.default_collapsed, container.has_header_divider.

pub fn container_block_decoder() -> decode.Decoder(ContainerBlock)

Decodes ContainerBlock from json.

pub fn container_block_to_json(it: ContainerBlock) -> json.Json

Encodes ContainerBlock as json.

pub fn container_width_decoder() -> decode.Decoder(ContainerWidth)

Decodes ContainerWidth from a json string.

pub fn container_width_from_string(
  string: String,
) -> ContainerWidth

Parses ContainerWidth from its json string.

pub fn container_width_to_json(it: ContainerWidth) -> json.Json

Encodes ContainerWidth as a json string.

pub fn container_width_to_string(it: ContainerWidth) -> String

The json string of ContainerWidth.

pub fn context(
  elements elements: List(ContextElement),
  with attrs: List(Attr(ContextBlock)),
) -> Block

Images and text shown as small contextual info. Maximum 10 elements. https://docs.slack.dev/reference/block-kit/blocks/context-block

Attributes: context.block_id.

pub fn context_actions(
  elements elements: List(ContextActionsElement),
  with attrs: List(Attr(ContextActionsBlock)),
) -> Block

Feedback and icon buttons shown as contextual info. Maximum 5 elements. https://docs.slack.dev/reference/block-kit/blocks/context-actions-block

Attributes: context_actions.block_id.

pub fn context_actions_block_decoder() -> decode.Decoder(
  ContextActionsBlock,
)

Decodes ContextActionsBlock from json.

pub fn context_actions_block_to_json(
  it: ContextActionsBlock,
) -> json.Json

Encodes ContextActionsBlock as json.

pub fn context_actions_element_decoder() -> decode.Decoder(
  ContextActionsElement,
)

Decodes ContextActionsElement from json. The type field selects the variant.

pub fn context_actions_element_to_json(
  it: ContextActionsElement,
) -> json.Json

Encodes ContextActionsElement as json.

pub fn context_block_decoder() -> decode.Decoder(ContextBlock)

Decodes ContextBlock from json.

pub fn context_block_to_json(it: ContextBlock) -> json.Json

Encodes ContextBlock as json.

pub fn context_element_decoder() -> decode.Decoder(ContextElement)

Decodes ContextElement from json. The type field selects the variant.

pub fn context_element_to_json(it: ContextElement) -> json.Json

Encodes ContextElement as json.

pub fn context_image(
  image_url image_url: String,
  alt_text alt_text: String,
) -> ContextElement

An image from a public URL as a context block element.

pub fn context_mrkdwn(text: String) -> ContextElement

mrkdwn text as a context block element.

pub fn context_plain(text: String) -> ContextElement

Plain text as a context block element.

pub fn conversation_filter_decoder() -> decode.Decoder(
  ConversationFilter,
)

Decodes ConversationFilter from json.

pub fn conversation_filter_to_json(
  it: ConversationFilter,
) -> json.Json

Encodes ConversationFilter as json.

pub fn conversation_kind_decoder() -> decode.Decoder(
  ConversationKind,
)

Decodes ConversationKind from a json string.

pub fn conversation_kind_from_string(
  string: String,
) -> ConversationKind

Parses ConversationKind from its json string.

pub fn conversation_kind_to_json(
  it: ConversationKind,
) -> json.Json

Encodes ConversationKind as a json string.

pub fn conversation_kind_to_string(
  it: ConversationKind,
) -> String

The json string of ConversationKind.

pub fn conversations_select_element_decoder() -> decode.Decoder(
  ConversationsSelectElement,
)

Decodes ConversationsSelectElement from json.

pub fn conversations_select_element_to_json(
  it: ConversationsSelectElement,
) -> json.Json

Encodes ConversationsSelectElement as json.

pub fn data_table(
  rows rows: List(List(TableCell)),
  caption caption: String,
  with attrs: List(Attr(DataTableBlock)),
) -> Block

A table with pagination, sorting, filtering and buttons. https://docs.slack.dev/reference/block-kit/blocks/data-table-block

Attributes: data_table.block_id, data_table.page_size, data_table.row_header_column_index.

pub fn data_table_block_decoder() -> decode.Decoder(
  DataTableBlock,
)

Decodes DataTableBlock from json.

pub fn data_table_block_to_json(it: DataTableBlock) -> json.Json

Encodes DataTableBlock as json.

pub fn data_visualization(
  title title: String,
  chart chart: Chart,
  with attrs: List(Attr(DataVisualizationBlock)),
) -> Block

A pie, bar, area or line chart. https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block

Attributes: data_visualization.block_id.

pub fn data_visualization_block_decoder() -> decode.Decoder(
  DataVisualizationBlock,
)

Decodes DataVisualizationBlock from json.

pub fn data_visualization_block_to_json(
  it: DataVisualizationBlock,
) -> json.Json

Encodes DataVisualizationBlock as json.

pub fn datepicker_element_decoder() -> decode.Decoder(
  DatepickerElement,
)

Decodes DatepickerElement from json.

pub fn datepicker_element_to_json(
  it: DatepickerElement,
) -> json.Json

Encodes DatepickerElement as json.

pub fn datetimepicker_element_decoder() -> decode.Decoder(
  DatetimepickerElement,
)

Decodes DatetimepickerElement from json.

pub fn datetimepicker_element_to_json(
  it: DatetimepickerElement,
) -> json.Json

Encodes DatetimepickerElement as json.

pub fn dispatch_action_config_decoder() -> decode.Decoder(
  DispatchActionConfig,
)

Decodes DispatchActionConfig from json.

pub fn dispatch_action_config_to_json(
  it: DispatchActionConfig,
) -> json.Json

Encodes DispatchActionConfig as json.

pub fn divider(with attrs: List(Attr(DividerBlock))) -> Block

A visual separator. https://docs.slack.dev/reference/block-kit/blocks/divider-block

Attributes: divider.block_id.

pub fn divider_block_decoder() -> decode.Decoder(DividerBlock)

Decodes DividerBlock from json.

pub fn divider_block_to_json(it: DividerBlock) -> json.Json

Encodes DividerBlock as json.

pub fn element_decoder() -> decode.Decoder(Element)

Decodes Element from json. The type field selects the variant.

pub fn element_to_json(it: Element) -> json.Json

Encodes Element as json.

pub fn email_text_input_element_decoder() -> decode.Decoder(
  EmailTextInputElement,
)

Decodes EmailTextInputElement from json.

pub fn email_text_input_element_to_json(
  it: EmailTextInputElement,
) -> json.Json

Encodes EmailTextInputElement as json.

pub fn external_select_element_decoder() -> decode.Decoder(
  ExternalSelectElement,
)

Decodes ExternalSelectElement from json.

pub fn external_select_element_to_json(
  it: ExternalSelectElement,
) -> json.Json

Encodes ExternalSelectElement as json.

pub fn feedback_button_decoder() -> decode.Decoder(FeedbackButton)

Decodes FeedbackButton from json.

pub fn feedback_button_to_json(it: FeedbackButton) -> json.Json

Encodes FeedbackButton as json.

pub fn feedback_buttons_element_decoder() -> decode.Decoder(
  FeedbackButtonsElement,
)

Decodes FeedbackButtonsElement from json.

pub fn feedback_buttons_element_to_json(
  it: FeedbackButtonsElement,
) -> json.Json

Encodes FeedbackButtonsElement as json.

pub fn file(
  external_id external_id: String,
  source source: String,
  with attrs: List(Attr(FileBlock)),
) -> Block

A remote file. https://docs.slack.dev/reference/block-kit/blocks/file-block

Attributes: file.block_id.

pub fn file_block_decoder() -> decode.Decoder(FileBlock)

Decodes FileBlock from json.

pub fn file_block_to_json(it: FileBlock) -> json.Json

Encodes FileBlock as json.

pub fn file_input_element_decoder() -> decode.Decoder(
  FileInputElement,
)

Decodes FileInputElement from json.

pub fn file_input_element_to_json(
  it: FileInputElement,
) -> json.Json

Encodes FileInputElement as json.

pub fn grid_lines_decoder() -> decode.Decoder(GridLines)

Decodes GridLines from a json string.

pub fn grid_lines_from_string(string: String) -> GridLines

Parses GridLines from its json string.

pub fn grid_lines_to_json(it: GridLines) -> json.Json

Encodes GridLines as a json string.

pub fn grid_lines_to_string(it: GridLines) -> String

The json string of GridLines.

pub fn header(
  text text: String,
  with attrs: List(Attr(HeaderBlock)),
) -> Block

Larger, bold text. https://docs.slack.dev/reference/block-kit/blocks/header-block

Attributes: header.block_id, header.level.

pub fn header_block_decoder() -> decode.Decoder(HeaderBlock)

Decodes HeaderBlock from json.

pub fn header_block_to_json(it: HeaderBlock) -> json.Json

Encodes HeaderBlock as json.

pub fn horizontal_alignment_decoder() -> decode.Decoder(
  HorizontalAlignment,
)

Decodes HorizontalAlignment from a json string.

pub fn horizontal_alignment_from_string(
  string: String,
) -> HorizontalAlignment

Parses HorizontalAlignment from its json string.

pub fn horizontal_alignment_to_json(
  it: HorizontalAlignment,
) -> json.Json

Encodes HorizontalAlignment as a json string.

pub fn horizontal_alignment_to_string(
  it: HorizontalAlignment,
) -> String

The json string of HorizontalAlignment.

pub fn icon_button_element_decoder() -> decode.Decoder(
  IconButtonElement,
)

Decodes IconButtonElement from json.

pub fn icon_button_element_to_json(
  it: IconButtonElement,
) -> json.Json

Encodes IconButtonElement as json.

pub fn image(
  alt_text alt_text: String,
  with attrs: List(Attr(ImageBlock)),
) -> Block

An image. Set image_url or slack_file. https://docs.slack.dev/reference/block-kit/blocks/image-block

Attributes: image.image_url, image.slack_file, image.title, image.block_id.

pub fn image_block_decoder() -> decode.Decoder(ImageBlock)

Decodes ImageBlock from json.

pub fn image_block_to_json(it: ImageBlock) -> json.Json

Encodes ImageBlock as json.

pub fn image_element_decoder() -> decode.Decoder(ImageElement)

Decodes ImageElement from json.

pub fn image_element_to_json(it: ImageElement) -> json.Json

Encodes ImageElement as json.

pub fn input(
  label label: String,
  element element: Element,
  with attrs: List(Attr(InputBlock)),
) -> Block

Collects information from users with a single element. https://docs.slack.dev/reference/block-kit/blocks/input-block

Attributes: input.dispatch_action, input.block_id, input.hint, input.optional.

pub fn input_block_decoder() -> decode.Decoder(InputBlock)

Decodes InputBlock from json.

pub fn input_block_to_json(it: InputBlock) -> json.Json

Encodes InputBlock as json.

pub fn layout(
  label label: String,
  rows rows: List(LayoutRow),
  with attrs: List(Attr(LayoutBlock)),
) -> Block

Arranges blocks in a grid of rows and side-by-side items. https://docs.slack.dev/reference/block-kit/blocks/layout-block

Attributes: layout.is_label_visible, layout.grid_lines, layout.fallback, layout.block_id.

pub fn layout_block_decoder() -> decode.Decoder(LayoutBlock)

Decodes LayoutBlock from json.

pub fn layout_block_to_json(it: LayoutBlock) -> json.Json

Encodes LayoutBlock as json.

pub fn layout_item_decoder() -> decode.Decoder(LayoutItem)

Decodes LayoutItem from json.

pub fn layout_item_to_json(it: LayoutItem) -> json.Json

Encodes LayoutItem as json.

pub fn layout_item_width_decoder() -> decode.Decoder(
  LayoutItemWidth,
)

Decodes LayoutItemWidth from a json string.

pub fn layout_item_width_from_string(
  string: String,
) -> LayoutItemWidth

Parses LayoutItemWidth from its json string.

pub fn layout_item_width_to_json(
  it: LayoutItemWidth,
) -> json.Json

Encodes LayoutItemWidth as a json string.

pub fn layout_item_width_to_string(it: LayoutItemWidth) -> String

The json string of LayoutItemWidth.

pub fn layout_row_decoder() -> decode.Decoder(LayoutRow)

Decodes LayoutRow from json.

pub fn layout_row_to_json(it: LayoutRow) -> json.Json

Encodes LayoutRow as json.

pub fn markdown(
  text text: String,
  with attrs: List(Attr(MarkdownBlock)),
) -> Block

Standard markdown text. https://docs.slack.dev/reference/block-kit/blocks/markdown-block

Attributes: markdown.block_id.

pub fn markdown_block_decoder() -> decode.Decoder(MarkdownBlock)

Decodes MarkdownBlock from json.

pub fn markdown_block_to_json(it: MarkdownBlock) -> json.Json

Encodes MarkdownBlock as json.

pub fn mrkdwn(text: String) -> Text

A mrkdwn text object.

pub fn mrkdwn_decoder() -> decode.Decoder(Mrkdwn)

Decodes Mrkdwn from json.

pub fn mrkdwn_to_json(it: Mrkdwn) -> json.Json

Encodes Mrkdwn as json.

pub fn multi_channels_select_element_decoder() -> decode.Decoder(
  MultiChannelsSelectElement,
)

Decodes MultiChannelsSelectElement from json.

pub fn multi_channels_select_element_to_json(
  it: MultiChannelsSelectElement,
) -> json.Json

Encodes MultiChannelsSelectElement as json.

pub fn multi_conversations_select_element_decoder() -> decode.Decoder(
  MultiConversationsSelectElement,
)

Decodes MultiConversationsSelectElement from json.

pub fn multi_conversations_select_element_to_json(
  it: MultiConversationsSelectElement,
) -> json.Json

Encodes MultiConversationsSelectElement as json.

pub fn multi_external_select_element_decoder() -> decode.Decoder(
  MultiExternalSelectElement,
)

Decodes MultiExternalSelectElement from json.

pub fn multi_external_select_element_to_json(
  it: MultiExternalSelectElement,
) -> json.Json

Encodes MultiExternalSelectElement as json.

pub fn multi_static_select_element_decoder() -> decode.Decoder(
  MultiStaticSelectElement,
)

Decodes MultiStaticSelectElement from json.

pub fn multi_static_select_element_to_json(
  it: MultiStaticSelectElement,
) -> json.Json

Encodes MultiStaticSelectElement as json.

pub fn multi_users_select_element_decoder() -> decode.Decoder(
  MultiUsersSelectElement,
)

Decodes MultiUsersSelectElement from json.

pub fn multi_users_select_element_to_json(
  it: MultiUsersSelectElement,
) -> json.Json

Encodes MultiUsersSelectElement as json.

pub fn no_style() -> RichTextStyle

A rich text style with every property unset.

pub fn number_input_element_decoder() -> decode.Decoder(
  NumberInputElement,
)

Decodes NumberInputElement from json.

pub fn number_input_element_to_json(
  it: NumberInputElement,
) -> json.Json

Encodes NumberInputElement as json.

pub fn option(label: String, value: String) -> SelectOption

An option with plain text and a value.

pub fn option_group(
  label: String,
  options: List(SelectOption),
) -> OptionGroup

A labelled group of options.

pub fn option_group_decoder() -> decode.Decoder(OptionGroup)

Decodes OptionGroup from json.

pub fn option_group_to_json(it: OptionGroup) -> json.Json

Encodes OptionGroup as json.

pub fn overflow_element_decoder() -> decode.Decoder(
  OverflowElement,
)

Decodes OverflowElement from json.

pub fn overflow_element_to_json(it: OverflowElement) -> json.Json

Encodes OverflowElement as json.

pub fn plain_text(text: String) -> PlainText

A plain_text object for fields that only accept plain text, with emoji unset.

pub fn plain_text_decoder() -> decode.Decoder(PlainText)

Decodes PlainText from json.

pub fn plain_text_input_element_decoder() -> decode.Decoder(
  PlainTextInputElement,
)

Decodes PlainTextInputElement from json.

pub fn plain_text_input_element_to_json(
  it: PlainTextInputElement,
) -> json.Json

Encodes PlainTextInputElement as json.

pub fn plain_text_to_json(it: PlainText) -> json.Json

Encodes PlainText as json.

pub fn plan(
  title title: String,
  tasks tasks: List(PlanTask),
  with attrs: List(Attr(PlanBlock)),
) -> Block

A collection of related tasks. https://docs.slack.dev/reference/block-kit/blocks/plan-block

Attributes: plan.block_id.

pub fn plan_block_decoder() -> decode.Decoder(PlanBlock)

Decodes PlanBlock from json.

pub fn plan_block_to_json(it: PlanBlock) -> json.Json

Encodes PlanBlock as json.

pub fn plan_task_decoder() -> decode.Decoder(PlanTask)

Decodes PlanTask from json.

pub fn plan_task_to_json(it: PlanTask) -> json.Json

Encodes PlanTask as json.

pub fn radio_buttons_element_decoder() -> decode.Decoder(
  RadioButtonsElement,
)

Decodes RadioButtonsElement from json.

pub fn radio_buttons_element_to_json(
  it: RadioButtonsElement,
) -> json.Json

Encodes RadioButtonsElement as json.

pub fn rich_text(
  elements elements: List(RichTextObject),
  with attrs: List(Attr(RichText)),
) -> Block

Formatted, structured text.

Attributes: rich_text.block_id.

pub fn rich_text_decoder() -> decode.Decoder(RichText)

Decodes RichText from json.

pub fn rich_text_element_decoder() -> decode.Decoder(
  RichTextElement,
)

Decodes RichTextElement from json. The type field selects the variant.

pub fn rich_text_element_to_json(
  it: RichTextElement,
) -> json.Json

Encodes RichTextElement as json.

pub fn rich_text_input_element_decoder() -> decode.Decoder(
  RichTextInputElement,
)

Decodes RichTextInputElement from json.

pub fn rich_text_input_element_to_json(
  it: RichTextInputElement,
) -> json.Json

Encodes RichTextInputElement as json.

pub fn rich_text_list_style_decoder() -> decode.Decoder(
  RichTextListStyle,
)

Decodes RichTextListStyle from a json string.

pub fn rich_text_list_style_from_string(
  string: String,
) -> RichTextListStyle

Parses RichTextListStyle from its json string.

pub fn rich_text_list_style_to_json(
  it: RichTextListStyle,
) -> json.Json

Encodes RichTextListStyle as a json string.

pub fn rich_text_list_style_to_string(
  it: RichTextListStyle,
) -> String

The json string of RichTextListStyle.

pub fn rich_text_object_decoder() -> decode.Decoder(
  RichTextObject,
)

Decodes RichTextObject from json. The type field selects the variant.

pub fn rich_text_object_to_json(it: RichTextObject) -> json.Json

Encodes RichTextObject as json.

pub fn rich_text_run(text: String) -> RichTextElement

An unstyled rich text run.

pub fn rich_text_section(
  elements: List(RichTextElement),
) -> RichTextObject

A rich text section (paragraph).

pub fn rich_text_style_decoder() -> decode.Decoder(RichTextStyle)

Decodes RichTextStyle from json.

pub fn rich_text_style_to_json(it: RichTextStyle) -> json.Json

Encodes RichTextStyle as json.

pub fn rich_text_to_json(it: RichText) -> json.Json

Encodes RichText as json.

pub fn rich_text_value(
  elements: List(RichTextObject),
) -> RichText

A rich text object, for example the initial_value of a rich text input. rich_text builds the block.

pub fn section(
  text text: Text,
  with attrs: List(Attr(SectionBlock)),
) -> Block

Displays text, possibly with an accessory element. Provide text, fields, or both. https://docs.slack.dev/reference/block-kit/blocks/section-block

Attributes: section.block_id, section.fields, section.accessory, section.expand.

pub fn section_block_decoder() -> decode.Decoder(SectionBlock)

Decodes SectionBlock from json.

pub fn section_block_to_json(it: SectionBlock) -> json.Json

Encodes SectionBlock as json.

pub fn select_option_decoder() -> decode.Decoder(SelectOption)

Decodes SelectOption from json.

pub fn select_option_to_json(it: SelectOption) -> json.Json

Encodes SelectOption as json.

pub fn slack_file_decoder() -> decode.Decoder(SlackFile)

Decodes SlackFile from json.

pub fn slack_file_to_json(it: SlackFile) -> json.Json

Encodes SlackFile as json.

pub fn slack_icon_decoder() -> decode.Decoder(SlackIcon)

Decodes SlackIcon from json.

pub fn slack_icon_name_decoder() -> decode.Decoder(SlackIconName)

Decodes SlackIconName from a json string.

pub fn slack_icon_name_from_string(
  string: String,
) -> SlackIconName

Parses SlackIconName from its json string.

pub fn slack_icon_name_to_json(it: SlackIconName) -> json.Json

Encodes SlackIconName as a json string.

pub fn slack_icon_name_to_string(it: SlackIconName) -> String

The json string of SlackIconName.

pub fn slack_icon_to_json(it: SlackIcon) -> json.Json

Encodes SlackIcon as json.

pub fn static_select_element_decoder() -> decode.Decoder(
  StaticSelectElement,
)

Decodes StaticSelectElement from json.

pub fn static_select_element_to_json(
  it: StaticSelectElement,
) -> json.Json

Encodes StaticSelectElement as json.

pub fn table(
  rows rows: List(List(TableCell)),
  with attrs: List(Attr(TableBlock)),
) -> Block

Structured information in a table. https://docs.slack.dev/reference/block-kit/blocks/table-block

Attributes: table.block_id, table.column_settings.

pub fn table_block_decoder() -> decode.Decoder(TableBlock)

Decodes TableBlock from json.

pub fn table_block_to_json(it: TableBlock) -> json.Json

Encodes TableBlock as json.

pub fn table_cell_decoder() -> decode.Decoder(TableCell)

Decodes TableCell from json. The type field selects the variant.

pub fn table_cell_to_json(it: TableCell) -> json.Json

Encodes TableCell as json.

pub fn tag_color_decoder() -> decode.Decoder(TagColor)

Decodes TagColor from a json string.

pub fn tag_color_from_string(string: String) -> TagColor

Parses TagColor from its json string.

pub fn tag_color_to_json(it: TagColor) -> json.Json

Encodes TagColor as a json string.

pub fn tag_color_to_string(it: TagColor) -> String

The json string of TagColor.

pub fn task_card(
  task_id task_id: String,
  title title: String,
  status status: TaskStatus,
  with attrs: List(Attr(TaskCardBlock)),
) -> Block

A single task shown as a block. https://docs.slack.dev/reference/block-kit/blocks/task-card-block

Attributes: task_card.details, task_card.output, task_card.sources, task_card.block_id, task_card.icon, task_card.hide_title.

pub fn task_card_block_decoder() -> decode.Decoder(TaskCardBlock)

Decodes TaskCardBlock from json.

pub fn task_card_block_to_json(it: TaskCardBlock) -> json.Json

Encodes TaskCardBlock as json.

pub fn task_status_decoder() -> decode.Decoder(TaskStatus)

Decodes TaskStatus from a json string.

pub fn task_status_from_string(string: String) -> TaskStatus

Parses TaskStatus from its json string.

pub fn task_status_to_json(it: TaskStatus) -> json.Json

Encodes TaskStatus as a json string.

pub fn task_status_to_string(it: TaskStatus) -> String

The json string of TaskStatus.

pub fn text(text: String) -> Text

A plain_text text object, for fields that accept either kind of text. Use plain_text for fields that only accept plain text.

pub fn text_decoder() -> decode.Decoder(Text)

Decodes Text from json. The type field selects the variant.

pub fn text_to_json(it: Text) -> json.Json

Encodes Text as json.

pub fn timepicker_element_decoder() -> decode.Decoder(
  TimepickerElement,
)

Decodes TimepickerElement from json.

pub fn timepicker_element_to_json(
  it: TimepickerElement,
) -> json.Json

Encodes TimepickerElement as json.

pub fn trigger_action_decoder() -> decode.Decoder(TriggerAction)

Decodes TriggerAction from a json string.

pub fn trigger_action_from_string(
  string: String,
) -> TriggerAction

Parses TriggerAction from its json string.

pub fn trigger_action_to_json(it: TriggerAction) -> json.Json

Encodes TriggerAction as a json string.

pub fn trigger_action_to_string(it: TriggerAction) -> String

The json string of TriggerAction.

pub fn trigger_decoder() -> decode.Decoder(Trigger)

Decodes Trigger from json.

pub fn trigger_input_parameter_decoder() -> decode.Decoder(
  TriggerInputParameter,
)

Decodes TriggerInputParameter from json.

pub fn trigger_input_parameter_to_json(
  it: TriggerInputParameter,
) -> json.Json

Encodes TriggerInputParameter as json.

pub fn trigger_to_json(it: Trigger) -> json.Json

Encodes Trigger as json.

pub fn url_source_decoder() -> decode.Decoder(UrlSource)

Decodes UrlSource from json.

pub fn url_source_to_json(it: UrlSource) -> json.Json

Encodes UrlSource as json.

pub fn url_text_input_element_decoder() -> decode.Decoder(
  UrlTextInputElement,
)

Decodes UrlTextInputElement from json.

pub fn url_text_input_element_to_json(
  it: UrlTextInputElement,
) -> json.Json

Encodes UrlTextInputElement as json.

pub fn users_select_element_decoder() -> decode.Decoder(
  UsersSelectElement,
)

Decodes UsersSelectElement from json.

pub fn users_select_element_to_json(
  it: UsersSelectElement,
) -> json.Json

Encodes UsersSelectElement as json.

pub fn video(
  alt_text alt_text: String,
  title title: String,
  thumbnail_url thumbnail_url: String,
  video_url video_url: String,
  with attrs: List(Attr(VideoBlock)),
) -> Block

An embedded video player. https://docs.slack.dev/reference/block-kit/blocks/video-block

Attributes: video.author_name, video.block_id, video.description, video.provider_icon_url, video.provider_name, video.title_url.

pub fn video_block_decoder() -> decode.Decoder(VideoBlock)

Decodes VideoBlock from json.

pub fn video_block_to_json(it: VideoBlock) -> json.Json

Encodes VideoBlock as json.

pub fn workflow_button_element_decoder() -> decode.Decoder(
  WorkflowButtonElement,
)

Decodes WorkflowButtonElement from json.

pub fn workflow_button_element_to_json(
  it: WorkflowButtonElement,
) -> json.Json

Encodes WorkflowButtonElement as json.

pub fn workflow_decoder() -> decode.Decoder(Workflow)

Decodes Workflow from json.

pub fn workflow_to_json(it: Workflow) -> json.Json

Encodes Workflow as json.

✨ Search Document