{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.RDS.Types.DBProxyEndpoint
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.RDS.Types.DBProxyEndpoint where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types.DBProxyEndpointStatus
import Amazonka.RDS.Types.DBProxyEndpointTargetRole

-- | The data structure representing an endpoint associated with a DB proxy.
-- RDS automatically creates one endpoint for each DB proxy. For Aurora DB
-- clusters, you can associate additional endpoints with the same DB proxy.
-- These endpoints can be read\/write or read-only. They can also reside in
-- different VPCs than the associated DB proxy.
--
-- This data type is used as a response element in the
-- @DescribeDBProxyEndpoints@ operation.
--
-- /See:/ 'newDBProxyEndpoint' smart constructor.
data DBProxyEndpoint = DBProxyEndpoint'
  { -- | The current status of this DB proxy endpoint. A status of @available@
    -- means the endpoint is ready to handle requests. Other values indicate
    -- that you must wait for the endpoint to be ready, or take some action to
    -- resolve an issue.
    DBProxyEndpoint -> Maybe DBProxyEndpointStatus
status :: Prelude.Maybe DBProxyEndpointStatus,
    -- | The Amazon Resource Name (ARN) for the DB proxy endpoint.
    DBProxyEndpoint -> Maybe Text
dbProxyEndpointArn :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether the DB proxy endpoint can be used for
    -- read\/write or read-only operations.
    DBProxyEndpoint -> Maybe DBProxyEndpointTargetRole
targetRole :: Prelude.Maybe DBProxyEndpointTargetRole,
    -- | The EC2 subnet IDs for the DB proxy endpoint.
    DBProxyEndpoint -> Maybe [Text]
vpcSubnetIds :: Prelude.Maybe [Prelude.Text],
    -- | Provides the VPC ID of the DB proxy endpoint.
    DBProxyEndpoint -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the DB proxy endpoint was first created.
    DBProxyEndpoint -> Maybe ISO8601
createdDate :: Prelude.Maybe Core.ISO8601,
    -- | Provides a list of VPC security groups that the DB proxy endpoint
    -- belongs to.
    DBProxyEndpoint -> Maybe [Text]
vpcSecurityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | The identifier for the DB proxy that is associated with this DB proxy
    -- endpoint.
    DBProxyEndpoint -> Maybe Text
dbProxyName :: Prelude.Maybe Prelude.Text,
    -- | The endpoint that you can use to connect to the DB proxy. You include
    -- the endpoint value in the connection string for a database client
    -- application.
    DBProxyEndpoint -> Maybe Text
endpoint :: Prelude.Maybe Prelude.Text,
    -- | The name for the DB proxy endpoint. An identifier must begin with a
    -- letter and must contain only ASCII letters, digits, and hyphens; it
    -- can\'t end with a hyphen or contain two consecutive hyphens.
    DBProxyEndpoint -> Maybe Text
dbProxyEndpointName :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether this endpoint is the default endpoint for
    -- the associated DB proxy. Default DB proxy endpoints always have
    -- read\/write capability. Other endpoints that you associate with the DB
    -- proxy can be either read\/write or read-only.
    DBProxyEndpoint -> Maybe Bool
isDefault :: Prelude.Maybe Prelude.Bool
  }
  deriving (DBProxyEndpoint -> DBProxyEndpoint -> Bool
(DBProxyEndpoint -> DBProxyEndpoint -> Bool)
-> (DBProxyEndpoint -> DBProxyEndpoint -> Bool)
-> Eq DBProxyEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBProxyEndpoint -> DBProxyEndpoint -> Bool
$c/= :: DBProxyEndpoint -> DBProxyEndpoint -> Bool
== :: DBProxyEndpoint -> DBProxyEndpoint -> Bool
$c== :: DBProxyEndpoint -> DBProxyEndpoint -> Bool
Prelude.Eq, ReadPrec [DBProxyEndpoint]
ReadPrec DBProxyEndpoint
Int -> ReadS DBProxyEndpoint
ReadS [DBProxyEndpoint]
(Int -> ReadS DBProxyEndpoint)
-> ReadS [DBProxyEndpoint]
-> ReadPrec DBProxyEndpoint
-> ReadPrec [DBProxyEndpoint]
-> Read DBProxyEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DBProxyEndpoint]
$creadListPrec :: ReadPrec [DBProxyEndpoint]
readPrec :: ReadPrec DBProxyEndpoint
$creadPrec :: ReadPrec DBProxyEndpoint
readList :: ReadS [DBProxyEndpoint]
$creadList :: ReadS [DBProxyEndpoint]
readsPrec :: Int -> ReadS DBProxyEndpoint
$creadsPrec :: Int -> ReadS DBProxyEndpoint
Prelude.Read, Int -> DBProxyEndpoint -> ShowS
[DBProxyEndpoint] -> ShowS
DBProxyEndpoint -> String
(Int -> DBProxyEndpoint -> ShowS)
-> (DBProxyEndpoint -> String)
-> ([DBProxyEndpoint] -> ShowS)
-> Show DBProxyEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DBProxyEndpoint] -> ShowS
$cshowList :: [DBProxyEndpoint] -> ShowS
show :: DBProxyEndpoint -> String
$cshow :: DBProxyEndpoint -> String
showsPrec :: Int -> DBProxyEndpoint -> ShowS
$cshowsPrec :: Int -> DBProxyEndpoint -> ShowS
Prelude.Show, (forall x. DBProxyEndpoint -> Rep DBProxyEndpoint x)
-> (forall x. Rep DBProxyEndpoint x -> DBProxyEndpoint)
-> Generic DBProxyEndpoint
forall x. Rep DBProxyEndpoint x -> DBProxyEndpoint
forall x. DBProxyEndpoint -> Rep DBProxyEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DBProxyEndpoint x -> DBProxyEndpoint
$cfrom :: forall x. DBProxyEndpoint -> Rep DBProxyEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'DBProxyEndpoint' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'dbProxyEndpoint_status' - The current status of this DB proxy endpoint. A status of @available@
-- means the endpoint is ready to handle requests. Other values indicate
-- that you must wait for the endpoint to be ready, or take some action to
-- resolve an issue.
--
-- 'dbProxyEndpointArn', 'dbProxyEndpoint_dbProxyEndpointArn' - The Amazon Resource Name (ARN) for the DB proxy endpoint.
--
-- 'targetRole', 'dbProxyEndpoint_targetRole' - A value that indicates whether the DB proxy endpoint can be used for
-- read\/write or read-only operations.
--
-- 'vpcSubnetIds', 'dbProxyEndpoint_vpcSubnetIds' - The EC2 subnet IDs for the DB proxy endpoint.
--
-- 'vpcId', 'dbProxyEndpoint_vpcId' - Provides the VPC ID of the DB proxy endpoint.
--
-- 'createdDate', 'dbProxyEndpoint_createdDate' - The date and time when the DB proxy endpoint was first created.
--
-- 'vpcSecurityGroupIds', 'dbProxyEndpoint_vpcSecurityGroupIds' - Provides a list of VPC security groups that the DB proxy endpoint
-- belongs to.
--
-- 'dbProxyName', 'dbProxyEndpoint_dbProxyName' - The identifier for the DB proxy that is associated with this DB proxy
-- endpoint.
--
-- 'endpoint', 'dbProxyEndpoint_endpoint' - The endpoint that you can use to connect to the DB proxy. You include
-- the endpoint value in the connection string for a database client
-- application.
--
-- 'dbProxyEndpointName', 'dbProxyEndpoint_dbProxyEndpointName' - The name for the DB proxy endpoint. An identifier must begin with a
-- letter and must contain only ASCII letters, digits, and hyphens; it
-- can\'t end with a hyphen or contain two consecutive hyphens.
--
-- 'isDefault', 'dbProxyEndpoint_isDefault' - A value that indicates whether this endpoint is the default endpoint for
-- the associated DB proxy. Default DB proxy endpoints always have
-- read\/write capability. Other endpoints that you associate with the DB
-- proxy can be either read\/write or read-only.
newDBProxyEndpoint ::
  DBProxyEndpoint
