module TD.Query.RemoveBusinessConnectedBotFromChat
  (RemoveBusinessConnectedBotFromChat(..)
  ) where

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

-- | Removes the connected business bot from a specific chat by adding the chat to businessRecipients.excluded_chat_ids. Returns 'TD.Data.Ok.Ok'
data RemoveBusinessConnectedBotFromChat
  = RemoveBusinessConnectedBotFromChat
    { RemoveBusinessConnectedBotFromChat -> Maybe Int
chat_id :: Maybe Int -- ^ Chat identifier
    }
  deriving (RemoveBusinessConnectedBotFromChat
-> RemoveBusinessConnectedBotFromChat -> Bool
(RemoveBusinessConnectedBotFromChat
 -> RemoveBusinessConnectedBotFromChat -> Bool)
-> (RemoveBusinessConnectedBotFromChat
    -> RemoveBusinessConnectedBotFromChat -> Bool)
-> Eq RemoveBusinessConnectedBotFromChat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RemoveBusinessConnectedBotFromChat
-> RemoveBusinessConnectedBotFromChat -> Bool
== :: RemoveBusinessConnectedBotFromChat
-> RemoveBusinessConnectedBotFromChat -> Bool
$c/= :: RemoveBusinessConnectedBotFromChat
-> RemoveBusinessConnectedBotFromChat -> Bool
/= :: RemoveBusinessConnectedBotFromChat
-> RemoveBusinessConnectedBotFromChat -> Bool
Eq, Int -> RemoveBusinessConnectedBotFromChat -> ShowS
[RemoveBusinessConnectedBotFromChat] -> ShowS
RemoveBusinessConnectedBotFromChat -> String
(Int -> RemoveBusinessConnectedBotFromChat -> ShowS)
-> (RemoveBusinessConnectedBotFromChat -> String)
-> ([RemoveBusinessConnectedBotFromChat] -> ShowS)
-> Show RemoveBusinessConnectedBotFromChat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RemoveBusinessConnectedBotFromChat -> ShowS
showsPrec :: Int -> RemoveBusinessConnectedBotFromChat -> ShowS
$cshow :: RemoveBusinessConnectedBotFromChat -> String
show :: RemoveBusinessConnectedBotFromChat -> String
$cshowList :: [RemoveBusinessConnectedBotFromChat] -> ShowS
showList :: [RemoveBusinessConnectedBotFromChat] -> ShowS
Show)

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