module TD.Query.SetSavedMessagesTagLabel
(SetSavedMessagesTagLabel(..)
, defaultSetSavedMessagesTagLabel
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.ReactionType as ReactionType
import qualified Data.Text as T
data SetSavedMessagesTagLabel
= SetSavedMessagesTagLabel
{ SetSavedMessagesTagLabel -> Maybe ReactionType
tag :: Maybe ReactionType.ReactionType
, SetSavedMessagesTagLabel -> Maybe Text
label :: Maybe T.Text
}
deriving (SetSavedMessagesTagLabel -> SetSavedMessagesTagLabel -> Bool
(SetSavedMessagesTagLabel -> SetSavedMessagesTagLabel -> Bool)
-> (SetSavedMessagesTagLabel -> SetSavedMessagesTagLabel -> Bool)
-> Eq SetSavedMessagesTagLabel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetSavedMessagesTagLabel -> SetSavedMessagesTagLabel -> Bool
== :: SetSavedMessagesTagLabel -> SetSavedMessagesTagLabel -> Bool
$c/= :: SetSavedMessagesTagLabel -> SetSavedMessagesTagLabel -> Bool
/= :: SetSavedMessagesTagLabel -> SetSavedMessagesTagLabel -> Bool
Eq, Int -> SetSavedMessagesTagLabel -> ShowS
[SetSavedMessagesTagLabel] -> ShowS
SetSavedMessagesTagLabel -> String
(Int -> SetSavedMessagesTagLabel -> ShowS)
-> (SetSavedMessagesTagLabel -> String)
-> ([SetSavedMessagesTagLabel] -> ShowS)
-> Show SetSavedMessagesTagLabel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetSavedMessagesTagLabel -> ShowS
showsPrec :: Int -> SetSavedMessagesTagLabel -> ShowS
$cshow :: SetSavedMessagesTagLabel -> String
show :: SetSavedMessagesTagLabel -> String
$cshowList :: [SetSavedMessagesTagLabel] -> ShowS
showList :: [SetSavedMessagesTagLabel] -> ShowS
Show)
instance I.ShortShow SetSavedMessagesTagLabel where
shortShow :: SetSavedMessagesTagLabel -> String
shortShow
SetSavedMessagesTagLabel
{ tag :: SetSavedMessagesTagLabel -> Maybe ReactionType
tag = Maybe ReactionType
tag_
, label :: SetSavedMessagesTagLabel -> Maybe Text
label = Maybe Text
label_
}
= String
"SetSavedMessagesTagLabel"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"tag" String -> Maybe ReactionType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ReactionType
tag_
, String
"label" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
label_
]
instance AT.ToJSON SetSavedMessagesTagLabel where
toJSON :: SetSavedMessagesTagLabel -> Value
toJSON
SetSavedMessagesTagLabel
{ tag :: SetSavedMessagesTagLabel -> Maybe ReactionType
tag = Maybe ReactionType
tag_
, label :: SetSavedMessagesTagLabel -> Maybe Text
label = Maybe Text
label_
}
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"setSavedMessagesTagLabel"
, Key
"tag" Key -> Maybe ReactionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe ReactionType
tag_
, Key
"label" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
label_
]
defaultSetSavedMessagesTagLabel :: SetSavedMessagesTagLabel
defaultSetSavedMessagesTagLabel :: SetSavedMessagesTagLabel
defaultSetSavedMessagesTagLabel =
SetSavedMessagesTagLabel
{ tag :: Maybe ReactionType
tag = Maybe ReactionType
forall a. Maybe a
Nothing
, label :: Maybe Text
label = Maybe Text
forall a. Maybe a
Nothing
}