module TD.Query.GetPremiumGiftCodePaymentOptions
  (GetPremiumGiftCodePaymentOptions(..)
  ) where

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

-- | Returns available options for Telegram Premium gift code or Telegram Premium giveaway creation. Returns 'TD.Data.PremiumGiftCodePaymentOptions.PremiumGiftCodePaymentOptions'
data GetPremiumGiftCodePaymentOptions
  = GetPremiumGiftCodePaymentOptions
    { GetPremiumGiftCodePaymentOptions -> Maybe Int
boosted_chat_id :: Maybe Int -- ^ Identifier of the supergroup or channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none
    }
  deriving (GetPremiumGiftCodePaymentOptions
-> GetPremiumGiftCodePaymentOptions -> Bool
(GetPremiumGiftCodePaymentOptions
 -> GetPremiumGiftCodePaymentOptions -> Bool)
-> (GetPremiumGiftCodePaymentOptions
    -> GetPremiumGiftCodePaymentOptions -> Bool)
-> Eq GetPremiumGiftCodePaymentOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetPremiumGiftCodePaymentOptions
-> GetPremiumGiftCodePaymentOptions -> Bool
== :: GetPremiumGiftCodePaymentOptions
-> GetPremiumGiftCodePaymentOptions -> Bool
$c/= :: GetPremiumGiftCodePaymentOptions
-> GetPremiumGiftCodePaymentOptions -> Bool
/= :: GetPremiumGiftCodePaymentOptions
-> GetPremiumGiftCodePaymentOptions -> Bool
Eq, Int -> GetPremiumGiftCodePaymentOptions -> ShowS
[GetPremiumGiftCodePaymentOptions] -> ShowS
GetPremiumGiftCodePaymentOptions -> String
(Int -> GetPremiumGiftCodePaymentOptions -> ShowS)
-> (GetPremiumGiftCodePaymentOptions -> String)
-> ([GetPremiumGiftCodePaymentOptions] -> ShowS)
-> Show GetPremiumGiftCodePaymentOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetPremiumGiftCodePaymentOptions -> ShowS
showsPrec :: Int -> GetPremiumGiftCodePaymentOptions -> ShowS
$cshow :: GetPremiumGiftCodePaymentOptions -> String
show :: GetPremiumGiftCodePaymentOptions -> String
$cshowList :: [GetPremiumGiftCodePaymentOptions] -> ShowS
showList :: [GetPremiumGiftCodePaymentOptions] -> ShowS
Show)

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

instance AT.ToJSON GetPremiumGiftCodePaymentOptions where
  toJSON :: GetPremiumGiftCodePaymentOptions -> Value
toJSON
    GetPremiumGiftCodePaymentOptions
      { boosted_chat_id :: GetPremiumGiftCodePaymentOptions -> Maybe Int
boosted_chat_id = Maybe Int
boosted_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
"getPremiumGiftCodePaymentOptions"
          , Key
"boosted_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
boosted_chat_id_
          ]