module TD.Query.GetChatBoostStatus
  (GetChatBoostStatus(..)
  ) where

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

-- | Returns the current boost status for a supergroup or a channel chat. Returns 'TD.Data.ChatBoostStatus.ChatBoostStatus'
data GetChatBoostStatus
  = GetChatBoostStatus
    { GetChatBoostStatus -> Maybe Int
chat_id :: Maybe Int -- ^ Identifier of the chat
    }
  deriving (GetChatBoostStatus -> GetChatBoostStatus -> Bool
(GetChatBoostStatus -> GetChatBoostStatus -> Bool)
-> (GetChatBoostStatus -> GetChatBoostStatus -> Bool)
-> Eq GetChatBoostStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatBoostStatus -> GetChatBoostStatus -> Bool
== :: GetChatBoostStatus -> GetChatBoostStatus -> Bool
$c/= :: GetChatBoostStatus -> GetChatBoostStatus -> Bool
/= :: GetChatBoostStatus -> GetChatBoostStatus -> Bool
Eq, Int -> GetChatBoostStatus -> ShowS
[GetChatBoostStatus] -> ShowS
GetChatBoostStatus -> String
(Int -> GetChatBoostStatus -> ShowS)
-> (GetChatBoostStatus -> String)
-> ([GetChatBoostStatus] -> ShowS)
-> Show GetChatBoostStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatBoostStatus -> ShowS
showsPrec :: Int -> GetChatBoostStatus -> ShowS
$cshow :: GetChatBoostStatus -> String
show :: GetChatBoostStatus -> String
$cshowList :: [GetChatBoostStatus] -> ShowS
showList :: [GetChatBoostStatus] -> ShowS
Show)

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

instance AT.ToJSON GetChatBoostStatus where
  toJSON :: GetChatBoostStatus -> Value
toJSON
    GetChatBoostStatus
      { chat_id :: GetChatBoostStatus -> Maybe Int
chat_id = Maybe Int
chat_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
"getChatBoostStatus"
          , 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_
          ]