{-# 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.ElastiCache.Types.UnprocessedUpdateAction
-- 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.ElastiCache.Types.UnprocessedUpdateAction where

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

-- | Update action that has failed to be processed for the corresponding
-- apply\/stop request
--
-- /See:/ 'newUnprocessedUpdateAction' smart constructor.
data UnprocessedUpdateAction = UnprocessedUpdateAction'
  { -- | The ID of the cache cluster
    UnprocessedUpdateAction -> Maybe Text
cacheClusterId :: Prelude.Maybe Prelude.Text,
    -- | The unique ID of the service update
    UnprocessedUpdateAction -> Maybe Text
serviceUpdateName :: Prelude.Maybe Prelude.Text,
    -- | The error type for requests that are not processed
    UnprocessedUpdateAction -> Maybe Text
errorType :: Prelude.Maybe Prelude.Text,
    -- | The error message that describes the reason the request was not
    -- processed
    UnprocessedUpdateAction -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | The replication group ID
    UnprocessedUpdateAction -> Maybe Text
replicationGroupId :: Prelude.Maybe Prelude.Text
  }
  deriving (UnprocessedUpdateAction -> UnprocessedUpdateAction -> Bool
(UnprocessedUpdateAction -> UnprocessedUpdateAction -> Bool)
-> (UnprocessedUpdateAction -> UnprocessedUpdateAction -> Bool)
-> Eq UnprocessedUpdateAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnprocessedUpdateAction -> UnprocessedUpdateAction -> Bool
$c/= :: UnprocessedUpdateAction -> UnprocessedUpdateAction -> Bool
== :: UnprocessedUpdateAction -> UnprocessedUpdateAction -> Bool
$c== :: UnprocessedUpdateAction -> UnprocessedUpdateAction -> Bool
Prelude.Eq, ReadPrec [UnprocessedUpdateAction]
ReadPrec UnprocessedUpdateAction
Int -> ReadS UnprocessedUpdateAction
ReadS [UnprocessedUpdateAction]
(Int -> ReadS UnprocessedUpdateAction)
-> ReadS [UnprocessedUpdateAction]
-> ReadPrec UnprocessedUpdateAction
-> ReadPrec [UnprocessedUpdateAction]
-> Read UnprocessedUpdateAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnprocessedUpdateAction]
$creadListPrec :: ReadPrec [UnprocessedUpdateAction]
readPrec :: ReadPrec UnprocessedUpdateAction
$creadPrec :: ReadPrec UnprocessedUpdateAction
readList :: ReadS [UnprocessedUpdateAction]
$creadList :: ReadS [UnprocessedUpdateAction]
readsPrec :: Int -> ReadS UnprocessedUpdateAction
$creadsPrec :: Int -> ReadS UnprocessedUpdateAction
Prelude.Read, Int -> UnprocessedUpdateAction -> ShowS
[UnprocessedUpdateAction] -> ShowS
UnprocessedUpdateAction -> String
(Int -> UnprocessedUpdateAction -> ShowS)
-> (UnprocessedUpdateAction -> String)
-> ([UnprocessedUpdateAction] -> ShowS)
-> Show UnprocessedUpdateAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnprocessedUpdateAction] -> ShowS
$cshowList :: [UnprocessedUpdateAction] -> ShowS
show :: UnprocessedUpdateAction -> String
$cshow :: UnprocessedUpdateAction -> String
showsPrec :: Int -> UnprocessedUpdateAction -> ShowS
$cshowsPrec :: Int -> UnprocessedUpdateAction -> ShowS
Prelude.Show, (forall x.
 UnprocessedUpdateAction -> Rep UnprocessedUpdateAction x)
-> (forall x.
    Rep UnprocessedUpdateAction x -> UnprocessedUpdateAction)
-> Generic UnprocessedUpdateAction
forall x. Rep UnprocessedUpdateAction x -> UnprocessedUpdateAction
forall x. UnprocessedUpdateAction -> Rep UnprocessedUpdateAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnprocessedUpdateAction x -> UnprocessedUpdateAction
$cfrom :: forall x. UnprocessedUpdateAction -> Rep UnprocessedUpdateAction x
Prelude.Generic)

