{-# 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.BatchCreateVariableError
-- 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.BatchCreateVariableError 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 create variable API.
--
-- /See:/ 'newBatchCreateVariableError' smart constructor.
data BatchCreateVariableError = BatchCreateVariableError'
  { -- | The error code.
    BatchCreateVariableError -> Maybe Int
code :: Prelude.Maybe Prelude.Int,
    -- | The error message.
    BatchCreateVariableError -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The name.
    BatchCreateVariableError -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchCreateVariableError -> BatchCreateVariableError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchCreateVariableError -> BatchCreateVariableError -> Bool
$c/= :: BatchCreateVariableError -> BatchCreateVariableError -> Bool
== :: BatchCreateVariableError -> BatchCreateVariableError -> Bool
$c== :: BatchCreateVariableError -> BatchCreateVariableError -> Bool
Prelude.Eq, ReadPrec [BatchCreateVariableError]
ReadPrec BatchCreateVariableError
Int -> ReadS BatchCreateVariableError
ReadS [BatchCreateVariableError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchCreateVariableError]
$creadListPrec :: ReadPrec [BatchCreateVariableError]
readPrec :: ReadPrec BatchCreateVariableError
$creadPrec :: ReadPrec BatchCreateVariableError
readList :: ReadS [BatchCreateVariableError]
$creadList :: ReadS [BatchCreateVariableError]
readsPrec :: Int -> ReadS BatchCreateVariableError
$creadsPrec :: Int -> ReadS BatchCreateVariableError
Prelude.Read, Int -> BatchCreateVariableError -> ShowS
[BatchCreateVariableError] -> ShowS
BatchCreateVariableError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchCreateVariableError] -> ShowS
$cshowList :: [BatchCreateVariableError] -> ShowS
show :: BatchCreateVariableError -> String
$cshow :: BatchCreateVariableError -> String
showsPrec :: Int -> BatchCreateVariableError -> ShowS
$cshowsPrec :: Int -> BatchCreateVariableError -> ShowS
Prelude.Show, forall x.
Rep BatchCreateVariableError x -> BatchCreateVariableError
forall x.
BatchCreateVariableError -> Rep BatchCreateVariableError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchCreateVariableError x -> BatchCreateVariableError
$cfrom :: forall x.
BatchCreateVariableError -> Rep BatchCreateVariableError x
Prelude.Generic)

-- |
-- Create a value of 'BatchCreateVariableError' 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', 'batchCreateVariableError_code' - The error code.
--
-- 'message', 'batchCreateVariableError_message' - The error message.
--
-- 'name', 'batchCreateVariableError_name' - The name.
newBatchCreateVariableError ::
  BatchCreateVariableError
newBatchCreateVariableError :: BatchCreateVariableError
newBatchCreateVariableError =
  BatchCreateVariableError'
    { $sel:code:BatchCreateVariableError' :: Maybe Int
code = forall a. Maybe a
Prelude.Nothing,
      $sel:message:BatchCreateVariableError' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
      $sel:name:BatchCreateVariableError' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

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

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

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

instance Data.FromJSON BatchCreateVariableError where
  parseJSON :: Value -> Parser BatchCreateVariableError
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchCreateVariableError"
      ( \Object
x ->
          Maybe Int -> Maybe Text -> Maybe Text -> BatchCreateVariableError
BatchCreateVariableError'
            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 BatchCreateVariableError where
  hashWithSalt :: Int -> BatchCreateVariableError -> Int
hashWithSalt Int
_salt BatchCreateVariableError' {Maybe Int
Maybe Text
name :: Maybe Text
message :: Maybe Text
code :: Maybe Int
$sel:name:BatchCreateVariableError' :: BatchCreateVariableError -> Maybe Text
$sel:message:BatchCreateVariableError' :: BatchCreateVariableError -> Maybe Text
$sel:code:BatchCreateVariableError' :: BatchCreateVariableError -> 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 BatchCreateVariableError where
  rnf :: BatchCreateVariableError -> ()
rnf BatchCreateVariableError' {Maybe Int
Maybe Text
name :: Maybe Text
message :: Maybe Text
code :: Maybe Int
$sel:name:BatchCreateVariableError' :: BatchCreateVariableError -> Maybe Text
$sel:message:BatchCreateVariableError' :: BatchCreateVariableError -> Maybe Text
$sel:code:BatchCreateVariableError' :: BatchCreateVariableError -> 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