module TD.Query.GetGiftOnChainListingTransaction
(GetGiftOnChainListingTransaction(..)
, defaultGetGiftOnChainListingTransaction
) 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
data GetGiftOnChainListingTransaction
= GetGiftOnChainListingTransaction
{ GetGiftOnChainListingTransaction -> Maybe Text
gift_name :: Maybe T.Text
, GetGiftOnChainListingTransaction -> Maybe Int
gram_amount :: Maybe Int
}
deriving (GetGiftOnChainListingTransaction
-> GetGiftOnChainListingTransaction -> Bool
(GetGiftOnChainListingTransaction
-> GetGiftOnChainListingTransaction -> Bool)
-> (GetGiftOnChainListingTransaction
-> GetGiftOnChainListingTransaction -> Bool)
-> Eq GetGiftOnChainListingTransaction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetGiftOnChainListingTransaction
-> GetGiftOnChainListingTransaction -> Bool
== :: GetGiftOnChainListingTransaction
-> GetGiftOnChainListingTransaction -> Bool
$c/= :: GetGiftOnChainListingTransaction
-> GetGiftOnChainListingTransaction -> Bool
/= :: GetGiftOnChainListingTransaction
-> GetGiftOnChainListingTransaction -> Bool
Eq, Int -> GetGiftOnChainListingTransaction -> ShowS
[GetGiftOnChainListingTransaction] -> ShowS
GetGiftOnChainListingTransaction -> String
(Int -> GetGiftOnChainListingTransaction -> ShowS)
-> (GetGiftOnChainListingTransaction -> String)
-> ([GetGiftOnChainListingTransaction] -> ShowS)
-> Show GetGiftOnChainListingTransaction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetGiftOnChainListingTransaction -> ShowS
showsPrec :: Int -> GetGiftOnChainListingTransaction -> ShowS
$cshow :: GetGiftOnChainListingTransaction -> String
show :: GetGiftOnChainListingTransaction -> String
$cshowList :: [GetGiftOnChainListingTransaction] -> ShowS
showList :: [GetGiftOnChainListingTransaction] -> ShowS
Show)
instance I.ShortShow GetGiftOnChainListingTransaction where
shortShow :: GetGiftOnChainListingTransaction -> String
shortShow
GetGiftOnChainListingTransaction
{ gift_name :: GetGiftOnChainListingTransaction -> Maybe Text
gift_name = Maybe Text
gift_name_
, gram_amount :: GetGiftOnChainListingTransaction -> Maybe Int
gram_amount = Maybe Int
gram_amount_
}
= String
"GetGiftOnChainListingTransaction"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"gift_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
gift_name_
, String
"gram_amount" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
gram_amount_
]
instance AT.ToJSON GetGiftOnChainListingTransaction where
toJSON :: GetGiftOnChainListingTransaction -> Value
toJSON
GetGiftOnChainListingTransaction
{ gift_name :: GetGiftOnChainListingTransaction -> Maybe Text
gift_name = Maybe Text
gift_name_
, gram_amount :: GetGiftOnChainListingTransaction -> Maybe Int
gram_amount = Maybe Int
gram_amount_
}
= [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
"getGiftOnChainListingTransaction"
, Key
"gift_name" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
gift_name_
, Key
"gram_amount" Key -> Maybe Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= (Int -> Value) -> Maybe Int -> Maybe Value
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Int -> Value
I.writeInt64 Maybe Int
gram_amount_
]
defaultGetGiftOnChainListingTransaction :: GetGiftOnChainListingTransaction
defaultGetGiftOnChainListingTransaction :: GetGiftOnChainListingTransaction
defaultGetGiftOnChainListingTransaction =
GetGiftOnChainListingTransaction
{ gift_name :: Maybe Text
gift_name = Maybe Text
forall a. Maybe a
Nothing
, gram_amount :: Maybe Int
gram_amount = Maybe Int
forall a. Maybe a
Nothing
}