{-# 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.MemoryDb.Types.Node where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types.Endpoint
import qualified Amazonka.Prelude as Prelude
data Node = Node'
{
Node -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
Node -> Maybe Text
availabilityZone :: Prelude.Maybe Prelude.Text,
Node -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Node -> Maybe Endpoint
endpoint :: Prelude.Maybe Endpoint,
Node -> Maybe POSIX
createTime :: Prelude.Maybe Core.POSIX
}
deriving (Node -> Node -> Bool
(Node -> Node -> Bool) -> (Node -> Node -> Bool) -> Eq Node
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Node -> Node -> Bool
$c/= :: Node -> Node -> Bool
== :: Node -> Node -> Bool
$c== :: Node -> Node -> Bool
Prelude.Eq, ReadPrec [Node]
ReadPrec Node
Int -> ReadS Node
ReadS [Node]
(Int -> ReadS Node)
-> ReadS [Node] -> ReadPrec Node -> ReadPrec [Node] -> Read Node
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Node]
$creadListPrec :: ReadPrec [Node]
readPrec :: ReadPrec Node
$creadPrec :: ReadPrec Node
readList :: ReadS [Node]
$creadList :: ReadS [Node]
readsPrec :: Int -> ReadS Node
$creadsPrec :: Int -> ReadS Node
Prelude.Read, Int -> Node -> ShowS
[Node] -> ShowS
Node -> String
(Int -> Node -> ShowS)
-> (Node -> String) -> ([Node] -> ShowS) -> Show Node
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Node] -> ShowS
$cshowList :: [Node] -> ShowS
show :: Node -> String
$cshow :: Node -> String
showsPrec :: Int -> Node -> ShowS
$cshowsPrec :: Int -> Node -> ShowS
Prelude.Show, (forall x. Node -> Rep Node x)
-> (forall x. Rep Node x -> Node) -> Generic Node
forall x. Rep Node x -> Node
forall x. Node -> Rep Node x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Node x -> Node
$cfrom :: forall x. Node -> Rep Node x
Prelude.Generic)
newNode ::
Node
newNode :: Node
newNode =
Node' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> Maybe POSIX
-> Node
Node'
{ $sel:status:Node' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:availabilityZone:Node' :: Maybe Text
availabilityZone = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Node' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpoint:Node' :: Maybe Endpoint
endpoint = Maybe Endpoint
forall a. Maybe a
Prelude.Nothing,
$sel:createTime:Node' :: Maybe POSIX
createTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
node_status :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_status :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_status = (Node -> Maybe Text)
-> (Node -> Maybe Text -> Node)
-> Lens Node Node (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe Text
status :: Maybe Text
$sel:status:Node' :: Node -> Maybe Text
status} -> Maybe Text
status) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:status:Node' :: Maybe Text
status = Maybe Text
a} :: Node)
node_availabilityZone :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_availabilityZone :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_availabilityZone = (Node -> Maybe Text)
-> (Node -> Maybe Text -> Node)
-> Lens Node Node (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe Text
availabilityZone :: Maybe Text
$sel:availabilityZone:Node' :: Node -> Maybe Text
availabilityZone} -> Maybe Text
availabilityZone) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:availabilityZone:Node' :: Maybe Text
availabilityZone = Maybe Text
a} :: Node)
node_name :: Lens.Lens' Node (Prelude.Maybe Prelude.Text)
node_name :: (Maybe Text -> f (Maybe Text)) -> Node -> f Node
node_name = (Node -> Maybe Text)
-> (Node -> Maybe Text -> Node)
-> Lens Node Node (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe Text
name :: Maybe Text
$sel:name:Node' :: Node -> Maybe Text
name} -> Maybe Text
name) (\s :: Node
s@Node' {} Maybe Text
a -> Node
s {$sel:name:Node' :: Maybe Text
name = Maybe Text
a} :: Node)
node_endpoint :: Lens.Lens' Node (Prelude.Maybe Endpoint)
node_endpoint :: (Maybe Endpoint -> f (Maybe Endpoint)) -> Node -> f Node
node_endpoint = (Node -> Maybe Endpoint)
-> (Node -> Maybe Endpoint -> Node)
-> Lens Node Node (Maybe Endpoint) (Maybe Endpoint)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe Endpoint
endpoint :: Maybe Endpoint
$sel:endpoint:Node' :: Node -> Maybe Endpoint
endpoint} -> Maybe Endpoint
endpoint) (\s :: Node
s@Node' {} Maybe Endpoint
a -> Node
s {$sel:endpoint:Node' :: Maybe Endpoint
endpoint = Maybe Endpoint
a} :: Node)
node_createTime :: Lens.Lens' Node (Prelude.Maybe Prelude.UTCTime)
node_createTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Node -> f Node
node_createTime = (Node -> Maybe POSIX)
-> (Node -> Maybe POSIX -> Node)
-> Lens Node Node (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Node' {Maybe POSIX
createTime :: Maybe POSIX
$sel:createTime:Node' :: Node -> Maybe POSIX
createTime} -> Maybe POSIX
createTime) (\s :: Node
s@Node' {} Maybe POSIX
a -> Node
s {$sel:createTime:Node' :: Maybe POSIX
createTime = Maybe POSIX
a} :: Node) ((Maybe POSIX -> f (Maybe POSIX)) -> Node -> f Node)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Node
-> f Node
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON Node where
parseJSON :: Value -> Parser Node
parseJSON =
String -> (Object -> Parser Node) -> Value -> Parser Node
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Node"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> Maybe POSIX
-> Node
Node'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Endpoint
-> Maybe POSIX
-> Node)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Endpoint -> Maybe POSIX -> Node)
forall (f :: * -> *) a b. Functor 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
"Status")
Parser
(Maybe Text -> Maybe Text -> Maybe Endpoint -> Maybe POSIX -> Node)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Endpoint -> Maybe POSIX -> Node)
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
"AvailabilityZone")
Parser (Maybe Text -> Maybe Endpoint -> Maybe POSIX -> Node)
-> Parser (Maybe Text)
-> Parser (Maybe Endpoint -> Maybe POSIX -> Node)
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
"Name")
Parser (Maybe Endpoint -> Maybe POSIX -> Node)
-> Parser (Maybe Endpoint) -> Parser (Maybe POSIX -> Node)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Endpoint)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Endpoint")
Parser (Maybe POSIX -> Node) -> Parser (Maybe POSIX) -> Parser Node
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreateTime")
)
instance Prelude.Hashable Node
instance Prelude.NFData Node