module TD.Query.CreateNewStickerSet
(CreateNewStickerSet(..)
, defaultCreateNewStickerSet
) 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.StickerType as StickerType
import qualified TD.Data.InputSticker as InputSticker
data CreateNewStickerSet
= CreateNewStickerSet
{ CreateNewStickerSet -> Maybe Int
user_id :: Maybe Int
, CreateNewStickerSet -> Maybe Text
title :: Maybe T.Text
, CreateNewStickerSet -> Maybe Text
name :: Maybe T.Text
, CreateNewStickerSet -> Maybe StickerType
sticker_type :: Maybe StickerType.StickerType
, CreateNewStickerSet -> Maybe Bool
needs_repainting :: Maybe Bool
, CreateNewStickerSet -> Maybe [InputSticker]
stickers :: Maybe [InputSticker.InputSticker]
, CreateNewStickerSet -> Maybe Text
source :: Maybe T.Text
}
deriving (CreateNewStickerSet -> CreateNewStickerSet -> Bool
(CreateNewStickerSet -> CreateNewStickerSet -> Bool)
-> (CreateNewStickerSet -> CreateNewStickerSet -> Bool)
-> Eq CreateNewStickerSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CreateNewStickerSet -> CreateNewStickerSet -> Bool
== :: CreateNewStickerSet -> CreateNewStickerSet -> Bool
$c/= :: CreateNewStickerSet -> CreateNewStickerSet -> Bool
/= :: CreateNewStickerSet -> CreateNewStickerSet -> Bool
Eq, Int -> CreateNewStickerSet -> ShowS
[CreateNewStickerSet] -> ShowS
CreateNewStickerSet -> String
(Int -> CreateNewStickerSet -> ShowS)
-> (CreateNewStickerSet -> String)
-> ([CreateNewStickerSet] -> ShowS)
-> Show CreateNewStickerSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CreateNewStickerSet -> ShowS
showsPrec :: Int -> CreateNewStickerSet -> ShowS
$cshow :: CreateNewStickerSet -> String
show :: CreateNewStickerSet -> String
$cshowList :: [CreateNewStickerSet] -> ShowS
showList :: [CreateNewStickerSet] -> ShowS
Show)
instance I.ShortShow CreateNewStickerSet where
shortShow :: CreateNewStickerSet -> String
shortShow
CreateNewStickerSet
{ user_id :: CreateNewStickerSet -> Maybe Int
user_id = Maybe Int
user_id_
, title :: CreateNewStickerSet -> Maybe Text
title = Maybe Text
title_
, name :: CreateNewStickerSet -> Maybe Text
name = Maybe Text
name_
, sticker_type :: CreateNewStickerSet -> Maybe StickerType
sticker_type = Maybe StickerType
sticker_type_
, needs_repainting :: CreateNewStickerSet -> Maybe Bool
needs_repainting = Maybe Bool
needs_repainting_
, stickers :: CreateNewStickerSet -> Maybe [InputSticker]
stickers = Maybe [InputSticker]
stickers_
, source :: CreateNewStickerSet -> Maybe Text
source = Maybe Text
source_
}
= String
"CreateNewStickerSet"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"title" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
title_
, String
"name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
name_
, String
"sticker_type" String -> Maybe StickerType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe StickerType
sticker_type_
, String
"needs_repainting" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
needs_repainting_
, String
"stickers" String -> Maybe [InputSticker] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [InputSticker]
stickers_
, String
"source" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
source_
]
instance AT.ToJSON CreateNewStickerSet where
toJSON :: CreateNewStickerSet -> Value
toJSON
CreateNewStickerSet
{ user_id :: CreateNewStickerSet -> Maybe Int
user_id = Maybe Int
user_id_
, title :: CreateNewStickerSet -> Maybe Text
title = Maybe Text
title_
, name :: CreateNewStickerSet -> Maybe Text
name = Maybe Text
name_
, sticker_type :: CreateNewStickerSet -> Maybe StickerType
sticker_type = Maybe StickerType
sticker_type_
, needs_repainting :: CreateNewStickerSet -> Maybe Bool
needs_repainting = Maybe Bool
needs_repainting_
, stickers :: CreateNewStickerSet -> Maybe [InputSticker]
stickers = Maybe [InputSticker]
stickers_
, source :: CreateNewStickerSet -> Maybe Text
source = Maybe Text
source_
}
= [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
"createNewStickerSet"
, Key
"user_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
user_id_
, Key
"title" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
title_
, 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
"sticker_type" Key -> Maybe StickerType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe StickerType
sticker_type_
, Key
"needs_repainting" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
needs_repainting_
, Key
"stickers" Key -> Maybe [InputSticker] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe [InputSticker]
stickers_
, Key
"source" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
source_
]
defaultCreateNewStickerSet :: CreateNewStickerSet
defaultCreateNewStickerSet :: CreateNewStickerSet
defaultCreateNewStickerSet =
CreateNewStickerSet
{ user_id :: Maybe Int
user_id = Maybe Int
forall a. Maybe a
Nothing
, title :: Maybe Text
title = Maybe Text
forall a. Maybe a
Nothing
, name :: Maybe Text
name = Maybe Text
forall a. Maybe a
Nothing
, sticker_type :: Maybe StickerType
sticker_type = Maybe StickerType
forall a. Maybe a
Nothing
, needs_repainting :: Maybe Bool
needs_repainting = Maybe Bool
forall a. Maybe a
Nothing
, stickers :: Maybe [InputSticker]
stickers = Maybe [InputSticker]
forall a. Maybe a
Nothing
, source :: Maybe Text
source = Maybe Text
forall a. Maybe a
Nothing
}