module TD.Query.CreateGiftCollection
(CreateGiftCollection(..)
, defaultCreateGiftCollection
) 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.MessageSender as MessageSender
import qualified Data.Text as T
data CreateGiftCollection
= CreateGiftCollection
{ CreateGiftCollection -> Maybe MessageSender
owner_id :: Maybe MessageSender.MessageSender
, CreateGiftCollection -> Maybe Text
name :: Maybe T.Text
, CreateGiftCollection -> Maybe [Text]
received_gift_ids :: Maybe [T.Text]
}
deriving (CreateGiftCollection -> CreateGiftCollection -> Bool
(CreateGiftCollection -> CreateGiftCollection -> Bool)
-> (CreateGiftCollection -> CreateGiftCollection -> Bool)
-> Eq CreateGiftCollection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateGiftCollection -> CreateGiftCollection -> Bool
== :: CreateGiftCollection -> CreateGiftCollection -> Bool
$c/= :: CreateGiftCollection -> CreateGiftCollection -> Bool
/= :: CreateGiftCollection -> CreateGiftCollection -> Bool
Eq, Int -> CreateGiftCollection -> ShowS
[CreateGiftCollection] -> ShowS
CreateGiftCollection -> String
(Int -> CreateGiftCollection -> ShowS)
-> (CreateGiftCollection -> String)
-> ([CreateGiftCollection] -> ShowS)
-> Show CreateGiftCollection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateGiftCollection -> ShowS
showsPrec :: Int -> CreateGiftCollection -> ShowS
$cshow :: CreateGiftCollection -> String
show :: CreateGiftCollection -> String
$cshowList :: [CreateGiftCollection] -> ShowS
showList :: [CreateGiftCollection] -> ShowS
Show)
instance I.ShortShow CreateGiftCollection where
shortShow :: CreateGiftCollection -> String
shortShow
CreateGiftCollection
{ owner_id :: CreateGiftCollection -> Maybe MessageSender
owner_id = Maybe MessageSender
owner_id_
, name :: CreateGiftCollection -> Maybe Text
name = Maybe Text
name_
, received_gift_ids :: CreateGiftCollection -> Maybe [Text]
received_gift_ids = Maybe [Text]
received_gift_ids_
}
= String
"CreateGiftCollection"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"owner_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
owner_id_
, String
"name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
name_
, String
"received_gift_ids" String -> Maybe [Text] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Text]
received_gift_ids_
]
instance AT.ToJSON CreateGiftCollection where
toJSON :: CreateGiftCollection -> Value
toJSON
CreateGiftCollection
{ owner_id :: CreateGiftCollection -> Maybe MessageSender
owner_id = Maybe MessageSender
owner_id_
, name :: CreateGiftCollection -> Maybe Text
name = Maybe Text
name_
, received_gift_ids :: CreateGiftCollection -> Maybe [Text]
received_gift_ids = Maybe [Text]
received_gift_ids_
}
= [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
"createGiftCollection"
, Key
"owner_id" Key -> Maybe MessageSender -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSender
owner_id_
, Key
"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
name_
, Key
"received_gift_ids" Key -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [Text]
received_gift_ids_
]
defaultCreateGiftCollection :: CreateGiftCollection
defaultCreateGiftCollection :: CreateGiftCollection
defaultCreateGiftCollection =
CreateGiftCollection
{ owner_id :: Maybe MessageSender
owner_id = Maybe MessageSender
forall a. Maybe a
Nothing
, name :: Maybe Text
name = Maybe Text
forall a. Maybe a
Nothing
, received_gift_ids :: Maybe [Text]
received_gift_ids = Maybe [Text]
forall a. Maybe a
Nothing
}