module TD.Query.EditInlineMessageLiveLocation
(EditInlineMessageLiveLocation(..)
, defaultEditInlineMessageLiveLocation
) 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.ReplyMarkup as ReplyMarkup
import qualified TD.Data.Location as Location
data EditInlineMessageLiveLocation
= EditInlineMessageLiveLocation
{ EditInlineMessageLiveLocation -> Maybe Text
inline_message_id :: Maybe T.Text
, EditInlineMessageLiveLocation -> Maybe ReplyMarkup
reply_markup :: Maybe ReplyMarkup.ReplyMarkup
, EditInlineMessageLiveLocation -> Maybe Location
location :: Maybe Location.Location
, EditInlineMessageLiveLocation -> Maybe Int
live_period :: Maybe Int
, EditInlineMessageLiveLocation -> Maybe Int
heading :: Maybe Int
, EditInlineMessageLiveLocation -> Maybe Int
proximity_alert_radius :: Maybe Int
}
deriving (EditInlineMessageLiveLocation
-> EditInlineMessageLiveLocation -> Bool
(EditInlineMessageLiveLocation
-> EditInlineMessageLiveLocation -> Bool)
-> (EditInlineMessageLiveLocation
-> EditInlineMessageLiveLocation -> Bool)
-> Eq EditInlineMessageLiveLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EditInlineMessageLiveLocation
-> EditInlineMessageLiveLocation -> Bool
== :: EditInlineMessageLiveLocation
-> EditInlineMessageLiveLocation -> Bool
$c/= :: EditInlineMessageLiveLocation
-> EditInlineMessageLiveLocation -> Bool
/= :: EditInlineMessageLiveLocation
-> EditInlineMessageLiveLocation -> Bool
Eq, Int -> EditInlineMessageLiveLocation -> ShowS
[EditInlineMessageLiveLocation] -> ShowS
EditInlineMessageLiveLocation -> String
(Int -> EditInlineMessageLiveLocation -> ShowS)
-> (EditInlineMessageLiveLocation -> String)
-> ([EditInlineMessageLiveLocation] -> ShowS)
-> Show EditInlineMessageLiveLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EditInlineMessageLiveLocation -> ShowS
showsPrec :: Int -> EditInlineMessageLiveLocation -> ShowS
$cshow :: EditInlineMessageLiveLocation -> String
show :: EditInlineMessageLiveLocation -> String
$cshowList :: [EditInlineMessageLiveLocation] -> ShowS
showList :: [EditInlineMessageLiveLocation] -> ShowS
Show)
instance I.ShortShow EditInlineMessageLiveLocation where
shortShow :: EditInlineMessageLiveLocation -> String
shortShow
EditInlineMessageLiveLocation
{ inline_message_id :: EditInlineMessageLiveLocation -> Maybe Text
inline_message_id = Maybe Text
inline_message_id_
, reply_markup :: EditInlineMessageLiveLocation -> Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
reply_markup_
, location :: EditInlineMessageLiveLocation -> Maybe Location
location = Maybe Location
location_
, live_period :: EditInlineMessageLiveLocation -> Maybe Int
live_period = Maybe Int
live_period_
, heading :: EditInlineMessageLiveLocation -> Maybe Int
heading = Maybe Int
heading_
, proximity_alert_radius :: EditInlineMessageLiveLocation -> Maybe Int
proximity_alert_radius = Maybe Int
proximity_alert_radius_
}
= String
"EditInlineMessageLiveLocation"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"inline_message_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
inline_message_id_
, String
"reply_markup" String -> Maybe ReplyMarkup -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ReplyMarkup
reply_markup_
, String
"location" String -> Maybe Location -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Location
location_
, String
"live_period" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
live_period_
, String
"heading" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
heading_
, String
"proximity_alert_radius" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
proximity_alert_radius_
]
instance AT.ToJSON EditInlineMessageLiveLocation where
toJSON :: EditInlineMessageLiveLocation -> Value
toJSON
EditInlineMessageLiveLocation
{ inline_message_id :: EditInlineMessageLiveLocation -> Maybe Text
inline_message_id = Maybe Text
inline_message_id_
, reply_markup :: EditInlineMessageLiveLocation -> Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
reply_markup_
, location :: EditInlineMessageLiveLocation -> Maybe Location
location = Maybe Location
location_
, live_period :: EditInlineMessageLiveLocation -> Maybe Int
live_period = Maybe Int
live_period_
, heading :: EditInlineMessageLiveLocation -> Maybe Int
heading = Maybe Int
heading_
, proximity_alert_radius :: EditInlineMessageLiveLocation -> Maybe Int
proximity_alert_radius = Maybe Int
proximity_alert_radius_
}
= [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
"editInlineMessageLiveLocation"
, Key
"inline_message_id" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
inline_message_id_
, Key
"reply_markup" Key -> Maybe ReplyMarkup -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe ReplyMarkup
reply_markup_
, Key
"location" Key -> Maybe Location -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Location
location_
, Key
"live_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
live_period_
, Key
"heading" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
heading_
, Key
"proximity_alert_radius" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
proximity_alert_radius_
]
defaultEditInlineMessageLiveLocation :: EditInlineMessageLiveLocation
defaultEditInlineMessageLiveLocation :: EditInlineMessageLiveLocation
defaultEditInlineMessageLiveLocation =
EditInlineMessageLiveLocation
{ inline_message_id :: Maybe Text
inline_message_id = Maybe Text
forall a. Maybe a
Nothing
, reply_markup :: Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
forall a. Maybe a
Nothing
, location :: Maybe Location
location = Maybe Location
forall a. Maybe a
Nothing
, live_period :: Maybe Int
live_period = Maybe Int
forall a. Maybe a
Nothing
, heading :: Maybe Int
heading = Maybe Int
forall a. Maybe a
Nothing
, proximity_alert_radius :: Maybe Int
proximity_alert_radius = Maybe Int
forall a. Maybe a
Nothing
}