module TD.Query.GetChatFolderInviteLinks
  (GetChatFolderInviteLinks(..)
  ) where

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

-- | Returns invite links created by the current user for a shareable chat folder. Returns 'TD.Data.ChatFolderInviteLinks.ChatFolderInviteLinks'
data GetChatFolderInviteLinks
  = GetChatFolderInviteLinks
    { GetChatFolderInviteLinks -> Maybe Int
chat_folder_id :: Maybe Int -- ^ Chat folder identifier
    }
  deriving (GetChatFolderInviteLinks -> GetChatFolderInviteLinks -> Bool
(GetChatFolderInviteLinks -> GetChatFolderInviteLinks -> Bool)
-> (GetChatFolderInviteLinks -> GetChatFolderInviteLinks -> Bool)
-> Eq GetChatFolderInviteLinks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatFolderInviteLinks -> GetChatFolderInviteLinks -> Bool
== :: GetChatFolderInviteLinks -> GetChatFolderInviteLinks -> Bool
$c/= :: GetChatFolderInviteLinks -> GetChatFolderInviteLinks -> Bool
/= :: GetChatFolderInviteLinks -> GetChatFolderInviteLinks -> Bool
Eq, Int -> GetChatFolderInviteLinks -> ShowS
[GetChatFolderInviteLinks] -> ShowS
GetChatFolderInviteLinks -> String
(Int -> GetChatFolderInviteLinks -> ShowS)
-> (GetChatFolderInviteLinks -> String)
-> ([GetChatFolderInviteLinks] -> ShowS)
-> Show GetChatFolderInviteLinks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatFolderInviteLinks -> ShowS
showsPrec :: Int -> GetChatFolderInviteLinks -> ShowS
$cshow :: GetChatFolderInviteLinks -> String
show :: GetChatFolderInviteLinks -> String
$cshowList :: [GetChatFolderInviteLinks] -> ShowS
showList :: [GetChatFolderInviteLinks] -> ShowS
Show)

instance I.ShortShow GetChatFolderInviteLinks where
  shortShow :: GetChatFolderInviteLinks -> String
shortShow
    GetChatFolderInviteLinks
      { chat_folder_id :: GetChatFolderInviteLinks -> Maybe Int
chat_folder_id = Maybe Int
chat_folder_id_
      }
        = String
"GetChatFolderInviteLinks"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"chat_folder_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_folder_id_
          ]

instance AT.ToJSON GetChatFolderInviteLinks where
  toJSON :: GetChatFolderInviteLinks -> Value
toJSON
    GetChatFolderInviteLinks
      { chat_folder_id :: GetChatFolderInviteLinks -> Maybe Int
chat_folder_id = Maybe Int
chat_folder_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
"getChatFolderInviteLinks"
          , Key
"chat_folder_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_folder_id_
          ]