{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Location.BatchPutGeofence
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- A batch request for storing geofence geometries into a given geofence
-- collection, or updates the geometry of an existing geofence if a
-- geofence ID is included in the request.
module Amazonka.Location.BatchPutGeofence
  ( -- * Creating a Request
    BatchPutGeofence (..),
    newBatchPutGeofence,

    -- * Request Lenses
    batchPutGeofence_collectionName,
    batchPutGeofence_entries,

    -- * Destructuring the Response
    BatchPutGeofenceResponse (..),
    newBatchPutGeofenceResponse,

    -- * Response Lenses
    batchPutGeofenceResponse_httpStatus,
    batchPutGeofenceResponse_errors,
    batchPutGeofenceResponse_successes,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newBatchPutGeofence' smart constructor.
data BatchPutGeofence = BatchPutGeofence'
  { -- | The geofence collection storing the geofences.
    BatchPutGeofence -> Text
collectionName :: Prelude.Text,
    -- | The batch of geofences to be stored in a geofence collection.
    BatchPutGeofence -> NonEmpty BatchPutGeofenceRequestEntry
entries :: Prelude.NonEmpty BatchPutGeofenceRequestEntry
  }
  deriving (BatchPutGeofence -> BatchPutGeofence -> Bool
(BatchPutGeofence -> BatchPutGeofence -> Bool)
-> (BatchPutGeofence -> BatchPutGeofence -> Bool)
-> Eq BatchPutGeofence
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchPutGeofence -> BatchPutGeofence -> Bool
$c/= :: BatchPutGeofence -> BatchPutGeofence -> Bool
== :: BatchPutGeofence -> BatchPutGeofence -> Bool
$c== :: BatchPutGeofence -> BatchPutGeofence -> Bool
Prelude.Eq, Int -> BatchPutGeofence -> ShowS
[BatchPutGeofence] -> ShowS
BatchPutGeofence -> String
(Int -> BatchPutGeofence -> ShowS)
-> (BatchPutGeofence -> String)
-> ([BatchPutGeofence] -> ShowS)
-> Show BatchPutGeofence
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchPutGeofence] -> ShowS
$cshowList :: [BatchPutGeofence] -> ShowS
show :: BatchPutGeofence -> String
$cshow :: BatchPutGeofence -> String
showsPrec :: Int -> BatchPutGeofence -> ShowS
$cshowsPrec :: Int -> BatchPutGeofence -> ShowS
Prelude.Show, (forall x. BatchPutGeofence -> Rep BatchPutGeofence x)
-> (forall x. Rep BatchPutGeofence x -> BatchPutGeofence)
-> Generic BatchPutGeofence
forall x. Rep BatchPutGeofence x -> BatchPutGeofence
forall x. BatchPutGeofence -> Rep BatchPutGeofence x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchPutGeofence x -> BatchPutGeofence
$cfrom :: forall x. BatchPutGeofence -> Rep BatchPutGeofence x
Prelude.Generic)

-- |
-- Create a value of 'BatchPutGeofence' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'collectionName', 'batchPutGeofence_collectionName' - The geofence collection storing the geofences.
--
-- 'entries', 'batchPutGeofence_entries' - The batch of geofences to be stored in a geofence collection.
newBatchPutGeofence ::
  -- | 'collectionName'
  Prelude.Text ->
  -- | 'entries'
  Prelude.NonEmpty BatchPutGeofenceRequestEntry ->
  BatchPutGeofence
newBatchPutGeofence :: Text -> NonEmpty BatchPutGeofenceRequestEntry -> BatchPutGeofence
newBatchPutGeofence Text
pCollectionName_ NonEmpty BatchPutGeofenceRequestEntry
pEntries_ =
  BatchPutGeofence' :: Text -> NonEmpty BatchPutGeofenceRequestEntry -> BatchPutGeofence
BatchPutGeofence'
    { $sel:collectionName:BatchPutGeofence' :: Text
collectionName =
        Text
pCollectionName_,
      $sel:entries:BatchPutGeofence' :: NonEmpty BatchPutGeofenceRequestEntry
entries = Tagged
  (NonEmpty BatchPutGeofenceRequestEntry)
  (Identity (NonEmpty BatchPutGeofenceRequestEntry))
-> Tagged
     (NonEmpty BatchPutGeofenceRequestEntry)
     (Identity (NonEmpty BatchPutGeofenceRequestEntry))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty BatchPutGeofenceRequestEntry)
   (Identity (NonEmpty BatchPutGeofenceRequestEntry))
 -> Tagged
      (NonEmpty BatchPutGeofenceRequestEntry)
      (Identity (NonEmpty BatchPutGeofenceRequestEntry)))
