{-# 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.Redshift.Types.ClusterNode where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Internal
data ClusterNode = ClusterNode'
{
ClusterNode -> Maybe Text
nodeRole :: Prelude.Maybe Prelude.Text,
ClusterNode -> Maybe Text
privateIPAddress :: Prelude.Maybe Prelude.Text,
ClusterNode -> Maybe Text
publicIPAddress :: Prelude.Maybe Prelude.Text
}
deriving (ClusterNode -> ClusterNode -> Bool
(ClusterNode -> ClusterNode -> Bool)
-> (ClusterNode -> ClusterNode -> Bool) -> Eq ClusterNode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterNode -> ClusterNode -> Bool
$c/= :: ClusterNode -> ClusterNode -> Bool
== :: ClusterNode -> ClusterNode -> Bool
$c== :: ClusterNode -> ClusterNode -> Bool
Prelude.Eq, ReadPrec [ClusterNode]
ReadPrec ClusterNode
Int -> ReadS ClusterNode
ReadS [ClusterNode]
(Int -> ReadS ClusterNode)
-> ReadS [ClusterNode]
-> ReadPrec ClusterNode
-> ReadPrec [ClusterNode]
-> Read ClusterNode
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterNode]
$creadListPrec :: ReadPrec [ClusterNode]
readPrec :: ReadPrec ClusterNode
$creadPrec :: ReadPrec ClusterNode
readList :: ReadS [ClusterNode]
$creadList :: ReadS [ClusterNode]
readsPrec :: Int -> ReadS ClusterNode
$creadsPrec :: Int -> ReadS ClusterNode
Prelude.Read, Int -> ClusterNode -> ShowS
[ClusterNode] -> ShowS
ClusterNode -> String
(Int -> ClusterNode -> ShowS)
-> (ClusterNode -> String)
-> ([ClusterNode] -> ShowS)
-> Show ClusterNode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterNode] -> ShowS
$cshowList :: [ClusterNode] -> ShowS
show :: ClusterNode -> String
$cshow :: ClusterNode -> String
showsPrec :: Int -> ClusterNode -> ShowS
$cshowsPrec :: Int -> ClusterNode -> ShowS
Prelude.Show, (forall x. ClusterNode -> Rep ClusterNode x)
-> (forall x. Rep ClusterNode x -> ClusterNode)
-> Generic ClusterNode
forall x. Rep ClusterNode x -> ClusterNode
forall x. ClusterNode -> Rep ClusterNode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterNode x -> ClusterNode
$cfrom :: forall x. ClusterNode -> Rep ClusterNode x
Prelude.Generic)
newClusterNode ::
ClusterNode
newClusterNode :: ClusterNode
newClusterNode =
ClusterNode' :: Maybe Text -> Maybe Text -> Maybe Text -> ClusterNode
ClusterNode'
{ $sel:nodeRole:ClusterNode' :: Maybe Text
nodeRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:privateIPAddress:ClusterNode' :: Maybe Text
privateIPAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:publicIPAddress:ClusterNode' :: Maybe Text
publicIPAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
clusterNode_nodeRole :: Lens.Lens' ClusterNode (Prelude.Maybe Prelude.Text)
clusterNode_nodeRole :: (Maybe Text -> f (Maybe Text)) -> ClusterNode -> f ClusterNode
clusterNode_nodeRole = (ClusterNode -> Maybe Text)
-> (ClusterNode -> Maybe Text -> ClusterNode)
-> Lens ClusterNode ClusterNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterNode' {Maybe Text
nodeRole :: Maybe Text
$sel:nodeRole:ClusterNode' :: ClusterNode -> Maybe Text
nodeRole} -> Maybe Text
nodeRole) (\s :: ClusterNode
s@ClusterNode' {} Maybe Text
a -> ClusterNode
s {$sel:nodeRole:ClusterNode' :: Maybe Text
nodeRole = Maybe Text
a} :: ClusterNode)
clusterNode_privateIPAddress :: Lens.Lens' ClusterNode (Prelude.Maybe Prelude.Text)
clusterNode_privateIPAddress :: (Maybe Text -> f (Maybe Text)) -> ClusterNode -> f ClusterNode
clusterNode_privateIPAddress = (ClusterNode -> Maybe Text)
-> (ClusterNode -> Maybe Text -> ClusterNode)
-> Lens ClusterNode ClusterNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterNode' {Maybe Text
privateIPAddress :: Maybe Text
$sel:privateIPAddress:ClusterNode' :: ClusterNode -> Maybe Text
privateIPAddress} -> Maybe Text
privateIPAddress) (\s :: ClusterNode
s@ClusterNode' {} Maybe Text
a -> ClusterNode
s {$sel:privateIPAddress:ClusterNode' :: Maybe Text
privateIPAddress = Maybe Text
a} :: ClusterNode)
clusterNode_publicIPAddress :: Lens.Lens' ClusterNode (Prelude.Maybe Prelude.Text)
clusterNode_publicIPAddress :: (Maybe Text -> f (Maybe Text)) -> ClusterNode -> f ClusterNode
clusterNode_publicIPAddress = (ClusterNode -> Maybe Text)
-> (ClusterNode -> Maybe Text -> ClusterNode)
-> Lens ClusterNode ClusterNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterNode' {Maybe Text
publicIPAddress :: Maybe Text
$sel:publicIPAddress:ClusterNode' :: ClusterNode -> Maybe Text
publicIPAddress} -> Maybe Text
publicIPAddress) (\s :: ClusterNode
s@ClusterNode' {} Maybe Text
a -> ClusterNode
s {$sel:publicIPAddress:ClusterNode' :: Maybe Text
publicIPAddress = Maybe Text
a} :: ClusterNode)
instance Core.FromXML ClusterNode where
parseXML :: [Node] -> Either String ClusterNode
parseXML [Node]
x =
Maybe Text -> Maybe Text -> Maybe Text -> ClusterNode
ClusterNode'
(Maybe Text -> Maybe Text -> Maybe Text -> ClusterNode)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> ClusterNode)
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
"NodeRole")
Either String (Maybe Text -> Maybe Text -> ClusterNode)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> ClusterNode)
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
"PrivateIPAddress")
Either String (Maybe Text -> ClusterNode)
-> Either String (Maybe Text) -> Either String ClusterNode
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
"PublicIPAddress")
instance Prelude.Hashable ClusterNode
instance Prelude.NFData ClusterNode