module TD.Query.GetManagedBotAccessSettings
  (GetManagedBotAccessSettings(..)
  ) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I

-- | Returns access settings of a managed bot; for bots only. Returns 'TD.Data.BotAccessSettings.BotAccessSettings'
data GetManagedBotAccessSettings
  = GetManagedBotAccessSettings
    { GetManagedBotAccessSettings -> Maybe Int
bot_user_id :: Maybe Int -- ^ Identifier of the managed bot
    }
  deriving (GetManagedBotAccessSettings -> GetManagedBotAccessSettings -> Bool
(GetManagedBotAccessSettings
 -> GetManagedBotAccessSettings -> Bool)
-> (GetManagedBotAccessSettings
    -> GetManagedBotAccessSettings -> Bool)
-> Eq GetManagedBotAccessSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetManagedBotAccessSettings -> GetManagedBotAccessSettings -> Bool
== :: GetManagedBotAccessSettings -> GetManagedBotAccessSettings -> Bool
$c/= :: GetManagedBotAccessSettings -> GetManagedBotAccessSettings -> Bool
/= :: GetManagedBotAccessSettings -> GetManagedBotAccessSettings -> Bool
Eq, Int -> GetManagedBotAccessSettings -> ShowS
[GetManagedBotAccessSettings] -> ShowS
GetManagedBotAccessSettings -> String
(Int -> GetManagedBotAccessSettings -> ShowS)
-> (GetManagedBotAccessSettings -> String)
-> ([GetManagedBotAccessSettings] -> ShowS)
-> Show GetManagedBotAccessSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetManagedBotAccessSettings -> ShowS
showsPrec :: Int -> GetManagedBotAccessSettings -> ShowS
$cshow :: GetManagedBotAccessSettings -> String
show :: GetManagedBotAccessSettings -> String
$cshowList :: [GetManagedBotAccessSettings] -> ShowS
showList :: [GetManagedBotAccessSettings] -> ShowS
Show)

instance I.ShortShow GetManagedBotAccessSettings where
  shortShow :: GetManagedBotAccessSettings -> String
shortShow
    GetManagedBotAccessSettings
      { bot_user_id :: GetManagedBotAccessSettings -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
      }
        = String
"GetManagedBotAccessSettings"
          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_
          ]

instance AT.ToJSON GetManagedBotAccessSettings where
  toJSON :: GetManagedBotAccessSettings -> Value
toJSON
    GetManagedBotAccessSettings
      { bot_user_id :: GetManagedBotAccessSettings -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
      }
        = [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
"getManagedBotAccessSettings"
          , 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_
          ]