module TD.Query.SearchPublicStoriesByTag
(SearchPublicStoriesByTag(..)
, defaultSearchPublicStoriesByTag
) 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 SearchPublicStoriesByTag
= SearchPublicStoriesByTag
{ SearchPublicStoriesByTag -> Maybe Int
story_sender_chat_id :: Maybe Int
, SearchPublicStoriesByTag -> Maybe Text
tag :: Maybe T.Text
, SearchPublicStoriesByTag -> Maybe Text
offset :: Maybe T.Text
, SearchPublicStoriesByTag -> Maybe Int
limit :: Maybe Int
}
deriving (SearchPublicStoriesByTag -> SearchPublicStoriesByTag -> Bool
(SearchPublicStoriesByTag -> SearchPublicStoriesByTag -> Bool)
-> (SearchPublicStoriesByTag -> SearchPublicStoriesByTag -> Bool)
-> Eq SearchPublicStoriesByTag
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SearchPublicStoriesByTag -> SearchPublicStoriesByTag -> Bool
== :: SearchPublicStoriesByTag -> SearchPublicStoriesByTag -> Bool
$c/= :: SearchPublicStoriesByTag -> SearchPublicStoriesByTag -> Bool
/= :: SearchPublicStoriesByTag -> SearchPublicStoriesByTag -> Bool
Eq, Int -> SearchPublicStoriesByTag -> ShowS
[SearchPublicStoriesByTag] -> ShowS
SearchPublicStoriesByTag -> String
(Int -> SearchPublicStoriesByTag -> ShowS)
-> (SearchPublicStoriesByTag -> String)
-> ([SearchPublicStoriesByTag] -> ShowS)
-> Show SearchPublicStoriesByTag
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SearchPublicStoriesByTag -> ShowS
showsPrec :: Int -> SearchPublicStoriesByTag -> ShowS
$cshow :: SearchPublicStoriesByTag -> String
show :: SearchPublicStoriesByTag -> String
$cshowList :: [SearchPublicStoriesByTag] -> ShowS
showList :: [SearchPublicStoriesByTag] -> ShowS
Show)
instance I.ShortShow SearchPublicStoriesByTag where
shortShow :: SearchPublicStoriesByTag -> String
shortShow
SearchPublicStoriesByTag
{ story_sender_chat_id :: SearchPublicStoriesByTag -> Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
, tag :: SearchPublicStoriesByTag -> Maybe Text
tag = Maybe Text
tag_
, offset :: SearchPublicStoriesByTag -> Maybe Text
offset = Maybe Text
offset_
, limit :: SearchPublicStoriesByTag -> Maybe Int
limit = Maybe Int
limit_
}
= String
"SearchPublicStoriesByTag"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"story_sender_chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_sender_chat_id_
, 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 SearchPublicStoriesByTag where
toJSON :: SearchPublicStoriesByTag -> Value
toJSON
SearchPublicStoriesByTag
{ story_sender_chat_id :: SearchPublicStoriesByTag -> Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
, tag :: SearchPublicStoriesByTag -> Maybe Text
tag = Maybe Text
tag_
, offset :: SearchPublicStoriesByTag -> Maybe Text
offset = Maybe Text
offset_
, limit :: SearchPublicStoriesByTag -> 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
"searchPublicStoriesByTag"
, Key
"story_sender_chat_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
story_sender_chat_id_
, 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_
]
defaultSearchPublicStoriesByTag :: SearchPublicStoriesByTag
defaultSearchPublicStoriesByTag :: SearchPublicStoriesByTag
defaultSearchPublicStoriesByTag =
SearchPublicStoriesByTag
{ story_sender_chat_id :: Maybe Int
story_sender_chat_id = Maybe Int
forall a. Maybe a
Nothing
, 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
}