-- |
-- Create a value of 'UnprocessedUpdateAction' 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:
--
-- 'cacheClusterId', 'unprocessedUpdateAction_cacheClusterId' - The ID of the cache cluster
--
-- 'serviceUpdateName', 'unprocessedUpdateAction_serviceUpdateName' - The unique ID of the service update
--
-- 'errorType', 'unprocessedUpdateAction_errorType' - The error type for requests that are not processed
--
-- 'errorMessage', 'unprocessedUpdateAction_errorMessage' - The error message that describes the reason the request was not
-- processed
--
-- 'replicationGroupId', 'unprocessedUpdateAction_replicationGroupId' - The replication group ID
newUnprocessedUpdateAction ::
  UnprocessedUpdateAction
newUnprocessedUpdateAction :: UnprocessedUpdateAction
newUnprocessedUpdateAction =
  UnprocessedUpdateAction' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> UnprocessedUpdateAction
UnprocessedUpdateAction'
    { $sel:cacheClusterId:UnprocessedUpdateAction' :: Maybe Text
cacheClusterId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceUpdateName:UnprocessedUpdateAction' :: Maybe Text
serviceUpdateName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorType:UnprocessedUpdateAction' :: Maybe Text
errorType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:UnprocessedUpdateAction' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:replicationGroupId:UnprocessedUpdateAction' :: Maybe Text
replicationGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the cache cluster
unprocessedUpdateAction_cacheClusterId :: Lens.Lens' UnprocessedUpdateAction (Prelude.Maybe Prelude.Text)
unprocessedUpdateAction_cacheClusterId :: (Maybe Text -> f (Maybe Text))
-> UnprocessedUpdateAction -> f UnprocessedUpdateAction
unprocessedUpdateAction_cacheClusterId = (UnprocessedUpdateAction -> Maybe Text)
-> (UnprocessedUpdateAction
    -> Maybe Text -> UnprocessedUpdateAction)
-> Lens
     UnprocessedUpdateAction
     UnprocessedUpdateAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedUpdateAction' {Maybe Text
cacheClusterId :: Maybe Text
$sel:cacheClusterId:UnprocessedUpdateAction' :: UnprocessedUpdateAction -> Maybe Text
cacheClusterId} -> Maybe Text
cacheClusterId) (\s :: UnprocessedUpdateAction
s@UnprocessedUpdateAction' {} Maybe Text
a -> UnprocessedUpdateAction
s {$sel:cacheClusterId:UnprocessedUpdateAction' :: Maybe Text
cacheClusterId = Maybe Text
a} :: UnprocessedUpdateAction)

-- | The unique ID of the service update
unprocessedUpdateAction_serviceUpdateName :: Lens.Lens' UnprocessedUpdateAction (Prelude.Maybe Prelude.Text)
unprocessedUpdateAction_serviceUpdateName :: (Maybe Text -> f (Maybe Text))
-> UnprocessedUpdateAction -> f UnprocessedUpdateAction
unprocessedUpdateAction_serviceUpdateName = (UnprocessedUpdateAction -> Maybe Text)
-> (UnprocessedUpdateAction
    -> Maybe Text -> UnprocessedUpdateAction)
-> Lens
     UnprocessedUpdateAction
     UnprocessedUpdateAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedUpdateAction' {Maybe Text
serviceUpdateName :: Maybe Text
$sel:serviceUpdateName:UnprocessedUpdateAction' :: UnprocessedUpdateAction -> Maybe Text
serviceUpdateName} -> Maybe Text
serviceUpdateName) (\s :: UnprocessedUpdateAction
s@UnprocessedUpdateAction' {} Maybe Text
a -> UnprocessedUpdateAction
s {$sel:serviceUpdateName:UnprocessedUpdateAction' :: Maybe Text
serviceUpdateName = Maybe Text
a} :: UnprocessedUpdateAction)

-- | The error type for requests that are not processed
unprocessedUpdateAction_errorType :: Lens.Lens' UnprocessedUpdateAction (Prelude.Maybe Prelude.Text)
unprocessedUpdateAction_errorType :: (Maybe Text -> f (Maybe Text))
-> UnprocessedUpdateAction -> f UnprocessedUpdateAction
unprocessedUpdateAction_errorType = (UnprocessedUpdateAction -> Maybe Text)
-> (UnprocessedUpdateAction
    -> Maybe Text -> UnprocessedUpdateAction)
