Slackblocks.Objects.Option (slackblocks v2.8.0)
View SourceA selectable option for menus, checkboxes, radio buttons, and overflow menus.
Slack reference: https://docs.slack.dev/reference/block-kit/composition-objects/option-object
Fields
text— Sets the option label shown to users. Required.value— Sets the value sent in interaction payloads when this option is chosen. Required.description— Sets supporting text shown below the label. Only rendered by checkboxes and radio buttons. Optional;nilomits the field.url— Sets a URL loaded in the user's browser when an overflow menu option is chosen. Optional;nilomits the field.
Summary
Functions
Atomically replaces supplied fields; omitted fields retain their values.
Replaces fields or raises Slackblocks.ValidationError.
Constructs and validates a value. Text conveniences apply to keyword input.
Constructs a value or raises Slackblocks.ValidationError.
Types
@type t() :: %Slackblocks.Objects.Option{ description: Slackblocks.Types.text() | nil, text: Slackblocks.Types.text(), url: binary() | nil, value: binary() }
Functions
@spec change( t(), keyword() ) :: {:ok, t()} | {:error, Slackblocks.ValidationError.t()}
Atomically replaces supplied fields; omitted fields retain their values.
Replaces fields or raises Slackblocks.ValidationError.
@spec new(keyword()) :: {:ok, t()} | {:error, Slackblocks.ValidationError.t()}
Constructs and validates a value. Text conveniences apply to keyword input.
Constructs a value or raises Slackblocks.ValidationError.