module TD.Query.ToggleChatIsTranslatable
(ToggleChatIsTranslatable(..)
, defaultToggleChatIsTranslatable
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data ToggleChatIsTranslatable
= ToggleChatIsTranslatable
{ ToggleChatIsTranslatable -> Maybe Int
chat_id :: Maybe Int
, ToggleChatIsTranslatable -> Maybe Bool
is_translatable :: Maybe Bool
}
deriving (ToggleChatIsTranslatable -> ToggleChatIsTranslatable -> Bool
(ToggleChatIsTranslatable -> ToggleChatIsTranslatable -> Bool)
-> (ToggleChatIsTranslatable -> ToggleChatIsTranslatable -> Bool)
-> Eq ToggleChatIsTranslatable
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToggleChatIsTranslatable -> ToggleChatIsTranslatable -> Bool
== :: ToggleChatIsTranslatable -> ToggleChatIsTranslatable -> Bool
$c/= :: ToggleChatIsTranslatable -> ToggleChatIsTranslatable -> Bool
/= :: ToggleChatIsTranslatable -> ToggleChatIsTranslatable -> Bool
Eq, Int -> ToggleChatIsTranslatable -> ShowS
[ToggleChatIsTranslatable] -> ShowS
ToggleChatIsTranslatable -> String
(Int -> ToggleChatIsTranslatable -> ShowS)
-> (ToggleChatIsTranslatable -> String)
-> ([ToggleChatIsTranslatable] -> ShowS)
-> Show ToggleChatIsTranslatable
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ToggleChatIsTranslatable -> ShowS
showsPrec :: Int -> ToggleChatIsTranslatable -> ShowS
$cshow :: ToggleChatIsTranslatable -> String
show :: ToggleChatIsTranslatable -> String
$cshowList :: [ToggleChatIsTranslatable] -> ShowS
showList :: [ToggleChatIsTranslatable] -> ShowS
Show)
instance I.ShortShow ToggleChatIsTranslatable where
shortShow :: ToggleChatIsTranslatable -> String
shortShow
ToggleChatIsTranslatable
{ chat_id :: ToggleChatIsTranslatable -> Maybe Int
chat_id = Maybe Int
chat_id_
, is_translatable :: ToggleChatIsTranslatable -> Maybe Bool
is_translatable = Maybe Bool
is_translatable_
}
= String
"ToggleChatIsTranslatable"
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
"is_translatable" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_translatable_
]
instance AT.ToJSON ToggleChatIsTranslatable where
toJSON :: ToggleChatIsTranslatable -> Value
toJSON
ToggleChatIsTranslatable
{ chat_id :: ToggleChatIsTranslatable -> Maybe Int
chat_id = Maybe Int
chat_id_
, is_translatable :: ToggleChatIsTranslatable -> Maybe Bool
is_translatable = Maybe Bool
is_translatable_
}
= [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
"toggleChatIsTranslatable"
, 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
"is_translatable" 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_translatable_
]
defaultToggleChatIsTranslatable :: ToggleChatIsTranslatable
defaultToggleChatIsTranslatable :: ToggleChatIsTranslatable
defaultToggleChatIsTranslatable =
ToggleChatIsTranslatable
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, is_translatable :: Maybe Bool
is_translatable = Maybe Bool
forall a. Maybe a
Nothing
}