{-# 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.RDS.Types.DBProxyTarget where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types.TargetHealth
import Amazonka.RDS.Types.TargetRole
import Amazonka.RDS.Types.TargetType
data DBProxyTarget = DBProxyTarget'
{
DBProxyTarget -> Maybe Text
targetArn :: Prelude.Maybe Prelude.Text,
DBProxyTarget -> Maybe TargetHealth
targetHealth :: Prelude.Maybe TargetHealth,
DBProxyTarget -> Maybe Text
trackedClusterId :: Prelude.Maybe Prelude.Text,
DBProxyTarget -> Maybe TargetRole
role' :: Prelude.Maybe TargetRole,
DBProxyTarget -> Maybe Text
rdsResourceId :: Prelude.Maybe Prelude.Text,
DBProxyTarget -> Maybe TargetType
type' :: Prelude.Maybe TargetType,
DBProxyTarget -> Maybe Text
endpoint :: Prelude.Maybe Prelude.Text,
DBProxyTarget -> Maybe Int
port :: Prelude.Maybe Prelude.Int
}
deriving (DBProxyTarget -> DBProxyTarget -> Bool
(DBProxyTarget -> DBProxyTarget -> Bool)
-> (DBProxyTarget -> DBProxyTarget -> Bool) -> Eq DBProxyTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBProxyTarget -> DBProxyTarget -> Bool
$c/= :: DBProxyTarget -> DBProxyTarget -> Bool
== :: DBProxyTarget -> DBProxyTarget -> Bool
$c== :: DBProxyTarget -> DBProxyTarget -> Bool
Prelude.Eq, ReadPrec [DBProxyTarget]
ReadPrec DBProxyTarget
Int -> ReadS DBProxyTarget
ReadS [DBProxyTarget]
(Int -> ReadS DBProxyTarget)
-> ReadS [DBProxyTarget]
-> ReadPrec DBProxyTarget
-> ReadPrec [DBProxyTarget]
-> Read DBProxyTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DBProxyTarget]
$creadListPrec :: ReadPrec [DBProxyTarget]
readPrec :: ReadPrec DBProxyTarget
$creadPrec :: ReadPrec DBProxyTarget
readList :: ReadS [DBProxyTarget]
$creadList :: ReadS [DBProxyTarget]
readsPrec :: Int -> ReadS DBProxyTarget
$creadsPrec :: Int -> ReadS DBProxyTarget
Prelude.Read, Int -> DBProxyTarget -> ShowS
[DBProxyTarget] -> ShowS
DBProxyTarget -> String
(Int -> DBProxyTarget -> ShowS)
-> (DBProxyTarget -> String)
-> ([DBProxyTarget] -> ShowS)
-> Show DBProxyTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DBProxyTarget] -> ShowS
$cshowList :: [DBProxyTarget] -> ShowS
show :: DBProxyTarget -> String
$cshow :: DBProxyTarget -> String
showsPrec :: Int -> DBProxyTarget -> ShowS
$cshowsPrec :: Int -> DBProxyTarget -> ShowS
Prelude.Show, (forall x. DBProxyTarget -> Rep DBProxyTarget x)
-> (forall x. Rep DBProxyTarget x -> DBProxyTarget)
-> Generic DBProxyTarget
forall x. Rep DBProxyTarget x -> DBProxyTarget
forall x. DBProxyTarget -> Rep DBProxyTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DBProxyTarget x -> DBProxyTarget
$cfrom :: forall x. DBProxyTarget -> Rep DBProxyTarget x
Prelude.Generic)
newDBProxyTarget ::
DBProxyTarget
newDBProxyTarget :: DBProxyTarget
newDBProxyTarget =
DBProxyTarget' :: Maybe Text
-> Maybe TargetHealth
-> Maybe Text
-> Maybe TargetRole
-> Maybe Text
-> Maybe TargetType
-> Maybe Text
-> Maybe Int
-> DBProxyTarget
DBProxyTarget'
{ $sel:targetArn:DBProxyTarget' :: Maybe Text
targetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:targetHealth:DBProxyTarget' :: Maybe TargetHealth
targetHealth = Maybe TargetHealth
forall a. Maybe a
Prelude.Nothing,
$sel:trackedClusterId:DBProxyTarget' :: Maybe Text
trackedClusterId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:role':DBProxyTarget' :: Maybe TargetRole
role' = Maybe TargetRole
forall a. Maybe a
Prelude.Nothing,
$sel:rdsResourceId:DBProxyTarget' :: Maybe Text
rdsResourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':DBProxyTarget' :: Maybe TargetType
type' = Maybe TargetType
forall a. Maybe a
Prelude.Nothing,
$sel:endpoint:DBProxyTarget' :: Maybe Text
endpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:port:DBProxyTarget' :: Maybe Int
port = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
dbProxyTarget_targetArn :: Lens.Lens' DBProxyTarget (Prelude.Maybe Prelude.Text)
dbProxyTarget_targetArn :: (Maybe Text -> f (Maybe Text)) -> DBProxyTarget -> f DBProxyTarget
dbProxyTarget_targetArn = (DBProxyTarget -> Maybe Text)
-> (DBProxyTarget -> Maybe Text -> DBProxyTarget)
-> Lens DBProxyTarget DBProxyTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyTarget' {Maybe Text
targetArn :: Maybe Text
$sel:targetArn:DBProxyTarget' :: DBProxyTarget -> Maybe Text
targetArn} -> Maybe Text
targetArn) (\s :: DBProxyTarget
s@DBProxyTarget' {} Maybe Text
a -> DBProxyTarget
s {$sel:targetArn:DBProxyTarget' :: Maybe Text
targetArn = Maybe Text
a} :: DBProxyTarget)
dbProxyTarget_targetHealth :: Lens.Lens' DBProxyTarget (Prelude.Maybe TargetHealth)
dbProxyTarget_targetHealth :: (Maybe TargetHealth -> f (Maybe TargetHealth))
-> DBProxyTarget -> f DBProxyTarget
dbProxyTarget_targetHealth = (DBProxyTarget -> Maybe TargetHealth)
-> (DBProxyTarget -> Maybe TargetHealth -> DBProxyTarget)
-> Lens
DBProxyTarget
DBProxyTarget
(Maybe TargetHealth)
(Maybe TargetHealth)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyTarget' {Maybe TargetHealth
targetHealth :: Maybe TargetHealth
$sel:targetHealth:DBProxyTarget' :: DBProxyTarget -> Maybe TargetHealth
targetHealth} -> Maybe TargetHealth
targetHealth) (\s :: DBProxyTarget
s@DBProxyTarget' {} Maybe TargetHealth
a -> DBProxyTarget
s {$sel:targetHealth:DBProxyTarget' :: Maybe TargetHealth
targetHealth = Maybe TargetHealth
a} :: DBProxyTarget)
dbProxyTarget_trackedClusterId :: Lens.Lens' DBProxyTarget (Prelude.Maybe Prelude.Text)
dbProxyTarget_trackedClusterId :: (Maybe Text -> f (Maybe Text)) -> DBProxyTarget -> f DBProxyTarget
dbProxyTarget_trackedClusterId = (DBProxyTarget -> Maybe Text)
-> (DBProxyTarget -> Maybe Text -> DBProxyTarget)
-> Lens DBProxyTarget DBProxyTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyTarget' {Maybe Text
trackedClusterId :: Maybe Text
$sel:trackedClusterId:DBProxyTarget' :: DBProxyTarget -> Maybe Text
trackedClusterId} -> Maybe Text
trackedClusterId) (\s :: DBProxyTarget
s@DBProxyTarget' {} Maybe Text
a -> DBProxyTarget
s {$sel:trackedClusterId:DBProxyTarget' :: Maybe Text
trackedClusterId = Maybe Text
a} :: DBProxyTarget)
dbProxyTarget_role :: Lens.Lens' DBProxyTarget (Prelude.Maybe TargetRole)
dbProxyTarget_role :: (Maybe TargetRole -> f (Maybe TargetRole))
-> DBProxyTarget -> f DBProxyTarget
dbProxyTarget_role = (DBProxyTarget -> Maybe TargetRole)
-> (DBProxyTarget -> Maybe TargetRole -> DBProxyTarget)
-> Lens
DBProxyTarget DBProxyTarget (Maybe TargetRole) (Maybe TargetRole)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyTarget' {Maybe TargetRole
role' :: Maybe TargetRole
$sel:role':DBProxyTarget' :: DBProxyTarget -> Maybe TargetRole
role'} -> Maybe TargetRole
role') (\s :: DBProxyTarget
s@DBProxyTarget' {} Maybe TargetRole
a -> DBProxyTarget
s {$sel:role':DBProxyTarget' :: Maybe TargetRole
role' = Maybe TargetRole
a} :: DBProxyTarget)
dbProxyTarget_rdsResourceId :: Lens.Lens' DBProxyTarget (Prelude.Maybe Prelude.Text)
dbProxyTarget_rdsResourceId :: (Maybe Text -> f (Maybe Text)) -> DBProxyTarget -> f DBProxyTarget
dbProxyTarget_rdsResourceId = (DBProxyTarget -> Maybe Text)
-> (DBProxyTarget -> Maybe Text -> DBProxyTarget)
-> Lens DBProxyTarget DBProxyTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyTarget' {Maybe Text
rdsResourceId :: Maybe Text
$sel:rdsResourceId:DBProxyTarget' :: DBProxyTarget -> Maybe Text
rdsResourceId} -> Maybe Text
rdsResourceId) (\s :: DBProxyTarget
s@DBProxyTarget' {} Maybe Text
a -> DBProxyTarget
s {$sel:rdsResourceId:DBProxyTarget' :: Maybe Text
rdsResourceId = Maybe Text
a} :: DBProxyTarget)
dbProxyTarget_type :: Lens.Lens' DBProxyTarget (Prelude.Maybe TargetType)
dbProxyTarget_type :: (Maybe TargetType -> f (Maybe TargetType))
-> DBProxyTarget -> f DBProxyTarget
dbProxyTarget_type = (DBProxyTarget -> Maybe TargetType)
-> (DBProxyTarget -> Maybe TargetType -> DBProxyTarget)
-> Lens
DBProxyTarget DBProxyTarget (Maybe TargetType) (Maybe TargetType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyTarget' {Maybe TargetType
type' :: Maybe TargetType
$sel:type':DBProxyTarget' :: DBProxyTarget -> Maybe TargetType
type'} -> Maybe TargetType
type') (\s :: DBProxyTarget
s@DBProxyTarget' {} Maybe TargetType
a -> DBProxyTarget
s {$sel:type':DBProxyTarget' :: Maybe TargetType
type' = Maybe TargetType
a} :: DBProxyTarget)
dbProxyTarget_endpoint :: Lens.Lens' DBProxyTarget (Prelude.Maybe Prelude.Text)
dbProxyTarget_endpoint :: (Maybe Text -> f (Maybe Text)) -> DBProxyTarget -> f DBProxyTarget
dbProxyTarget_endpoint = (DBProxyTarget -> Maybe Text)
-> (DBProxyTarget -> Maybe Text -> DBProxyTarget)
-> Lens DBProxyTarget DBProxyTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyTarget' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:DBProxyTarget' :: DBProxyTarget -> Maybe Text
endpoint} -> Maybe Text
endpoint) (\s :: DBProxyTarget
s@DBProxyTarget' {} Maybe Text
a -> DBProxyTarget
s {$sel:endpoint:DBProxyTarget' :: Maybe Text
endpoint = Maybe Text
a} :: DBProxyTarget)
dbProxyTarget_port :: Lens.Lens' DBProxyTarget (Prelude.Maybe Prelude.Int)
dbProxyTarget_port :: (Maybe Int -> f (Maybe Int)) -> DBProxyTarget -> f DBProxyTarget
dbProxyTarget_port = (DBProxyTarget -> Maybe Int)
-> (DBProxyTarget -> Maybe Int -> DBProxyTarget)
-> Lens DBProxyTarget DBProxyTarget (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyTarget' {Maybe Int
port :: Maybe Int
$sel:port:DBProxyTarget' :: DBProxyTarget -> Maybe Int
port} -> Maybe Int
port) (\s :: DBProxyTarget
s@DBProxyTarget' {} Maybe Int
a -> DBProxyTarget
s {$sel:port:DBProxyTarget' :: Maybe Int
port = Maybe Int
a} :: DBProxyTarget)
instance Core.FromXML DBProxyTarget where
parseXML :: [Node] -> Either String DBProxyTarget
parseXML [Node]
x =
Maybe Text
-> Maybe TargetHealth
-> Maybe Text
-> Maybe TargetRole
-> Maybe Text
-> Maybe TargetType
-> Maybe Text
-> Maybe Int
-> DBProxyTarget
DBProxyTarget'
(Maybe Text
-> Maybe TargetHealth
-> Maybe Text
-> Maybe TargetRole
-> Maybe Text
-> Maybe TargetType
-> Maybe Text
-> Maybe Int
-> DBProxyTarget)
-> Either String (Maybe Text)
-> Either
String
(Maybe TargetHealth
-> Maybe Text
-> Maybe TargetRole
-> Maybe Text
-> Maybe TargetType
-> Maybe Text
-> Maybe Int
-> DBProxyTarget)
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
"TargetArn")
Either
String
(Maybe TargetHealth
-> Maybe Text
-> Maybe TargetRole
-> Maybe Text
-> Maybe TargetType
-> Maybe Text
-> Maybe Int
-> DBProxyTarget)
-> Either String (Maybe TargetHealth)
-> Either
String
(Maybe Text
-> Maybe TargetRole
-> Maybe Text
-> Maybe TargetType
-> Maybe Text
-> Maybe Int
-> DBProxyTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe TargetHealth)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TargetHealth")
Either
String
(Maybe Text
-> Maybe TargetRole
-> Maybe Text
-> Maybe TargetType
-> Maybe Text
-> Maybe Int
-> DBProxyTarget)
-> Either String (Maybe Text)
-> Either
String
(Maybe TargetRole
-> Maybe Text
-> Maybe TargetType
-> Maybe Text
-> Maybe Int
-> DBProxyTarget)
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
"TrackedClusterId")
Either
String
(Maybe TargetRole
-> Maybe Text
-> Maybe TargetType
-> Maybe Text
-> Maybe Int
-> DBProxyTarget)
-> Either String (Maybe TargetRole)
-> Either
String
(Maybe Text
-> Maybe TargetType -> Maybe Text -> Maybe Int -> DBProxyTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe TargetRole)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Role")
Either
String
(Maybe Text
-> Maybe TargetType -> Maybe Text -> Maybe Int -> DBProxyTarget)
-> Either String (Maybe Text)
-> Either
String
(Maybe TargetType -> Maybe Text -> Maybe Int -> DBProxyTarget)
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
"RdsResourceId")
Either
String
(Maybe TargetType -> Maybe Text -> Maybe Int -> DBProxyTarget)
-> Either String (Maybe TargetType)
-> Either String (Maybe Text -> Maybe Int -> DBProxyTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe TargetType)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Type")
Either String (Maybe Text -> Maybe Int -> DBProxyTarget)
-> Either String (Maybe Text)
-> Either String (Maybe Int -> DBProxyTarget)
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
"Endpoint")
Either String (Maybe Int -> DBProxyTarget)
-> Either String (Maybe Int) -> Either String DBProxyTarget
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Port")
instance Prelude.Hashable DBProxyTarget
instance Prelude.NFData DBProxyTarget