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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 identifier for the recipe version associated with this error.
    RecipeVersionErrorDetail -> Maybe Text
recipeVersion :: Prelude.Maybe Prelude.Text,
    -- | 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
  }
  deriving (RecipeVersionErrorDetail -> RecipeVersionErrorDetail -> Bool
(RecipeVersionErrorDetail -> RecipeVersionErrorDetail -> Bool)
-> (RecipeVersionErrorDetail -> RecipeVersionErrorDetail -> Bool)
-> Eq RecipeVersionErrorDetail
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]
(Int -> ReadS RecipeVersionErrorDetail)
-> ReadS [RecipeVersionErrorDetail]
-> ReadPrec RecipeVersionErrorDetail
-> ReadPrec [RecipeVersionErrorDetail]
-> Read 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
(Int -> RecipeVersionErrorDetail -> ShowS)
-> (RecipeVersionErrorDetail -> String)
-> ([RecipeVersionErrorDetail] -> ShowS)
-> Show RecipeVersionErrorDetail
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.
 RecipeVersionErrorDetail -> Rep RecipeVersionErrorDetail x)
-> (forall x.
    Rep RecipeVersionErrorDetail x -> RecipeVersionErrorDetail)
-> Generic RecipeVersionErrorDetail
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:
--
-- 'recipeVersion', 'recipeVersionErrorDetail_recipeVersion' - The identifier for the recipe version associated with this error.
--
-- 'errorCode', 'recipeVersionErrorDetail_errorCode' - The HTTP status code for the error.
--
-- 'errorMessage', 'recipeVersionErrorDetail_errorMessage' - The text of the error message.
newRecipeVersionErrorDetail ::
  RecipeVersionErrorDetail
newRecipeVersionErrorDetail :: RecipeVersionErrorDetail
newRecipeVersionErrorDetail =
  RecipeVersionErrorDetail' :: Maybe Text -> Maybe Text -> Maybe Text -> RecipeVersionErrorDetail
RecipeVersionErrorDetail'
    { $sel:recipeVersion:RecipeVersionErrorDetail' :: Maybe Text
recipeVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorCode:RecipeVersionErrorDetail' :: Maybe Text
errorCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:RecipeVersionErrorDetail' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier for the recipe version associated with this error.
recipeVersionErrorDetail_recipeVersion :: Lens.Lens' RecipeVersionErrorDetail (Prelude.Maybe Prelude.Text)
recipeVersionErrorDetail_recipeVersion :: (Maybe Text -> f (Maybe Text))
-> RecipeVersionErrorDetail -> f RecipeVersionErrorDetail
recipeVersionErrorDetail_recipeVersion = (RecipeVersionErrorDetail -> Maybe Text)
-> (RecipeVersionErrorDetail
    -> Maybe Text -> RecipeVersionErrorDetail)
-> Lens
     RecipeVersionErrorDetail
     RecipeVersionErrorDetail
     (Maybe Text)
     (Maybe Text)
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)

-- | The HTTP status code for the error.
recipeVersionErrorDetail_errorCode :: Lens.Lens' RecipeVersionErrorDetail (Prelude.Maybe Prelude.Text)
recipeVersionErrorDetail_errorCode :: (Maybe Text -> f (Maybe Text))
-> RecipeVersionErrorDetail -> f RecipeVersionErrorDetail
recipeVersionErrorDetail_errorCode = (RecipeVersionErrorDetail -> Maybe Text)
-> (RecipeVersionErrorDetail
    -> Maybe Text -> RecipeVersionErrorDetail)
-> Lens
     RecipeVersionErrorDetail
     RecipeVersionErrorDetail
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> RecipeVersionErrorDetail -> f RecipeVersionErrorDetail
recipeVersionErrorDetail_errorMessage = (RecipeVersionErrorDetail -> Maybe Text)
-> (RecipeVersionErrorDetail
    -> Maybe Text -> RecipeVersionErrorDetail)
-> Lens
     RecipeVersionErrorDetail
     RecipeVersionErrorDetail
     (Maybe Text)
     (Maybe Text)
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)

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

instance Prelude.Hashable RecipeVersionErrorDetail

instance Prelude.NFData RecipeVersionErrorDetail