{-# 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.Location.Types.GeofenceGeometry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GeofenceGeometry = GeofenceGeometry'
{
GeofenceGeometry
-> Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
polygon :: Prelude.Maybe (Prelude.NonEmpty (Prelude.NonEmpty (Core.Sensitive (Prelude.NonEmpty Prelude.Double))))
}
deriving (GeofenceGeometry -> GeofenceGeometry -> Bool
(GeofenceGeometry -> GeofenceGeometry -> Bool)
-> (GeofenceGeometry -> GeofenceGeometry -> Bool)
-> Eq GeofenceGeometry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeofenceGeometry -> GeofenceGeometry -> Bool
$c/= :: GeofenceGeometry -> GeofenceGeometry -> Bool
== :: GeofenceGeometry -> GeofenceGeometry -> Bool
$c== :: GeofenceGeometry -> GeofenceGeometry -> Bool
Prelude.Eq, Int -> GeofenceGeometry -> ShowS
[GeofenceGeometry] -> ShowS
GeofenceGeometry -> String
(Int -> GeofenceGeometry -> ShowS)
-> (GeofenceGeometry -> String)
-> ([GeofenceGeometry] -> ShowS)
-> Show GeofenceGeometry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeofenceGeometry] -> ShowS
$cshowList :: [GeofenceGeometry] -> ShowS
show :: GeofenceGeometry -> String
$cshow :: GeofenceGeometry -> String
showsPrec :: Int -> GeofenceGeometry -> ShowS
$cshowsPrec :: Int -> GeofenceGeometry -> ShowS
Prelude.Show, (forall x. GeofenceGeometry -> Rep GeofenceGeometry x)
-> (forall x. Rep GeofenceGeometry x -> GeofenceGeometry)
-> Generic GeofenceGeometry
forall x. Rep GeofenceGeometry x -> GeofenceGeometry
forall x. GeofenceGeometry -> Rep GeofenceGeometry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GeofenceGeometry x -> GeofenceGeometry
$cfrom :: forall x. GeofenceGeometry -> Rep GeofenceGeometry x
Prelude.Generic)
newGeofenceGeometry ::
GeofenceGeometry
newGeofenceGeometry :: GeofenceGeometry
newGeofenceGeometry =
GeofenceGeometry' :: Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
-> GeofenceGeometry
GeofenceGeometry' {$sel:polygon:GeofenceGeometry' :: Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
polygon = Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
forall a. Maybe a
Prelude.Nothing}
geofenceGeometry_polygon :: Lens.Lens' GeofenceGeometry (Prelude.Maybe (Prelude.NonEmpty (Prelude.NonEmpty (Prelude.NonEmpty Prelude.Double))))
geofenceGeometry_polygon :: (Maybe (NonEmpty (NonEmpty (NonEmpty Double)))
-> f (Maybe (NonEmpty (NonEmpty (NonEmpty Double)))))
-> GeofenceGeometry -> f GeofenceGeometry
geofenceGeometry_polygon = (GeofenceGeometry
-> Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double)))))
-> (GeofenceGeometry
-> Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
-> GeofenceGeometry)
-> Lens
GeofenceGeometry
GeofenceGeometry
(Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double)))))
(Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double)))))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeofenceGeometry' {Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
polygon :: Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
$sel:polygon:GeofenceGeometry' :: GeofenceGeometry
-> Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
polygon} -> Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
polygon) (\s :: GeofenceGeometry
s@GeofenceGeometry' {} Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
a -> GeofenceGeometry
s {$sel:polygon:GeofenceGeometry' :: Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
polygon = Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
a} :: GeofenceGeometry) ((Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
-> f (Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))))
-> GeofenceGeometry -> f GeofenceGeometry)
-> ((Maybe (NonEmpty (NonEmpty (NonEmpty Double)))
-> f (Maybe (NonEmpty (NonEmpty (NonEmpty Double)))))
-> Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
-> f (Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))))
-> (Maybe (NonEmpty (NonEmpty (NonEmpty Double)))
-> f (Maybe (NonEmpty (NonEmpty (NonEmpty Double)))))
-> GeofenceGeometry
-> f GeofenceGeometry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
(NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
(NonEmpty (NonEmpty (NonEmpty Double)))
(NonEmpty (NonEmpty (NonEmpty Double)))
-> Iso
(Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double)))))
(Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double)))))
(Maybe (NonEmpty (NonEmpty (NonEmpty Double))))
(Maybe (NonEmpty (NonEmpty (NonEmpty Double))))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
(NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
(NonEmpty (NonEmpty (NonEmpty Double)))
(NonEmpty (NonEmpty (NonEmpty Double)))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON GeofenceGeometry where
parseJSON :: Value -> Parser GeofenceGeometry
parseJSON =
String
-> (Object -> Parser GeofenceGeometry)
-> Value
-> Parser GeofenceGeometry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GeofenceGeometry"
( \Object
x ->
Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
-> GeofenceGeometry
GeofenceGeometry' (Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
-> GeofenceGeometry)
-> Parser
(Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double)))))
-> Parser GeofenceGeometry
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Parser
(Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double)))))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Polygon")
)
instance Prelude.Hashable GeofenceGeometry
instance Prelude.NFData GeofenceGeometry
instance Core.ToJSON GeofenceGeometry where
toJSON :: GeofenceGeometry -> Value
toJSON GeofenceGeometry' {Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
polygon :: Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
$sel:polygon:GeofenceGeometry' :: GeofenceGeometry
-> Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"Polygon" Text -> NonEmpty (NonEmpty (Sensitive (NonEmpty Double))) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))) -> Pair)
-> Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
-> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty (NonEmpty (Sensitive (NonEmpty Double))))
polygon]
)