{-# 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.ClusterEndpoint where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ClusterEndpoint = ClusterEndpoint'
{
ClusterEndpoint -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
ClusterEndpoint -> Maybe Text
endpoint :: Prelude.Maybe Prelude.Text
}
deriving (ClusterEndpoint -> ClusterEndpoint -> Bool
(ClusterEndpoint -> ClusterEndpoint -> Bool)
-> (ClusterEndpoint -> ClusterEndpoint -> Bool)
-> Eq ClusterEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterEndpoint -> ClusterEndpoint -> Bool
$c/= :: ClusterEndpoint -> ClusterEndpoint -> Bool
== :: ClusterEndpoint -> ClusterEndpoint -> Bool
$c== :: ClusterEndpoint -> ClusterEndpoint -> Bool
Prelude.Eq, ReadPrec [ClusterEndpoint]
ReadPrec ClusterEndpoint
Int -> ReadS ClusterEndpoint
ReadS [ClusterEndpoint]
(Int -> ReadS ClusterEndpoint)
-> ReadS [ClusterEndpoint]
-> ReadPrec ClusterEndpoint
-> ReadPrec [ClusterEndpoint]
-> Read ClusterEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClusterEndpoint]
$creadListPrec :: ReadPrec [ClusterEndpoint]
readPrec :: ReadPrec ClusterEndpoint
$creadPrec :: ReadPrec ClusterEndpoint
readList :: ReadS [ClusterEndpoint]
$creadList :: ReadS [ClusterEndpoint]
readsPrec :: Int -> ReadS ClusterEndpoint
$creadsPrec :: Int -> ReadS ClusterEndpoint
Prelude.Read, Int -> ClusterEndpoint -> ShowS
[ClusterEndpoint] -> ShowS
ClusterEndpoint -> String
(Int -> ClusterEndpoint -> ShowS)
-> (ClusterEndpoint -> String)
-> ([ClusterEndpoint] -> ShowS)
-> Show ClusterEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterEndpoint] -> ShowS
$cshowList :: [ClusterEndpoint] -> ShowS
show :: ClusterEndpoint -> String
$cshow :: ClusterEndpoint -> String
showsPrec :: Int -> ClusterEndpoint -> ShowS
$cshowsPrec :: Int -> ClusterEndpoint -> ShowS
Prelude.Show, (forall x. ClusterEndpoint -> Rep ClusterEndpoint x)
-> (forall x. Rep ClusterEndpoint x -> ClusterEndpoint)
-> Generic ClusterEndpoint
forall x. Rep ClusterEndpoint x -> ClusterEndpoint
forall x. ClusterEndpoint -> Rep ClusterEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterEndpoint x -> ClusterEndpoint
$cfrom :: forall x. ClusterEndpoint -> Rep ClusterEndpoint x
Prelude.Generic)
newClusterEndpoint ::
ClusterEndpoint
newClusterEndpoint :: ClusterEndpoint
newClusterEndpoint =
ClusterEndpoint' :: Maybe Text -> Maybe Text -> ClusterEndpoint
ClusterEndpoint'
{ $sel:region:ClusterEndpoint' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpoint:ClusterEndpoint' :: Maybe Text
endpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
clusterEndpoint_region :: Lens.Lens' ClusterEndpoint (Prelude.Maybe Prelude.Text)
clusterEndpoint_region :: (Maybe Text -> f (Maybe Text))
-> ClusterEndpoint -> f ClusterEndpoint
clusterEndpoint_region = (ClusterEndpoint -> Maybe Text)
-> (ClusterEndpoint -> Maybe Text -> ClusterEndpoint)
-> Lens ClusterEndpoint ClusterEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterEndpoint' {Maybe Text
region :: Maybe Text
$sel:region:ClusterEndpoint' :: ClusterEndpoint -> Maybe Text
region} -> Maybe Text
region) (\s :: ClusterEndpoint
s@ClusterEndpoint' {} Maybe Text
a -> ClusterEndpoint
s {$sel:region:ClusterEndpoint' :: Maybe Text
region = Maybe Text
a} :: ClusterEndpoint)
clusterEndpoint_endpoint :: Lens.Lens' ClusterEndpoint (Prelude.Maybe Prelude.Text)
clusterEndpoint_endpoint :: (Maybe Text -> f (Maybe Text))
-> ClusterEndpoint -> f ClusterEndpoint
clusterEndpoint_endpoint = (ClusterEndpoint -> Maybe Text)
-> (ClusterEndpoint -> Maybe Text -> ClusterEndpoint)
-> Lens ClusterEndpoint ClusterEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClusterEndpoint' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:ClusterEndpoint' :: ClusterEndpoint -> Maybe Text
endpoint} -> Maybe Text
endpoint) (\s :: ClusterEndpoint
s@ClusterEndpoint' {} Maybe Text
a -> ClusterEndpoint
s {$sel:endpoint:ClusterEndpoint' :: Maybe Text
endpoint = Maybe Text
a} :: ClusterEndpoint)
instance Core.FromJSON ClusterEndpoint where
parseJSON :: Value -> Parser ClusterEndpoint
parseJSON =
String
-> (Object -> Parser ClusterEndpoint)
-> Value
-> Parser ClusterEndpoint
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ClusterEndpoint"
( \Object
x ->
Maybe Text -> Maybe Text -> ClusterEndpoint
ClusterEndpoint'
(Maybe Text -> Maybe Text -> ClusterEndpoint)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ClusterEndpoint)
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
"Region")
Parser (Maybe Text -> ClusterEndpoint)
-> Parser (Maybe Text) -> Parser ClusterEndpoint
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
"Endpoint")
)
instance Prelude.Hashable ClusterEndpoint
instance Prelude.NFData ClusterEndpoint