newDBProxyEndpoint :: DBProxyEndpoint
newDBProxyEndpoint =
  DBProxyEndpoint' :: Maybe DBProxyEndpointStatus
-> Maybe Text
-> Maybe DBProxyEndpointTargetRole
-> Maybe [Text]
-> Maybe Text
-> Maybe ISO8601
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> DBProxyEndpoint
DBProxyEndpoint'
    { $sel:status:DBProxyEndpoint' :: Maybe DBProxyEndpointStatus
status = Maybe DBProxyEndpointStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:dbProxyEndpointArn:DBProxyEndpoint' :: Maybe Text
dbProxyEndpointArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetRole:DBProxyEndpoint' :: Maybe DBProxyEndpointTargetRole
targetRole = Maybe DBProxyEndpointTargetRole
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcSubnetIds:DBProxyEndpoint' :: Maybe [Text]
vpcSubnetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:DBProxyEndpoint' :: Maybe Text
vpcId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdDate:DBProxyEndpoint' :: Maybe ISO8601
createdDate = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
      $sel:vpcSecurityGroupIds:DBProxyEndpoint' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:dbProxyName:DBProxyEndpoint' :: Maybe Text
dbProxyName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpoint:DBProxyEndpoint' :: Maybe Text
endpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dbProxyEndpointName:DBProxyEndpoint' :: Maybe Text
dbProxyEndpointName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isDefault:DBProxyEndpoint' :: Maybe Bool
isDefault = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | The current status of this DB proxy endpoint. A status of @available@
-- means the endpoint is ready to handle requests. Other values indicate
-- that you must wait for the endpoint to be ready, or take some action to
-- resolve an issue.
dbProxyEndpoint_status :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe DBProxyEndpointStatus)
dbProxyEndpoint_status :: (Maybe DBProxyEndpointStatus -> f (Maybe DBProxyEndpointStatus))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_status = (DBProxyEndpoint -> Maybe DBProxyEndpointStatus)
-> (DBProxyEndpoint
    -> Maybe DBProxyEndpointStatus -> DBProxyEndpoint)
