{-# 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 #-}
module Amazonka.ElastiCache.Types.GlobalNodeGroup where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GlobalNodeGroup = GlobalNodeGroup'
{
GlobalNodeGroup -> Maybe Text
slots :: Prelude.Maybe Prelude.Text,
GlobalNodeGroup -> Maybe Text
globalNodeGroupId :: Prelude.Maybe Prelude.Text
}
deriving (GlobalNodeGroup -> GlobalNodeGroup -> Bool
(GlobalNodeGroup -> GlobalNodeGroup -> Bool)
-> (GlobalNodeGroup -> GlobalNodeGroup -> Bool)
-> Eq GlobalNodeGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GlobalNodeGroup -> GlobalNodeGroup -> Bool
$c/= :: GlobalNodeGroup -> GlobalNodeGroup -> Bool
== :: GlobalNodeGroup -> GlobalNodeGroup -> Bool
$c== :: GlobalNodeGroup -> GlobalNodeGroup -> Bool
Prelude.Eq, ReadPrec [GlobalNodeGroup]
ReadPrec GlobalNodeGroup
Int -> ReadS GlobalNodeGroup
ReadS [GlobalNodeGroup]
(Int -> ReadS GlobalNodeGroup)
-> ReadS [GlobalNodeGroup]
-> ReadPrec GlobalNodeGroup
-> ReadPrec [GlobalNodeGroup]
-> Read GlobalNodeGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GlobalNodeGroup]
$creadListPrec :: ReadPrec [GlobalNodeGroup]
readPrec :: ReadPrec GlobalNodeGroup
$creadPrec :: ReadPrec GlobalNodeGroup
readList :: ReadS [GlobalNodeGroup]
$creadList :: ReadS [GlobalNodeGroup]
readsPrec :: Int -> ReadS GlobalNodeGroup
$creadsPrec :: Int -> ReadS GlobalNodeGroup
Prelude.Read, Int -> GlobalNodeGroup -> ShowS
[GlobalNodeGroup] -> ShowS
GlobalNodeGroup -> String
(Int -> GlobalNodeGroup -> ShowS)
-> (GlobalNodeGroup -> String)
-> ([GlobalNodeGroup] -> ShowS)
-> Show GlobalNodeGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GlobalNodeGroup] -> ShowS
$cshowList :: [GlobalNodeGroup] -> ShowS
show :: GlobalNodeGroup -> String
$cshow :: GlobalNodeGroup -> String
showsPrec :: Int -> GlobalNodeGroup -> ShowS
$cshowsPrec :: Int -> GlobalNodeGroup -> ShowS
Prelude.Show, (forall x. GlobalNodeGroup -> Rep GlobalNodeGroup x)
-> (forall x. Rep GlobalNodeGroup x -> GlobalNodeGroup)
-> Generic GlobalNodeGroup
forall x. Rep GlobalNodeGroup x -> GlobalNodeGroup
forall x. GlobalNodeGroup -> Rep GlobalNodeGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GlobalNodeGroup x -> GlobalNodeGroup
$cfrom :: forall x. GlobalNodeGroup -> Rep GlobalNodeGroup x
Prelude.Generic)
newGlobalNodeGroup ::
GlobalNodeGroup
newGlobalNodeGroup :: GlobalNodeGroup
newGlobalNodeGroup =
GlobalNodeGroup' :: Maybe Text -> Maybe Text -> GlobalNodeGroup
GlobalNodeGroup'
{ $sel:slots:GlobalNodeGroup' :: Maybe Text
slots = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:globalNodeGroupId:GlobalNodeGroup' :: Maybe Text
globalNodeGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
globalNodeGroup_slots :: Lens.Lens' GlobalNodeGroup (Prelude.Maybe Prelude.Text)
globalNodeGroup_slots :: (Maybe Text -> f (Maybe Text))
-> GlobalNodeGroup -> f GlobalNodeGroup
globalNodeGroup_slots = (GlobalNodeGroup -> Maybe Text)
-> (GlobalNodeGroup -> Maybe Text -> GlobalNodeGroup)
-> Lens GlobalNodeGroup GlobalNodeGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalNodeGroup' {Maybe Text
slots :: Maybe Text
$sel:slots:GlobalNodeGroup' :: GlobalNodeGroup -> Maybe Text
slots} -> Maybe Text
slots) (\s :: GlobalNodeGroup
s@GlobalNodeGroup' {} Maybe Text
a -> GlobalNodeGroup
s {$sel:slots:GlobalNodeGroup' :: Maybe Text
slots = Maybe Text
a} :: GlobalNodeGroup)
globalNodeGroup_globalNodeGroupId :: Lens.Lens' GlobalNodeGroup (Prelude.Maybe Prelude.Text)
globalNodeGroup_globalNodeGroupId :: (Maybe Text -> f (Maybe Text))
-> GlobalNodeGroup -> f GlobalNodeGroup
globalNodeGroup_globalNodeGroupId = (GlobalNodeGroup -> Maybe Text)
-> (GlobalNodeGroup -> Maybe Text -> GlobalNodeGroup)
-> Lens GlobalNodeGroup GlobalNodeGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GlobalNodeGroup' {Maybe Text
globalNodeGroupId :: Maybe Text
$sel:globalNodeGroupId:GlobalNodeGroup' :: GlobalNodeGroup -> Maybe Text
globalNodeGroupId} -> Maybe Text
globalNodeGroupId) (\s :: GlobalNodeGroup
s@GlobalNodeGroup' {} Maybe Text
a -> GlobalNodeGroup
s {$sel:globalNodeGroupId:GlobalNodeGroup' :: Maybe Text
globalNodeGroupId = Maybe Text
a} :: GlobalNodeGroup)
instance Core.FromXML GlobalNodeGroup where
parseXML :: [Node] -> Either String GlobalNodeGroup
parseXML [Node]
x =
Maybe Text -> Maybe Text -> GlobalNodeGroup
GlobalNodeGroup'
(Maybe Text -> Maybe Text -> GlobalNodeGroup)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> GlobalNodeGroup)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Slots")
Either String (Maybe Text -> GlobalNodeGroup)
-> Either String (Maybe Text) -> Either String GlobalNodeGroup
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"GlobalNodeGroupId")
instance Prelude.Hashable GlobalNodeGroup
instance Prelude.NFData GlobalNodeGroup