module TD.Query.AddFileToDownloads
(AddFileToDownloads(..)
, defaultAddFileToDownloads
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data AddFileToDownloads
= AddFileToDownloads
{ AddFileToDownloads -> Maybe Int
file_id :: Maybe Int
, AddFileToDownloads -> Maybe Int
chat_id :: Maybe Int
, AddFileToDownloads -> Maybe Int
message_id :: Maybe Int
, AddFileToDownloads -> Maybe Int
priority :: Maybe Int
}
deriving (AddFileToDownloads -> AddFileToDownloads -> Bool
(AddFileToDownloads -> AddFileToDownloads -> Bool)
-> (AddFileToDownloads -> AddFileToDownloads -> Bool)
-> Eq AddFileToDownloads
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddFileToDownloads -> AddFileToDownloads -> Bool
== :: AddFileToDownloads -> AddFileToDownloads -> Bool
$c/= :: AddFileToDownloads -> AddFileToDownloads -> Bool
/= :: AddFileToDownloads -> AddFileToDownloads -> Bool
Eq, Int -> AddFileToDownloads -> ShowS
[AddFileToDownloads] -> ShowS
AddFileToDownloads -> String
(Int -> AddFileToDownloads -> ShowS)
-> (AddFileToDownloads -> String)
-> ([AddFileToDownloads] -> ShowS)
-> Show AddFileToDownloads
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddFileToDownloads -> ShowS
showsPrec :: Int -> AddFileToDownloads -> ShowS
$cshow :: AddFileToDownloads -> String
show :: AddFileToDownloads -> String
$cshowList :: [AddFileToDownloads] -> ShowS
showList :: [AddFileToDownloads] -> ShowS
Show)
instance I.ShortShow AddFileToDownloads where
shortShow :: AddFileToDownloads -> String
shortShow
AddFileToDownloads
{ file_id :: AddFileToDownloads -> Maybe Int
file_id = Maybe Int
file_id_
, chat_id :: AddFileToDownloads -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: AddFileToDownloads -> Maybe Int
message_id = Maybe Int
message_id_
, priority :: AddFileToDownloads -> Maybe Int
priority = Maybe Int
priority_
}
= String
"AddFileToDownloads"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"file_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
file_id_
, 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
"priority" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
priority_
]
instance AT.ToJSON AddFileToDownloads where
toJSON :: AddFileToDownloads -> Value
toJSON
AddFileToDownloads
{ file_id :: AddFileToDownloads -> Maybe Int
file_id = Maybe Int
file_id_
, chat_id :: AddFileToDownloads -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: AddFileToDownloads -> Maybe Int
message_id = Maybe Int
message_id_
, priority :: AddFileToDownloads -> Maybe Int
priority = Maybe Int
priority_
}
= [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
"addFileToDownloads"
, Key
"file_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
file_id_
, 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
"priority" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
priority_
]
defaultAddFileToDownloads :: AddFileToDownloads
defaultAddFileToDownloads :: AddFileToDownloads
defaultAddFileToDownloads =
AddFileToDownloads
{ file_id :: Maybe Int
file_id = Maybe Int
forall a. Maybe a
Nothing
, 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
, priority :: Maybe Int
priority = Maybe Int
forall a. Maybe a
Nothing
}