module TD.Query.GetBusinessChatLinkInfo
  (GetBusinessChatLinkInfo(..)
  ) where

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

-- | Returns information about a business chat link. Returns 'TD.Data.BusinessChatLinkInfo.BusinessChatLinkInfo'
data GetBusinessChatLinkInfo
  = GetBusinessChatLinkInfo
    { GetBusinessChatLinkInfo -> Maybe Text
link_name :: Maybe T.Text -- ^ Name of the link
    }
  deriving (GetBusinessChatLinkInfo -> GetBusinessChatLinkInfo -> Bool
(GetBusinessChatLinkInfo -> GetBusinessChatLinkInfo -> Bool)
-> (GetBusinessChatLinkInfo -> GetBusinessChatLinkInfo -> Bool)
-> Eq GetBusinessChatLinkInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetBusinessChatLinkInfo -> GetBusinessChatLinkInfo -> Bool
== :: GetBusinessChatLinkInfo -> GetBusinessChatLinkInfo -> Bool
$c/= :: GetBusinessChatLinkInfo -> GetBusinessChatLinkInfo -> Bool
/= :: GetBusinessChatLinkInfo -> GetBusinessChatLinkInfo -> Bool
Eq, Int -> GetBusinessChatLinkInfo -> ShowS
[GetBusinessChatLinkInfo] -> ShowS
GetBusinessChatLinkInfo -> String
(Int -> GetBusinessChatLinkInfo -> ShowS)
-> (GetBusinessChatLinkInfo -> String)
-> ([GetBusinessChatLinkInfo] -> ShowS)
-> Show GetBusinessChatLinkInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetBusinessChatLinkInfo -> ShowS
showsPrec :: Int -> GetBusinessChatLinkInfo -> ShowS
$cshow :: GetBusinessChatLinkInfo -> String
show :: GetBusinessChatLinkInfo -> String
$cshowList :: [GetBusinessChatLinkInfo] -> ShowS
showList :: [GetBusinessChatLinkInfo] -> ShowS
Show)

instance I.ShortShow GetBusinessChatLinkInfo where
  shortShow :: GetBusinessChatLinkInfo -> String
shortShow
    GetBusinessChatLinkInfo
      { link_name :: GetBusinessChatLinkInfo -> Maybe Text
link_name = Maybe Text
link_name_
      }
        = String
"GetBusinessChatLinkInfo"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"link_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
link_name_
          ]

instance AT.ToJSON GetBusinessChatLinkInfo where
  toJSON :: GetBusinessChatLinkInfo -> Value
toJSON
    GetBusinessChatLinkInfo
      { link_name :: GetBusinessChatLinkInfo -> Maybe Text
link_name = Maybe Text
link_name_
      }
        = [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
"getBusinessChatLinkInfo"
          , Key
"link_name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
link_name_
          ]