-> NonEmpty BatchPutGeofenceRequestEntry
-> NonEmpty BatchPutGeofenceRequestEntry
forall t b. AReview t b -> b -> t
Lens.# NonEmpty BatchPutGeofenceRequestEntry
pEntries_
    }

-- | The geofence collection storing the geofences.
batchPutGeofence_collectionName :: Lens.Lens' BatchPutGeofence Prelude.Text
batchPutGeofence_collectionName :: (Text -> f Text) -> BatchPutGeofence -> f BatchPutGeofence
batchPutGeofence_collectionName = (BatchPutGeofence -> Text)
-> (BatchPutGeofence -> Text -> BatchPutGeofence)
-> Lens BatchPutGeofence BatchPutGeofence Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofence' {Text
collectionName :: Text
$sel:collectionName:BatchPutGeofence' :: BatchPutGeofence -> Text
collectionName} -> Text
collectionName) (\s :: BatchPutGeofence
s@BatchPutGeofence' {} Text
a -> BatchPutGeofence
s {$sel:collectionName:BatchPutGeofence' :: Text
collectionName = Text
a} :: BatchPutGeofence)

-- | The batch of geofences to be stored in a geofence collection.
batchPutGeofence_entries :: Lens.Lens' BatchPutGeofence (Prelude.NonEmpty BatchPutGeofenceRequestEntry)
batchPutGeofence_entries :: (NonEmpty BatchPutGeofenceRequestEntry
 -> f (NonEmpty BatchPutGeofenceRequestEntry))
-> BatchPutGeofence -> f BatchPutGeofence
batchPutGeofence_entries = (BatchPutGeofence -> NonEmpty BatchPutGeofenceRequestEntry)
-> (BatchPutGeofence
    -> NonEmpty BatchPutGeofenceRequestEntry -> BatchPutGeofence)
-> Lens
     BatchPutGeofence
     BatchPutGeofence
     (NonEmpty BatchPutGeofenceRequestEntry)
     (NonEmpty BatchPutGeofenceRequestEntry)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofence' {NonEmpty BatchPutGeofenceRequestEntry
entries :: NonEmpty BatchPutGeofenceRequestEntry
$sel:entries:BatchPutGeofence' :: BatchPutGeofence -> NonEmpty BatchPutGeofenceRequestEntry
entries} -> NonEmpty BatchPutGeofenceRequestEntry
entries) (\s :: BatchPutGeofence
s@BatchPutGeofence' {} NonEmpty BatchPutGeofenceRequestEntry
a -> BatchPutGeofence
s {$sel:entries:BatchPutGeofence' :: NonEmpty BatchPutGeofenceRequestEntry
entries = NonEmpty BatchPutGeofenceRequestEntry
a} :: BatchPutGeofence) ((NonEmpty BatchPutGeofenceRequestEntry
  -> f (NonEmpty BatchPutGeofenceRequestEntry))
 -> BatchPutGeofence -> f BatchPutGeofence)
-> ((NonEmpty BatchPutGeofenceRequestEntry
     -> f (NonEmpty BatchPutGeofenceRequestEntry))
    -> NonEmpty BatchPutGeofenceRequestEntry
    -> f (NonEmpty BatchPutGeofenceRequestEntry))
-> (NonEmpty BatchPutGeofenceRequestEntry
    -> f (NonEmpty BatchPutGeofenceRequestEntry))
-> BatchPutGeofence
-> f BatchPutGeofence
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty BatchPutGeofenceRequestEntry
 -> f (NonEmpty BatchPutGeofenceRequestEntry))
-> NonEmpty BatchPutGeofenceRequestEntry
-> f (NonEmpty BatchPutGeofenceRequestEntry)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest BatchPutGeofence where
  type
    AWSResponse BatchPutGeofence =
      BatchPutGeofenceResponse
  request :: BatchPutGeofence -> Request BatchPutGeofence
request = Service -> BatchPutGeofence -> Request BatchPutGeofence
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchPutGeofence
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse BatchPutGeofence)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchPutGeofence))
-> Logger
-> Service
-> Proxy BatchPutGeofence
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse BatchPutGeofence)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> [BatchPutGeofenceError]
-> [BatchPutGeofenceSuccess]
-> BatchPutGeofenceResponse
BatchPutGeofenceResponse'
            (Int
 -> [BatchPutGeofenceError]
 -> [BatchPutGeofenceSuccess]
 -> BatchPutGeofenceResponse)
