module TD.Query.EditStory
(EditStory(..)
, defaultEditStory
) 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.InputStoryContent as InputStoryContent
import qualified TD.Data.InputStoryAreas as InputStoryAreas
import qualified TD.Data.FormattedText as FormattedText
data EditStory
= EditStory
{ EditStory -> Maybe Int
story_sender_chat_id :: Maybe Int
, EditStory -> Maybe Int
story_id :: Maybe Int
, EditStory -> Maybe InputStoryContent
content :: Maybe InputStoryContent.InputStoryContent
, EditStory -> Maybe InputStoryAreas
areas :: Maybe InputStoryAreas.InputStoryAreas
, EditStory -> Maybe FormattedText
caption :: Maybe FormattedText.FormattedText
}
deriving (EditStory -> EditStory -> Bool
(EditStory -> EditStory -> Bool)
-> (EditStory -> EditStory -> Bool) -> Eq EditStory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EditStory -> EditStory -> Bool
== :: EditStory -> EditStory -> Bool
$c/= :: EditStory -> EditStory -> Bool
/= :: EditStory -> EditStory -> Bool
Eq, Int -> EditStory -> ShowS
[EditStory] -> ShowS
EditStory -> String
(Int -> EditStory -> ShowS)
-> (EditStory -> String)
-> ([EditStory] -> ShowS)
-> Show EditStory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EditStory -> ShowS
showsPrec :: Int -> EditStory -> ShowS
$cshow :: EditStory -> String
show :: EditStory -> String
$cshowList :: [EditStory] -> ShowS
showList :: [EditStory] -> ShowS
Show)
instance I.ShortShow EditStory where
shortShow :: EditStory -> String
shortShow
EditStory
{ story_sender_chat_id :: EditStory -> Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
, story_id :: EditStory -> Maybe Int
story_id = Maybe Int
story_id_
, content :: EditStory -> Maybe InputStoryContent
content = Maybe InputStoryContent
content_
, areas :: EditStory -> Maybe InputStoryAreas
areas = Maybe InputStoryAreas
areas_
, caption :: EditStory -> Maybe FormattedText
caption = Maybe FormattedText
caption_
}
= String
"EditStory"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"story_sender_chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_sender_chat_id_
, String
"story_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_id_
, String
"content" String -> Maybe InputStoryContent -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputStoryContent
content_
, String
"areas" String -> Maybe InputStoryAreas -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputStoryAreas
areas_
, String
"caption" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
]
instance AT.ToJSON EditStory where
toJSON :: EditStory -> Value
toJSON
EditStory
{ story_sender_chat_id :: EditStory -> Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
, story_id :: EditStory -> Maybe Int
story_id = Maybe Int
story_id_
, content :: EditStory -> Maybe InputStoryContent
content = Maybe InputStoryContent
content_
, areas :: EditStory -> Maybe InputStoryAreas
areas = Maybe InputStoryAreas
areas_
, caption :: EditStory -> Maybe FormattedText
caption = Maybe FormattedText
caption_
}
= [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
"editStory"
, Key
"story_sender_chat_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
story_sender_chat_id_
, Key
"story_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
story_id_
, Key
"content" Key -> Maybe InputStoryContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputStoryContent
content_
, Key
"areas" Key -> Maybe InputStoryAreas -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputStoryAreas
areas_
, Key
"caption" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
caption_
]
defaultEditStory :: EditStory
defaultEditStory :: EditStory
defaultEditStory =
EditStory
{ story_sender_chat_id :: Maybe Int
story_sender_chat_id = Maybe Int
forall a. Maybe a
Nothing
, story_id :: Maybe Int
story_id = Maybe Int
forall a. Maybe a
Nothing
, content :: Maybe InputStoryContent
content = Maybe InputStoryContent
forall a. Maybe a
Nothing
, areas :: Maybe InputStoryAreas
areas = Maybe InputStoryAreas
forall a. Maybe a
Nothing
, caption :: Maybe FormattedText
caption = Maybe FormattedText
forall a. Maybe a
Nothing
}