module TD.Query.GetGiftChatThemes
  (GetGiftChatThemes(..)
  , defaultGetGiftChatThemes
  ) 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 available to the current user gift chat themes. Returns 'TD.Data.GiftChatThemes.GiftChatThemes'
data GetGiftChatThemes
  = GetGiftChatThemes
    { GetGiftChatThemes -> Maybe Text
offset :: Maybe T.Text -- ^ Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
    , GetGiftChatThemes -> Maybe Int
limit  :: Maybe Int    -- ^ The maximum number of chat themes to return
    }
  deriving (GetGiftChatThemes -> GetGiftChatThemes -> Bool
(GetGiftChatThemes -> GetGiftChatThemes -> Bool)
-> (GetGiftChatThemes -> GetGiftChatThemes -> Bool)
-> Eq GetGiftChatThemes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetGiftChatThemes -> GetGiftChatThemes -> Bool
== :: GetGiftChatThemes -> GetGiftChatThemes -> Bool
$c/= :: GetGiftChatThemes -> GetGiftChatThemes -> Bool
/= :: GetGiftChatThemes -> GetGiftChatThemes -> Bool
Eq, Int -> GetGiftChatThemes -> ShowS
[GetGiftChatThemes] -> ShowS
GetGiftChatThemes -> String
(Int -> GetGiftChatThemes -> ShowS)
-> (GetGiftChatThemes -> String)
-> ([GetGiftChatThemes] -> ShowS)
-> Show GetGiftChatThemes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetGiftChatThemes -> ShowS
showsPrec :: Int -> GetGiftChatThemes -> ShowS
$cshow :: GetGiftChatThemes -> String
show :: GetGiftChatThemes -> String
$cshowList :: [GetGiftChatThemes] -> ShowS
showList :: [GetGiftChatThemes] -> ShowS
Show)

instance I.ShortShow GetGiftChatThemes where
  shortShow :: GetGiftChatThemes -> String
shortShow
    GetGiftChatThemes
      { offset :: GetGiftChatThemes -> Maybe Text
offset = Maybe Text
offset_
      , limit :: GetGiftChatThemes -> Maybe Int
limit  = Maybe Int
limit_
      }
        = String
"GetGiftChatThemes"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"offset" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
offset_
          , String
"limit"  String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
limit_
          ]

instance AT.ToJSON GetGiftChatThemes where
  toJSON :: GetGiftChatThemes -> Value
toJSON
    GetGiftChatThemes
      { offset :: GetGiftChatThemes -> Maybe Text
offset = Maybe Text
offset_
      , limit :: GetGiftChatThemes -> Maybe Int
limit  = Maybe Int
limit_
      }
        = [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
"getGiftChatThemes"
          , Key
"offset" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
offset_
          , Key
"limit"  Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
limit_
          ]

defaultGetGiftChatThemes :: GetGiftChatThemes
defaultGetGiftChatThemes :: GetGiftChatThemes
defaultGetGiftChatThemes =
  GetGiftChatThemes
    { offset :: Maybe Text
offset = Maybe Text
forall a. Maybe a
Nothing
    , limit :: Maybe Int
limit  = Maybe Int
forall a. Maybe a
Nothing
    }