{-# 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.CacheParameterGroupStatus
-- 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.CacheParameterGroupStatus 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

-- | Status of the cache parameter group.
--
-- /See:/ 'newCacheParameterGroupStatus' smart constructor.
data CacheParameterGroupStatus = CacheParameterGroupStatus'
  { -- | A list of the cache node IDs which need to be rebooted for parameter
    -- changes to be applied. A node ID is a numeric identifier (0001, 0002,
    -- etc.).
    CacheParameterGroupStatus -> Maybe [Text]
cacheNodeIdsToReboot :: Prelude.Maybe [Prelude.Text],
    -- | The name of the cache parameter group.
    CacheParameterGroupStatus -> Maybe Text
cacheParameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | The status of parameter updates.
    CacheParameterGroupStatus -> Maybe Text
parameterApplyStatus :: Prelude.Maybe Prelude.Text
  }
  deriving (CacheParameterGroupStatus -> CacheParameterGroupStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CacheParameterGroupStatus -> CacheParameterGroupStatus -> Bool
$c/= :: CacheParameterGroupStatus -> CacheParameterGroupStatus -> Bool
== :: CacheParameterGroupStatus -> CacheParameterGroupStatus -> Bool
$c== :: CacheParameterGroupStatus -> CacheParameterGroupStatus -> Bool
Prelude.Eq, ReadPrec [CacheParameterGroupStatus]
ReadPrec CacheParameterGroupStatus
Int -> ReadS CacheParameterGroupStatus
ReadS [CacheParameterGroupStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CacheParameterGroupStatus]
$creadListPrec :: ReadPrec [CacheParameterGroupStatus]
readPrec :: ReadPrec CacheParameterGroupStatus
$creadPrec :: ReadPrec CacheParameterGroupStatus
readList :: ReadS [CacheParameterGroupStatus]
$creadList :: ReadS [CacheParameterGroupStatus]
readsPrec :: Int -> ReadS CacheParameterGroupStatus
$creadsPrec :: Int -> ReadS CacheParameterGroupStatus
Prelude.Read, Int -> CacheParameterGroupStatus -> ShowS
[CacheParameterGroupStatus] -> ShowS
CacheParameterGroupStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CacheParameterGroupStatus] -> ShowS
$cshowList :: [CacheParameterGroupStatus] -> ShowS
show :: CacheParameterGroupStatus -> String
$cshow :: CacheParameterGroupStatus -> String
showsPrec :: Int -> CacheParameterGroupStatus -> ShowS
$cshowsPrec :: Int -> CacheParameterGroupStatus -> ShowS
Prelude.Show, forall x.
Rep CacheParameterGroupStatus x -> CacheParameterGroupStatus
forall x.
CacheParameterGroupStatus -> Rep CacheParameterGroupStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CacheParameterGroupStatus x -> CacheParameterGroupStatus
$cfrom :: forall x.
CacheParameterGroupStatus -> Rep CacheParameterGroupStatus x
Prelude.Generic)

-- |
-- Create a value of 'CacheParameterGroupStatus' 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:
--
-- 'cacheNodeIdsToReboot', 'cacheParameterGroupStatus_cacheNodeIdsToReboot' - A list of the cache node IDs which need to be rebooted for parameter
-- changes to be applied. A node ID is a numeric identifier (0001, 0002,
-- etc.).
--
-- 'cacheParameterGroupName', 'cacheParameterGroupStatus_cacheParameterGroupName' - The name of the cache parameter group.
--
-- 'parameterApplyStatus', 'cacheParameterGroupStatus_parameterApplyStatus' - The status of parameter updates.
newCacheParameterGroupStatus ::
  CacheParameterGroupStatus
newCacheParameterGroupStatus :: CacheParameterGroupStatus
newCacheParameterGroupStatus =
  CacheParameterGroupStatus'
    { $sel:cacheNodeIdsToReboot:CacheParameterGroupStatus' :: Maybe [Text]
cacheNodeIdsToReboot =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cacheParameterGroupName:CacheParameterGroupStatus' :: Maybe Text
cacheParameterGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:parameterApplyStatus:CacheParameterGroupStatus' :: Maybe Text
parameterApplyStatus = forall a. Maybe a
Prelude.Nothing
    }

