{-# 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.Route53RecoveryControlConfig.Types.Cluster where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53RecoveryControlConfig.Types.ClusterEndpoint
import Amazonka.Route53RecoveryControlConfig.Types.Status
data Cluster = Cluster'
{
Cluster -> Maybe Status
status :: Prelude.Maybe Status,
Cluster -> Maybe Text
clusterArn :: Prelude.Maybe Prelude.Text,
Cluster -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
Cluster -> Maybe [ClusterEndpoint]
clusterEndpoints :: Prelude.Maybe [ClusterEndpoint]
}
deriving (Cluster -> Cluster -> Bool
(Cluster -> Cluster -> Bool)
-> (Cluster -> Cluster -> Bool) -> Eq Cluster
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Cluster -> Cluster -> Bool
$c/= :: Cluster -> Cluster -> Bool
== :: Cluster -> Cluster -> Bool
$c== :: Cluster -> Cluster -> Bool
Prelude.Eq, ReadPrec [Cluster]
ReadPrec Cluster
Int -> ReadS Cluster
ReadS [Cluster]
(Int -> ReadS Cluster)
-> ReadS [Cluster]
-> ReadPrec Cluster
-> ReadPrec [Cluster]
-> Read Cluster
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Cluster]
$creadListPrec :: ReadPrec [Cluster]
readPrec :: ReadPrec Cluster
$creadPrec :: ReadPrec Cluster
readList :: ReadS [Cluster]
$creadList :: ReadS [Cluster]
readsPrec :: Int -> ReadS Cluster
$creadsPrec :: Int -> ReadS Cluster
Prelude.Read, Int -> Cluster -> ShowS
[Cluster] -> ShowS
Cluster -> String
(Int -> Cluster -> ShowS)
-> (Cluster -> String) -> ([Cluster] -> ShowS) -> Show Cluster
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Cluster] -> ShowS
$cshowList :: [Cluster] -> ShowS
show :: Cluster -> String
$cshow :: Cluster -> String
showsPrec :: Int -> Cluster -> ShowS
$cshowsPrec :: Int -> Cluster -> ShowS
Prelude.Show, (forall x. Cluster -> Rep Cluster x)
-> (forall x. Rep Cluster x -> Cluster) -> Generic Cluster
forall x. Rep Cluster x -> Cluster
forall x. Cluster -> Rep Cluster x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Cluster x -> Cluster
$cfrom :: forall x. Cluster -> Rep Cluster x
Prelude.Generic)
newCluster ::
Cluster
newCluster :: Cluster
newCluster =
Cluster' :: Maybe Status
-> Maybe Text -> Maybe Text -> Maybe [ClusterEndpoint] -> Cluster
Cluster'
{ $sel:status:Cluster' :: Maybe Status
status = Maybe Status
forall a. Maybe a
Prelude.Nothing,
$sel:clusterArn:Cluster' :: Maybe Text
clusterArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:Cluster' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clusterEndpoints:Cluster' :: Maybe [ClusterEndpoint]
clusterEndpoints = Maybe [ClusterEndpoint]
forall a. Maybe a
Prelude.Nothing
}
cluster_status :: Lens.Lens' Cluster (Prelude.Maybe Status)
cluster_status :: (Maybe Status -> f (Maybe Status)) -> Cluster -> f Cluster
cluster_status = (Cluster -> Maybe Status)
-> (Cluster -> Maybe Status -> Cluster)
-> Lens Cluster Cluster (Maybe Status) (Maybe Status)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Status
status :: Maybe Status
$sel:status:Cluster' :: Cluster -> Maybe Status
status} -> Maybe Status
status) (\s :: Cluster
s@Cluster' {} Maybe Status
a -> Cluster
s {$sel:status:Cluster' :: Maybe Status
status = Maybe Status
a} :: Cluster)
cluster_clusterArn :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_clusterArn :: (Maybe Text -> f (Maybe Text)) -> Cluster -> f Cluster
cluster_clusterArn = (Cluster -> Maybe Text)
-> (Cluster -> Maybe Text -> Cluster)
-> Lens Cluster Cluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
clusterArn :: Maybe Text
$sel:clusterArn:Cluster' :: Cluster -> Maybe Text
clusterArn} -> Maybe Text
clusterArn) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:clusterArn:Cluster' :: Maybe Text
clusterArn = Maybe Text
a} :: Cluster)
cluster_name :: Lens.Lens' Cluster (Prelude.Maybe Prelude.Text)
cluster_name :: (Maybe Text -> f (Maybe Text)) -> Cluster -> f Cluster
cluster_name = (Cluster -> Maybe Text)
-> (Cluster -> Maybe Text -> Cluster)
-> Lens Cluster Cluster (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe Text
name :: Maybe Text
$sel:name:Cluster' :: Cluster -> Maybe Text
name} -> Maybe Text
name) (\s :: Cluster
s@Cluster' {} Maybe Text
a -> Cluster
s {$sel:name:Cluster' :: Maybe Text
name = Maybe Text
a} :: Cluster)
cluster_clusterEndpoints :: Lens.Lens' Cluster (Prelude.Maybe [ClusterEndpoint])
cluster_clusterEndpoints :: (Maybe [ClusterEndpoint] -> f (Maybe [ClusterEndpoint]))
-> Cluster -> f Cluster
cluster_clusterEndpoints = (Cluster -> Maybe [ClusterEndpoint])
-> (Cluster -> Maybe [ClusterEndpoint] -> Cluster)
-> Lens
Cluster Cluster (Maybe [ClusterEndpoint]) (Maybe [ClusterEndpoint])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Cluster' {Maybe [ClusterEndpoint]
clusterEndpoints :: Maybe [ClusterEndpoint]
$sel:clusterEndpoints:Cluster' :: Cluster -> Maybe [ClusterEndpoint]
clusterEndpoints} -> Maybe [ClusterEndpoint]
clusterEndpoints) (\s :: Cluster
s@Cluster' {} Maybe [ClusterEndpoint]
a -> Cluster
s {$sel:clusterEndpoints:Cluster' :: Maybe [ClusterEndpoint]
clusterEndpoints = Maybe [ClusterEndpoint]
a} :: Cluster) ((Maybe [ClusterEndpoint] -> f (Maybe [ClusterEndpoint]))
-> Cluster -> f Cluster)
-> ((Maybe [ClusterEndpoint] -> f (Maybe [ClusterEndpoint]))
-> Maybe [ClusterEndpoint] -> f (Maybe [ClusterEndpoint]))
-> (Maybe [ClusterEndpoint] -> f (Maybe [ClusterEndpoint]))
-> Cluster
-> f Cluster
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ClusterEndpoint]
[ClusterEndpoint]
[ClusterEndpoint]
[ClusterEndpoint]
-> Iso
(Maybe [ClusterEndpoint])
(Maybe [ClusterEndpoint])
(Maybe [ClusterEndpoint])
(Maybe [ClusterEndpoint])
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
[ClusterEndpoint]
[ClusterEndpoint]
[ClusterEndpoint]
[ClusterEndpoint]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Cluster where
parseJSON :: Value -> Parser Cluster
parseJSON =
String -> (Object -> Parser Cluster) -> Value -> Parser Cluster
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Cluster"
( \Object
x ->
Maybe Status
-> Maybe Text -> Maybe Text -> Maybe [ClusterEndpoint] -> Cluster
Cluster'
(Maybe Status
-> Maybe Text -> Maybe Text -> Maybe [ClusterEndpoint] -> Cluster)
-> Parser (Maybe Status)
-> Parser
(Maybe Text -> Maybe Text -> Maybe [ClusterEndpoint] -> Cluster)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Status)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text -> Maybe Text -> Maybe [ClusterEndpoint] -> Cluster)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [ClusterEndpoint] -> Cluster)
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
"ClusterArn")
Parser (Maybe Text -> Maybe [ClusterEndpoint] -> Cluster)
-> Parser (Maybe Text)
-> Parser (Maybe [ClusterEndpoint] -> Cluster)
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 [ClusterEndpoint] -> Cluster)
-> Parser (Maybe [ClusterEndpoint]) -> Parser Cluster
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ClusterEndpoint]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClusterEndpoints"
Parser (Maybe (Maybe [ClusterEndpoint]))
-> Maybe [ClusterEndpoint] -> Parser (Maybe [ClusterEndpoint])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ClusterEndpoint]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable Cluster
instance Prelude.NFData Cluster