-> Either String Int
-> Either
     String
     ([BatchPutGeofenceError]
      -> [BatchPutGeofenceSuccess] -> BatchPutGeofenceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  ([BatchPutGeofenceError]
   -> [BatchPutGeofenceSuccess] -> BatchPutGeofenceResponse)
-> Either String [BatchPutGeofenceError]
-> Either
     String ([BatchPutGeofenceSuccess] -> BatchPutGeofenceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [BatchPutGeofenceError])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Errors" Either String (Maybe [BatchPutGeofenceError])
-> [BatchPutGeofenceError] -> Either String [BatchPutGeofenceError]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [BatchPutGeofenceError]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String ([BatchPutGeofenceSuccess] -> BatchPutGeofenceResponse)
-> Either String [BatchPutGeofenceSuccess]
-> Either String BatchPutGeofenceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [BatchPutGeofenceSuccess])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Successes" Either String (Maybe [BatchPutGeofenceSuccess])
-> [BatchPutGeofenceSuccess]
-> Either String [BatchPutGeofenceSuccess]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [BatchPutGeofenceSuccess]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable BatchPutGeofence

instance Prelude.NFData BatchPutGeofence

instance Core.ToHeaders BatchPutGeofence where
  toHeaders :: BatchPutGeofence -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchPutGeofence -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON BatchPutGeofence where
  toJSON :: BatchPutGeofence -> Value
toJSON BatchPutGeofence' {NonEmpty BatchPutGeofenceRequestEntry
Text
entries :: NonEmpty BatchPutGeofenceRequestEntry
collectionName :: Text
$sel:entries:BatchPutGeofence' :: BatchPutGeofence -> NonEmpty BatchPutGeofenceRequestEntry
$sel:collectionName:BatchPutGeofence' :: BatchPutGeofence -> 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
"Entries" Text -> NonEmpty BatchPutGeofenceRequestEntry -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty BatchPutGeofenceRequestEntry
entries)]
      )

instance Core.ToPath BatchPutGeofence where
  toPath :: BatchPutGeofence -> ByteString
toPath BatchPutGeofence' {NonEmpty BatchPutGeofenceRequestEntry
Text
entries :: NonEmpty BatchPutGeofenceRequestEntry
collectionName :: Text
$sel:entries:BatchPutGeofence' :: BatchPutGeofence -> NonEmpty BatchPutGeofenceRequestEntry
$sel:collectionName:BatchPutGeofence' :: BatchPutGeofence -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/geofencing/v0/collections/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
collectionName,
        ByteString
"/put-geofences"
      ]

instance Core.ToQuery BatchPutGeofence where
  toQuery :: BatchPutGeofence -> QueryString
