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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(ParameterGroupStatus -> ParameterGroupStatus -> Bool)
-> (ParameterGroupStatus -> ParameterGroupStatus -> Bool)
-> Eq ParameterGroupStatus
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]
(Int -> ReadS ParameterGroupStatus)
-> ReadS [ParameterGroupStatus]
-> ReadPrec ParameterGroupStatus
-> ReadPrec [ParameterGroupStatus]
-> Read 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
(Int -> ParameterGroupStatus -> ShowS)
-> (ParameterGroupStatus -> String)
-> ([ParameterGroupStatus] -> ShowS)
-> Show ParameterGroupStatus
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. ParameterGroupStatus -> Rep ParameterGroupStatus x)
-> (forall x. Rep ParameterGroupStatus x -> ParameterGroupStatus)
-> Generic ParameterGroupStatus
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' :: Maybe [Text] -> Maybe Text -> Maybe Text -> ParameterGroupStatus
ParameterGroupStatus'
    { $sel:nodeIdsToReboot:ParameterGroupStatus' :: Maybe [Text]
nodeIdsToReboot =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterApplyStatus:ParameterGroupStatus' :: Maybe Text
parameterApplyStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupName:ParameterGroupStatus' :: Maybe Text
parameterGroupName = Maybe Text
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 :: (Maybe [Text] -> f (Maybe [Text]))
-> ParameterGroupStatus -> f ParameterGroupStatus
parameterGroupStatus_nodeIdsToReboot = (ParameterGroupStatus -> Maybe [Text])
-> (ParameterGroupStatus -> Maybe [Text] -> ParameterGroupStatus)
-> Lens
     ParameterGroupStatus
     ParameterGroupStatus
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ParameterGroupStatus -> f ParameterGroupStatus)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ParameterGroupStatus
-> f ParameterGroupStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
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 :: (Maybe Text -> f (Maybe Text))
-> ParameterGroupStatus -> f ParameterGroupStatus
parameterGroupStatus_parameterApplyStatus = (ParameterGroupStatus -> Maybe Text)
-> (ParameterGroupStatus -> Maybe Text -> ParameterGroupStatus)
-> Lens
     ParameterGroupStatus ParameterGroupStatus (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> ParameterGroupStatus -> f ParameterGroupStatus
parameterGroupStatus_parameterGroupName = (ParameterGroupStatus -> Maybe Text)
-> (ParameterGroupStatus -> Maybe Text -> ParameterGroupStatus)
-> Lens
     ParameterGroupStatus ParameterGroupStatus (Maybe Text) (Maybe Text)
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 Core.FromJSON ParameterGroupStatus where
  parseJSON :: Value -> Parser ParameterGroupStatus
parseJSON =
    String
-> (Object -> Parser ParameterGroupStatus)
-> Value
-> Parser ParameterGroupStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ParameterGroupStatus"
      ( \Object
x ->
          Maybe [Text] -> Maybe Text -> Maybe Text -> ParameterGroupStatus
ParameterGroupStatus'
            (Maybe [Text] -> Maybe Text -> Maybe Text -> ParameterGroupStatus)
-> Parser (Maybe [Text])
-> Parser (Maybe Text -> Maybe Text -> ParameterGroupStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NodeIdsToReboot"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> Maybe Text -> ParameterGroupStatus)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ParameterGroupStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ParameterApplyStatus")
            Parser (Maybe Text -> ParameterGroupStatus)
-> Parser (Maybe Text) -> Parser ParameterGroupStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ParameterGroupName")
      )

instance Prelude.Hashable ParameterGroupStatus

instance Prelude.NFData ParameterGroupStatus