{-# LANGUAGE DeriveGeneric #-}
module Telegram.Bot.API.Types.Location where
import Data.Aeson (FromJSON (..), ToJSON (..))
import GHC.Generics (Generic)
import Telegram.Bot.API.Types.Common
import Telegram.Bot.API.Internal.Utils
data Location = Location
{ Location -> Float
locationLongitude :: Float
, Location -> Float
locationLatitude :: Float
, Location -> Maybe Float
locationHorizontalAccuracy :: Maybe Float
, Location -> Maybe Seconds
locationLivePeriod :: Maybe Seconds
, Location -> Maybe Int
locationHeading :: Maybe Int
, Location -> Maybe Int
locationProximityAlertRadius :: Maybe Int
}
deriving (forall x. Rep Location x -> Location
forall x. Location -> Rep Location x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Location x -> Location
$cfrom :: forall x. Location -> Rep Location x
Generic, Int -> Location -> ShowS
[Location] -> ShowS
Location -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Location] -> ShowS
$cshowList :: [Location] -> ShowS
show :: Location -> String
$cshow :: Location -> String
showsPrec :: Int -> Location -> ShowS
$cshowsPrec :: Int -> Location -> ShowS
Show)
instance ToJSON Location where toJSON :: Location -> Value
toJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GToJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
a -> Value
gtoJSON
instance FromJSON Location where parseJSON :: Value -> Parser Location
parseJSON = forall a (d :: Meta) (f :: * -> *).
(Generic a, GFromJSON Zero (Rep a), Rep a ~ D1 d f, Datatype d) =>
Value -> Parser a
gparseJSON