module TD.Query.GetMessagePublicForwards
(GetMessagePublicForwards(..)
, defaultGetMessagePublicForwards
) 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 GetMessagePublicForwards
= GetMessagePublicForwards
{ GetMessagePublicForwards -> Maybe Int
chat_id :: Maybe Int
, GetMessagePublicForwards -> Maybe Int
message_id :: Maybe Int
, GetMessagePublicForwards -> Maybe Text
offset :: Maybe T.Text
, GetMessagePublicForwards -> Maybe Int
limit :: Maybe Int
}
deriving (GetMessagePublicForwards -> GetMessagePublicForwards -> Bool
(GetMessagePublicForwards -> GetMessagePublicForwards -> Bool)
-> (GetMessagePublicForwards -> GetMessagePublicForwards -> Bool)
-> Eq GetMessagePublicForwards
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetMessagePublicForwards -> GetMessagePublicForwards -> Bool
== :: GetMessagePublicForwards -> GetMessagePublicForwards -> Bool
$c/= :: GetMessagePublicForwards -> GetMessagePublicForwards -> Bool
/= :: GetMessagePublicForwards -> GetMessagePublicForwards -> Bool
Eq, Int -> GetMessagePublicForwards -> ShowS
[GetMessagePublicForwards] -> ShowS
GetMessagePublicForwards -> String
(Int -> GetMessagePublicForwards -> ShowS)
-> (GetMessagePublicForwards -> String)
-> ([GetMessagePublicForwards] -> ShowS)
-> Show GetMessagePublicForwards
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetMessagePublicForwards -> ShowS
showsPrec :: Int -> GetMessagePublicForwards -> ShowS
$cshow :: GetMessagePublicForwards -> String
show :: GetMessagePublicForwards -> String
$cshowList :: [GetMessagePublicForwards] -> ShowS
showList :: [GetMessagePublicForwards] -> ShowS
Show)
instance I.ShortShow GetMessagePublicForwards where
shortShow :: GetMessagePublicForwards -> String
shortShow
GetMessagePublicForwards
{ chat_id :: GetMessagePublicForwards -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: GetMessagePublicForwards -> Maybe Int
message_id = Maybe Int
message_id_
, offset :: GetMessagePublicForwards -> Maybe Text
offset = Maybe Text
offset_
, limit :: GetMessagePublicForwards -> Maybe Int
limit = Maybe Int
limit_
}
= String
"GetMessagePublicForwards"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_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 GetMessagePublicForwards where
toJSON :: GetMessagePublicForwards -> Value
toJSON
GetMessagePublicForwards
{ chat_id :: GetMessagePublicForwards -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: GetMessagePublicForwards -> Maybe Int
message_id = Maybe Int
message_id_
, offset :: GetMessagePublicForwards -> Maybe Text
offset = Maybe Text
offset_
, limit :: GetMessagePublicForwards -> 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
"getMessagePublicForwards"
, Key
"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
chat_id_
, Key
"message_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
message_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_
]
defaultGetMessagePublicForwards :: GetMessagePublicForwards
defaultGetMessagePublicForwards :: GetMessagePublicForwards
defaultGetMessagePublicForwards =
GetMessagePublicForwards
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, message_id :: Maybe Int
message_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
}