{-# 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.BatchPutGeofenceRequestEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types.GeofenceGeometry
import qualified Amazonka.Prelude as Prelude
data BatchPutGeofenceRequestEntry = BatchPutGeofenceRequestEntry'
{
BatchPutGeofenceRequestEntry -> Text
geofenceId :: Prelude.Text,
BatchPutGeofenceRequestEntry -> GeofenceGeometry
geometry :: GeofenceGeometry
}
deriving (BatchPutGeofenceRequestEntry
-> BatchPutGeofenceRequestEntry -> Bool
(BatchPutGeofenceRequestEntry
-> BatchPutGeofenceRequestEntry -> Bool)
-> (BatchPutGeofenceRequestEntry
-> BatchPutGeofenceRequestEntry -> Bool)
-> Eq BatchPutGeofenceRequestEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchPutGeofenceRequestEntry
-> BatchPutGeofenceRequestEntry -> Bool
$c/= :: BatchPutGeofenceRequestEntry
-> BatchPutGeofenceRequestEntry -> Bool
== :: BatchPutGeofenceRequestEntry
-> BatchPutGeofenceRequestEntry -> Bool
$c== :: BatchPutGeofenceRequestEntry
-> BatchPutGeofenceRequestEntry -> Bool
Prelude.Eq, Int -> BatchPutGeofenceRequestEntry -> ShowS
[BatchPutGeofenceRequestEntry] -> ShowS
BatchPutGeofenceRequestEntry -> String
(Int -> BatchPutGeofenceRequestEntry -> ShowS)
-> (BatchPutGeofenceRequestEntry -> String)
-> ([BatchPutGeofenceRequestEntry] -> ShowS)
-> Show BatchPutGeofenceRequestEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchPutGeofenceRequestEntry] -> ShowS
$cshowList :: [BatchPutGeofenceRequestEntry] -> ShowS
show :: BatchPutGeofenceRequestEntry -> String
$cshow :: BatchPutGeofenceRequestEntry -> String
showsPrec :: Int -> BatchPutGeofenceRequestEntry -> ShowS
$cshowsPrec :: Int -> BatchPutGeofenceRequestEntry -> ShowS
Prelude.Show, (forall x.
BatchPutGeofenceRequestEntry -> Rep BatchPutGeofenceRequestEntry x)
-> (forall x.
Rep BatchPutGeofenceRequestEntry x -> BatchPutGeofenceRequestEntry)
-> Generic BatchPutGeofenceRequestEntry
forall x.
Rep BatchPutGeofenceRequestEntry x -> BatchPutGeofenceRequestEntry
forall x.
BatchPutGeofenceRequestEntry -> Rep BatchPutGeofenceRequestEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchPutGeofenceRequestEntry x -> BatchPutGeofenceRequestEntry
$cfrom :: forall x.
BatchPutGeofenceRequestEntry -> Rep BatchPutGeofenceRequestEntry x
Prelude.Generic)
newBatchPutGeofenceRequestEntry ::
Prelude.Text ->
GeofenceGeometry ->
BatchPutGeofenceRequestEntry
newBatchPutGeofenceRequestEntry :: Text -> GeofenceGeometry -> BatchPutGeofenceRequestEntry
newBatchPutGeofenceRequestEntry
Text
pGeofenceId_
GeofenceGeometry
pGeometry_ =
BatchPutGeofenceRequestEntry' :: Text -> GeofenceGeometry -> BatchPutGeofenceRequestEntry
BatchPutGeofenceRequestEntry'
{ $sel:geofenceId:BatchPutGeofenceRequestEntry' :: Text
geofenceId =
Text
pGeofenceId_,
$sel:geometry:BatchPutGeofenceRequestEntry' :: GeofenceGeometry
geometry = GeofenceGeometry
pGeometry_
}
batchPutGeofenceRequestEntry_geofenceId :: Lens.Lens' BatchPutGeofenceRequestEntry Prelude.Text
batchPutGeofenceRequestEntry_geofenceId :: (Text -> f Text)
-> BatchPutGeofenceRequestEntry -> f BatchPutGeofenceRequestEntry
batchPutGeofenceRequestEntry_geofenceId = (BatchPutGeofenceRequestEntry -> Text)
-> (BatchPutGeofenceRequestEntry
-> Text -> BatchPutGeofenceRequestEntry)
-> Lens
BatchPutGeofenceRequestEntry BatchPutGeofenceRequestEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofenceRequestEntry' {Text
geofenceId :: Text
$sel:geofenceId:BatchPutGeofenceRequestEntry' :: BatchPutGeofenceRequestEntry -> Text
geofenceId} -> Text
geofenceId) (\s :: BatchPutGeofenceRequestEntry
s@BatchPutGeofenceRequestEntry' {} Text
a -> BatchPutGeofenceRequestEntry
s {$sel:geofenceId:BatchPutGeofenceRequestEntry' :: Text
geofenceId = Text
a} :: BatchPutGeofenceRequestEntry)
batchPutGeofenceRequestEntry_geometry :: Lens.Lens' BatchPutGeofenceRequestEntry GeofenceGeometry
batchPutGeofenceRequestEntry_geometry :: (GeofenceGeometry -> f GeofenceGeometry)
-> BatchPutGeofenceRequestEntry -> f BatchPutGeofenceRequestEntry
batchPutGeofenceRequestEntry_geometry = (BatchPutGeofenceRequestEntry -> GeofenceGeometry)
-> (BatchPutGeofenceRequestEntry
-> GeofenceGeometry -> BatchPutGeofenceRequestEntry)
-> Lens
BatchPutGeofenceRequestEntry
BatchPutGeofenceRequestEntry
GeofenceGeometry
GeofenceGeometry
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofenceRequestEntry' {GeofenceGeometry
geometry :: GeofenceGeometry
$sel:geometry:BatchPutGeofenceRequestEntry' :: BatchPutGeofenceRequestEntry -> GeofenceGeometry
geometry} -> GeofenceGeometry
geometry) (\s :: BatchPutGeofenceRequestEntry
s@BatchPutGeofenceRequestEntry' {} GeofenceGeometry
a -> BatchPutGeofenceRequestEntry
s {$sel:geometry:BatchPutGeofenceRequestEntry' :: GeofenceGeometry
geometry = GeofenceGeometry
a} :: BatchPutGeofenceRequestEntry)
instance
Prelude.Hashable
BatchPutGeofenceRequestEntry
instance Prelude.NFData BatchPutGeofenceRequestEntry
instance Core.ToJSON BatchPutGeofenceRequestEntry where
toJSON :: BatchPutGeofenceRequestEntry -> Value
toJSON BatchPutGeofenceRequestEntry' {Text
GeofenceGeometry
geometry :: GeofenceGeometry
geofenceId :: Text
$sel:geometry:BatchPutGeofenceRequestEntry' :: BatchPutGeofenceRequestEntry -> GeofenceGeometry
$sel:geofenceId:BatchPutGeofenceRequestEntry' :: BatchPutGeofenceRequestEntry -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GeofenceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
geofenceId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Geometry" Text -> GeofenceGeometry -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= GeofenceGeometry
geometry)
]
)