module TD.Query.GetStoryPublicForwards
(GetStoryPublicForwards(..)
, defaultGetStoryPublicForwards
) 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 GetStoryPublicForwards
= GetStoryPublicForwards
{ GetStoryPublicForwards -> Maybe Int
story_sender_chat_id :: Maybe Int
, GetStoryPublicForwards -> Maybe Int
story_id :: Maybe Int
, GetStoryPublicForwards -> Maybe Text
offset :: Maybe T.Text
, GetStoryPublicForwards -> Maybe Int
limit :: Maybe Int
}
deriving (GetStoryPublicForwards -> GetStoryPublicForwards -> Bool
(GetStoryPublicForwards -> GetStoryPublicForwards -> Bool)
-> (GetStoryPublicForwards -> GetStoryPublicForwards -> Bool)
-> Eq GetStoryPublicForwards
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetStoryPublicForwards -> GetStoryPublicForwards -> Bool
== :: GetStoryPublicForwards -> GetStoryPublicForwards -> Bool
$c/= :: GetStoryPublicForwards -> GetStoryPublicForwards -> Bool
/= :: GetStoryPublicForwards -> GetStoryPublicForwards -> Bool
Eq, Int -> GetStoryPublicForwards -> ShowS
[GetStoryPublicForwards] -> ShowS
GetStoryPublicForwards -> String
(Int -> GetStoryPublicForwards -> ShowS)
-> (GetStoryPublicForwards -> String)
-> ([GetStoryPublicForwards] -> ShowS)
-> Show GetStoryPublicForwards
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetStoryPublicForwards -> ShowS
showsPrec :: Int -> GetStoryPublicForwards -> ShowS
$cshow :: GetStoryPublicForwards -> String
show :: GetStoryPublicForwards -> String
$cshowList :: [GetStoryPublicForwards] -> ShowS
showList :: [GetStoryPublicForwards] -> ShowS
Show)
instance I.ShortShow GetStoryPublicForwards where
shortShow :: GetStoryPublicForwards -> String
shortShow
GetStoryPublicForwards
{ story_sender_chat_id :: GetStoryPublicForwards -> Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
, story_id :: GetStoryPublicForwards -> Maybe Int
story_id = Maybe Int
story_id_
, offset :: GetStoryPublicForwards -> Maybe Text
offset = Maybe Text
offset_
, limit :: GetStoryPublicForwards -> Maybe Int
limit = Maybe Int
limit_
}
= String
"GetStoryPublicForwards"
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
"story_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_id_
, 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 GetStoryPublicForwards where
toJSON :: GetStoryPublicForwards -> Value
toJSON
GetStoryPublicForwards
{ story_sender_chat_id :: GetStoryPublicForwards -> Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
, story_id :: GetStoryPublicForwards -> Maybe Int
story_id = Maybe Int
story_id_
, offset :: GetStoryPublicForwards -> Maybe Text
offset = Maybe Text
offset_
, limit :: GetStoryPublicForwards -> 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
"getStoryPublicForwards"
, 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
"story_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_id_
, 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_
]
defaultGetStoryPublicForwards :: GetStoryPublicForwards
defaultGetStoryPublicForwards :: GetStoryPublicForwards
defaultGetStoryPublicForwards =
GetStoryPublicForwards
{ story_sender_chat_id :: Maybe Int
story_sender_chat_id = Maybe Int
forall a. Maybe a
Nothing
, story_id :: Maybe Int
story_id = Maybe Int
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
}