module TD.Query.SendStory
(SendStory(..)
, defaultSendStory
) 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
import qualified TD.Data.StoryPrivacySettings as StoryPrivacySettings
import qualified TD.Data.StoryFullId as StoryFullId
data SendStory
= SendStory
{ SendStory -> Maybe Int
chat_id :: Maybe Int
, SendStory -> Maybe InputStoryContent
content :: Maybe InputStoryContent.InputStoryContent
, SendStory -> Maybe InputStoryAreas
areas :: Maybe InputStoryAreas.InputStoryAreas
, SendStory -> Maybe FormattedText
caption :: Maybe FormattedText.FormattedText
, SendStory -> Maybe StoryPrivacySettings
privacy_settings :: Maybe StoryPrivacySettings.StoryPrivacySettings
, SendStory -> Maybe Int
active_period :: Maybe Int
, SendStory -> Maybe StoryFullId
from_story_full_id :: Maybe StoryFullId.StoryFullId
, SendStory -> Maybe Bool
is_posted_to_chat_page :: Maybe Bool
, SendStory -> Maybe Bool
protect_content :: Maybe Bool
}
deriving (SendStory -> SendStory -> Bool
(SendStory -> SendStory -> Bool)
-> (SendStory -> SendStory -> Bool) -> Eq SendStory
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SendStory -> SendStory -> Bool
== :: SendStory -> SendStory -> Bool
$c/= :: SendStory -> SendStory -> Bool
/= :: SendStory -> SendStory -> Bool
Eq, Int -> SendStory -> ShowS
[SendStory] -> ShowS
SendStory -> String
(Int -> SendStory -> ShowS)
-> (SendStory -> String)
-> ([SendStory] -> ShowS)
-> Show SendStory
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SendStory -> ShowS
showsPrec :: Int -> SendStory -> ShowS
$cshow :: SendStory -> String
show :: SendStory -> String
$cshowList :: [SendStory] -> ShowS
showList :: [SendStory] -> ShowS
Show)
instance I.ShortShow SendStory where
shortShow :: SendStory -> String
shortShow
SendStory
{ chat_id :: SendStory -> Maybe Int
chat_id = Maybe Int
chat_id_
, content :: SendStory -> Maybe InputStoryContent
content = Maybe InputStoryContent
content_
, areas :: SendStory -> Maybe InputStoryAreas
areas = Maybe InputStoryAreas
areas_
, caption :: SendStory -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, privacy_settings :: SendStory -> Maybe StoryPrivacySettings
privacy_settings = Maybe StoryPrivacySettings
privacy_settings_
, active_period :: SendStory -> Maybe Int
active_period = Maybe Int
active_period_
, from_story_full_id :: SendStory -> Maybe StoryFullId
from_story_full_id = Maybe StoryFullId
from_story_full_id_
, is_posted_to_chat_page :: SendStory -> Maybe Bool
is_posted_to_chat_page = Maybe Bool
is_posted_to_chat_page_
, protect_content :: SendStory -> Maybe Bool
protect_content = Maybe Bool
protect_content_
}
= String
"SendStory"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_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_
, String
"privacy_settings" String -> Maybe StoryPrivacySettings -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe StoryPrivacySettings
privacy_settings_
, String
"active_period" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
active_period_
, String
"from_story_full_id" String -> Maybe StoryFullId -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe StoryFullId
from_story_full_id_
, String
"is_posted_to_chat_page" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_posted_to_chat_page_
, String
"protect_content" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
protect_content_
]
instance AT.ToJSON SendStory where
toJSON :: SendStory -> Value
toJSON
SendStory
{ chat_id :: SendStory -> Maybe Int
chat_id = Maybe Int
chat_id_
, content :: SendStory -> Maybe InputStoryContent
content = Maybe InputStoryContent
content_
, areas :: SendStory -> Maybe InputStoryAreas
areas = Maybe InputStoryAreas
areas_
, caption :: SendStory -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, privacy_settings :: SendStory -> Maybe StoryPrivacySettings
privacy_settings = Maybe StoryPrivacySettings
privacy_settings_
, active_period :: SendStory -> Maybe Int
active_period = Maybe Int
active_period_
, from_story_full_id :: SendStory -> Maybe StoryFullId
from_story_full_id = Maybe StoryFullId
from_story_full_id_
, is_posted_to_chat_page :: SendStory -> Maybe Bool
is_posted_to_chat_page = Maybe Bool
is_posted_to_chat_page_
, protect_content :: SendStory -> Maybe Bool
protect_content = Maybe Bool
protect_content_
}
= [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
"sendStory"
, Key
"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
chat_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_
, Key
"privacy_settings" Key -> Maybe StoryPrivacySettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe StoryPrivacySettings
privacy_settings_
, Key
"active_period" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
active_period_
, Key
"from_story_full_id" Key -> Maybe StoryFullId -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe StoryFullId
from_story_full_id_
, Key
"is_posted_to_chat_page" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_posted_to_chat_page_
, Key
"protect_content" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
protect_content_
]
defaultSendStory :: SendStory
defaultSendStory :: SendStory
defaultSendStory =
SendStory
{ chat_id :: Maybe Int
chat_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
, privacy_settings :: Maybe StoryPrivacySettings
privacy_settings = Maybe StoryPrivacySettings
forall a. Maybe a
Nothing
, active_period :: Maybe Int
active_period = Maybe Int
forall a. Maybe a
Nothing
, from_story_full_id :: Maybe StoryFullId
from_story_full_id = Maybe StoryFullId
forall a. Maybe a
Nothing
, is_posted_to_chat_page :: Maybe Bool
is_posted_to_chat_page = Maybe Bool
forall a. Maybe a
Nothing
, protect_content :: Maybe Bool
protect_content = Maybe Bool
forall a. Maybe a
Nothing
}