{-# 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.NodeGroupUpdateStatus
-- 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.NodeGroupUpdateStatus 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.NodeGroupMemberUpdateStatus
import qualified Amazonka.Prelude as Prelude

-- | The status of the service update on the node group
--
-- /See:/ 'newNodeGroupUpdateStatus' smart constructor.
data NodeGroupUpdateStatus = NodeGroupUpdateStatus'
  { -- | The ID of the node group
    NodeGroupUpdateStatus -> Maybe Text
nodeGroupId :: Prelude.Maybe Prelude.Text,
    -- | The status of the service update on the node group member
    NodeGroupUpdateStatus -> Maybe [NodeGroupMemberUpdateStatus]
nodeGroupMemberUpdateStatus :: Prelude.Maybe [NodeGroupMemberUpdateStatus]
  }
  deriving (NodeGroupUpdateStatus -> NodeGroupUpdateStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NodeGroupUpdateStatus -> NodeGroupUpdateStatus -> Bool
$c/= :: NodeGroupUpdateStatus -> NodeGroupUpdateStatus -> Bool
== :: NodeGroupUpdateStatus -> NodeGroupUpdateStatus -> Bool
$c== :: NodeGroupUpdateStatus -> NodeGroupUpdateStatus -> Bool
Prelude.Eq, ReadPrec [NodeGroupUpdateStatus]
ReadPrec NodeGroupUpdateStatus
Int -> ReadS NodeGroupUpdateStatus
ReadS [NodeGroupUpdateStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NodeGroupUpdateStatus]
$creadListPrec :: ReadPrec [NodeGroupUpdateStatus]
readPrec :: ReadPrec NodeGroupUpdateStatus
$creadPrec :: ReadPrec NodeGroupUpdateStatus
readList :: ReadS [NodeGroupUpdateStatus]
$creadList :: ReadS [NodeGroupUpdateStatus]
readsPrec :: Int -> ReadS NodeGroupUpdateStatus
$creadsPrec :: Int -> ReadS NodeGroupUpdateStatus
Prelude.Read, Int -> NodeGroupUpdateStatus -> ShowS
[NodeGroupUpdateStatus] -> ShowS
NodeGroupUpdateStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NodeGroupUpdateStatus] -> ShowS
$cshowList :: [NodeGroupUpdateStatus] -> ShowS
show :: NodeGroupUpdateStatus -> String
$cshow :: NodeGroupUpdateStatus -> String
showsPrec :: Int -> NodeGroupUpdateStatus -> ShowS
$cshowsPrec :: Int -> NodeGroupUpdateStatus -> ShowS
Prelude.Show, forall x. Rep NodeGroupUpdateStatus x -> NodeGroupUpdateStatus
forall x. NodeGroupUpdateStatus -> Rep NodeGroupUpdateStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NodeGroupUpdateStatus x -> NodeGroupUpdateStatus
$cfrom :: forall x. NodeGroupUpdateStatus -> Rep NodeGroupUpdateStatus x
Prelude.Generic)

-- |
-- Create a value of 'NodeGroupUpdateStatus' 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:
--
-- 'nodeGroupId', 'nodeGroupUpdateStatus_nodeGroupId' - The ID of the node group
--
-- 'nodeGroupMemberUpdateStatus', 'nodeGroupUpdateStatus_nodeGroupMemberUpdateStatus' - The status of the service update on the node group member
newNodeGroupUpdateStatus ::
  NodeGroupUpdateStatus
newNodeGroupUpdateStatus :: NodeGroupUpdateStatus
newNodeGroupUpdateStatus =
  NodeGroupUpdateStatus'
    { $sel:nodeGroupId:NodeGroupUpdateStatus' :: Maybe Text
nodeGroupId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nodeGroupMemberUpdateStatus:NodeGroupUpdateStatus' :: Maybe [NodeGroupMemberUpdateStatus]
nodeGroupMemberUpdateStatus = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the node group
nodeGroupUpdateStatus_nodeGroupId :: Lens.Lens' NodeGroupUpdateStatus (Prelude.Maybe Prelude.Text)
nodeGroupUpdateStatus_nodeGroupId :: Lens' NodeGroupUpdateStatus (Maybe Text)
nodeGroupUpdateStatus_nodeGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeGroupUpdateStatus' {Maybe Text
nodeGroupId :: Maybe Text
$sel:nodeGroupId:NodeGroupUpdateStatus' :: NodeGroupUpdateStatus -> Maybe Text
nodeGroupId} -> Maybe Text
nodeGroupId) (\s :: NodeGroupUpdateStatus
s@NodeGroupUpdateStatus' {} Maybe Text
a -> NodeGroupUpdateStatus
s {$sel:nodeGroupId:NodeGroupUpdateStatus' :: Maybe Text
nodeGroupId = Maybe Text
a} :: NodeGroupUpdateStatus)

