module TD.Query.RemoveChatActionBar
  (RemoveChatActionBar(..)
  ) where

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

-- | Removes a chat action bar without any other action. Returns 'TD.Data.Ok.Ok'
data RemoveChatActionBar
  = RemoveChatActionBar
    { RemoveChatActionBar -> Maybe Int
chat_id :: Maybe Int -- ^ Chat identifier
    }
  deriving (RemoveChatActionBar -> RemoveChatActionBar -> Bool
(RemoveChatActionBar -> RemoveChatActionBar -> Bool)
-> (RemoveChatActionBar -> RemoveChatActionBar -> Bool)
-> Eq RemoveChatActionBar
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RemoveChatActionBar -> RemoveChatActionBar -> Bool
== :: RemoveChatActionBar -> RemoveChatActionBar -> Bool
$c/= :: RemoveChatActionBar -> RemoveChatActionBar -> Bool
/= :: RemoveChatActionBar -> RemoveChatActionBar -> Bool
Eq, Int -> RemoveChatActionBar -> ShowS
[RemoveChatActionBar] -> ShowS
RemoveChatActionBar -> String
(Int -> RemoveChatActionBar -> ShowS)
-> (RemoveChatActionBar -> String)
-> ([RemoveChatActionBar] -> ShowS)
-> Show RemoveChatActionBar
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RemoveChatActionBar -> ShowS
showsPrec :: Int -> RemoveChatActionBar -> ShowS
$cshow :: RemoveChatActionBar -> String
show :: RemoveChatActionBar -> String
$cshowList :: [RemoveChatActionBar] -> ShowS
showList :: [RemoveChatActionBar] -> ShowS
Show)

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