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