module TD.Query.CreateInvoiceLink
(CreateInvoiceLink(..)
, defaultCreateInvoiceLink
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T
import qualified TD.Data.InputMessageContent as InputMessageContent
data CreateInvoiceLink
= CreateInvoiceLink
{ CreateInvoiceLink -> Maybe Text
business_connection_id :: Maybe T.Text
, CreateInvoiceLink -> Maybe InputMessageContent
invoice :: Maybe InputMessageContent.InputMessageContent
}
deriving (CreateInvoiceLink -> CreateInvoiceLink -> Bool
(CreateInvoiceLink -> CreateInvoiceLink -> Bool)
-> (CreateInvoiceLink -> CreateInvoiceLink -> Bool)
-> Eq CreateInvoiceLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateInvoiceLink -> CreateInvoiceLink -> Bool
== :: CreateInvoiceLink -> CreateInvoiceLink -> Bool
$c/= :: CreateInvoiceLink -> CreateInvoiceLink -> Bool
/= :: CreateInvoiceLink -> CreateInvoiceLink -> Bool
Eq, Int -> CreateInvoiceLink -> ShowS
[CreateInvoiceLink] -> ShowS
CreateInvoiceLink -> String
(Int -> CreateInvoiceLink -> ShowS)
-> (CreateInvoiceLink -> String)
-> ([CreateInvoiceLink] -> ShowS)
-> Show CreateInvoiceLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateInvoiceLink -> ShowS
showsPrec :: Int -> CreateInvoiceLink -> ShowS
$cshow :: CreateInvoiceLink -> String
show :: CreateInvoiceLink -> String
$cshowList :: [CreateInvoiceLink] -> ShowS
showList :: [CreateInvoiceLink] -> ShowS
Show)
instance I.ShortShow CreateInvoiceLink where
shortShow :: CreateInvoiceLink -> String
shortShow
CreateInvoiceLink
{ business_connection_id :: CreateInvoiceLink -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
, invoice :: CreateInvoiceLink -> Maybe InputMessageContent
invoice = Maybe InputMessageContent
invoice_
}
= String
"CreateInvoiceLink"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"business_connection_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
business_connection_id_
, String
"invoice" String -> Maybe InputMessageContent -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputMessageContent
invoice_
]
instance AT.ToJSON CreateInvoiceLink where
toJSON :: CreateInvoiceLink -> Value
toJSON
CreateInvoiceLink
{ business_connection_id :: CreateInvoiceLink -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
, invoice :: CreateInvoiceLink -> Maybe InputMessageContent
invoice = Maybe InputMessageContent
invoice_
}
= [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
"createInvoiceLink"
, Key
"business_connection_id" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
business_connection_id_
, Key
"invoice" Key -> Maybe InputMessageContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputMessageContent
invoice_
]
defaultCreateInvoiceLink :: CreateInvoiceLink
defaultCreateInvoiceLink :: CreateInvoiceLink
defaultCreateInvoiceLink =
CreateInvoiceLink
{ business_connection_id :: Maybe Text
business_connection_id = Maybe Text
forall a. Maybe a
Nothing
, invoice :: Maybe InputMessageContent
invoice = Maybe InputMessageContent
forall a. Maybe a
Nothing
}