module TD.Query.GetPaymentForm
(GetPaymentForm(..)
, defaultGetPaymentForm
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.InputInvoice as InputInvoice
import qualified TD.Data.ThemeParameters as ThemeParameters
data GetPaymentForm
= GetPaymentForm
{ GetPaymentForm -> Maybe InputInvoice
input_invoice :: Maybe InputInvoice.InputInvoice
, GetPaymentForm -> Maybe ThemeParameters
theme :: Maybe ThemeParameters.ThemeParameters
}
deriving (GetPaymentForm -> GetPaymentForm -> Bool
(GetPaymentForm -> GetPaymentForm -> Bool)
-> (GetPaymentForm -> GetPaymentForm -> Bool) -> Eq GetPaymentForm
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetPaymentForm -> GetPaymentForm -> Bool
== :: GetPaymentForm -> GetPaymentForm -> Bool
$c/= :: GetPaymentForm -> GetPaymentForm -> Bool
/= :: GetPaymentForm -> GetPaymentForm -> Bool
Eq, Int -> GetPaymentForm -> ShowS
[GetPaymentForm] -> ShowS
GetPaymentForm -> String
(Int -> GetPaymentForm -> ShowS)
-> (GetPaymentForm -> String)
-> ([GetPaymentForm] -> ShowS)
-> Show GetPaymentForm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetPaymentForm -> ShowS
showsPrec :: Int -> GetPaymentForm -> ShowS
$cshow :: GetPaymentForm -> String
show :: GetPaymentForm -> String
$cshowList :: [GetPaymentForm] -> ShowS
showList :: [GetPaymentForm] -> ShowS
Show)
instance I.ShortShow GetPaymentForm where
shortShow :: GetPaymentForm -> String
shortShow
GetPaymentForm
{ input_invoice :: GetPaymentForm -> Maybe InputInvoice
input_invoice = Maybe InputInvoice
input_invoice_
, theme :: GetPaymentForm -> Maybe ThemeParameters
theme = Maybe ThemeParameters
theme_
}
= String
"GetPaymentForm"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"input_invoice" String -> Maybe InputInvoice -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputInvoice
input_invoice_
, String
"theme" String -> Maybe ThemeParameters -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ThemeParameters
theme_
]
instance AT.ToJSON GetPaymentForm where
toJSON :: GetPaymentForm -> Value
toJSON
GetPaymentForm
{ input_invoice :: GetPaymentForm -> Maybe InputInvoice
input_invoice = Maybe InputInvoice
input_invoice_
, theme :: GetPaymentForm -> Maybe ThemeParameters
theme = Maybe ThemeParameters
theme_
}
= [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
"getPaymentForm"
, Key
"input_invoice" Key -> Maybe InputInvoice -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputInvoice
input_invoice_
, Key
"theme" Key -> Maybe ThemeParameters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe ThemeParameters
theme_
]
defaultGetPaymentForm :: GetPaymentForm
defaultGetPaymentForm :: GetPaymentForm
defaultGetPaymentForm =
GetPaymentForm
{ input_invoice :: Maybe InputInvoice
input_invoice = Maybe InputInvoice
forall a. Maybe a
Nothing
, theme :: Maybe ThemeParameters
theme = Maybe ThemeParameters
forall a. Maybe a
Nothing
}