{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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
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.
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'
{ $sel:geofenceId:BatchPutGeofenceRequestEntry' :: Text
geofenceId =
Text
pGeofenceId_,
$sel:geometry:BatchPutGeofenceRequestEntry' :: GeofenceGeometry
geometry = GeofenceGeometry
pGeometry_
}
batchPutGeofenceRequestEntry_geofenceId :: Lens.Lens' BatchPutGeofenceRequestEntry Prelude.Text
batchPutGeofenceRequestEntry_geofenceId :: Lens' BatchPutGeofenceRequestEntry Text
batchPutGeofenceRequestEntry_geofenceId = 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 :: Lens' BatchPutGeofenceRequestEntry GeofenceGeometry
batchPutGeofenceRequestEntry_geometry = 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
where
hashWithSalt :: Int -> BatchPutGeofenceRequestEntry -> Int
hashWithSalt Int
_salt BatchPutGeofenceRequestEntry' {Text
GeofenceGeometry
geometry :: GeofenceGeometry
geofenceId :: Text
$sel:geometry:BatchPutGeofenceRequestEntry' :: BatchPutGeofenceRequestEntry -> GeofenceGeometry
$sel:geofenceId:BatchPutGeofenceRequestEntry' :: BatchPutGeofenceRequestEntry -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
geofenceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` GeofenceGeometry
geometry
instance Prelude.NFData BatchPutGeofenceRequestEntry where
rnf :: BatchPutGeofenceRequestEntry -> ()
rnf BatchPutGeofenceRequestEntry' {Text
GeofenceGeometry
geometry :: GeofenceGeometry
geofenceId :: Text
$sel:geometry:BatchPutGeofenceRequestEntry' :: BatchPutGeofenceRequestEntry -> GeofenceGeometry
$sel:geofenceId:BatchPutGeofenceRequestEntry' :: BatchPutGeofenceRequestEntry -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
geofenceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf GeofenceGeometry
geometry
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"GeofenceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
geofenceId),
forall a. a -> Maybe a
Prelude.Just (Key
"Geometry" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= GeofenceGeometry
geometry)
]
)