-- | The status of the service update on the node group member
nodeGroupUpdateStatus_nodeGroupMemberUpdateStatus :: Lens.Lens' NodeGroupUpdateStatus (Prelude.Maybe [NodeGroupMemberUpdateStatus])
nodeGroupUpdateStatus_nodeGroupMemberUpdateStatus :: Lens' NodeGroupUpdateStatus (Maybe [NodeGroupMemberUpdateStatus])
nodeGroupUpdateStatus_nodeGroupMemberUpdateStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NodeGroupUpdateStatus' {Maybe [NodeGroupMemberUpdateStatus]
nodeGroupMemberUpdateStatus :: Maybe [NodeGroupMemberUpdateStatus]
$sel:nodeGroupMemberUpdateStatus:NodeGroupUpdateStatus' :: NodeGroupUpdateStatus -> Maybe [NodeGroupMemberUpdateStatus]
nodeGroupMemberUpdateStatus} -> Maybe [NodeGroupMemberUpdateStatus]
nodeGroupMemberUpdateStatus) (\s :: NodeGroupUpdateStatus
s@NodeGroupUpdateStatus' {} Maybe [NodeGroupMemberUpdateStatus]
a -> NodeGroupUpdateStatus
s {$sel:nodeGroupMemberUpdateStatus:NodeGroupUpdateStatus' :: Maybe [NodeGroupMemberUpdateStatus]
nodeGroupMemberUpdateStatus = Maybe [NodeGroupMemberUpdateStatus]
a} :: NodeGroupUpdateStatus) 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

instance Data.FromXML NodeGroupUpdateStatus where
  parseXML :: [Node] -> Either String NodeGroupUpdateStatus
parseXML [Node]
x =
    Maybe Text
-> Maybe [NodeGroupMemberUpdateStatus] -> NodeGroupUpdateStatus
NodeGroupUpdateStatus'
      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
"NodeGroupId")
      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
"NodeGroupMemberUpdateStatus"
                      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
"NodeGroupMemberUpdateStatus")
                  )

instance Prelude.Hashable NodeGroupUpdateStatus where
  hashWithSalt :: Int -> NodeGroupUpdateStatus -> Int
hashWithSalt Int
_salt NodeGroupUpdateStatus' {Maybe [NodeGroupMemberUpdateStatus]
Maybe Text
nodeGroupMemberUpdateStatus :: Maybe [NodeGroupMemberUpdateStatus]
nodeGroupId :: Maybe Text
$sel:nodeGroupMemberUpdateStatus:NodeGroupUpdateStatus' :: NodeGroupUpdateStatus -> Maybe [NodeGroupMemberUpdateStatus]
$sel:nodeGroupId:NodeGroupUpdateStatus' :: NodeGroupUpdateStatus -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nodeGroupId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [NodeGroupMemberUpdateStatus]
nodeGroupMemberUpdateStatus

instance Prelude.NFData NodeGroupUpdateStatus where
  rnf :: NodeGroupUpdateStatus -> ()
rnf NodeGroupUpdateStatus' {Maybe [NodeGroupMemberUpdateStatus]
Maybe Text
nodeGroupMemberUpdateStatus :: Maybe [NodeGroupMemberUpdateStatus]
nodeGroupId :: Maybe Text
$sel:nodeGroupMemberUpdateStatus:NodeGroupUpdateStatus' :: NodeGroupUpdateStatus -> Maybe [NodeGroupMemberUpdateStatus]
$sel:nodeGroupId:NodeGroupUpdateStatus' :: NodeGroupUpdateStatus -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nodeGroupId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [NodeGroupMemberUpdateStatus]
nodeGroupMemberUpdateStatus