{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.PreCheckoutQuery where
import Data.Aeson (FromJSON (..), ToJSON (..))
import Data.Text (Text)
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Types.OrderInfo
import Telegram.Bot.API.Types.User
import Telegram.Bot.API.Internal.Utils
data PreCheckoutQuery = PreCheckoutQuery
{ PreCheckoutQuery -> Text
preCheckoutQueryId :: Text
, PreCheckoutQuery -> User
preCheckoutQueryFrom :: User
, PreCheckoutQuery -> Text
preCheckoutQueryCurrency :: Text
, PreCheckoutQuery -> Int
preCheckoutQueryTotalAmount :: Int
, PreCheckoutQuery -> Text
preCheckoutQueryInvoicePayload :: Text
, PreCheckoutQuery -> Maybe ShippingOptionId
preCheckoutQueryShippingOptionId :: Maybe ShippingOptionId
, PreCheckoutQuery -> Maybe OrderInfo
preCheckoutQueryOrderInfo :: Maybe OrderInfo
}
deriving (forall x. Rep PreCheckoutQuery x -> PreCheckoutQuery
forall x. PreCheckoutQuery -> Rep PreCheckoutQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PreCheckoutQuery x -> PreCheckoutQuery
$cfrom :: forall x. PreCheckoutQuery -> Rep PreCheckoutQuery x
Generic, Int -> PreCheckoutQuery -> ShowS
[PreCheckoutQuery] -> ShowS
PreCheckoutQuery -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PreCheckoutQuery] -> ShowS
$cshowList :: [PreCheckoutQuery] -> ShowS
show :: PreCheckoutQuery -> String
$cshow :: PreCheckoutQuery -> String
showsPrec :: Int -> PreCheckoutQuery -> ShowS
$cshowsPrec :: Int -> PreCheckoutQuery -> ShowS
Show)
instance ToJSON PreCheckoutQuery where toJSON :: PreCheckoutQuery -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON PreCheckoutQuery where parseJSON :: Value -> Parser PreCheckoutQuery
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON