module TD.Query.SearchPublicMessagesByTag
(SearchPublicMessagesByTag(..)
, defaultSearchPublicMessagesByTag
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T
data SearchPublicMessagesByTag
= SearchPublicMessagesByTag
{ SearchPublicMessagesByTag -> Maybe Text
tag :: Maybe T.Text
, SearchPublicMessagesByTag -> Maybe Text
offset :: Maybe T.Text
, SearchPublicMessagesByTag -> Maybe Int
limit :: Maybe Int
}
deriving (SearchPublicMessagesByTag -> SearchPublicMessagesByTag -> Bool
(SearchPublicMessagesByTag -> SearchPublicMessagesByTag -> Bool)
-> (SearchPublicMessagesByTag -> SearchPublicMessagesByTag -> Bool)
-> Eq SearchPublicMessagesByTag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SearchPublicMessagesByTag -> SearchPublicMessagesByTag -> Bool
== :: SearchPublicMessagesByTag -> SearchPublicMessagesByTag -> Bool
$c/= :: SearchPublicMessagesByTag -> SearchPublicMessagesByTag -> Bool
/= :: SearchPublicMessagesByTag -> SearchPublicMessagesByTag -> Bool
Eq, Int -> SearchPublicMessagesByTag -> ShowS
[SearchPublicMessagesByTag] -> ShowS
SearchPublicMessagesByTag -> String
(Int -> SearchPublicMessagesByTag -> ShowS)
-> (SearchPublicMessagesByTag -> String)
-> ([SearchPublicMessagesByTag] -> ShowS)
-> Show SearchPublicMessagesByTag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SearchPublicMessagesByTag -> ShowS
showsPrec :: Int -> SearchPublicMessagesByTag -> ShowS
$cshow :: SearchPublicMessagesByTag -> String
show :: SearchPublicMessagesByTag -> String
$cshowList :: [SearchPublicMessagesByTag] -> ShowS
showList :: [SearchPublicMessagesByTag] -> ShowS
Show)
instance I.ShortShow SearchPublicMessagesByTag where
shortShow :: SearchPublicMessagesByTag -> String
shortShow
SearchPublicMessagesByTag
{ tag :: SearchPublicMessagesByTag -> Maybe Text
tag = Maybe Text
tag_
, offset :: SearchPublicMessagesByTag -> Maybe Text
offset = Maybe Text
offset_
, limit :: SearchPublicMessagesByTag -> Maybe Int
limit = Maybe Int
limit_
}
= String
"SearchPublicMessagesByTag"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"tag" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
tag_
, String
"offset" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
offset_
, String
"limit" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
limit_
]
instance AT.ToJSON SearchPublicMessagesByTag where
toJSON :: SearchPublicMessagesByTag -> Value
toJSON
SearchPublicMessagesByTag
{ tag :: SearchPublicMessagesByTag -> Maybe Text
tag = Maybe Text
tag_
, offset :: SearchPublicMessagesByTag -> Maybe Text
offset = Maybe Text
offset_
, limit :: SearchPublicMessagesByTag -> Maybe Int
limit = Maybe Int
limit_
}
= [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
"searchPublicMessagesByTag"
, Key
"tag" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
tag_
, Key
"offset" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
offset_
, Key
"limit" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
limit_
]
defaultSearchPublicMessagesByTag :: SearchPublicMessagesByTag
defaultSearchPublicMessagesByTag :: SearchPublicMessagesByTag
defaultSearchPublicMessagesByTag =
SearchPublicMessagesByTag
{ tag :: Maybe Text
tag = Maybe Text
forall a. Maybe a
Nothing
, offset :: Maybe Text
offset = Maybe Text
forall a. Maybe a
Nothing
, limit :: Maybe Int
limit = Maybe Int
forall a. Maybe a
Nothing
}