{-# 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.DataBrew.Types.RecipeVersionErrorDetail
-- 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.DataBrew.Types.RecipeVersionErrorDetail 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

-- | Represents any errors encountered when attempting to delete multiple
-- recipe versions.
--
-- /See:/ 'newRecipeVersionErrorDetail' smart constructor.
data RecipeVersionErrorDetail = RecipeVersionErrorDetail'
  { -- | The HTTP status code for the error.
    RecipeVersionErrorDetail -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
    -- | The text of the error message.
    RecipeVersionErrorDetail -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the recipe version associated with this error.
    RecipeVersionErrorDetail -> Maybe Text
recipeVersion :: Prelude.Maybe Prelude.Text
  }
  deriving (RecipeVersionErrorDetail -> RecipeVersionErrorDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipeVersionErrorDetail -> RecipeVersionErrorDetail -> Bool
$c/= :: RecipeVersionErrorDetail -> RecipeVersionErrorDetail -> Bool
== :: RecipeVersionErrorDetail -> RecipeVersionErrorDetail -> Bool
$c== :: RecipeVersionErrorDetail -> RecipeVersionErrorDetail -> Bool
Prelude.Eq, ReadPrec [RecipeVersionErrorDetail]
ReadPrec RecipeVersionErrorDetail
Int -> ReadS RecipeVersionErrorDetail
ReadS [RecipeVersionErrorDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecipeVersionErrorDetail]
$creadListPrec :: ReadPrec [RecipeVersionErrorDetail]
readPrec :: ReadPrec RecipeVersionErrorDetail
$creadPrec :: ReadPrec RecipeVersionErrorDetail
readList :: ReadS [RecipeVersionErrorDetail]
$creadList :: ReadS [RecipeVersionErrorDetail]
readsPrec :: Int -> ReadS RecipeVersionErrorDetail
$creadsPrec :: Int -> ReadS RecipeVersionErrorDetail
Prelude.Read, Int -> RecipeVersionErrorDetail -> ShowS
[RecipeVersionErrorDetail] -> ShowS
RecipeVersionErrorDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipeVersionErrorDetail] -> ShowS
$cshowList :: [RecipeVersionErrorDetail] -> ShowS
show :: RecipeVersionErrorDetail -> String
$cshow :: RecipeVersionErrorDetail -> String
showsPrec :: Int -> RecipeVersionErrorDetail -> ShowS
$cshowsPrec :: Int -> RecipeVersionErrorDetail -> ShowS
Prelude.Show, forall x.
Rep RecipeVersionErrorDetail x -> RecipeVersionErrorDetail
forall x.
RecipeVersionErrorDetail -> Rep RecipeVersionErrorDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecipeVersionErrorDetail x -> RecipeVersionErrorDetail
$cfrom :: forall x.
RecipeVersionErrorDetail -> Rep RecipeVersionErrorDetail x
Prelude.Generic)

-- |
-- Create a value of 'RecipeVersionErrorDetail' 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:
--
-- 'errorCode', 'recipeVersionErrorDetail_errorCode' - The HTTP status code for the error.
--
-- 'errorMessage', 'recipeVersionErrorDetail_errorMessage' - The text of the error message.
--
-- 'recipeVersion', 'recipeVersionErrorDetail_recipeVersion' - The identifier for the recipe version associated with this error.
newRecipeVersionErrorDetail ::
  RecipeVersionErrorDetail
newRecipeVersionErrorDetail :: RecipeVersionErrorDetail
newRecipeVersionErrorDetail =
  RecipeVersionErrorDetail'
    { $sel:errorCode:RecipeVersionErrorDetail' :: Maybe Text
errorCode =
        forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:RecipeVersionErrorDetail' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:recipeVersion:RecipeVersionErrorDetail' :: Maybe Text
recipeVersion = forall a. Maybe a
Prelude.Nothing
    }

