module TD.Query.ConfirmBusinessConnectedBot
  (ConfirmBusinessConnectedBot(..)
  ) where

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

-- | Confirms an unconfirmed business connection of the current user from another device. Returns 'TD.Data.Ok.Ok'
data ConfirmBusinessConnectedBot
  = ConfirmBusinessConnectedBot
    { ConfirmBusinessConnectedBot -> Maybe Int
bot_user_id :: Maybe Int -- ^ User identifier of the bot
    }
  deriving (ConfirmBusinessConnectedBot -> ConfirmBusinessConnectedBot -> Bool
(ConfirmBusinessConnectedBot
 -> ConfirmBusinessConnectedBot -> Bool)
-> (ConfirmBusinessConnectedBot
    -> ConfirmBusinessConnectedBot -> Bool)
-> Eq ConfirmBusinessConnectedBot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConfirmBusinessConnectedBot -> ConfirmBusinessConnectedBot -> Bool
== :: ConfirmBusinessConnectedBot -> ConfirmBusinessConnectedBot -> Bool
$c/= :: ConfirmBusinessConnectedBot -> ConfirmBusinessConnectedBot -> Bool
/= :: ConfirmBusinessConnectedBot -> ConfirmBusinessConnectedBot -> Bool
Eq, Int -> ConfirmBusinessConnectedBot -> ShowS
[ConfirmBusinessConnectedBot] -> ShowS
ConfirmBusinessConnectedBot -> String
(Int -> ConfirmBusinessConnectedBot -> ShowS)
-> (ConfirmBusinessConnectedBot -> String)
-> ([ConfirmBusinessConnectedBot] -> ShowS)
-> Show ConfirmBusinessConnectedBot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConfirmBusinessConnectedBot -> ShowS
showsPrec :: Int -> ConfirmBusinessConnectedBot -> ShowS
$cshow :: ConfirmBusinessConnectedBot -> String
show :: ConfirmBusinessConnectedBot -> String
$cshowList :: [ConfirmBusinessConnectedBot] -> ShowS
showList :: [ConfirmBusinessConnectedBot] -> ShowS
Show)

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