{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.GuardDuty.Types.GeoLocation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data GeoLocation = GeoLocation'
{
GeoLocation -> Maybe Double
lat :: Prelude.Maybe Prelude.Double,
GeoLocation -> Maybe Double
lon :: Prelude.Maybe Prelude.Double
}
deriving (GeoLocation -> GeoLocation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeoLocation -> GeoLocation -> Bool
$c/= :: GeoLocation -> GeoLocation -> Bool
== :: GeoLocation -> GeoLocation -> Bool
$c== :: GeoLocation -> GeoLocation -> Bool
Prelude.Eq, ReadPrec [GeoLocation]
ReadPrec GeoLocation
Int -> ReadS GeoLocation
ReadS [GeoLocation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GeoLocation]
$creadListPrec :: ReadPrec [GeoLocation]
readPrec :: ReadPrec GeoLocation
$creadPrec :: ReadPrec GeoLocation
readList :: ReadS [GeoLocation]
$creadList :: ReadS [GeoLocation]
readsPrec :: Int -> ReadS GeoLocation
$creadsPrec :: Int -> ReadS GeoLocation
Prelude.Read, Int -> GeoLocation -> ShowS
[GeoLocation] -> ShowS
GeoLocation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeoLocation] -> ShowS
$cshowList :: [GeoLocation] -> ShowS
show :: GeoLocation -> String
$cshow :: GeoLocation -> String
showsPrec :: Int -> GeoLocation -> ShowS
$cshowsPrec :: Int -> GeoLocation -> ShowS
Prelude.Show, forall x. Rep GeoLocation x -> GeoLocation
forall x. GeoLocation -> Rep GeoLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GeoLocation x -> GeoLocation
$cfrom :: forall x. GeoLocation -> Rep GeoLocation x
Prelude.Generic)
newGeoLocation ::
GeoLocation
newGeoLocation :: GeoLocation
newGeoLocation =
GeoLocation'
{ $sel:lat:GeoLocation' :: Maybe Double
lat = forall a. Maybe a
Prelude.Nothing,
$sel:lon:GeoLocation' :: Maybe Double
lon = forall a. Maybe a
Prelude.Nothing
}
geoLocation_lat :: Lens.Lens' GeoLocation (Prelude.Maybe Prelude.Double)
geoLocation_lat :: Lens' GeoLocation (Maybe Double)
geoLocation_lat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeoLocation' {Maybe Double
lat :: Maybe Double
$sel:lat:GeoLocation' :: GeoLocation -> Maybe Double
lat} -> Maybe Double
lat) (\s :: GeoLocation
s@GeoLocation' {} Maybe Double
a -> GeoLocation
s {$sel:lat:GeoLocation' :: Maybe Double
lat = Maybe Double
a} :: GeoLocation)
geoLocation_lon :: Lens.Lens' GeoLocation (Prelude.Maybe Prelude.Double)
geoLocation_lon :: Lens' GeoLocation (Maybe Double)
geoLocation_lon = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeoLocation' {Maybe Double
lon :: Maybe Double
$sel:lon:GeoLocation' :: GeoLocation -> Maybe Double
lon} -> Maybe Double
lon) (\s :: GeoLocation
s@GeoLocation' {} Maybe Double
a -> GeoLocation
s {$sel:lon:GeoLocation' :: Maybe Double
lon = Maybe Double
a} :: GeoLocation)
instance Data.FromJSON GeoLocation where
parseJSON :: Value -> Parser GeoLocation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GeoLocation"
( \Object
x ->
Maybe Double -> Maybe Double -> GeoLocation
GeoLocation'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lat")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lon")
)
instance Prelude.Hashable GeoLocation where
hashWithSalt :: Int -> GeoLocation -> Int
hashWithSalt Int
_salt GeoLocation' {Maybe Double
lon :: Maybe Double
lat :: Maybe Double
$sel:lon:GeoLocation' :: GeoLocation -> Maybe Double
$sel:lat:GeoLocation' :: GeoLocation -> Maybe Double
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
lat
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
lon
instance Prelude.NFData GeoLocation where
rnf :: GeoLocation -> ()
rnf GeoLocation' {Maybe Double
lon :: Maybe Double
lat :: Maybe Double
$sel:lon:GeoLocation' :: GeoLocation -> Maybe Double
$sel:lat:GeoLocation' :: GeoLocation -> Maybe Double
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
lat seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
lon