{-# 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-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)
module Amazonka.FraudDetector.Types.BatchCreateVariableError where

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

-- | Provides the error of the batch create variable API.
--
-- /See:/ 'newBatchCreateVariableError' smart constructor.
data BatchCreateVariableError = BatchCreateVariableError'
  { -- | The name.
    BatchCreateVariableError -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The error code.
    BatchCreateVariableError -> Maybe Int
code :: Prelude.Maybe Prelude.Int,
    -- | The error message.
    BatchCreateVariableError -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (BatchCreateVariableError -> BatchCreateVariableError -> Bool
(BatchCreateVariableError -> BatchCreateVariableError -> Bool)
-> (BatchCreateVariableError -> BatchCreateVariableError -> Bool)
-> Eq BatchCreateVariableError
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]
(Int -> ReadS BatchCreateVariableError)
-> ReadS [BatchCreateVariableError]
-> ReadPrec BatchCreateVariableError
-> ReadPrec [BatchCreateVariableError]
-> Read 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
(Int -> BatchCreateVariableError -> ShowS)
-> (BatchCreateVariableError -> String)
-> ([BatchCreateVariableError] -> ShowS)
-> Show BatchCreateVariableError
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.
 BatchCreateVariableError -> Rep BatchCreateVariableError x)
-> (forall x.
    Rep BatchCreateVariableError x -> BatchCreateVariableError)
-> Generic BatchCreateVariableError
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:
--
-- 'name', 'batchCreateVariableError_name' - The name.
--
-- 'code', 'batchCreateVariableError_code' - The error code.
--
-- 'message', 'batchCreateVariableError_message' - The error message.
newBatchCreateVariableError ::
  BatchCreateVariableError
newBatchCreateVariableError :: BatchCreateVariableError
newBatchCreateVariableError =
  BatchCreateVariableError' :: Maybe Text -> Maybe Int -> Maybe Text -> BatchCreateVariableError
BatchCreateVariableError'
    { $sel:name:BatchCreateVariableError' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:code:BatchCreateVariableError' :: Maybe Int
code = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:message:BatchCreateVariableError' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name.
batchCreateVariableError_name :: Lens.Lens' BatchCreateVariableError (Prelude.Maybe Prelude.Text)
batchCreateVariableError_name :: (Maybe Text -> f (Maybe Text))
-> BatchCreateVariableError -> f BatchCreateVariableError
batchCreateVariableError_name = (BatchCreateVariableError -> Maybe Text)
-> (BatchCreateVariableError
    -> Maybe Text -> BatchCreateVariableError)
-> Lens
     BatchCreateVariableError
     BatchCreateVariableError
     (Maybe Text)
     (Maybe Text)
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)

-- | The error code.
batchCreateVariableError_code :: Lens.Lens' BatchCreateVariableError (Prelude.Maybe Prelude.Int)
batchCreateVariableError_code :: (Maybe Int -> f (Maybe Int))
-> BatchCreateVariableError -> f BatchCreateVariableError
batchCreateVariableError_code = (BatchCreateVariableError -> Maybe Int)
-> (BatchCreateVariableError
    -> Maybe Int -> BatchCreateVariableError)
-> Lens
     BatchCreateVariableError
     BatchCreateVariableError
     (Maybe Int)
     (Maybe Int)
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 :: (Maybe Text -> f (Maybe Text))
-> BatchCreateVariableError -> f BatchCreateVariableError
batchCreateVariableError_message = (BatchCreateVariableError -> Maybe Text)
-> (BatchCreateVariableError
    -> Maybe Text -> BatchCreateVariableError)
-> Lens
     BatchCreateVariableError
     BatchCreateVariableError
     (Maybe Text)
     (Maybe Text)
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)

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

instance Prelude.Hashable BatchCreateVariableError

instance Prelude.NFData BatchCreateVariableError