toQuery = QueryString -> BatchPutGeofence -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newBatchPutGeofenceResponse' smart constructor.
data BatchPutGeofenceResponse = BatchPutGeofenceResponse'
  { -- | The response's http status code.
    BatchPutGeofenceResponse -> Int
httpStatus :: Prelude.Int,
    -- | Contains additional error details for each geofence that failed to be
    -- stored in a geofence collection.
    BatchPutGeofenceResponse -> [BatchPutGeofenceError]
errors :: [BatchPutGeofenceError],
    -- | Contains each geofence that was successfully stored in a geofence
    -- collection.
    BatchPutGeofenceResponse -> [BatchPutGeofenceSuccess]
successes :: [BatchPutGeofenceSuccess]
  }
  deriving (BatchPutGeofenceResponse -> BatchPutGeofenceResponse -> Bool
(BatchPutGeofenceResponse -> BatchPutGeofenceResponse -> Bool)
-> (BatchPutGeofenceResponse -> BatchPutGeofenceResponse -> Bool)
-> Eq BatchPutGeofenceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchPutGeofenceResponse -> BatchPutGeofenceResponse -> Bool
$c/= :: BatchPutGeofenceResponse -> BatchPutGeofenceResponse -> Bool
== :: BatchPutGeofenceResponse -> BatchPutGeofenceResponse -> Bool
$c== :: BatchPutGeofenceResponse -> BatchPutGeofenceResponse -> Bool
Prelude.Eq, ReadPrec [BatchPutGeofenceResponse]
ReadPrec BatchPutGeofenceResponse
Int -> ReadS BatchPutGeofenceResponse
ReadS [BatchPutGeofenceResponse]
(Int -> ReadS BatchPutGeofenceResponse)
-> ReadS [BatchPutGeofenceResponse]
-> ReadPrec BatchPutGeofenceResponse
-> ReadPrec [BatchPutGeofenceResponse]
-> Read BatchPutGeofenceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchPutGeofenceResponse]
$creadListPrec :: ReadPrec [BatchPutGeofenceResponse]
readPrec :: ReadPrec BatchPutGeofenceResponse
$creadPrec :: ReadPrec BatchPutGeofenceResponse
readList :: ReadS [BatchPutGeofenceResponse]
$creadList :: ReadS [BatchPutGeofenceResponse]
readsPrec :: Int -> ReadS BatchPutGeofenceResponse
$creadsPrec :: Int -> ReadS BatchPutGeofenceResponse
Prelude.Read, Int -> BatchPutGeofenceResponse -> ShowS
[BatchPutGeofenceResponse] -> ShowS
BatchPutGeofenceResponse -> String
(Int -> BatchPutGeofenceResponse -> ShowS)
-> (BatchPutGeofenceResponse -> String)
-> ([BatchPutGeofenceResponse] -> ShowS)
-> Show BatchPutGeofenceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchPutGeofenceResponse] -> ShowS
$cshowList :: [BatchPutGeofenceResponse] -> ShowS
show :: BatchPutGeofenceResponse -> String
$cshow :: BatchPutGeofenceResponse -> String
showsPrec :: Int -> BatchPutGeofenceResponse -> ShowS
$cshowsPrec :: Int -> BatchPutGeofenceResponse -> ShowS
Prelude.Show, (forall x.
 BatchPutGeofenceResponse -> Rep BatchPutGeofenceResponse x)
-> (forall x.
    Rep BatchPutGeofenceResponse x -> BatchPutGeofenceResponse)
-> Generic BatchPutGeofenceResponse
forall x.
Rep BatchPutGeofenceResponse x -> BatchPutGeofenceResponse
forall x.
BatchPutGeofenceResponse -> Rep BatchPutGeofenceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchPutGeofenceResponse x -> BatchPutGeofenceResponse
$cfrom :: forall x.
BatchPutGeofenceResponse -> Rep BatchPutGeofenceResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchPutGeofenceResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'batchPutGeofenceResponse_httpStatus' - The response's http status code.
--
-- 'errors', 'batchPutGeofenceResponse_errors' - Contains additional error details for each geofence that failed to be
-- stored in a geofence collection.
--
-- 'successes', 'batchPutGeofenceResponse_successes' - Contains each geofence that was successfully stored in a geofence
-- collection.
newBatchPutGeofenceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchPutGeofenceResponse
newBatchPutGeofenceResponse :: Int -> BatchPutGeofenceResponse
newBatchPutGeofenceResponse Int
pHttpStatus_ =
  BatchPutGeofenceResponse' :: Int
-> [BatchPutGeofenceError]
-> [BatchPutGeofenceSuccess]
-> BatchPutGeofenceResponse
BatchPutGeofenceResponse'
    { $sel:httpStatus:BatchPutGeofenceResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:errors:BatchPutGeofenceResponse' :: [BatchPutGeofenceError]
errors = [BatchPutGeofenceError]
forall a. Monoid a => a
Prelude.mempty,
      $sel:successes:BatchPutGeofenceResponse' :: [BatchPutGeofenceSuccess]
successes = [BatchPutGeofenceSuccess]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The response's http status code.
batchPutGeofenceResponse_httpStatus :: Lens.Lens' BatchPutGeofenceResponse Prelude.Int
batchPutGeofenceResponse_httpStatus :: (Int -> f Int)
-> BatchPutGeofenceResponse -> f BatchPutGeofenceResponse
batchPutGeofenceResponse_httpStatus = (BatchPutGeofenceResponse -> Int)
-> (BatchPutGeofenceResponse -> Int -> BatchPutGeofenceResponse)
-> Lens BatchPutGeofenceResponse BatchPutGeofenceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofenceResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchPutGeofenceResponse' :: BatchPutGeofenceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchPutGeofenceResponse
s@BatchPutGeofenceResponse' {} Int
a -> BatchPutGeofenceResponse
s {$sel:httpStatus:BatchPutGeofenceResponse' :: Int
httpStatus = Int
a} :: BatchPutGeofenceResponse)