-> Lens
     DBProxyEndpoint
     DBProxyEndpoint
     (Maybe DBProxyEndpointStatus)
     (Maybe DBProxyEndpointStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe DBProxyEndpointStatus
status :: Maybe DBProxyEndpointStatus
$sel:status:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe DBProxyEndpointStatus
status} -> Maybe DBProxyEndpointStatus
status) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe DBProxyEndpointStatus
a -> DBProxyEndpoint
s {$sel:status:DBProxyEndpoint' :: Maybe DBProxyEndpointStatus
status = Maybe DBProxyEndpointStatus
a} :: DBProxyEndpoint)

-- | The Amazon Resource Name (ARN) for the DB proxy endpoint.
dbProxyEndpoint_dbProxyEndpointArn :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe Prelude.Text)
dbProxyEndpoint_dbProxyEndpointArn :: (Maybe Text -> f (Maybe Text))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_dbProxyEndpointArn = (DBProxyEndpoint -> Maybe Text)
-> (DBProxyEndpoint -> Maybe Text -> DBProxyEndpoint)
-> Lens DBProxyEndpoint DBProxyEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe Text
dbProxyEndpointArn :: Maybe Text
$sel:dbProxyEndpointArn:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe Text
dbProxyEndpointArn} -> Maybe Text
dbProxyEndpointArn) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe Text
a -> DBProxyEndpoint
s {$sel:dbProxyEndpointArn:DBProxyEndpoint' :: Maybe Text
dbProxyEndpointArn = Maybe Text
a} :: DBProxyEndpoint)

