{-# 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.DAX.Types.ParameterGroupStatus
-- 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.DAX.Types.ParameterGroupStatus 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

-- | The status of a parameter group.
--
-- /See:/ 'newParameterGroupStatus' smart constructor.
data ParameterGroupStatus = ParameterGroupStatus'
  { -- | The node IDs of one or more nodes to be rebooted.
    ParameterGroupStatus -> Maybe [Text]
nodeIdsToReboot :: Prelude.Maybe [Prelude.Text],
    -- | The status of parameter updates.
    ParameterGroupStatus -> Maybe Text
parameterApplyStatus :: Prelude.Maybe Prelude.Text,
    -- | The name of the parameter group.
    ParameterGroupStatus -> Maybe Text
parameterGroupName :: Prelude.Maybe Prelude.Text
  }
  deriving (ParameterGroupStatus -> ParameterGroupStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ParameterGroupStatus -> ParameterGroupStatus -> Bool
$c/= :: ParameterGroupStatus -> ParameterGroupStatus -> Bool
== :: ParameterGroupStatus -> ParameterGroupStatus -> Bool
$c== :: ParameterGroupStatus -> ParameterGroupStatus -> Bool
Prelude.Eq, ReadPrec [ParameterGroupStatus]
ReadPrec ParameterGroupStatus
Int -> ReadS ParameterGroupStatus
ReadS [ParameterGroupStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ParameterGroupStatus]
$creadListPrec :: ReadPrec [ParameterGroupStatus]
readPrec :: ReadPrec ParameterGroupStatus
$creadPrec :: ReadPrec ParameterGroupStatus
readList :: ReadS [ParameterGroupStatus]
$creadList :: ReadS [ParameterGroupStatus]
readsPrec :: Int -> ReadS ParameterGroupStatus
$creadsPrec :: Int -> ReadS ParameterGroupStatus
Prelude.Read, Int -> ParameterGroupStatus -> ShowS
[ParameterGroupStatus] -> ShowS
ParameterGroupStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ParameterGroupStatus] -> ShowS
$cshowList :: [ParameterGroupStatus] -> ShowS
show :: ParameterGroupStatus -> String
$cshow :: ParameterGroupStatus -> String
showsPrec :: Int -> ParameterGroupStatus -> ShowS
$cshowsPrec :: Int -> ParameterGroupStatus -> ShowS
Prelude.Show, forall x. Rep ParameterGroupStatus x -> ParameterGroupStatus
forall x. ParameterGroupStatus -> Rep ParameterGroupStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ParameterGroupStatus x -> ParameterGroupStatus
$cfrom :: forall x. ParameterGroupStatus -> Rep ParameterGroupStatus x
Prelude.Generic)

-- |
-- Create a value of 'ParameterGroupStatus' 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:
--
-- 'nodeIdsToReboot', 'parameterGroupStatus_nodeIdsToReboot' - The node IDs of one or more nodes to be rebooted.
--
-- 'parameterApplyStatus', 'parameterGroupStatus_parameterApplyStatus' - The status of parameter updates.
--
-- 'parameterGroupName', 'parameterGroupStatus_parameterGroupName' - The name of the parameter group.
newParameterGroupStatus ::
  ParameterGroupStatus
newParameterGroupStatus :: ParameterGroupStatus
newParameterGroupStatus =
  ParameterGroupStatus'
    { $sel:nodeIdsToReboot:ParameterGroupStatus' :: Maybe [Text]
nodeIdsToReboot =
        forall a. Maybe a
Prelude.Nothing,
      $sel:parameterApplyStatus:ParameterGroupStatus' :: Maybe Text
parameterApplyStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupName:ParameterGroupStatus' :: Maybe Text
parameterGroupName = forall a. Maybe a
Prelude.Nothing
    }

-- | The node IDs of one or more nodes to be rebooted.
parameterGroupStatus_nodeIdsToReboot :: Lens.Lens' ParameterGroupStatus (Prelude.Maybe [Prelude.Text])
parameterGroupStatus_nodeIdsToReboot :: Lens' ParameterGroupStatus (Maybe [Text])
parameterGroupStatus_nodeIdsToReboot = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterGroupStatus' {Maybe [Text]
nodeIdsToReboot :: Maybe [Text]
$sel:nodeIdsToReboot:ParameterGroupStatus' :: ParameterGroupStatus -> Maybe [Text]
nodeIdsToReboot} -> Maybe [Text]
nodeIdsToReboot) (\s :: ParameterGroupStatus
s@ParameterGroupStatus' {} Maybe [Text]
a -> ParameterGroupStatus
s {$sel:nodeIdsToReboot:ParameterGroupStatus' :: Maybe [Text]
nodeIdsToReboot = Maybe [Text]
a} :: ParameterGroupStatus) 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 status of parameter updates.
parameterGroupStatus_parameterApplyStatus :: Lens.Lens' ParameterGroupStatus (Prelude.Maybe Prelude.Text)
parameterGroupStatus_parameterApplyStatus :: Lens' ParameterGroupStatus (Maybe Text)
parameterGroupStatus_parameterApplyStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ParameterGroupStatus' {Maybe Text
parameterApplyStatus :: Maybe Text
$sel:parameterApplyStatus:ParameterGroupStatus' :: ParameterGroupStatus -> Maybe Text
parameterApplyStatus} -> Maybe Text
parameterApplyStatus) (\s :: ParameterGroupStatus
s@ParameterGroupStatus' {} Maybe Text
a -> ParameterGroupStatus
s {$sel:parameterApplyStatus:ParameterGroupStatus' :: Maybe Text
parameterApplyStatus = Maybe Text
a} :: ParameterGroupStatus)

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

instance Data.FromJSON ParameterGroupStatus where
  parseJSON :: Value -> Parser ParameterGroupStatus
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ParameterGroupStatus"
      ( \Object
x ->
          Maybe [Text] -> Maybe Text -> Maybe Text -> ParameterGroupStatus
ParameterGroupStatus'
            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
"NodeIdsToReboot"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            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
"ParameterApplyStatus")
            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
"ParameterGroupName")
      )

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

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