module TD.Query.GetCommunityFullInfo
  (GetCommunityFullInfo(..)
  ) where

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

-- | Returns full information about a community. Returns 'TD.Data.CommunityFullInfo.CommunityFullInfo'
data GetCommunityFullInfo
  = GetCommunityFullInfo
    { GetCommunityFullInfo -> Maybe Int
community_id :: Maybe Int -- ^ Community identifier
    }
  deriving (GetCommunityFullInfo -> GetCommunityFullInfo -> Bool
(GetCommunityFullInfo -> GetCommunityFullInfo -> Bool)
-> (GetCommunityFullInfo -> GetCommunityFullInfo -> Bool)
-> Eq GetCommunityFullInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetCommunityFullInfo -> GetCommunityFullInfo -> Bool
== :: GetCommunityFullInfo -> GetCommunityFullInfo -> Bool
$c/= :: GetCommunityFullInfo -> GetCommunityFullInfo -> Bool
/= :: GetCommunityFullInfo -> GetCommunityFullInfo -> Bool
Eq, Int -> GetCommunityFullInfo -> ShowS
[GetCommunityFullInfo] -> ShowS
GetCommunityFullInfo -> String
(Int -> GetCommunityFullInfo -> ShowS)
-> (GetCommunityFullInfo -> String)
-> ([GetCommunityFullInfo] -> ShowS)
-> Show GetCommunityFullInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetCommunityFullInfo -> ShowS
showsPrec :: Int -> GetCommunityFullInfo -> ShowS
$cshow :: GetCommunityFullInfo -> String
show :: GetCommunityFullInfo -> String
$cshowList :: [GetCommunityFullInfo] -> ShowS
showList :: [GetCommunityFullInfo] -> ShowS
Show)

instance I.ShortShow GetCommunityFullInfo where
  shortShow :: GetCommunityFullInfo -> String
shortShow
    GetCommunityFullInfo
      { community_id :: GetCommunityFullInfo -> Maybe Int
community_id = Maybe Int
community_id_
      }
        = String
"GetCommunityFullInfo"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"community_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
community_id_
          ]

instance AT.ToJSON GetCommunityFullInfo where
  toJSON :: GetCommunityFullInfo -> Value
toJSON
    GetCommunityFullInfo
      { community_id :: GetCommunityFullInfo -> Maybe Int
community_id = Maybe Int
community_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
"getCommunityFullInfo"
          , Key
"community_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
community_id_
          ]