module TD.Query.GetChatBoostLink
  (GetChatBoostLink(..)
  ) where

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

-- | Returns an HTTPS link to boost the specified supergroup or channel chat. Returns 'TD.Data.ChatBoostLink.ChatBoostLink'
data GetChatBoostLink
  = GetChatBoostLink
    { GetChatBoostLink -> Maybe Int
chat_id :: Maybe Int -- ^ Identifier of the chat
    }
  deriving (GetChatBoostLink -> GetChatBoostLink -> Bool
(GetChatBoostLink -> GetChatBoostLink -> Bool)
-> (GetChatBoostLink -> GetChatBoostLink -> Bool)
-> Eq GetChatBoostLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatBoostLink -> GetChatBoostLink -> Bool
== :: GetChatBoostLink -> GetChatBoostLink -> Bool
$c/= :: GetChatBoostLink -> GetChatBoostLink -> Bool
/= :: GetChatBoostLink -> GetChatBoostLink -> Bool
Eq, Int -> GetChatBoostLink -> ShowS
[GetChatBoostLink] -> ShowS
GetChatBoostLink -> String
(Int -> GetChatBoostLink -> ShowS)
-> (GetChatBoostLink -> String)
-> ([GetChatBoostLink] -> ShowS)
-> Show GetChatBoostLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatBoostLink -> ShowS
showsPrec :: Int -> GetChatBoostLink -> ShowS
$cshow :: GetChatBoostLink -> String
show :: GetChatBoostLink -> String
$cshowList :: [GetChatBoostLink] -> ShowS
showList :: [GetChatBoostLink] -> ShowS
Show)

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