| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Web.Slack.Experimental.Blocks.Types
Synopsis
- class Slack a where
- newtype SlackText = SlackText {
- unSlackTexts :: [Text]
- link :: Text -> Maybe Text -> SlackText
- data SlackPlainTextOnly = SlackPlainTextOnly SlackText
- plaintextonly :: Slack a => a -> SlackPlainTextOnly
- data SlackTextObject
- plaintext :: Slack a => a -> SlackTextObject
- mrkdwn :: Slack a => a -> SlackTextObject
- newtype OptionalSetting a = OptionalSetting {
- unOptionalSetting :: Maybe a
- setting :: a -> OptionalSetting a
- emptySetting :: OptionalSetting a
- data SlackStyle
- newtype SlackActionId = SlackActionId {
- unSlackActionId :: NonEmptyText 255
- data SlackImage = SlackImage {
- slackImageTitle :: !(Maybe Text)
- slackImageAltText :: !Text
- slackImageUrl :: !Text
- data SlackContent
- newtype SlackContext = SlackContext [SlackContent]
- type SlackActionListConstraints = SizeGreaterThan 0 && SizeLessThan 6
- newtype SlackActionList = SlackActionList {}
- class ToSlackActionList a where
- toSlackActionList :: a -> SlackActionList
- data RichStyle = RichStyle {}
- data RichLinkAttrs = RichLinkAttrs {}
- data RichItem
- data RichTextSectionItem
- data RichText = RichText {}
- data SlackAccessory = SlackButtonAccessory SlackAction
- sectionWithButtonAccessory :: SlackAction -> SlackText -> SlackBlock
- data SlackBlock
- newtype SlackMessage = SlackMessage [SlackBlock]
- textToMessage :: Text -> SlackMessage
- class Markdown a where
- class Image a where
- image :: SlackImage -> a
- context :: SlackContext -> SlackMessage
- textToContext :: Text -> SlackMessage
- actions :: ToSlackActionList as => as -> SlackMessage
- actionsWithBlockId :: ToSlackActionList as => SlackBlockId -> as -> SlackMessage
- data ButtonSettings = ButtonSettings {}
- buttonSettings :: ButtonSettings
- button :: SlackActionId -> SlackButtonText -> ButtonSettings -> SlackAction
- data ConfirmSettings = ConfirmSettings {}
- confirmAreYouSure :: ConfirmSettings
- confirm :: ConfirmSettings -> SlackConfirmObject
- type SlackBlockId = NonEmptyText 255
- data SlackAction = SlackAction SlackActionId SlackActionComponent
- data SlackConfirmObject = SlackConfirmObject {}
- newtype SlackResponseUrl = SlackResponseUrl {}
- data SlackInteractivePayload = SlackInteractivePayload {}
- data SlackActionResponse = SlackActionResponse {}
- data SlackInteractiveResponseResponse = SlackInteractiveResponseResponse {}
- data SlackInteractiveResponse
- newtype SlackButtonText = SlackButtonText (NonEmptyText 75)
- data SlackActionComponent = SlackButton {}
Documentation
Class of types that can be turned into part of a Slack Message. message
is the primary way of converting primitive and domain-level types into things
that can be shown in a slack message.
Constructors
| SlackText | |
Fields
| |
Instances
data SlackPlainTextOnly Source #
Constructors
| SlackPlainTextOnly SlackText |
Instances
plaintextonly :: Slack a => a -> SlackPlainTextOnly Source #
Create a SlackPlainTextOnly. Some API points can can take either markdown or plain text,
but some can take only plain text. This enforces the latter.
data SlackTextObject Source #
Constructors
| SlackPlainText SlackText | |
| SlackMarkdownText SlackText |
Instances
| FromJSON SlackTextObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser SlackTextObject # parseJSONList :: Value -> Parser [SlackTextObject] # | |
| ToJSON SlackTextObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toJSON :: SlackTextObject -> Value # toEncoding :: SlackTextObject -> Encoding # toJSONList :: [SlackTextObject] -> Value # toEncodingList :: [SlackTextObject] -> Encoding # | |
| Show SlackTextObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackTextObject -> ShowS # show :: SlackTextObject -> String # showList :: [SlackTextObject] -> ShowS # | |
| Eq SlackTextObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: SlackTextObject -> SlackTextObject -> Bool # (/=) :: SlackTextObject -> SlackTextObject -> Bool # | |
plaintext :: Slack a => a -> SlackTextObject Source #
Create a plain text SlackTextObject where the API allows either markdown or plain text.
mrkdwn :: Slack a => a -> SlackTextObject Source #
Create a markdown SlackTextObject where the API allows either markdown or plain text.
newtype OptionalSetting a Source #
Represents an optional setting for some Slack Setting.
Constructors
| OptionalSetting | |
Fields
| |
Instances
| IsString (OptionalSetting Text) Source # | Allows using bare Texts without having to use |
Defined in Web.Slack.Experimental.Blocks.Types Methods fromString :: String -> OptionalSetting Text # | |
| IsString (OptionalSetting String) Source # | Allows using bare Strings without having to use |
Defined in Web.Slack.Experimental.Blocks.Types Methods fromString :: String -> OptionalSetting String # | |
| Eq a => Eq (OptionalSetting a) Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: OptionalSetting a -> OptionalSetting a -> Bool # (/=) :: OptionalSetting a -> OptionalSetting a -> Bool # | |
setting :: a -> OptionalSetting a Source #
Sets a setting.
emptySetting :: OptionalSetting a Source #
Sets the empty setting.
data SlackStyle Source #
Styles for Slack buttons. If no style is given, the default style (black) is used.
Constructors
| SlackStylePrimary | Green button |
| SlackStyleDanger | Red button |
Instances
| FromJSON SlackStyle Source # | |
Defined in Web.Slack.Experimental.Blocks.Types | |
| ToJSON SlackStyle Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toJSON :: SlackStyle -> Value # toEncoding :: SlackStyle -> Encoding # toJSONList :: [SlackStyle] -> Value # toEncodingList :: [SlackStyle] -> Encoding # | |
| Show SlackStyle Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackStyle -> ShowS # show :: SlackStyle -> String # showList :: [SlackStyle] -> ShowS # | |
| Eq SlackStyle Source # | |
Defined in Web.Slack.Experimental.Blocks.Types | |
newtype SlackActionId Source #
Used to identify an action. The ID used should be unique among all actions in the block.
This is limited to 255 characters, per the Slack documentation at https://api.slack.com/reference/block-kit/block-elements#button
Constructors
| SlackActionId | |
Fields
| |
Instances
| FromJSON SlackActionId Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser SlackActionId # parseJSONList :: Value -> Parser [SlackActionId] # | |
| ToJSON SlackActionId Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toJSON :: SlackActionId -> Value # toEncoding :: SlackActionId -> Encoding # toJSONList :: [SlackActionId] -> Value # toEncodingList :: [SlackActionId] -> Encoding # | |
| Show SlackActionId Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackActionId -> ShowS # show :: SlackActionId -> String # showList :: [SlackActionId] -> ShowS # | |
| Eq SlackActionId Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: SlackActionId -> SlackActionId -> Bool # (/=) :: SlackActionId -> SlackActionId -> Bool # | |
data SlackImage Source #
Constructors
| SlackImage | |
Fields
| |
Instances
| Show SlackImage Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackImage -> ShowS # show :: SlackImage -> String # showList :: [SlackImage] -> ShowS # | |
| Eq SlackImage Source # | |
Defined in Web.Slack.Experimental.Blocks.Types | |
data SlackContent Source #
Constructors
| SlackContentText SlackText | |
| SlackContentImage SlackImage |
Instances
| FromJSON SlackContent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types | |
| ToJSON SlackContent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toJSON :: SlackContent -> Value # toEncoding :: SlackContent -> Encoding # toJSONList :: [SlackContent] -> Value # toEncodingList :: [SlackContent] -> Encoding # | |
| Show SlackContent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackContent -> ShowS # show :: SlackContent -> String # showList :: [SlackContent] -> ShowS # | |
| Eq SlackContent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types | |
newtype SlackContext Source #
Constructors
| SlackContext [SlackContent] |
Instances
type SlackActionListConstraints = SizeGreaterThan 0 && SizeLessThan 6 Source #
newtype SlackActionList Source #
List that enforces that Slack actions must have between 1 and 5 actions.
Constructors
| SlackActionList | |
Instances
| FromJSON SlackActionList Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser SlackActionList # parseJSONList :: Value -> Parser [SlackActionList] # | |
| ToJSON SlackActionList Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toJSON :: SlackActionList -> Value # toEncoding :: SlackActionList -> Encoding # toJSONList :: [SlackActionList] -> Value # toEncodingList :: [SlackActionList] -> Encoding # | |
| Show SlackActionList Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackActionList -> ShowS # show :: SlackActionList -> String # showList :: [SlackActionList] -> ShowS # | |
| Eq SlackActionList Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: SlackActionList -> SlackActionList -> Bool # (/=) :: SlackActionList -> SlackActionList -> Bool # | |
| ToSlackActionList SlackActionList Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toSlackActionList :: SlackActionList -> SlackActionList Source # | |
class ToSlackActionList a where Source #
Helper to allow using up to a 5-tuple for a SlackActionList
Methods
toSlackActionList :: a -> SlackActionList Source #
Instances
A rich text style. You can't actually send these, for some reason.
data RichLinkAttrs Source #
Constructors
| RichLinkAttrs | |
Instances
| Show RichLinkAttrs Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> RichLinkAttrs -> ShowS # show :: RichLinkAttrs -> String # showList :: [RichLinkAttrs] -> ShowS # | |
| Eq RichLinkAttrs Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: RichLinkAttrs -> RichLinkAttrs -> Bool # (/=) :: RichLinkAttrs -> RichLinkAttrs -> Bool # | |
Seemingly only documented at https://api.slack.com/changelog/2019-09-what-they-see-is-what-you-get-and-more-and-less
They warn of undocumented element types. Joy.
Constructors
| RichItemText Text RichStyle | |
| RichItemChannel ConversationId | |
| RichItemUser UserId RichStyle | |
| RichItemLink RichLinkAttrs | |
| RichItemEmoji Text | |
| RichItemOther Text Value |
data RichTextSectionItem Source #
Constructors
| RichTextSectionItemRichText [RichItem] | |
| RichTextSectionItemUnknown Text Value |
Instances
| FromJSON RichTextSectionItem Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser RichTextSectionItem # parseJSONList :: Value -> Parser [RichTextSectionItem] # | |
| Show RichTextSectionItem Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> RichTextSectionItem -> ShowS # show :: RichTextSectionItem -> String # showList :: [RichTextSectionItem] -> ShowS # | |
| Eq RichTextSectionItem Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: RichTextSectionItem -> RichTextSectionItem -> Bool # (/=) :: RichTextSectionItem -> RichTextSectionItem -> Bool # | |
Constructors
| RichText | |
Fields | |
data SlackAccessory Source #
Accessory is a type of optional block element that floats to the right of text in a BlockSection. https://api.slack.com/reference/block-kit/blocks#section_fields
Constructors
| SlackButtonAccessory SlackAction |
Instances
| FromJSON SlackAccessory Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser SlackAccessory # parseJSONList :: Value -> Parser [SlackAccessory] # | |
| ToJSON SlackAccessory Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toJSON :: SlackAccessory -> Value # toEncoding :: SlackAccessory -> Encoding # toJSONList :: [SlackAccessory] -> Value # toEncodingList :: [SlackAccessory] -> Encoding # | |
| Show SlackAccessory Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackAccessory -> ShowS # show :: SlackAccessory -> String # showList :: [SlackAccessory] -> ShowS # | |
| Eq SlackAccessory Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: SlackAccessory -> SlackAccessory -> Bool # (/=) :: SlackAccessory -> SlackAccessory -> Bool # | |
sectionWithButtonAccessory :: SlackAction -> SlackText -> SlackBlock Source #
Small helper function for constructing a section with a button accessory out of a button and text components
data SlackBlock Source #
Constructors
Instances
| FromJSON SlackBlock Source # | |
Defined in Web.Slack.Experimental.Blocks.Types | |
| ToJSON SlackBlock Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toJSON :: SlackBlock -> Value # toEncoding :: SlackBlock -> Encoding # toJSONList :: [SlackBlock] -> Value # toEncodingList :: [SlackBlock] -> Encoding # | |
| Show SlackBlock Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackBlock -> ShowS # show :: SlackBlock -> String # showList :: [SlackBlock] -> ShowS # | |
| Eq SlackBlock Source # | |
Defined in Web.Slack.Experimental.Blocks.Types | |
newtype SlackMessage Source #
Constructors
| SlackMessage [SlackBlock] |
Instances
textToMessage :: Text -> SlackMessage Source #
class Markdown a where Source #
Instances
| Markdown SlackContext Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods markdown :: SlackText -> SlackContext Source # | |
| Markdown SlackMessage Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods markdown :: SlackText -> SlackMessage Source # | |
Methods
image :: SlackImage -> a Source #
Instances
| Image SlackContext Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods image :: SlackImage -> SlackContext Source # | |
| Image SlackMessage Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods image :: SlackImage -> SlackMessage Source # | |
context :: SlackContext -> SlackMessage Source #
textToContext :: Text -> SlackMessage Source #
actions :: ToSlackActionList as => as -> SlackMessage Source #
Generates interactive components such as buttons.
actionsWithBlockId :: ToSlackActionList as => SlackBlockId -> as -> SlackMessage Source #
Generates interactive components such as buttons with a SlackBlockId.
data ButtonSettings Source #
Settings for button elements.
Constructors
| ButtonSettings | |
Fields
| |
buttonSettings :: ButtonSettings Source #
Default button settings.
button :: SlackActionId -> SlackButtonText -> ButtonSettings -> SlackAction Source #
Button builder.
data ConfirmSettings Source #
Settings for confirmation dialog objects.
Constructors
| ConfirmSettings | |
Fields
| |
confirmAreYouSure :: ConfirmSettings Source #
Default settings for a "Are you sure?" confirmation dialog.
confirm :: ConfirmSettings -> SlackConfirmObject Source #
Confirm dialog builder.
type SlackBlockId = NonEmptyText 255 Source #
SlackBlockId should be unique for each message and each iteration
of a message. If a message is updated, use a new block_id.
data SlackAction Source #
All Slack Actions must have a SlackActionId and one SlackActionComponent (such as a button).
Constructors
| SlackAction SlackActionId SlackActionComponent |
Instances
data SlackConfirmObject Source #
Constructors
| SlackConfirmObject | |
Instances
| FromJSON SlackConfirmObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser SlackConfirmObject # parseJSONList :: Value -> Parser [SlackConfirmObject] # | |
| ToJSON SlackConfirmObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toJSON :: SlackConfirmObject -> Value # toEncoding :: SlackConfirmObject -> Encoding # toJSONList :: [SlackConfirmObject] -> Value # toEncodingList :: [SlackConfirmObject] -> Encoding # | |
| Eq SlackConfirmObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: SlackConfirmObject -> SlackConfirmObject -> Bool # (/=) :: SlackConfirmObject -> SlackConfirmObject -> Bool # | |
newtype SlackResponseUrl Source #
Constructors
| SlackResponseUrl | |
Fields | |
Instances
| FromJSON SlackResponseUrl Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser SlackResponseUrl # parseJSONList :: Value -> Parser [SlackResponseUrl] # | |
| ToJSON SlackResponseUrl Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toJSON :: SlackResponseUrl -> Value # toEncoding :: SlackResponseUrl -> Encoding # toJSONList :: [SlackResponseUrl] -> Value # toEncodingList :: [SlackResponseUrl] -> Encoding # | |
| Show SlackResponseUrl Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackResponseUrl -> ShowS # show :: SlackResponseUrl -> String # showList :: [SlackResponseUrl] -> ShowS # | |
| Eq SlackResponseUrl Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: SlackResponseUrl -> SlackResponseUrl -> Bool # (/=) :: SlackResponseUrl -> SlackResponseUrl -> Bool # | |
data SlackInteractivePayload Source #
Represents the data we get from a callback from Slack for interactive operations. See https://api.slack.com/interactivity/handling#payloads
Constructors
| SlackInteractivePayload | |
Fields
| |
Instances
| FromJSON SlackInteractivePayload Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser SlackInteractivePayload # parseJSONList :: Value -> Parser [SlackInteractivePayload] # | |
| Show SlackInteractivePayload Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackInteractivePayload -> ShowS # show :: SlackInteractivePayload -> String # showList :: [SlackInteractivePayload] -> ShowS # | |
data SlackActionResponse Source #
Which component and it's IDs that triggered an interactive webhook call.
Constructors
| SlackActionResponse | |
Instances
| FromJSON SlackActionResponse Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser SlackActionResponse # parseJSONList :: Value -> Parser [SlackActionResponse] # | |
| Show SlackActionResponse Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackActionResponse -> ShowS # show :: SlackActionResponse -> String # showList :: [SlackActionResponse] -> ShowS # | |
data SlackInteractiveResponseResponse Source #
Constructors
| SlackInteractiveResponseResponse | |
Fields | |
Instances
data SlackInteractiveResponse Source #
Type of message to send in response to an interactive webhook. See Slack's Handling user interaction in your Slack apps for a description of these fieldds.
Constructors
| SlackInteractiveResponse SlackMessage | Respond with a new message. |
| Ephemeral SlackMessage | Respond with a message that only the interacting user can usee. |
| ReplaceOriginal SlackMessage | Replace the original message. |
| DeleteOriginal | Delete the original message. |
Instances
| ToJSON SlackInteractiveResponse Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods toJSON :: SlackInteractiveResponse -> Value # toEncoding :: SlackInteractiveResponse -> Encoding # toJSONList :: [SlackInteractiveResponse] -> Value # | |
| Show SlackInteractiveResponse Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackInteractiveResponse -> ShowS # show :: SlackInteractiveResponse -> String # showList :: [SlackInteractiveResponse] -> ShowS # | |
newtype SlackButtonText Source #
Text to be displayed in a SlackButton.
Up to 75 characters, but may be truncated to 30 characters.
Constructors
| SlackButtonText (NonEmptyText 75) |
Instances
| FromJSON SlackButtonText Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser SlackButtonText # parseJSONList :: Value -> Parser [SlackButtonText] # | |
| IsString SlackButtonText Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods fromString :: String -> SlackButtonText # | |
| Show SlackButtonText Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackButtonText -> ShowS # show :: SlackButtonText -> String # showList :: [SlackButtonText] -> ShowS # | |
| Eq SlackButtonText Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: SlackButtonText -> SlackButtonText -> Bool # (/=) :: SlackButtonText -> SlackButtonText -> Bool # | |
| Slack SlackButtonText Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods message :: SlackButtonText -> SlackText Source # | |
data SlackActionComponent Source #
The component in a SlackAction. Do not use directly.
Use the builder functions such as button instead.
Constructors
| SlackButton | |
Fields
| |
Instances
| FromJSON SlackActionComponent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods parseJSON :: Value -> Parser SlackActionComponent # parseJSONList :: Value -> Parser [SlackActionComponent] # | |
| Show SlackActionComponent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods showsPrec :: Int -> SlackActionComponent -> ShowS # show :: SlackActionComponent -> String # showList :: [SlackActionComponent] -> ShowS # | |
| Eq SlackActionComponent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types Methods (==) :: SlackActionComponent -> SlackActionComponent -> Bool # (/=) :: SlackActionComponent -> SlackActionComponent -> Bool # | |