{-# 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.FraudDetector.Types.BatchGetVariableError
-- 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.FraudDetector.Types.BatchGetVariableError where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provides the error of the batch get variable API.
--
-- /See:/ 'newBatchGetVariableError' smart constructor.
data BatchGetVariableError = BatchGetVariableError'
  { -- | The error code.
    BatchGetVariableError -> Maybe Int
code :: Prelude.Maybe Prelude.Int,
    -- | The error message.
    BatchGetVariableError -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The error name.
    BatchGetVariableError -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchGetVariableError -> BatchGetVariableError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetVariableError -> BatchGetVariableError -> Bool
$c/= :: BatchGetVariableError -> BatchGetVariableError -> Bool
== :: BatchGetVariableError -> BatchGetVariableError -> Bool
$c== :: BatchGetVariableError -> BatchGetVariableError -> Bool
Prelude.Eq, ReadPrec [BatchGetVariableError]
ReadPrec BatchGetVariableError
Int -> ReadS BatchGetVariableError
ReadS [BatchGetVariableError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetVariableError]
$creadListPrec :: ReadPrec [BatchGetVariableError]
readPrec :: ReadPrec BatchGetVariableError
$creadPrec :: ReadPrec BatchGetVariableError
readList :: ReadS [BatchGetVariableError]
$creadList :: ReadS [BatchGetVariableError]
readsPrec :: Int -> ReadS BatchGetVariableError
$creadsPrec :: Int -> ReadS BatchGetVariableError
Prelude.Read, Int -> BatchGetVariableError -> ShowS
[BatchGetVariableError] -> ShowS
BatchGetVariableError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetVariableError] -> ShowS
$cshowList :: [BatchGetVariableError] -> ShowS
show :: BatchGetVariableError -> String
$cshow :: BatchGetVariableError -> String
showsPrec :: Int -> BatchGetVariableError -> ShowS
$cshowsPrec :: Int -> BatchGetVariableError -> ShowS
Prelude.Show, forall x. Rep BatchGetVariableError x -> BatchGetVariableError
forall x. BatchGetVariableError -> Rep BatchGetVariableError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetVariableError x -> BatchGetVariableError
$cfrom :: forall x. BatchGetVariableError -> Rep BatchGetVariableError x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetVariableError' 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:
--
-- 'code', 'batchGetVariableError_code' - The error code.
--
-- 'message', 'batchGetVariableError_message' - The error message.
--
-- 'name', 'batchGetVariableError_name' - The error name.
newBatchGetVariableError ::
  BatchGetVariableError
newBatchGetVariableError :: BatchGetVariableError
newBatchGetVariableError =
  BatchGetVariableError'
    { $sel:code:BatchGetVariableError' :: Maybe Int
code = forall a. Maybe a
Prelude.Nothing,
      $sel:message:BatchGetVariableError' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
      $sel:name:BatchGetVariableError' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The error code.
batchGetVariableError_code :: Lens.Lens' BatchGetVariableError (Prelude.Maybe Prelude.Int)
batchGetVariableError_code :: Lens' BatchGetVariableError (Maybe Int)
batchGetVariableError_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetVariableError' {Maybe Int
code :: Maybe Int
$sel:code:BatchGetVariableError' :: BatchGetVariableError -> Maybe Int
code} -> Maybe Int
code) (\s :: BatchGetVariableError
s@BatchGetVariableError' {} Maybe Int
a -> BatchGetVariableError
s {$sel:code:BatchGetVariableError' :: Maybe Int
code = Maybe Int
a} :: BatchGetVariableError)

-- | The error message.
batchGetVariableError_message :: Lens.Lens' BatchGetVariableError (Prelude.Maybe Prelude.Text)
batchGetVariableError_message :: Lens' BatchGetVariableError (Maybe Text)
batchGetVariableError_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetVariableError' {Maybe Text
message :: Maybe Text
$sel:message:BatchGetVariableError' :: BatchGetVariableError -> Maybe Text
message} -> Maybe Text
message) (\s :: BatchGetVariableError
s@BatchGetVariableError' {} Maybe Text
a -> BatchGetVariableError
s {$sel:message:BatchGetVariableError' :: Maybe Text
message = Maybe Text
a} :: BatchGetVariableError)

-- | The error name.
batchGetVariableError_name :: Lens.Lens' BatchGetVariableError (Prelude.Maybe Prelude.Text)
batchGetVariableError_name :: Lens' BatchGetVariableError (Maybe Text)
batchGetVariableError_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetVariableError' {Maybe Text
name :: Maybe Text
$sel:name:BatchGetVariableError' :: BatchGetVariableError -> Maybe Text
name} -> Maybe Text
name) (\s :: BatchGetVariableError
s@BatchGetVariableError' {} Maybe Text
a -> BatchGetVariableError
s {$sel:name:BatchGetVariableError' :: Maybe Text
name = Maybe Text
a} :: BatchGetVariableError)

instance Data.FromJSON BatchGetVariableError where
  parseJSON :: Value -> Parser BatchGetVariableError
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchGetVariableError"
      ( \Object
x ->
          Maybe Int -> Maybe Text -> Maybe Text -> BatchGetVariableError
BatchGetVariableError'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"code")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"message")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
      )

instance Prelude.Hashable BatchGetVariableError where
  hashWithSalt :: Int -> BatchGetVariableError -> Int
hashWithSalt Int
_salt BatchGetVariableError' {Maybe Int
Maybe Text
name :: Maybe Text
message :: Maybe Text
code :: Maybe Int
$sel:name:BatchGetVariableError' :: BatchGetVariableError -> Maybe Text
$sel:message:BatchGetVariableError' :: BatchGetVariableError -> Maybe Text
$sel:code:BatchGetVariableError' :: BatchGetVariableError -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
code
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData BatchGetVariableError where
  rnf :: BatchGetVariableError -> ()
rnf BatchGetVariableError' {Maybe Int
Maybe Text
name :: Maybe Text
message :: Maybe Text
code :: Maybe Int
$sel:name:BatchGetVariableError' :: BatchGetVariableError -> Maybe Text
$sel:message:BatchGetVariableError' :: BatchGetVariableError -> Maybe Text
$sel:code:BatchGetVariableError' :: BatchGetVariableError -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
code
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name