{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Test.Sandwich.Formatters.Internal.Types where
import qualified Data.Aeson as A
import qualified Data.Text as T
newtype SlackConfig = SlackConfig { SlackConfig -> Text
slackApiToken :: T.Text
} deriving (Int -> SlackConfig -> ShowS
[SlackConfig] -> ShowS
SlackConfig -> String
(Int -> SlackConfig -> ShowS)
-> (SlackConfig -> String)
-> ([SlackConfig] -> ShowS)
-> Show SlackConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlackConfig] -> ShowS
$cshowList :: [SlackConfig] -> ShowS
show :: SlackConfig -> String
$cshow :: SlackConfig -> String
showsPrec :: Int -> SlackConfig -> ShowS
$cshowsPrec :: Int -> SlackConfig -> ShowS
Show)
data ProgressBarInfo = ProgressBarInfo { ProgressBarInfo -> Maybe Text
progressBarInfoTopMessage :: Maybe T.Text
, ProgressBarInfo -> Maybe Text
progressBarInfoBottomMessage :: Maybe T.Text
, ProgressBarInfo -> Maybe Double
progressBarInfoSize :: Maybe Double
, ProgressBarInfo -> Maybe [ProgressBarAttachment]
progressBarInfoAttachments :: Maybe [ProgressBarAttachment]
, ProgressBarInfo -> Maybe [Value]
progressBarInfoBlocks :: Maybe [A.Value]
}
data ProgressBarAttachment = ProgressBarAttachment { ProgressBarAttachment -> Text
progressBarAttachmentText :: T.Text
, ProgressBarAttachment -> Text
progressBarAttachmentColor :: T.Text
}
instance A.ToJSON ProgressBarAttachment
where toJSON :: ProgressBarAttachment -> Value
toJSON (ProgressBarAttachment {Text
progressBarAttachmentColor :: Text
progressBarAttachmentText :: Text
progressBarAttachmentColor :: ProgressBarAttachment -> Text
progressBarAttachmentText :: ProgressBarAttachment -> Text
..}) = [Pair] -> Value
A.object [(Text
"text", Text -> Value
A.String Text
progressBarAttachmentText)
, (Text
"color", Text -> Value
A.String Text
progressBarAttachmentColor)]
data ProgressBar = ProgressBar { ProgressBar -> Text
progressBarTs :: T.Text
, ProgressBar -> Text
progressBarChannel :: T.Text }
data SlackFormatterShowCallStacks =
SlackFormatterNoCallStacks
| SlackFormatterTopNCallStackFrames Int
| SlackFormatterFullCallStack
type ChannelName = T.Text