-- | A value that indicates whether the DB proxy endpoint can be used for
-- read\/write or read-only operations.
dbProxyEndpoint_targetRole :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe DBProxyEndpointTargetRole)
dbProxyEndpoint_targetRole :: (Maybe DBProxyEndpointTargetRole
 -> f (Maybe DBProxyEndpointTargetRole))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_targetRole = (DBProxyEndpoint -> Maybe DBProxyEndpointTargetRole)
-> (DBProxyEndpoint
    -> Maybe DBProxyEndpointTargetRole -> DBProxyEndpoint)
-> Lens
     DBProxyEndpoint
     DBProxyEndpoint
     (Maybe DBProxyEndpointTargetRole)
     (Maybe DBProxyEndpointTargetRole)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe DBProxyEndpointTargetRole
targetRole :: Maybe DBProxyEndpointTargetRole
$sel:targetRole:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe DBProxyEndpointTargetRole
targetRole} -> Maybe DBProxyEndpointTargetRole
targetRole) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe DBProxyEndpointTargetRole
a -> DBProxyEndpoint
s {$sel:targetRole:DBProxyEndpoint' :: Maybe DBProxyEndpointTargetRole
targetRole = Maybe DBProxyEndpointTargetRole
a} :: DBProxyEndpoint)

-- | The EC2 subnet IDs for the DB proxy endpoint.
dbProxyEndpoint_vpcSubnetIds :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe [Prelude.Text])
dbProxyEndpoint_vpcSubnetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_vpcSubnetIds = (DBProxyEndpoint -> Maybe [Text])
-> (DBProxyEndpoint -> Maybe [Text] -> DBProxyEndpoint)
-> Lens
     DBProxyEndpoint DBProxyEndpoint (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe [Text]
vpcSubnetIds :: Maybe [Text]
$sel:vpcSubnetIds:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe [Text]
vpcSubnetIds} -> Maybe [Text]
vpcSubnetIds) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe [Text]
a -> DBProxyEndpoint
s {$sel:vpcSubnetIds:DBProxyEndpoint' :: Maybe [Text]
vpcSubnetIds = Maybe [Text]
a} :: DBProxyEndpoint) ((Maybe [Text] -> f (Maybe [Text]))
 -> DBProxyEndpoint -> f DBProxyEndpoint)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DBProxyEndpoint
-> f DBProxyEndpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Provides the VPC ID of the DB proxy endpoint.
dbProxyEndpoint_vpcId :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe Prelude.Text)
dbProxyEndpoint_vpcId :: (Maybe Text -> f (Maybe Text))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_vpcId = (DBProxyEndpoint -> Maybe Text)
-> (DBProxyEndpoint -> Maybe Text -> DBProxyEndpoint)
-> Lens DBProxyEndpoint DBProxyEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe Text
a -> DBProxyEndpoint
s {$sel:vpcId:DBProxyEndpoint' :: Maybe Text
vpcId = Maybe Text
a} :: DBProxyEndpoint)

-- | The date and time when the DB proxy endpoint was first created.
dbProxyEndpoint_createdDate :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe Prelude.UTCTime)
dbProxyEndpoint_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_createdDate = (DBProxyEndpoint -> Maybe ISO8601)
-> (DBProxyEndpoint -> Maybe ISO8601 -> DBProxyEndpoint)
-> Lens
     DBProxyEndpoint DBProxyEndpoint (Maybe ISO8601) (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe ISO8601
createdDate :: Maybe ISO8601
$sel:createdDate:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe ISO8601
createdDate} -> Maybe ISO8601
createdDate) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe ISO8601
a -> DBProxyEndpoint
s {$sel:createdDate:DBProxyEndpoint' :: Maybe ISO8601
createdDate = Maybe ISO8601
a} :: DBProxyEndpoint) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> DBProxyEndpoint -> f DBProxyEndpoint)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DBProxyEndpoint
-> f DBProxyEndpoint
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

