module TD.Query.ToggleBotIsAddedToAttachmentMenu
(ToggleBotIsAddedToAttachmentMenu(..)
, defaultToggleBotIsAddedToAttachmentMenu
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data
=
{ ToggleBotIsAddedToAttachmentMenu -> Maybe Int
bot_user_id :: Maybe Int
, ToggleBotIsAddedToAttachmentMenu -> Maybe Bool
is_added :: Maybe Bool
, ToggleBotIsAddedToAttachmentMenu -> Maybe Bool
allow_write_access :: Maybe Bool
}
deriving (ToggleBotIsAddedToAttachmentMenu
-> ToggleBotIsAddedToAttachmentMenu -> Bool
(ToggleBotIsAddedToAttachmentMenu
-> ToggleBotIsAddedToAttachmentMenu -> Bool)
-> (ToggleBotIsAddedToAttachmentMenu
-> ToggleBotIsAddedToAttachmentMenu -> Bool)
-> Eq ToggleBotIsAddedToAttachmentMenu
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToggleBotIsAddedToAttachmentMenu
-> ToggleBotIsAddedToAttachmentMenu -> Bool
== :: ToggleBotIsAddedToAttachmentMenu
-> ToggleBotIsAddedToAttachmentMenu -> Bool
$c/= :: ToggleBotIsAddedToAttachmentMenu
-> ToggleBotIsAddedToAttachmentMenu -> Bool
/= :: ToggleBotIsAddedToAttachmentMenu
-> ToggleBotIsAddedToAttachmentMenu -> Bool
Eq, Int -> ToggleBotIsAddedToAttachmentMenu -> ShowS
[ToggleBotIsAddedToAttachmentMenu] -> ShowS
ToggleBotIsAddedToAttachmentMenu -> String
(Int -> ToggleBotIsAddedToAttachmentMenu -> ShowS)
-> (ToggleBotIsAddedToAttachmentMenu -> String)
-> ([ToggleBotIsAddedToAttachmentMenu] -> ShowS)
-> Show ToggleBotIsAddedToAttachmentMenu
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ToggleBotIsAddedToAttachmentMenu -> ShowS
showsPrec :: Int -> ToggleBotIsAddedToAttachmentMenu -> ShowS
$cshow :: ToggleBotIsAddedToAttachmentMenu -> String
show :: ToggleBotIsAddedToAttachmentMenu -> String
$cshowList :: [ToggleBotIsAddedToAttachmentMenu] -> ShowS
showList :: [ToggleBotIsAddedToAttachmentMenu] -> ShowS
Show)
instance I.ShortShow ToggleBotIsAddedToAttachmentMenu where
shortShow :: ToggleBotIsAddedToAttachmentMenu -> String
shortShow
ToggleBotIsAddedToAttachmentMenu
{ bot_user_id :: ToggleBotIsAddedToAttachmentMenu -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, is_added :: ToggleBotIsAddedToAttachmentMenu -> Maybe Bool
is_added = Maybe Bool
is_added_
, allow_write_access :: ToggleBotIsAddedToAttachmentMenu -> Maybe Bool
allow_write_access = Maybe Bool
allow_write_access_
}
= String
"ToggleBotIsAddedToAttachmentMenu"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
bot_user_id_
, String
"is_added" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_added_
, String
"allow_write_access" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
allow_write_access_
]
instance AT.ToJSON ToggleBotIsAddedToAttachmentMenu where
toJSON :: ToggleBotIsAddedToAttachmentMenu -> Value
toJSON
ToggleBotIsAddedToAttachmentMenu
{ bot_user_id :: ToggleBotIsAddedToAttachmentMenu -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, is_added :: ToggleBotIsAddedToAttachmentMenu -> Maybe Bool
is_added = Maybe Bool
is_added_
, allow_write_access :: ToggleBotIsAddedToAttachmentMenu -> Maybe Bool
allow_write_access = Maybe Bool
allow_write_access_
}
= [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
"toggleBotIsAddedToAttachmentMenu"
, Key
"bot_user_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
bot_user_id_
, Key
"is_added" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_added_
, Key
"allow_write_access" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
allow_write_access_
]
defaultToggleBotIsAddedToAttachmentMenu :: ToggleBotIsAddedToAttachmentMenu
=
ToggleBotIsAddedToAttachmentMenu
{ bot_user_id :: Maybe Int
bot_user_id = Maybe Int
forall a. Maybe a
Nothing
, is_added :: Maybe Bool
is_added = Maybe Bool
forall a. Maybe a
Nothing
, allow_write_access :: Maybe Bool
allow_write_access = Maybe Bool
forall a. Maybe a
Nothing
}