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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElastiCache.Types.UpdateActionStatus
import qualified Amazonka.Prelude as Prelude

-- | Update action that has been processed for the corresponding apply\/stop
-- request
--
-- /See:/ 'newProcessedUpdateAction' smart constructor.
data ProcessedUpdateAction = ProcessedUpdateAction'
  { -- | The ID of the cache cluster
    ProcessedUpdateAction -> Maybe Text
cacheClusterId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the replication group
    ProcessedUpdateAction -> Maybe Text
replicationGroupId :: Prelude.Maybe Prelude.Text,
    -- | The unique ID of the service update
    ProcessedUpdateAction -> Maybe Text
serviceUpdateName :: Prelude.Maybe Prelude.Text,
    -- | The status of the update action on the Redis cluster
    ProcessedUpdateAction -> Maybe UpdateActionStatus
updateActionStatus :: Prelude.Maybe UpdateActionStatus
  }
  deriving (ProcessedUpdateAction -> ProcessedUpdateAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProcessedUpdateAction -> ProcessedUpdateAction -> Bool
$c/= :: ProcessedUpdateAction -> ProcessedUpdateAction -> Bool
== :: ProcessedUpdateAction -> ProcessedUpdateAction -> Bool
$c== :: ProcessedUpdateAction -> ProcessedUpdateAction -> Bool
Prelude.Eq, ReadPrec [ProcessedUpdateAction]
ReadPrec ProcessedUpdateAction
Int -> ReadS ProcessedUpdateAction
ReadS [ProcessedUpdateAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProcessedUpdateAction]
$creadListPrec :: ReadPrec [ProcessedUpdateAction]
readPrec :: ReadPrec ProcessedUpdateAction
$creadPrec :: ReadPrec ProcessedUpdateAction
readList :: ReadS [ProcessedUpdateAction]
$creadList :: ReadS [ProcessedUpdateAction]
readsPrec :: Int -> ReadS ProcessedUpdateAction
$creadsPrec :: Int -> ReadS ProcessedUpdateAction
Prelude.Read, Int -> ProcessedUpdateAction -> ShowS
[ProcessedUpdateAction] -> ShowS
ProcessedUpdateAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProcessedUpdateAction] -> ShowS
$cshowList :: [ProcessedUpdateAction] -> ShowS
show :: ProcessedUpdateAction -> String
$cshow :: ProcessedUpdateAction -> String
showsPrec :: Int -> ProcessedUpdateAction -> ShowS
$cshowsPrec :: Int -> ProcessedUpdateAction -> ShowS
Prelude.Show, forall x. Rep ProcessedUpdateAction x -> ProcessedUpdateAction
forall x. ProcessedUpdateAction -> Rep ProcessedUpdateAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProcessedUpdateAction x -> ProcessedUpdateAction
$cfrom :: forall x. ProcessedUpdateAction -> Rep ProcessedUpdateAction x
Prelude.Generic)

-- |
-- Create a value of 'ProcessedUpdateAction' 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', 'processedUpdateAction_cacheClusterId' - The ID of the cache cluster
--
-- 'replicationGroupId', 'processedUpdateAction_replicationGroupId' - The ID of the replication group
--
-- 'serviceUpdateName', 'processedUpdateAction_serviceUpdateName' - The unique ID of the service update
--
-- 'updateActionStatus', 'processedUpdateAction_updateActionStatus' - The status of the update action on the Redis cluster
newProcessedUpdateAction ::
  ProcessedUpdateAction
newProcessedUpdateAction :: ProcessedUpdateAction
newProcessedUpdateAction =
  ProcessedUpdateAction'
    { $sel:cacheClusterId:ProcessedUpdateAction' :: Maybe Text
cacheClusterId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:replicationGroupId:ProcessedUpdateAction' :: Maybe Text
replicationGroupId = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceUpdateName:ProcessedUpdateAction' :: Maybe Text
serviceUpdateName = forall a. Maybe a
Prelude.Nothing,
      $sel:updateActionStatus:ProcessedUpdateAction' :: Maybe UpdateActionStatus
updateActionStatus = forall a. Maybe a
Prelude.Nothing
    }

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

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

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

-- | The status of the update action on the Redis cluster
processedUpdateAction_updateActionStatus :: Lens.Lens' ProcessedUpdateAction (Prelude.Maybe UpdateActionStatus)
processedUpdateAction_updateActionStatus :: Lens' ProcessedUpdateAction (Maybe UpdateActionStatus)
processedUpdateAction_updateActionStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProcessedUpdateAction' {Maybe UpdateActionStatus
updateActionStatus :: Maybe UpdateActionStatus
$sel:updateActionStatus:ProcessedUpdateAction' :: ProcessedUpdateAction -> Maybe UpdateActionStatus
updateActionStatus} -> Maybe UpdateActionStatus
updateActionStatus) (\s :: ProcessedUpdateAction
s@ProcessedUpdateAction' {} Maybe UpdateActionStatus
a -> ProcessedUpdateAction
s {$sel:updateActionStatus:ProcessedUpdateAction' :: Maybe UpdateActionStatus
updateActionStatus = Maybe UpdateActionStatus
a} :: ProcessedUpdateAction)

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

instance Prelude.Hashable ProcessedUpdateAction where
  hashWithSalt :: Int -> ProcessedUpdateAction -> Int
hashWithSalt Int
_salt ProcessedUpdateAction' {Maybe Text
Maybe UpdateActionStatus
updateActionStatus :: Maybe UpdateActionStatus
serviceUpdateName :: Maybe Text
replicationGroupId :: Maybe Text
cacheClusterId :: Maybe Text
$sel:updateActionStatus:ProcessedUpdateAction' :: ProcessedUpdateAction -> Maybe UpdateActionStatus
$sel:serviceUpdateName:ProcessedUpdateAction' :: ProcessedUpdateAction -> Maybe Text
$sel:replicationGroupId:ProcessedUpdateAction' :: ProcessedUpdateAction -> Maybe Text
$sel:cacheClusterId:ProcessedUpdateAction' :: ProcessedUpdateAction -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheClusterId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
replicationGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceUpdateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UpdateActionStatus
updateActionStatus

instance Prelude.NFData ProcessedUpdateAction where
  rnf :: ProcessedUpdateAction -> ()
rnf ProcessedUpdateAction' {Maybe Text
Maybe UpdateActionStatus
updateActionStatus :: Maybe UpdateActionStatus
serviceUpdateName :: Maybe Text
replicationGroupId :: Maybe Text
cacheClusterId :: Maybe Text
$sel:updateActionStatus:ProcessedUpdateAction' :: ProcessedUpdateAction -> Maybe UpdateActionStatus
$sel:serviceUpdateName:ProcessedUpdateAction' :: ProcessedUpdateAction -> Maybe Text
$sel:replicationGroupId:ProcessedUpdateAction' :: ProcessedUpdateAction -> Maybe Text
$sel:cacheClusterId:ProcessedUpdateAction' :: ProcessedUpdateAction -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheClusterId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
replicationGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceUpdateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UpdateActionStatus
updateActionStatus