-- | Provides a list of VPC security groups that the DB proxy endpoint
-- belongs to.
dbProxyEndpoint_vpcSecurityGroupIds :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe [Prelude.Text])
dbProxyEndpoint_vpcSecurityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_vpcSecurityGroupIds = (DBProxyEndpoint -> Maybe [Text])
-> (DBProxyEndpoint -> Maybe [Text] -> DBProxyEndpoint)
-> Lens
     DBProxyEndpoint DBProxyEndpoint (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe [Text]
vpcSecurityGroupIds :: Maybe [Text]
$sel:vpcSecurityGroupIds:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe [Text]
vpcSecurityGroupIds} -> Maybe [Text]
vpcSecurityGroupIds) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe [Text]
a -> DBProxyEndpoint
s {$sel:vpcSecurityGroupIds:DBProxyEndpoint' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
a} :: DBProxyEndpoint) ((Maybe [Text] -> f (Maybe [Text]))
 -> DBProxyEndpoint -> f DBProxyEndpoint)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DBProxyEndpoint
-> f DBProxyEndpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The identifier for the DB proxy that is associated with this DB proxy
-- endpoint.
dbProxyEndpoint_dbProxyName :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe Prelude.Text)
dbProxyEndpoint_dbProxyName :: (Maybe Text -> f (Maybe Text))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_dbProxyName = (DBProxyEndpoint -> Maybe Text)
-> (DBProxyEndpoint -> Maybe Text -> DBProxyEndpoint)
-> Lens DBProxyEndpoint DBProxyEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe Text
dbProxyName :: Maybe Text
$sel:dbProxyName:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe Text
dbProxyName} -> Maybe Text
dbProxyName) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe Text
a -> DBProxyEndpoint
s {$sel:dbProxyName:DBProxyEndpoint' :: Maybe Text
dbProxyName = Maybe Text
a} :: DBProxyEndpoint)

-- | The endpoint that you can use to connect to the DB proxy. You include
-- the endpoint value in the connection string for a database client
-- application.
dbProxyEndpoint_endpoint :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe Prelude.Text)
dbProxyEndpoint_endpoint :: (Maybe Text -> f (Maybe Text))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_endpoint = (DBProxyEndpoint -> Maybe Text)
-> (DBProxyEndpoint -> Maybe Text -> DBProxyEndpoint)
-> Lens DBProxyEndpoint DBProxyEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe Text
endpoint :: Maybe Text
$sel:endpoint:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe Text
endpoint} -> Maybe Text
endpoint) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe Text
a -> DBProxyEndpoint
s {$sel:endpoint:DBProxyEndpoint' :: Maybe Text
endpoint = Maybe Text
a} :: DBProxyEndpoint)

-- | The name for the DB proxy endpoint. An identifier must begin with a
-- letter and must contain only ASCII letters, digits, and hyphens; it
-- can\'t end with a hyphen or contain two consecutive hyphens.
dbProxyEndpoint_dbProxyEndpointName :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe Prelude.Text)
dbProxyEndpoint_dbProxyEndpointName :: (Maybe Text -> f (Maybe Text))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_dbProxyEndpointName = (DBProxyEndpoint -> Maybe Text)
-> (DBProxyEndpoint -> Maybe Text -> DBProxyEndpoint)
-> Lens DBProxyEndpoint DBProxyEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe Text
dbProxyEndpointName :: Maybe Text
$sel:dbProxyEndpointName:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe Text
dbProxyEndpointName} -> Maybe Text
dbProxyEndpointName) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe Text
a -> DBProxyEndpoint
s {$sel:dbProxyEndpointName:DBProxyEndpoint' :: Maybe Text
dbProxyEndpointName = Maybe Text
a} :: DBProxyEndpoint)

