module TD.Query.EditMessageLiveLocation
(EditMessageLiveLocation(..)
, defaultEditMessageLiveLocation
) 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.ReplyMarkup as ReplyMarkup
import qualified TD.Data.Location as Location
data EditMessageLiveLocation
= EditMessageLiveLocation
{ EditMessageLiveLocation -> Maybe Int
chat_id :: Maybe Int
, EditMessageLiveLocation -> Maybe Int
message_id :: Maybe Int
, EditMessageLiveLocation -> Maybe ReplyMarkup
reply_markup :: Maybe ReplyMarkup.ReplyMarkup
, EditMessageLiveLocation -> Maybe Location
location :: Maybe Location.Location
, EditMessageLiveLocation -> Maybe Int
live_period :: Maybe Int
, EditMessageLiveLocation -> Maybe Int
heading :: Maybe Int
, EditMessageLiveLocation -> Maybe Int
proximity_alert_radius :: Maybe Int
}
deriving (EditMessageLiveLocation -> EditMessageLiveLocation -> Bool
(EditMessageLiveLocation -> EditMessageLiveLocation -> Bool)
-> (EditMessageLiveLocation -> EditMessageLiveLocation -> Bool)
-> Eq EditMessageLiveLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EditMessageLiveLocation -> EditMessageLiveLocation -> Bool
== :: EditMessageLiveLocation -> EditMessageLiveLocation -> Bool
$c/= :: EditMessageLiveLocation -> EditMessageLiveLocation -> Bool
/= :: EditMessageLiveLocation -> EditMessageLiveLocation -> Bool
Eq, Int -> EditMessageLiveLocation -> ShowS
[EditMessageLiveLocation] -> ShowS
EditMessageLiveLocation -> String
(Int -> EditMessageLiveLocation -> ShowS)
-> (EditMessageLiveLocation -> String)
-> ([EditMessageLiveLocation] -> ShowS)
-> Show EditMessageLiveLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EditMessageLiveLocation -> ShowS
showsPrec :: Int -> EditMessageLiveLocation -> ShowS
$cshow :: EditMessageLiveLocation -> String
show :: EditMessageLiveLocation -> String
$cshowList :: [EditMessageLiveLocation] -> ShowS
showList :: [EditMessageLiveLocation] -> ShowS
Show)
instance I.ShortShow EditMessageLiveLocation where
shortShow :: EditMessageLiveLocation -> String
shortShow
EditMessageLiveLocation
{ chat_id :: EditMessageLiveLocation -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: EditMessageLiveLocation -> Maybe Int
message_id = Maybe Int
message_id_
, reply_markup :: EditMessageLiveLocation -> Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
reply_markup_
, location :: EditMessageLiveLocation -> Maybe Location
location = Maybe Location
location_
, live_period :: EditMessageLiveLocation -> Maybe Int
live_period = Maybe Int
live_period_
, heading :: EditMessageLiveLocation -> Maybe Int
heading = Maybe Int
heading_
, proximity_alert_radius :: EditMessageLiveLocation -> Maybe Int
proximity_alert_radius = Maybe Int
proximity_alert_radius_
}
= String
"EditMessageLiveLocation"
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
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
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 EditMessageLiveLocation where
toJSON :: EditMessageLiveLocation -> Value
toJSON
EditMessageLiveLocation
{ chat_id :: EditMessageLiveLocation -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: EditMessageLiveLocation -> Maybe Int
message_id = Maybe Int
message_id_
, reply_markup :: EditMessageLiveLocation -> Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
reply_markup_
, location :: EditMessageLiveLocation -> Maybe Location
location = Maybe Location
location_
, live_period :: EditMessageLiveLocation -> Maybe Int
live_period = Maybe Int
live_period_
, heading :: EditMessageLiveLocation -> Maybe Int
heading = Maybe Int
heading_
, proximity_alert_radius :: EditMessageLiveLocation -> 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
"editMessageLiveLocation"
, 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
"message_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
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_
]
defaultEditMessageLiveLocation :: EditMessageLiveLocation
defaultEditMessageLiveLocation :: EditMessageLiveLocation
defaultEditMessageLiveLocation =
EditMessageLiveLocation
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, message_id :: Maybe Int
message_id = Maybe Int
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
}