-- | The HTTP status code for the error.
recipeVersionErrorDetail_errorCode :: Lens.Lens' RecipeVersionErrorDetail (Prelude.Maybe Prelude.Text)
recipeVersionErrorDetail_errorCode :: Lens' RecipeVersionErrorDetail (Maybe Text)
recipeVersionErrorDetail_errorCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecipeVersionErrorDetail' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:RecipeVersionErrorDetail' :: RecipeVersionErrorDetail -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: RecipeVersionErrorDetail
s@RecipeVersionErrorDetail' {} Maybe Text
a -> RecipeVersionErrorDetail
s {$sel:errorCode:RecipeVersionErrorDetail' :: Maybe Text
errorCode = Maybe Text
a} :: RecipeVersionErrorDetail)

-- | The text of the error message.
recipeVersionErrorDetail_errorMessage :: Lens.Lens' RecipeVersionErrorDetail (Prelude.Maybe Prelude.Text)
recipeVersionErrorDetail_errorMessage :: Lens' RecipeVersionErrorDetail (Maybe Text)
recipeVersionErrorDetail_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecipeVersionErrorDetail' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:RecipeVersionErrorDetail' :: RecipeVersionErrorDetail -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: RecipeVersionErrorDetail
s@RecipeVersionErrorDetail' {} Maybe Text
a -> RecipeVersionErrorDetail
s {$sel:errorMessage:RecipeVersionErrorDetail' :: Maybe Text
errorMessage = Maybe Text
a} :: RecipeVersionErrorDetail)

-- | The identifier for the recipe version associated with this error.
recipeVersionErrorDetail_recipeVersion :: Lens.Lens' RecipeVersionErrorDetail (Prelude.Maybe Prelude.Text)
recipeVersionErrorDetail_recipeVersion :: Lens' RecipeVersionErrorDetail (Maybe Text)
recipeVersionErrorDetail_recipeVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecipeVersionErrorDetail' {Maybe Text
recipeVersion :: Maybe Text
$sel:recipeVersion:RecipeVersionErrorDetail' :: RecipeVersionErrorDetail -> Maybe Text
recipeVersion} -> Maybe Text
recipeVersion) (\s :: RecipeVersionErrorDetail
s@RecipeVersionErrorDetail' {} Maybe Text
a -> RecipeVersionErrorDetail
s {$sel:recipeVersion:RecipeVersionErrorDetail' :: Maybe Text
recipeVersion = Maybe Text
a} :: RecipeVersionErrorDetail)

instance Data.FromJSON RecipeVersionErrorDetail where
  parseJSON :: Value -> Parser RecipeVersionErrorDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RecipeVersionErrorDetail"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> RecipeVersionErrorDetail
RecipeVersionErrorDetail'
            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
"ErrorCode")
            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
"ErrorMessage")
            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
"RecipeVersion")
      )

instance Prelude.Hashable RecipeVersionErrorDetail where
  hashWithSalt :: Int -> RecipeVersionErrorDetail -> Int
hashWithSalt Int
_salt RecipeVersionErrorDetail' {Maybe Text
recipeVersion :: Maybe Text
errorMessage :: Maybe Text
errorCode :: Maybe Text
$sel:recipeVersion:RecipeVersionErrorDetail' :: RecipeVersionErrorDetail -> Maybe Text
$sel:errorMessage:RecipeVersionErrorDetail' :: RecipeVersionErrorDetail -> Maybe Text
$sel:errorCode:RecipeVersionErrorDetail' :: RecipeVersionErrorDetail -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recipeVersion

instance Prelude.NFData RecipeVersionErrorDetail where
  rnf :: RecipeVersionErrorDetail -> ()
rnf RecipeVersionErrorDetail' {Maybe Text
recipeVersion :: Maybe Text
errorMessage :: Maybe Text
errorCode :: Maybe Text
$sel:recipeVersion:RecipeVersionErrorDetail' :: RecipeVersionErrorDetail -> Maybe Text
$sel:errorMessage:RecipeVersionErrorDetail' :: RecipeVersionErrorDetail -> Maybe Text
$sel:errorCode:RecipeVersionErrorDetail' :: RecipeVersionErrorDetail -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recipeVersion