-- | A value that indicates whether this endpoint is the default endpoint for
-- the associated DB proxy. Default DB proxy endpoints always have
-- read\/write capability. Other endpoints that you associate with the DB
-- proxy can be either read\/write or read-only.
dbProxyEndpoint_isDefault :: Lens.Lens' DBProxyEndpoint (Prelude.Maybe Prelude.Bool)
dbProxyEndpoint_isDefault :: (Maybe Bool -> f (Maybe Bool))
-> DBProxyEndpoint -> f DBProxyEndpoint
dbProxyEndpoint_isDefault = (DBProxyEndpoint -> Maybe Bool)
-> (DBProxyEndpoint -> Maybe Bool -> DBProxyEndpoint)
-> Lens DBProxyEndpoint DBProxyEndpoint (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DBProxyEndpoint' {Maybe Bool
isDefault :: Maybe Bool
$sel:isDefault:DBProxyEndpoint' :: DBProxyEndpoint -> Maybe Bool
isDefault} -> Maybe Bool
isDefault) (\s :: DBProxyEndpoint
s@DBProxyEndpoint' {} Maybe Bool
a -> DBProxyEndpoint
s {$sel:isDefault:DBProxyEndpoint' :: Maybe Bool
isDefault = Maybe Bool
a} :: DBProxyEndpoint)

instance Core.FromXML DBProxyEndpoint where
  parseXML :: [Node] -> Either String DBProxyEndpoint
parseXML [Node]
x =
    Maybe DBProxyEndpointStatus
-> Maybe Text
-> Maybe DBProxyEndpointTargetRole
-> Maybe [Text]
-> Maybe Text
-> Maybe ISO8601
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> DBProxyEndpoint
DBProxyEndpoint'
      (Maybe DBProxyEndpointStatus
 -> Maybe Text
 -> Maybe DBProxyEndpointTargetRole
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe ISO8601
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> DBProxyEndpoint)
-> Either String (Maybe DBProxyEndpointStatus)
-> Either
     String
     (Maybe Text
      -> Maybe DBProxyEndpointTargetRole
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> DBProxyEndpoint)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe DBProxyEndpointStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
      Either
  String
  (Maybe Text
   -> Maybe DBProxyEndpointTargetRole
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> DBProxyEndpoint)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe DBProxyEndpointTargetRole
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> DBProxyEndpoint)
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
"DBProxyEndpointArn")
      Either
  String
  (Maybe DBProxyEndpointTargetRole
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> DBProxyEndpoint)
-> Either String (Maybe DBProxyEndpointTargetRole)
-> Either
     String
     (Maybe [Text]
      -> Maybe Text
      -> Maybe ISO8601
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> DBProxyEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe DBProxyEndpointTargetRole)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"TargetRole")
      Either
  String
  (Maybe [Text]
   -> Maybe Text
   -> Maybe ISO8601
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> DBProxyEndpoint)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe ISO8601
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> DBProxyEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VpcSubnetIds" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe Text
   -> Maybe ISO8601
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> DBProxyEndpoint)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe ISO8601
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> DBProxyEndpoint)
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
"VpcId")
      Either
  String
  (Maybe ISO8601
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> DBProxyEndpoint)
-> Either String (Maybe ISO8601)
-> Either
     String
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> DBProxyEndpoint)
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
"CreatedDate")
      Either
  String
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> DBProxyEndpoint)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Bool -> DBProxyEndpoint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VpcSecurityGroupIds"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                  )
      Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Bool -> DBProxyEndpoint)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Text -> Maybe Bool -> DBProxyEndpoint)
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
"DBProxyName")
      Either
  String (Maybe Text -> Maybe Text -> Maybe Bool -> DBProxyEndpoint)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Bool -> DBProxyEndpoint)
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 Text -> Maybe Bool -> DBProxyEndpoint)
-> Either String (Maybe Text)
-> Either String (Maybe Bool -> DBProxyEndpoint)
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
"DBProxyEndpointName")
      Either String (Maybe Bool -> DBProxyEndpoint)
-> Either String (Maybe Bool) -> Either String DBProxyEndpoint
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IsDefault")

instance Prelude.Hashable DBProxyEndpoint

instance Prelude.NFData DBProxyEndpoint