-> Lens
     UnprocessedUpdateAction
     UnprocessedUpdateAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedUpdateAction' {Maybe Text
errorType :: Maybe Text
$sel:errorType:UnprocessedUpdateAction' :: UnprocessedUpdateAction -> Maybe Text
errorType} -> Maybe Text
errorType) (\s :: UnprocessedUpdateAction
s@UnprocessedUpdateAction' {} Maybe Text
a -> UnprocessedUpdateAction
s {$sel:errorType:UnprocessedUpdateAction' :: Maybe Text
errorType = Maybe Text
a} :: UnprocessedUpdateAction)

-- | The error message that describes the reason the request was not
-- processed
unprocessedUpdateAction_errorMessage :: Lens.Lens' UnprocessedUpdateAction (Prelude.Maybe Prelude.Text)
unprocessedUpdateAction_errorMessage :: (Maybe Text -> f (Maybe Text))
-> UnprocessedUpdateAction -> f UnprocessedUpdateAction
unprocessedUpdateAction_errorMessage = (UnprocessedUpdateAction -> Maybe Text)
-> (UnprocessedUpdateAction
    -> Maybe Text -> UnprocessedUpdateAction)
-> Lens
     UnprocessedUpdateAction
     UnprocessedUpdateAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedUpdateAction' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:UnprocessedUpdateAction' :: UnprocessedUpdateAction -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: UnprocessedUpdateAction
s@UnprocessedUpdateAction' {} Maybe Text
a -> UnprocessedUpdateAction
s {$sel:errorMessage:UnprocessedUpdateAction' :: Maybe Text
errorMessage = Maybe Text
a} :: UnprocessedUpdateAction)

-- | The replication group ID
unprocessedUpdateAction_replicationGroupId :: Lens.Lens' UnprocessedUpdateAction (Prelude.Maybe Prelude.Text)
unprocessedUpdateAction_replicationGroupId :: (Maybe Text -> f (Maybe Text))
-> UnprocessedUpdateAction -> f UnprocessedUpdateAction
unprocessedUpdateAction_replicationGroupId = (UnprocessedUpdateAction -> Maybe Text)
-> (UnprocessedUpdateAction
    -> Maybe Text -> UnprocessedUpdateAction)
-> Lens
     UnprocessedUpdateAction
     UnprocessedUpdateAction
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnprocessedUpdateAction' {Maybe Text
replicationGroupId :: Maybe Text
$sel:replicationGroupId:UnprocessedUpdateAction' :: UnprocessedUpdateAction -> Maybe Text
replicationGroupId} -> Maybe Text
replicationGroupId) (\s :: UnprocessedUpdateAction
s@UnprocessedUpdateAction' {} Maybe Text
a -> UnprocessedUpdateAction
s {$sel:replicationGroupId:UnprocessedUpdateAction' :: Maybe Text
replicationGroupId = Maybe Text
a} :: UnprocessedUpdateAction)

instance Core.FromXML UnprocessedUpdateAction where
  parseXML :: [Node] -> Either String UnprocessedUpdateAction
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> UnprocessedUpdateAction
UnprocessedUpdateAction'
      (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> UnprocessedUpdateAction)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> UnprocessedUpdateAction)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CacheClusterId")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> UnprocessedUpdateAction)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe Text -> Maybe Text -> UnprocessedUpdateAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ServiceUpdateName")
      Either
  String
  (Maybe Text -> Maybe Text -> Maybe Text -> UnprocessedUpdateAction)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Text -> UnprocessedUpdateAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ErrorType")
      Either String (Maybe Text -> Maybe Text -> UnprocessedUpdateAction)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> UnprocessedUpdateAction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ErrorMessage")
      Either String (Maybe Text -> UnprocessedUpdateAction)
-> Either String (Maybe Text)
-> Either String UnprocessedUpdateAction
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ReplicationGroupId")

instance Prelude.Hashable UnprocessedUpdateAction

instance Prelude.NFData UnprocessedUpdateAction