| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Web.Slack.Experimental.Views
Contents
Description
Publishing views using the Blocks API.
This is used for App Home and modals.
https://api.slack.com/methods/views.publish
Since: 2.1.0.0
Synopsis
- data SlackView inner = SlackView {
- blocks :: Vector SlackBlock
- privateMetadata :: Maybe Text
- callbackId :: Maybe Text
- externalId :: Maybe Text
- inner :: inner
- data HomeTabView = HomeTabView {}
- data ModalView = ModalView {
- type_ :: Expected "modal"
- title :: SlackPlainTextOnly
- close :: Maybe SlackPlainTextOnly
- submit :: Maybe SlackPlainTextOnly
- submitDisabled :: Maybe Bool
- data Expected (lit :: Symbol) = Expected
- data PublishReq = PublishReq {
- userId :: UserId
- view :: SlackView HomeTabView
- data PublishResp = PublishResp {}
- type Api = "views.publish" :> (AuthProtect "token" :> (ReqBody '[FormUrlEncoded] PublishReq :> Post '[JSON] (ResponseJSON PublishResp)))
- viewsPublish :: SlackConfig -> PublishReq -> IO (Response PublishResp)
Types
View definition for some Slack surface. Has an inner type of either
ModalView or HomeTabView.
https://api.slack.com/reference/surfaces/views
Since: 2.1.0.0
Constructors
| SlackView | |
Fields
| |
Instances
data HomeTabView Source #
Since: 2.1.0.0
Constructors
| HomeTabView | |
Instances
| FromJSON HomeTabView Source # | |||||
Defined in Web.Slack.Experimental.Views | |||||
| ToJSON HomeTabView Source # | |||||
Defined in Web.Slack.Experimental.Views Methods toJSON :: HomeTabView -> Value # toEncoding :: HomeTabView -> Encoding # toJSONList :: [HomeTabView] -> Value # toEncodingList :: [HomeTabView] -> Encoding # omitField :: HomeTabView -> Bool # | |||||
| Generic HomeTabView Source # | |||||
Defined in Web.Slack.Experimental.Views Associated Types
| |||||
| Show HomeTabView Source # | |||||
Defined in Web.Slack.Experimental.Views Methods showsPrec :: Int -> HomeTabView -> ShowS # show :: HomeTabView -> String # showList :: [HomeTabView] -> ShowS # | |||||
| Eq HomeTabView Source # | |||||
Defined in Web.Slack.Experimental.Views | |||||
| type Rep HomeTabView Source # | |||||
Defined in Web.Slack.Experimental.Views type Rep HomeTabView = D1 ('MetaData "HomeTabView" "Web.Slack.Experimental.Views" "slack-web-2.2.0.0-2X4wKOtrXI0LMO4H3hWcQt" 'False) (C1 ('MetaCons "HomeTabView" 'PrefixI 'True) (S1 ('MetaSel ('Just "type_") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Expected "home")))) | |||||
Constructors
| ModalView | |
Fields
| |
Instances
| FromJSON ModalView Source # | |||||
Defined in Web.Slack.Experimental.Views | |||||
| ToJSON ModalView Source # | |||||
| Generic ModalView Source # | |||||
Defined in Web.Slack.Experimental.Views Associated Types
| |||||
| Show ModalView Source # | |||||
| Eq ModalView Source # | |||||
| type Rep ModalView Source # | |||||
Defined in Web.Slack.Experimental.Views type Rep ModalView = D1 ('MetaData "ModalView" "Web.Slack.Experimental.Views" "slack-web-2.2.0.0-2X4wKOtrXI0LMO4H3hWcQt" 'False) (C1 ('MetaCons "ModalView" 'PrefixI 'True) ((S1 ('MetaSel ('Just "type_") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Expected "modal")) :*: S1 ('MetaSel ('Just "title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SlackPlainTextOnly)) :*: (S1 ('MetaSel ('Just "close") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SlackPlainTextOnly)) :*: (S1 ('MetaSel ('Just "submit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SlackPlainTextOnly)) :*: S1 ('MetaSel ('Just "submitDisabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))))) | |||||
data Expected (lit :: Symbol) Source #
Expected a given value as a string. Useful for type fields in json.
Constructors
| Expected |
Instances
| KnownSymbol lit => FromJSON (Expected lit) Source # | |
Defined in Web.Slack.AesonUtils | |
| KnownSymbol lit => ToJSON (Expected lit) Source # | |
| KnownSymbol lit => Show (Expected lit) Source # | |
| KnownSymbol lit => Eq (Expected lit) Source # | |
Requests and responses
data PublishReq Source #
Constructors
| PublishReq | |
Fields
| |
Instances
| Show PublishReq Source # | |
Defined in Web.Slack.Experimental.Views Methods showsPrec :: Int -> PublishReq -> ShowS # show :: PublishReq -> String # showList :: [PublishReq] -> ShowS # | |
| ToForm PublishReq Source # | |
Defined in Web.Slack.Experimental.Views Methods toForm :: PublishReq -> Form # | |
data PublishResp Source #
Since: 2.1.0.0
Constructors
| PublishResp | |
Fields | |
Instances
| FromJSON PublishResp Source # | |
Defined in Web.Slack.Experimental.Views | |
| ToJSON PublishResp Source # | |
Defined in Web.Slack.Experimental.Views Methods toJSON :: PublishResp -> Value # toEncoding :: PublishResp -> Encoding # toJSONList :: [PublishResp] -> Value # toEncodingList :: [PublishResp] -> Encoding # omitField :: PublishResp -> Bool # | |
| Show PublishResp Source # | |
Defined in Web.Slack.Experimental.Views Methods showsPrec :: Int -> PublishResp -> ShowS # show :: PublishResp -> String # showList :: [PublishResp] -> ShowS # | |
type Api = "views.publish" :> (AuthProtect "token" :> (ReqBody '[FormUrlEncoded] PublishReq :> Post '[JSON] (ResponseJSON PublishResp))) Source #
Since: 2.1.0.0
viewsPublish :: SlackConfig -> PublishReq -> IO (Response PublishResp) Source #