{-# 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 #-}

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

-- |
-- Module      : Amazonka.Location.Types.BatchDeleteGeofenceError
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Location.Types.BatchDeleteGeofenceError 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.BatchItemError
import qualified Amazonka.Prelude as Prelude

-- | Contains error details for each geofence that failed to delete from the
-- geofence collection.
--
-- /See:/ 'newBatchDeleteGeofenceError' smart constructor.
data BatchDeleteGeofenceError = BatchDeleteGeofenceError'
  { -- | Contains details associated to the batch error.
    BatchDeleteGeofenceError -> BatchItemError
error :: BatchItemError,
    -- | The geofence associated with the error message.
    BatchDeleteGeofenceError -> Text
geofenceId :: Prelude.Text
  }
  deriving (BatchDeleteGeofenceError -> BatchDeleteGeofenceError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchDeleteGeofenceError -> BatchDeleteGeofenceError -> Bool
$c/= :: BatchDeleteGeofenceError -> BatchDeleteGeofenceError -> Bool
== :: BatchDeleteGeofenceError -> BatchDeleteGeofenceError -> Bool
$c== :: BatchDeleteGeofenceError -> BatchDeleteGeofenceError -> Bool
Prelude.Eq, ReadPrec [BatchDeleteGeofenceError]
ReadPrec BatchDeleteGeofenceError
Int -> ReadS BatchDeleteGeofenceError
ReadS [BatchDeleteGeofenceError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchDeleteGeofenceError]
$creadListPrec :: ReadPrec [BatchDeleteGeofenceError]
readPrec :: ReadPrec BatchDeleteGeofenceError
$creadPrec :: ReadPrec BatchDeleteGeofenceError
readList :: ReadS [BatchDeleteGeofenceError]
$creadList :: ReadS [BatchDeleteGeofenceError]
readsPrec :: Int -> ReadS BatchDeleteGeofenceError
$creadsPrec :: Int -> ReadS BatchDeleteGeofenceError
Prelude.Read, Int -> BatchDeleteGeofenceError -> ShowS
[BatchDeleteGeofenceError] -> ShowS
BatchDeleteGeofenceError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchDeleteGeofenceError] -> ShowS
$cshowList :: [BatchDeleteGeofenceError] -> ShowS
show :: BatchDeleteGeofenceError -> String
$cshow :: BatchDeleteGeofenceError -> String
showsPrec :: Int -> BatchDeleteGeofenceError -> ShowS
$cshowsPrec :: Int -> BatchDeleteGeofenceError -> ShowS
Prelude.Show, forall x.
Rep BatchDeleteGeofenceError x -> BatchDeleteGeofenceError
forall x.
BatchDeleteGeofenceError -> Rep BatchDeleteGeofenceError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchDeleteGeofenceError x -> BatchDeleteGeofenceError
$cfrom :: forall x.
BatchDeleteGeofenceError -> Rep BatchDeleteGeofenceError x
Prelude.Generic)

-- |
-- Create a value of 'BatchDeleteGeofenceError' 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:
--
-- 'error', 'batchDeleteGeofenceError_error' - Contains details associated to the batch error.
--
-- 'geofenceId', 'batchDeleteGeofenceError_geofenceId' - The geofence associated with the error message.
newBatchDeleteGeofenceError ::
  -- | 'error'
  BatchItemError ->
  -- | 'geofenceId'
  Prelude.Text ->
  BatchDeleteGeofenceError
newBatchDeleteGeofenceError :: BatchItemError -> Text -> BatchDeleteGeofenceError
newBatchDeleteGeofenceError BatchItemError
pError_ Text
pGeofenceId_ =
  BatchDeleteGeofenceError'
    { $sel:error:BatchDeleteGeofenceError' :: BatchItemError
error = BatchItemError
pError_,
      $sel:geofenceId:BatchDeleteGeofenceError' :: Text
geofenceId = Text
pGeofenceId_
    }

-- | Contains details associated to the batch error.
batchDeleteGeofenceError_error :: Lens.Lens' BatchDeleteGeofenceError BatchItemError
batchDeleteGeofenceError_error :: Lens' BatchDeleteGeofenceError BatchItemError
batchDeleteGeofenceError_error = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteGeofenceError' {BatchItemError
error :: BatchItemError
$sel:error:BatchDeleteGeofenceError' :: BatchDeleteGeofenceError -> BatchItemError
error} -> BatchItemError
error) (\s :: BatchDeleteGeofenceError
s@BatchDeleteGeofenceError' {} BatchItemError
a -> BatchDeleteGeofenceError
s {$sel:error:BatchDeleteGeofenceError' :: BatchItemError
error = BatchItemError
a} :: BatchDeleteGeofenceError)

-- | The geofence associated with the error message.
batchDeleteGeofenceError_geofenceId :: Lens.Lens' BatchDeleteGeofenceError Prelude.Text
batchDeleteGeofenceError_geofenceId :: Lens' BatchDeleteGeofenceError Text
batchDeleteGeofenceError_geofenceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchDeleteGeofenceError' {Text
geofenceId :: Text
$sel:geofenceId:BatchDeleteGeofenceError' :: BatchDeleteGeofenceError -> Text
geofenceId} -> Text
geofenceId) (\s :: BatchDeleteGeofenceError
s@BatchDeleteGeofenceError' {} Text
a -> BatchDeleteGeofenceError
s {$sel:geofenceId:BatchDeleteGeofenceError' :: Text
geofenceId = Text
a} :: BatchDeleteGeofenceError)

instance Data.FromJSON BatchDeleteGeofenceError where
  parseJSON :: Value -> Parser BatchDeleteGeofenceError
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchDeleteGeofenceError"
      ( \Object
x ->
          BatchItemError -> Text -> BatchDeleteGeofenceError
BatchDeleteGeofenceError'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Error")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"GeofenceId")
      )

instance Prelude.Hashable BatchDeleteGeofenceError where
  hashWithSalt :: Int -> BatchDeleteGeofenceError -> Int
hashWithSalt Int
_salt BatchDeleteGeofenceError' {Text
BatchItemError
geofenceId :: Text
error :: BatchItemError
$sel:geofenceId:BatchDeleteGeofenceError' :: BatchDeleteGeofenceError -> Text
$sel:error:BatchDeleteGeofenceError' :: BatchDeleteGeofenceError -> BatchItemError
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BatchItemError
error
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
geofenceId

instance Prelude.NFData BatchDeleteGeofenceError where
  rnf :: BatchDeleteGeofenceError -> ()
rnf BatchDeleteGeofenceError' {Text
BatchItemError
geofenceId :: Text
error :: BatchItemError
$sel:geofenceId:BatchDeleteGeofenceError' :: BatchDeleteGeofenceError -> Text
$sel:error:BatchDeleteGeofenceError' :: BatchDeleteGeofenceError -> BatchItemError
..} =
    forall a. NFData a => a -> ()
Prelude.rnf BatchItemError
error
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
geofenceId