module TD.Query.ShareChatWithBot
(ShareChatWithBot(..)
, defaultShareChatWithBot
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data ShareChatWithBot
= ShareChatWithBot
{ ShareChatWithBot -> Maybe Int
chat_id :: Maybe Int
, ShareChatWithBot -> Maybe Int
message_id :: Maybe Int
, ShareChatWithBot -> Maybe Int
button_id :: Maybe Int
, ShareChatWithBot -> Maybe Int
shared_chat_id :: Maybe Int
, ShareChatWithBot -> Maybe Bool
only_check :: Maybe Bool
}
deriving (ShareChatWithBot -> ShareChatWithBot -> Bool
(ShareChatWithBot -> ShareChatWithBot -> Bool)
-> (ShareChatWithBot -> ShareChatWithBot -> Bool)
-> Eq ShareChatWithBot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ShareChatWithBot -> ShareChatWithBot -> Bool
== :: ShareChatWithBot -> ShareChatWithBot -> Bool
$c/= :: ShareChatWithBot -> ShareChatWithBot -> Bool
/= :: ShareChatWithBot -> ShareChatWithBot -> Bool
Eq, Int -> ShareChatWithBot -> ShowS
[ShareChatWithBot] -> ShowS
ShareChatWithBot -> String
(Int -> ShareChatWithBot -> ShowS)
-> (ShareChatWithBot -> String)
-> ([ShareChatWithBot] -> ShowS)
-> Show ShareChatWithBot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ShareChatWithBot -> ShowS
showsPrec :: Int -> ShareChatWithBot -> ShowS
$cshow :: ShareChatWithBot -> String
show :: ShareChatWithBot -> String
$cshowList :: [ShareChatWithBot] -> ShowS
showList :: [ShareChatWithBot] -> ShowS
Show)
instance I.ShortShow ShareChatWithBot where
shortShow :: ShareChatWithBot -> String
shortShow
ShareChatWithBot
{ chat_id :: ShareChatWithBot -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: ShareChatWithBot -> Maybe Int
message_id = Maybe Int
message_id_
, button_id :: ShareChatWithBot -> Maybe Int
button_id = Maybe Int
button_id_
, shared_chat_id :: ShareChatWithBot -> Maybe Int
shared_chat_id = Maybe Int
shared_chat_id_
, only_check :: ShareChatWithBot -> Maybe Bool
only_check = Maybe Bool
only_check_
}
= String
"ShareChatWithBot"
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
"button_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
button_id_
, String
"shared_chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
shared_chat_id_
, String
"only_check" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
only_check_
]
instance AT.ToJSON ShareChatWithBot where
toJSON :: ShareChatWithBot -> Value
toJSON
ShareChatWithBot
{ chat_id :: ShareChatWithBot -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: ShareChatWithBot -> Maybe Int
message_id = Maybe Int
message_id_
, button_id :: ShareChatWithBot -> Maybe Int
button_id = Maybe Int
button_id_
, shared_chat_id :: ShareChatWithBot -> Maybe Int
shared_chat_id = Maybe Int
shared_chat_id_
, only_check :: ShareChatWithBot -> Maybe Bool
only_check = Maybe Bool
only_check_
}
= [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
"shareChatWithBot"
, 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
"button_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
button_id_
, Key
"shared_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
shared_chat_id_
, Key
"only_check" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
only_check_
]
defaultShareChatWithBot :: ShareChatWithBot
defaultShareChatWithBot :: ShareChatWithBot
defaultShareChatWithBot =
ShareChatWithBot
{ 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
, button_id :: Maybe Int
button_id = Maybe Int
forall a. Maybe a
Nothing
, shared_chat_id :: Maybe Int
shared_chat_id = Maybe Int
forall a. Maybe a
Nothing
, only_check :: Maybe Bool
only_check = Maybe Bool
forall a. Maybe a
Nothing
}