module TD.Query.GetBotSimilarBots
  (GetBotSimilarBots(..)
  ) where

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

-- | Returns a list of bots similar to the given bot. Returns 'TD.Data.Users.Users'
data GetBotSimilarBots
  = GetBotSimilarBots
    { GetBotSimilarBots -> Maybe Int
bot_user_id :: Maybe Int -- ^ User identifier of the target bot
    }
  deriving (GetBotSimilarBots -> GetBotSimilarBots -> Bool
(GetBotSimilarBots -> GetBotSimilarBots -> Bool)
-> (GetBotSimilarBots -> GetBotSimilarBots -> Bool)
-> Eq GetBotSimilarBots
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetBotSimilarBots -> GetBotSimilarBots -> Bool
== :: GetBotSimilarBots -> GetBotSimilarBots -> Bool
$c/= :: GetBotSimilarBots -> GetBotSimilarBots -> Bool
/= :: GetBotSimilarBots -> GetBotSimilarBots -> Bool
Eq, Int -> GetBotSimilarBots -> ShowS
[GetBotSimilarBots] -> ShowS
GetBotSimilarBots -> String
(Int -> GetBotSimilarBots -> ShowS)
-> (GetBotSimilarBots -> String)
-> ([GetBotSimilarBots] -> ShowS)
-> Show GetBotSimilarBots
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetBotSimilarBots -> ShowS
showsPrec :: Int -> GetBotSimilarBots -> ShowS
$cshow :: GetBotSimilarBots -> String
show :: GetBotSimilarBots -> String
$cshowList :: [GetBotSimilarBots] -> ShowS
showList :: [GetBotSimilarBots] -> ShowS
Show)

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