module TD.Query.OpenGiftAuction
(OpenGiftAuction(..)
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data OpenGiftAuction
= OpenGiftAuction
{ OpenGiftAuction -> Maybe Int
gift_id :: Maybe Int
}
deriving (OpenGiftAuction -> OpenGiftAuction -> Bool
(OpenGiftAuction -> OpenGiftAuction -> Bool)
-> (OpenGiftAuction -> OpenGiftAuction -> Bool)
-> Eq OpenGiftAuction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OpenGiftAuction -> OpenGiftAuction -> Bool
== :: OpenGiftAuction -> OpenGiftAuction -> Bool
$c/= :: OpenGiftAuction -> OpenGiftAuction -> Bool
/= :: OpenGiftAuction -> OpenGiftAuction -> Bool
Eq, Int -> OpenGiftAuction -> ShowS
[OpenGiftAuction] -> ShowS
OpenGiftAuction -> String
(Int -> OpenGiftAuction -> ShowS)
-> (OpenGiftAuction -> String)
-> ([OpenGiftAuction] -> ShowS)
-> Show OpenGiftAuction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OpenGiftAuction -> ShowS
showsPrec :: Int -> OpenGiftAuction -> ShowS
$cshow :: OpenGiftAuction -> String
show :: OpenGiftAuction -> String
$cshowList :: [OpenGiftAuction] -> ShowS
showList :: [OpenGiftAuction] -> ShowS
Show)
instance I.ShortShow OpenGiftAuction where
shortShow :: OpenGiftAuction -> String
shortShow
OpenGiftAuction
{ gift_id :: OpenGiftAuction -> Maybe Int
gift_id = Maybe Int
gift_id_
}
= String
"OpenGiftAuction"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"gift_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
gift_id_
]
instance AT.ToJSON OpenGiftAuction where
toJSON :: OpenGiftAuction -> Value
toJSON
OpenGiftAuction
{ gift_id :: OpenGiftAuction -> Maybe Int
gift_id = Maybe Int
gift_id_
}
= [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
"openGiftAuction"
, Key
"gift_id" 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
gift_id_
]