{-# 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.CacheNode where
import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.Types.Endpoint
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data CacheNode = CacheNode'
{
CacheNode -> Maybe Text
sourceCacheNodeId :: Prelude.Maybe Prelude.Text,
CacheNode -> Maybe Text
parameterGroupStatus :: Prelude.Maybe Prelude.Text,
CacheNode -> Maybe ISO8601
cacheNodeCreateTime :: Prelude.Maybe Core.ISO8601,
CacheNode -> Maybe Text
customerAvailabilityZone :: Prelude.Maybe Prelude.Text,
CacheNode -> Maybe Text
cacheNodeId :: Prelude.Maybe Prelude.Text,
CacheNode -> Maybe Text
customerOutpostArn :: Prelude.Maybe Prelude.Text,
CacheNode -> Maybe Text
cacheNodeStatus :: Prelude.Maybe Prelude.Text,
CacheNode -> Maybe Endpoint
endpoint :: Prelude.Maybe Endpoint
}
deriving (CacheNode -> CacheNode -> Bool
(CacheNode -> CacheNode -> Bool)
-> (CacheNode -> CacheNode -> Bool) -> Eq CacheNode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CacheNode -> CacheNode -> Bool
$c/= :: CacheNode -> CacheNode -> Bool
== :: CacheNode -> CacheNode -> Bool
$c== :: CacheNode -> CacheNode -> Bool
Prelude.Eq, ReadPrec [CacheNode]
ReadPrec CacheNode
Int -> ReadS CacheNode
ReadS [CacheNode]
(Int -> ReadS CacheNode)
-> ReadS [CacheNode]
-> ReadPrec CacheNode
-> ReadPrec [CacheNode]
-> Read CacheNode
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CacheNode]
$creadListPrec :: ReadPrec [CacheNode]
readPrec :: ReadPrec CacheNode
$creadPrec :: ReadPrec CacheNode
readList :: ReadS [CacheNode]
$creadList :: ReadS [CacheNode]
readsPrec :: Int -> ReadS CacheNode
$creadsPrec :: Int -> ReadS CacheNode
Prelude.Read, Int -> CacheNode -> ShowS
[CacheNode] -> ShowS
CacheNode -> String
(Int -> CacheNode -> ShowS)
-> (CacheNode -> String)
-> ([CacheNode] -> ShowS)
-> Show CacheNode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CacheNode] -> ShowS
$cshowList :: [CacheNode] -> ShowS
show :: CacheNode -> String
$cshow :: CacheNode -> String
showsPrec :: Int -> CacheNode -> ShowS
$cshowsPrec :: Int -> CacheNode -> ShowS
Prelude.Show, (forall x. CacheNode -> Rep CacheNode x)
-> (forall x. Rep CacheNode x -> CacheNode) -> Generic CacheNode
forall x. Rep CacheNode x -> CacheNode
forall x. CacheNode -> Rep CacheNode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CacheNode x -> CacheNode
$cfrom :: forall x. CacheNode -> Rep CacheNode x
Prelude.Generic)
newCacheNode ::
CacheNode
newCacheNode :: CacheNode
newCacheNode =
CacheNode' :: Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> CacheNode
CacheNode'
{ $sel:sourceCacheNodeId:CacheNode' :: Maybe Text
sourceCacheNodeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:parameterGroupStatus:CacheNode' :: Maybe Text
parameterGroupStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cacheNodeCreateTime:CacheNode' :: Maybe ISO8601
cacheNodeCreateTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
$sel:customerAvailabilityZone:CacheNode' :: Maybe Text
customerAvailabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cacheNodeId:CacheNode' :: Maybe Text
cacheNodeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:customerOutpostArn:CacheNode' :: Maybe Text
customerOutpostArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cacheNodeStatus:CacheNode' :: Maybe Text
cacheNodeStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpoint:CacheNode' :: Maybe Endpoint
endpoint = Maybe Endpoint
forall a. Maybe a
Prelude.Nothing
}
cacheNode_sourceCacheNodeId :: Lens.Lens' CacheNode (Prelude.Maybe Prelude.Text)
cacheNode_sourceCacheNodeId :: (Maybe Text -> f (Maybe Text)) -> CacheNode -> f CacheNode
cacheNode_sourceCacheNodeId = (CacheNode -> Maybe Text)
-> (CacheNode -> Maybe Text -> CacheNode)
-> Lens CacheNode CacheNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheNode' {Maybe Text
sourceCacheNodeId :: Maybe Text
$sel:sourceCacheNodeId:CacheNode' :: CacheNode -> Maybe Text
sourceCacheNodeId} -> Maybe Text
sourceCacheNodeId) (\s :: CacheNode
s@CacheNode' {} Maybe Text
a -> CacheNode
s {$sel:sourceCacheNodeId:CacheNode' :: Maybe Text
sourceCacheNodeId = Maybe Text
a} :: CacheNode)
cacheNode_parameterGroupStatus :: Lens.Lens' CacheNode (Prelude.Maybe Prelude.Text)
cacheNode_parameterGroupStatus :: (Maybe Text -> f (Maybe Text)) -> CacheNode -> f CacheNode
cacheNode_parameterGroupStatus = (CacheNode -> Maybe Text)
-> (CacheNode -> Maybe Text -> CacheNode)
-> Lens CacheNode CacheNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheNode' {Maybe Text
parameterGroupStatus :: Maybe Text
$sel:parameterGroupStatus:CacheNode' :: CacheNode -> Maybe Text
parameterGroupStatus} -> Maybe Text
parameterGroupStatus) (\s :: CacheNode
s@CacheNode' {} Maybe Text
a -> CacheNode
s {$sel:parameterGroupStatus:CacheNode' :: Maybe Text
parameterGroupStatus = Maybe Text
a} :: CacheNode)
cacheNode_cacheNodeCreateTime :: Lens.Lens' CacheNode (Prelude.Maybe Prelude.UTCTime)
cacheNode_cacheNodeCreateTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> CacheNode -> f CacheNode
cacheNode_cacheNodeCreateTime = (CacheNode -> Maybe ISO8601)
-> (CacheNode -> Maybe ISO8601 -> CacheNode)
-> Lens CacheNode CacheNode (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheNode' {Maybe ISO8601
cacheNodeCreateTime :: Maybe ISO8601
$sel:cacheNodeCreateTime:CacheNode' :: CacheNode -> Maybe ISO8601
cacheNodeCreateTime} -> Maybe ISO8601
cacheNodeCreateTime) (\s :: CacheNode
s@CacheNode' {} Maybe ISO8601
a -> CacheNode
s {$sel:cacheNodeCreateTime:CacheNode' :: Maybe ISO8601
cacheNodeCreateTime = Maybe ISO8601
a} :: CacheNode) ((Maybe ISO8601 -> f (Maybe ISO8601)) -> CacheNode -> f CacheNode)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CacheNode
-> f CacheNode
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
(Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
cacheNode_customerAvailabilityZone :: Lens.Lens' CacheNode (Prelude.Maybe Prelude.Text)
cacheNode_customerAvailabilityZone :: (Maybe Text -> f (Maybe Text)) -> CacheNode -> f CacheNode
cacheNode_customerAvailabilityZone = (CacheNode -> Maybe Text)
-> (CacheNode -> Maybe Text -> CacheNode)
-> Lens CacheNode CacheNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheNode' {Maybe Text
customerAvailabilityZone :: Maybe Text
$sel:customerAvailabilityZone:CacheNode' :: CacheNode -> Maybe Text
customerAvailabilityZone} -> Maybe Text
customerAvailabilityZone) (\s :: CacheNode
s@CacheNode' {} Maybe Text
a -> CacheNode
s {$sel:customerAvailabilityZone:CacheNode' :: Maybe Text
customerAvailabilityZone = Maybe Text
a} :: CacheNode)
cacheNode_cacheNodeId :: Lens.Lens' CacheNode (Prelude.Maybe Prelude.Text)
cacheNode_cacheNodeId :: (Maybe Text -> f (Maybe Text)) -> CacheNode -> f CacheNode
cacheNode_cacheNodeId = (CacheNode -> Maybe Text)
-> (CacheNode -> Maybe Text -> CacheNode)
-> Lens CacheNode CacheNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheNode' {Maybe Text
cacheNodeId :: Maybe Text
$sel:cacheNodeId:CacheNode' :: CacheNode -> Maybe Text
cacheNodeId} -> Maybe Text
cacheNodeId) (\s :: CacheNode
s@CacheNode' {} Maybe Text
a -> CacheNode
s {$sel:cacheNodeId:CacheNode' :: Maybe Text
cacheNodeId = Maybe Text
a} :: CacheNode)
cacheNode_customerOutpostArn :: Lens.Lens' CacheNode (Prelude.Maybe Prelude.Text)
cacheNode_customerOutpostArn :: (Maybe Text -> f (Maybe Text)) -> CacheNode -> f CacheNode
cacheNode_customerOutpostArn = (CacheNode -> Maybe Text)
-> (CacheNode -> Maybe Text -> CacheNode)
-> Lens CacheNode CacheNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheNode' {Maybe Text
customerOutpostArn :: Maybe Text
$sel:customerOutpostArn:CacheNode' :: CacheNode -> Maybe Text
customerOutpostArn} -> Maybe Text
customerOutpostArn) (\s :: CacheNode
s@CacheNode' {} Maybe Text
a -> CacheNode
s {$sel:customerOutpostArn:CacheNode' :: Maybe Text
customerOutpostArn = Maybe Text
a} :: CacheNode)
cacheNode_cacheNodeStatus :: Lens.Lens' CacheNode (Prelude.Maybe Prelude.Text)
cacheNode_cacheNodeStatus :: (Maybe Text -> f (Maybe Text)) -> CacheNode -> f CacheNode
cacheNode_cacheNodeStatus = (CacheNode -> Maybe Text)
-> (CacheNode -> Maybe Text -> CacheNode)
-> Lens CacheNode CacheNode (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheNode' {Maybe Text
cacheNodeStatus :: Maybe Text
$sel:cacheNodeStatus:CacheNode' :: CacheNode -> Maybe Text
cacheNodeStatus} -> Maybe Text
cacheNodeStatus) (\s :: CacheNode
s@CacheNode' {} Maybe Text
a -> CacheNode
s {$sel:cacheNodeStatus:CacheNode' :: Maybe Text
cacheNodeStatus = Maybe Text
a} :: CacheNode)
cacheNode_endpoint :: Lens.Lens' CacheNode (Prelude.Maybe Endpoint)
cacheNode_endpoint :: (Maybe Endpoint -> f (Maybe Endpoint)) -> CacheNode -> f CacheNode
cacheNode_endpoint = (CacheNode -> Maybe Endpoint)
-> (CacheNode -> Maybe Endpoint -> CacheNode)
-> Lens CacheNode CacheNode (Maybe Endpoint) (Maybe Endpoint)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheNode' {Maybe Endpoint
endpoint :: Maybe Endpoint
$sel:endpoint:CacheNode' :: CacheNode -> Maybe Endpoint
endpoint} -> Maybe Endpoint
endpoint) (\s :: CacheNode
s@CacheNode' {} Maybe Endpoint
a -> CacheNode
s {$sel:endpoint:CacheNode' :: Maybe Endpoint
endpoint = Maybe Endpoint
a} :: CacheNode)
instance Core.FromXML CacheNode where
parseXML :: [Node] -> Either String CacheNode
parseXML [Node]
x =
Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> CacheNode
CacheNode'
(Maybe Text
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> CacheNode)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> CacheNode)
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
"SourceCacheNodeId")
Either
String
(Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> CacheNode)
-> Either String (Maybe Text)
-> Either
String
(Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> CacheNode)
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
"ParameterGroupStatus")
Either
String
(Maybe ISO8601
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> CacheNode)
-> Either String (Maybe ISO8601)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> CacheNode)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe ISO8601)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CacheNodeCreateTime")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> CacheNode)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Endpoint -> CacheNode)
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
"CustomerAvailabilityZone")
Either
String
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Endpoint -> CacheNode)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Maybe Endpoint -> CacheNode)
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
"CacheNodeId")
Either
String (Maybe Text -> Maybe Text -> Maybe Endpoint -> CacheNode)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Endpoint -> CacheNode)
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
"CustomerOutpostArn")
Either String (Maybe Text -> Maybe Endpoint -> CacheNode)
-> Either String (Maybe Text)
-> Either String (Maybe Endpoint -> CacheNode)
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
"CacheNodeStatus")
Either String (Maybe Endpoint -> CacheNode)
-> Either String (Maybe Endpoint) -> Either String CacheNode
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Endpoint)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Endpoint")
instance Prelude.Hashable CacheNode
instance Prelude.NFData CacheNode