-- | Contains additional error details for each geofence that failed to be
-- stored in a geofence collection.
batchPutGeofenceResponse_errors :: Lens.Lens' BatchPutGeofenceResponse [BatchPutGeofenceError]
batchPutGeofenceResponse_errors :: ([BatchPutGeofenceError] -> f [BatchPutGeofenceError])
-> BatchPutGeofenceResponse -> f BatchPutGeofenceResponse
batchPutGeofenceResponse_errors = (BatchPutGeofenceResponse -> [BatchPutGeofenceError])
-> (BatchPutGeofenceResponse
    -> [BatchPutGeofenceError] -> BatchPutGeofenceResponse)
-> Lens
     BatchPutGeofenceResponse
     BatchPutGeofenceResponse
     [BatchPutGeofenceError]
     [BatchPutGeofenceError]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofenceResponse' {[BatchPutGeofenceError]
errors :: [BatchPutGeofenceError]
$sel:errors:BatchPutGeofenceResponse' :: BatchPutGeofenceResponse -> [BatchPutGeofenceError]
errors} -> [BatchPutGeofenceError]
errors) (\s :: BatchPutGeofenceResponse
s@BatchPutGeofenceResponse' {} [BatchPutGeofenceError]
a -> BatchPutGeofenceResponse
s {$sel:errors:BatchPutGeofenceResponse' :: [BatchPutGeofenceError]
errors = [BatchPutGeofenceError]
a} :: BatchPutGeofenceResponse) (([BatchPutGeofenceError] -> f [BatchPutGeofenceError])
 -> BatchPutGeofenceResponse -> f BatchPutGeofenceResponse)
-> (([BatchPutGeofenceError] -> f [BatchPutGeofenceError])
    -> [BatchPutGeofenceError] -> f [BatchPutGeofenceError])
-> ([BatchPutGeofenceError] -> f [BatchPutGeofenceError])
-> BatchPutGeofenceResponse
-> f BatchPutGeofenceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchPutGeofenceError] -> f [BatchPutGeofenceError])
-> [BatchPutGeofenceError] -> f [BatchPutGeofenceError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Contains each geofence that was successfully stored in a geofence
-- collection.
batchPutGeofenceResponse_successes :: Lens.Lens' BatchPutGeofenceResponse [BatchPutGeofenceSuccess]
batchPutGeofenceResponse_successes :: ([BatchPutGeofenceSuccess] -> f [BatchPutGeofenceSuccess])
-> BatchPutGeofenceResponse -> f BatchPutGeofenceResponse
batchPutGeofenceResponse_successes = (BatchPutGeofenceResponse -> [BatchPutGeofenceSuccess])
-> (BatchPutGeofenceResponse
    -> [BatchPutGeofenceSuccess] -> BatchPutGeofenceResponse)
-> Lens
     BatchPutGeofenceResponse
     BatchPutGeofenceResponse
     [BatchPutGeofenceSuccess]
     [BatchPutGeofenceSuccess]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchPutGeofenceResponse' {[BatchPutGeofenceSuccess]
successes :: [BatchPutGeofenceSuccess]
$sel:successes:BatchPutGeofenceResponse' :: BatchPutGeofenceResponse -> [BatchPutGeofenceSuccess]
successes} -> [BatchPutGeofenceSuccess]
successes) (\s :: BatchPutGeofenceResponse
s@BatchPutGeofenceResponse' {} [BatchPutGeofenceSuccess]
a -> BatchPutGeofenceResponse
s {$sel:successes:BatchPutGeofenceResponse' :: [BatchPutGeofenceSuccess]
successes = [BatchPutGeofenceSuccess]
a} :: BatchPutGeofenceResponse) (([BatchPutGeofenceSuccess] -> f [BatchPutGeofenceSuccess])
 -> BatchPutGeofenceResponse -> f BatchPutGeofenceResponse)
-> (([BatchPutGeofenceSuccess] -> f [BatchPutGeofenceSuccess])
    -> [BatchPutGeofenceSuccess] -> f [BatchPutGeofenceSuccess])
-> ([BatchPutGeofenceSuccess] -> f [BatchPutGeofenceSuccess])
-> BatchPutGeofenceResponse
-> f BatchPutGeofenceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchPutGeofenceSuccess] -> f [BatchPutGeofenceSuccess])
-> [BatchPutGeofenceSuccess] -> f [BatchPutGeofenceSuccess]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData BatchPutGeofenceResponse