{-# 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.MemoryDb.Types.UnprocessedCluster
-- 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.MemoryDb.Types.UnprocessedCluster 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

-- | A cluster whose updates have failed
--
-- /See:/ 'newUnprocessedCluster' smart constructor.
data UnprocessedCluster = UnprocessedCluster'
  { -- | The name of the cluster
    UnprocessedCluster -> Maybe Text
clusterName :: Prelude.Maybe Prelude.Text,
    -- | The error message associated with the update failure
    UnprocessedCluster -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | The error type associated with the update failure
    UnprocessedCluster -> Maybe Text
errorType :: Prelude.Maybe Prelude.Text
  }
  deriving (UnprocessedCluster -> UnprocessedCluster -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnprocessedCluster -> UnprocessedCluster -> Bool
$c/= :: UnprocessedCluster -> UnprocessedCluster -> Bool
== :: UnprocessedCluster -> UnprocessedCluster -> Bool
$c== :: UnprocessedCluster -> UnprocessedCluster -> Bool
Prelude.Eq, ReadPrec [UnprocessedCluster]
ReadPrec UnprocessedCluster
Int -> ReadS UnprocessedCluster
ReadS [UnprocessedCluster]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnprocessedCluster]
$creadListPrec :: ReadPrec [UnprocessedCluster]
readPrec :: ReadPrec UnprocessedCluster
$creadPrec :: ReadPrec UnprocessedCluster
readList :: ReadS [UnprocessedCluster]
$creadList :: ReadS [UnprocessedCluster]
readsPrec :: Int -> ReadS UnprocessedCluster
$creadsPrec :: Int -> ReadS UnprocessedCluster
Prelude.Read, Int -> UnprocessedCluster -> ShowS
[UnprocessedCluster] -> ShowS
UnprocessedCluster -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnprocessedCluster] -> ShowS
$cshowList :: [UnprocessedCluster] -> ShowS
show :: UnprocessedCluster -> String
$cshow :: UnprocessedCluster -> String
showsPrec :: Int -> UnprocessedCluster -> ShowS
$cshowsPrec :: Int -> UnprocessedCluster -> ShowS
Prelude.Show, forall x. Rep UnprocessedCluster x -> UnprocessedCluster
forall x. UnprocessedCluster -> Rep UnprocessedCluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnprocessedCluster x -> UnprocessedCluster
$cfrom :: forall x. UnprocessedCluster -> Rep UnprocessedCluster x
Prelude.Generic)

-- |
-- Create a value of 'UnprocessedCluster' 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:
--
-- 'clusterName', 'unprocessedCluster_clusterName' - The name of the cluster
--
-- 'errorMessage', 'unprocessedCluster_errorMessage' - The error message associated with the update failure
--
-- 'errorType', 'unprocessedCluster_errorType' - The error type associated with the update failure
newUnprocessedCluster ::
  UnprocessedCluster
newUnprocessedCluster :: UnprocessedCluster
newUnprocessedCluster =
  UnprocessedCluster'
    { $sel:clusterName:UnprocessedCluster' :: Maybe Text
clusterName = forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:UnprocessedCluster' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:errorType:UnprocessedCluster' :: Maybe Text
errorType = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the cluster
unprocessedCluster_clusterName :: Lens.Lens' UnprocessedCluster (Prelude.Maybe Prelude.Text)
unprocessedCluster_clusterName :: Lens' UnprocessedCluster (Maybe Text)
unprocessedCluster_clusterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedCluster' {Maybe Text
clusterName :: Maybe Text
$sel:clusterName:UnprocessedCluster' :: UnprocessedCluster -> Maybe Text
clusterName} -> Maybe Text
clusterName) (\s :: UnprocessedCluster
s@UnprocessedCluster' {} Maybe Text
a -> UnprocessedCluster
s {$sel:clusterName:UnprocessedCluster' :: Maybe Text
clusterName = Maybe Text
a} :: UnprocessedCluster)

-- | The error message associated with the update failure
unprocessedCluster_errorMessage :: Lens.Lens' UnprocessedCluster (Prelude.Maybe Prelude.Text)
unprocessedCluster_errorMessage :: Lens' UnprocessedCluster (Maybe Text)
unprocessedCluster_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedCluster' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:UnprocessedCluster' :: UnprocessedCluster -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: UnprocessedCluster
s@UnprocessedCluster' {} Maybe Text
a -> UnprocessedCluster
s {$sel:errorMessage:UnprocessedCluster' :: Maybe Text
errorMessage = Maybe Text
a} :: UnprocessedCluster)

-- | The error type associated with the update failure
unprocessedCluster_errorType :: Lens.Lens' UnprocessedCluster (Prelude.Maybe Prelude.Text)
unprocessedCluster_errorType :: Lens' UnprocessedCluster (Maybe Text)
unprocessedCluster_errorType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedCluster' {Maybe Text
errorType :: Maybe Text
$sel:errorType:UnprocessedCluster' :: UnprocessedCluster -> Maybe Text
errorType} -> Maybe Text
errorType) (\s :: UnprocessedCluster
s@UnprocessedCluster' {} Maybe Text
a -> UnprocessedCluster
s {$sel:errorType:UnprocessedCluster' :: Maybe Text
errorType = Maybe Text
a} :: UnprocessedCluster)

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

instance Prelude.Hashable UnprocessedCluster where
  hashWithSalt :: Int -> UnprocessedCluster -> Int
hashWithSalt Int
_salt UnprocessedCluster' {Maybe Text
errorType :: Maybe Text
errorMessage :: Maybe Text
clusterName :: Maybe Text
$sel:errorType:UnprocessedCluster' :: UnprocessedCluster -> Maybe Text
$sel:errorMessage:UnprocessedCluster' :: UnprocessedCluster -> Maybe Text
$sel:clusterName:UnprocessedCluster' :: UnprocessedCluster -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clusterName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorType

instance Prelude.NFData UnprocessedCluster where
  rnf :: UnprocessedCluster -> ()
rnf UnprocessedCluster' {Maybe Text
errorType :: Maybe Text
errorMessage :: Maybe Text
clusterName :: Maybe Text
$sel:errorType:UnprocessedCluster' :: UnprocessedCluster -> Maybe Text
$sel:errorMessage:UnprocessedCluster' :: UnprocessedCluster -> Maybe Text
$sel:clusterName:UnprocessedCluster' :: UnprocessedCluster -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clusterName
      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
errorType