-- | A list of the cache node IDs which need to be rebooted for parameter
-- changes to be applied. A node ID is a numeric identifier (0001, 0002,
-- etc.).
cacheParameterGroupStatus_cacheNodeIdsToReboot :: Lens.Lens' CacheParameterGroupStatus (Prelude.Maybe [Prelude.Text])
cacheParameterGroupStatus_cacheNodeIdsToReboot :: Lens' CacheParameterGroupStatus (Maybe [Text])
cacheParameterGroupStatus_cacheNodeIdsToReboot = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheParameterGroupStatus' {Maybe [Text]
cacheNodeIdsToReboot :: Maybe [Text]
$sel:cacheNodeIdsToReboot:CacheParameterGroupStatus' :: CacheParameterGroupStatus -> Maybe [Text]
cacheNodeIdsToReboot} -> Maybe [Text]
cacheNodeIdsToReboot) (\s :: CacheParameterGroupStatus
s@CacheParameterGroupStatus' {} Maybe [Text]
a -> CacheParameterGroupStatus
s {$sel:cacheNodeIdsToReboot:CacheParameterGroupStatus' :: Maybe [Text]
cacheNodeIdsToReboot = Maybe [Text]
a} :: CacheParameterGroupStatus) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the cache parameter group.
cacheParameterGroupStatus_cacheParameterGroupName :: Lens.Lens' CacheParameterGroupStatus (Prelude.Maybe Prelude.Text)
cacheParameterGroupStatus_cacheParameterGroupName :: Lens' CacheParameterGroupStatus (Maybe Text)
cacheParameterGroupStatus_cacheParameterGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheParameterGroupStatus' {Maybe Text
cacheParameterGroupName :: Maybe Text
$sel:cacheParameterGroupName:CacheParameterGroupStatus' :: CacheParameterGroupStatus -> Maybe Text
cacheParameterGroupName} -> Maybe Text
cacheParameterGroupName) (\s :: CacheParameterGroupStatus
s@CacheParameterGroupStatus' {} Maybe Text
a -> CacheParameterGroupStatus
s {$sel:cacheParameterGroupName:CacheParameterGroupStatus' :: Maybe Text
cacheParameterGroupName = Maybe Text
a} :: CacheParameterGroupStatus)

-- | The status of parameter updates.
cacheParameterGroupStatus_parameterApplyStatus :: Lens.Lens' CacheParameterGroupStatus (Prelude.Maybe Prelude.Text)
cacheParameterGroupStatus_parameterApplyStatus :: Lens' CacheParameterGroupStatus (Maybe Text)
cacheParameterGroupStatus_parameterApplyStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheParameterGroupStatus' {Maybe Text
parameterApplyStatus :: Maybe Text
$sel:parameterApplyStatus:CacheParameterGroupStatus' :: CacheParameterGroupStatus -> Maybe Text
parameterApplyStatus} -> Maybe Text
parameterApplyStatus) (\s :: CacheParameterGroupStatus
s@CacheParameterGroupStatus' {} Maybe Text
a -> CacheParameterGroupStatus
s {$sel:parameterApplyStatus:CacheParameterGroupStatus' :: Maybe Text
parameterApplyStatus = Maybe Text
a} :: CacheParameterGroupStatus)

instance Data.FromXML CacheParameterGroupStatus where
  parseXML :: [Node] -> Either String CacheParameterGroupStatus
parseXML [Node]
x =
    Maybe [Text]
-> Maybe Text -> Maybe Text -> CacheParameterGroupStatus
CacheParameterGroupStatus'
      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
"CacheNodeIdsToReboot"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"CacheNodeId")
                  )
      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
"CacheParameterGroupName")
      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
"ParameterApplyStatus")

instance Prelude.Hashable CacheParameterGroupStatus where
  hashWithSalt :: Int -> CacheParameterGroupStatus -> Int
hashWithSalt Int
_salt CacheParameterGroupStatus' {Maybe [Text]
Maybe Text
parameterApplyStatus :: Maybe Text
cacheParameterGroupName :: Maybe Text
cacheNodeIdsToReboot :: Maybe [Text]
$sel:parameterApplyStatus:CacheParameterGroupStatus' :: CacheParameterGroupStatus -> Maybe Text
$sel:cacheParameterGroupName:CacheParameterGroupStatus' :: CacheParameterGroupStatus -> Maybe Text
$sel:cacheNodeIdsToReboot:CacheParameterGroupStatus' :: CacheParameterGroupStatus -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
cacheNodeIdsToReboot
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheParameterGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
parameterApplyStatus

instance Prelude.NFData CacheParameterGroupStatus where
  rnf :: CacheParameterGroupStatus -> ()
rnf CacheParameterGroupStatus' {Maybe [Text]
Maybe Text
parameterApplyStatus :: Maybe Text
cacheParameterGroupName :: Maybe Text
cacheNodeIdsToReboot :: Maybe [Text]
$sel:parameterApplyStatus:CacheParameterGroupStatus' :: CacheParameterGroupStatus -> Maybe Text
$sel:cacheParameterGroupName:CacheParameterGroupStatus' :: CacheParameterGroupStatus -> Maybe Text
$sel:cacheNodeIdsToReboot:CacheParameterGroupStatus' :: CacheParameterGroupStatus -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
cacheNodeIdsToReboot
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheParameterGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
parameterApplyStatus