{-# 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. PreCheckoutQuery -> Rep PreCheckoutQuery x)
-> (forall x. Rep PreCheckoutQuery x -> PreCheckoutQuery)
-> Generic PreCheckoutQuery
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
$cfrom :: forall x. PreCheckoutQuery -> Rep PreCheckoutQuery x
from :: forall x. PreCheckoutQuery -> Rep PreCheckoutQuery x
$cto :: forall x. Rep PreCheckoutQuery x -> PreCheckoutQuery
to :: forall x. Rep PreCheckoutQuery x -> PreCheckoutQuery
Generic, Int -> PreCheckoutQuery -> ShowS
[PreCheckoutQuery] -> ShowS
PreCheckoutQuery -> String
(Int -> PreCheckoutQuery -> ShowS)
-> (PreCheckoutQuery -> String)
-> ([PreCheckoutQuery] -> ShowS)
-> Show PreCheckoutQuery
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PreCheckoutQuery -> ShowS
showsPrec :: Int -> PreCheckoutQuery -> ShowS
$cshow :: PreCheckoutQuery -> String
show :: PreCheckoutQuery -> String
$cshowList :: [PreCheckoutQuery] -> ShowS
showList :: [PreCheckoutQuery] -> ShowS
Show)
instance ToJSON PreCheckoutQuery where toJSON :: PreCheckoutQuery -> Value
toJSON = PreCheckoutQuery -> Value
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 = Value -> Parser PreCheckoutQuery
forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON