module TD.Query.GetPremiumGiveawayPaymentOptions
  (GetPremiumGiveawayPaymentOptions(..)
  ) 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 creating of Telegram Premium giveaway or manual distribution of Telegram Premium among chat members. Returns 'TD.Data.PremiumGiveawayPaymentOptions.PremiumGiveawayPaymentOptions'
data GetPremiumGiveawayPaymentOptions
  = GetPremiumGiveawayPaymentOptions
    { GetPremiumGiveawayPaymentOptions -> 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
    }
  deriving (GetPremiumGiveawayPaymentOptions
-> GetPremiumGiveawayPaymentOptions -> Bool
(GetPremiumGiveawayPaymentOptions
 -> GetPremiumGiveawayPaymentOptions -> Bool)
-> (GetPremiumGiveawayPaymentOptions
    -> GetPremiumGiveawayPaymentOptions -> Bool)
-> Eq GetPremiumGiveawayPaymentOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetPremiumGiveawayPaymentOptions
-> GetPremiumGiveawayPaymentOptions -> Bool
== :: GetPremiumGiveawayPaymentOptions
-> GetPremiumGiveawayPaymentOptions -> Bool
$c/= :: GetPremiumGiveawayPaymentOptions
-> GetPremiumGiveawayPaymentOptions -> Bool
/= :: GetPremiumGiveawayPaymentOptions
-> GetPremiumGiveawayPaymentOptions -> Bool
Eq, Int -> GetPremiumGiveawayPaymentOptions -> ShowS
[GetPremiumGiveawayPaymentOptions] -> ShowS
GetPremiumGiveawayPaymentOptions -> String
(Int -> GetPremiumGiveawayPaymentOptions -> ShowS)
-> (GetPremiumGiveawayPaymentOptions -> String)
-> ([GetPremiumGiveawayPaymentOptions] -> ShowS)
-> Show GetPremiumGiveawayPaymentOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetPremiumGiveawayPaymentOptions -> ShowS
showsPrec :: Int -> GetPremiumGiveawayPaymentOptions -> ShowS
$cshow :: GetPremiumGiveawayPaymentOptions -> String
show :: GetPremiumGiveawayPaymentOptions -> String
$cshowList :: [GetPremiumGiveawayPaymentOptions] -> ShowS
showList :: [GetPremiumGiveawayPaymentOptions] -> ShowS
Show)

instance I.ShortShow GetPremiumGiveawayPaymentOptions where
  shortShow :: GetPremiumGiveawayPaymentOptions -> String
shortShow
    GetPremiumGiveawayPaymentOptions
      { boosted_chat_id :: GetPremiumGiveawayPaymentOptions -> Maybe Int
boosted_chat_id = Maybe Int
boosted_chat_id_
      }
        = String
"GetPremiumGiveawayPaymentOptions"
          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 GetPremiumGiveawayPaymentOptions where
  toJSON :: GetPremiumGiveawayPaymentOptions -> Value
toJSON
    GetPremiumGiveawayPaymentOptions
      { boosted_chat_id :: GetPremiumGiveawayPaymentOptions -> 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
"getPremiumGiveawayPaymentOptions"
          , 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_
          ]