{-# 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.VpnDetails
-- 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.VpnDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the virtual private network (VPN) between the VMware
-- vSphere cluster and the Amazon Web Services website.
--
-- For more information about RDS on VMware, see the
-- <https://docs.aws.amazon.com/AmazonRDS/latest/RDSonVMwareUserGuide/rds-on-vmware.html RDS on VMware User Guide.>
--
-- /See:/ 'newVpnDetails' smart constructor.
data VpnDetails = VpnDetails'
  { -- | The name of the VPN.
    VpnDetails -> Maybe Text
vpnName :: Prelude.Maybe Prelude.Text,
    -- | The IP address of network traffic from your on-premises data center. A
    -- custom AZ receives the network traffic.
    VpnDetails -> Maybe Text
vpnTunnelOriginatorIP :: Prelude.Maybe Prelude.Text,
    -- | The ID of the VPN.
    VpnDetails -> Maybe Text
vpnId :: Prelude.Maybe Prelude.Text,
    -- | The state of the VPN.
    VpnDetails -> Maybe Text
vpnState :: Prelude.Maybe Prelude.Text,
    -- | The preshared key (PSK) for the VPN.
    VpnDetails -> Maybe (Sensitive Text)
vpnPSK :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The IP address of network traffic from Amazon Web Services to your
    -- on-premises data center.
    VpnDetails -> Maybe Text
vpnGatewayIp :: Prelude.Maybe Prelude.Text
  }
  deriving (VpnDetails -> VpnDetails -> Bool
(VpnDetails -> VpnDetails -> Bool)
-> (VpnDetails -> VpnDetails -> Bool) -> Eq VpnDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpnDetails -> VpnDetails -> Bool
$c/= :: VpnDetails -> VpnDetails -> Bool
== :: VpnDetails -> VpnDetails -> Bool
$c== :: VpnDetails -> VpnDetails -> Bool
Prelude.Eq, Int -> VpnDetails -> ShowS
[VpnDetails] -> ShowS
VpnDetails -> String
(Int -> VpnDetails -> ShowS)
-> (VpnDetails -> String)
-> ([VpnDetails] -> ShowS)
-> Show VpnDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpnDetails] -> ShowS
$cshowList :: [VpnDetails] -> ShowS
show :: VpnDetails -> String
$cshow :: VpnDetails -> String
showsPrec :: Int -> VpnDetails -> ShowS
$cshowsPrec :: Int -> VpnDetails -> ShowS
Prelude.Show, (forall x. VpnDetails -> Rep VpnDetails x)
-> (forall x. Rep VpnDetails x -> VpnDetails) -> Generic VpnDetails
forall x. Rep VpnDetails x -> VpnDetails
forall x. VpnDetails -> Rep VpnDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpnDetails x -> VpnDetails
$cfrom :: forall x. VpnDetails -> Rep VpnDetails x
Prelude.Generic)

-- |
-- Create a value of 'VpnDetails' 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:
--
-- 'vpnName', 'vpnDetails_vpnName' - The name of the VPN.
--
-- 'vpnTunnelOriginatorIP', 'vpnDetails_vpnTunnelOriginatorIP' - The IP address of network traffic from your on-premises data center. A
-- custom AZ receives the network traffic.
--
-- 'vpnId', 'vpnDetails_vpnId' - The ID of the VPN.
--
-- 'vpnState', 'vpnDetails_vpnState' - The state of the VPN.
--
-- 'vpnPSK', 'vpnDetails_vpnPSK' - The preshared key (PSK) for the VPN.
--
-- 'vpnGatewayIp', 'vpnDetails_vpnGatewayIp' - The IP address of network traffic from Amazon Web Services to your
-- on-premises data center.
newVpnDetails ::
  VpnDetails
newVpnDetails :: VpnDetails
newVpnDetails =
  VpnDetails' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> VpnDetails
VpnDetails'
    { $sel:vpnName:VpnDetails' :: Maybe Text
vpnName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpnTunnelOriginatorIP:VpnDetails' :: Maybe Text
vpnTunnelOriginatorIP = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpnId:VpnDetails' :: Maybe Text
vpnId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpnState:VpnDetails' :: Maybe Text
vpnState = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vpnPSK:VpnDetails' :: Maybe (Sensitive Text)
vpnPSK = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:vpnGatewayIp:VpnDetails' :: Maybe Text
vpnGatewayIp = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the VPN.
vpnDetails_vpnName :: Lens.Lens' VpnDetails (Prelude.Maybe Prelude.Text)
vpnDetails_vpnName :: (Maybe Text -> f (Maybe Text)) -> VpnDetails -> f VpnDetails
vpnDetails_vpnName = (VpnDetails -> Maybe Text)
-> (VpnDetails -> Maybe Text -> VpnDetails)
-> Lens VpnDetails VpnDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnDetails' {Maybe Text
vpnName :: Maybe Text
$sel:vpnName:VpnDetails' :: VpnDetails -> Maybe Text
vpnName} -> Maybe Text
vpnName) (\s :: VpnDetails
s@VpnDetails' {} Maybe Text
a -> VpnDetails
s {$sel:vpnName:VpnDetails' :: Maybe Text
vpnName = Maybe Text
a} :: VpnDetails)

-- | The IP address of network traffic from your on-premises data center. A
-- custom AZ receives the network traffic.
vpnDetails_vpnTunnelOriginatorIP :: Lens.Lens' VpnDetails (Prelude.Maybe Prelude.Text)
vpnDetails_vpnTunnelOriginatorIP :: (Maybe Text -> f (Maybe Text)) -> VpnDetails -> f VpnDetails
vpnDetails_vpnTunnelOriginatorIP = (VpnDetails -> Maybe Text)
-> (VpnDetails -> Maybe Text -> VpnDetails)
-> Lens VpnDetails VpnDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnDetails' {Maybe Text
vpnTunnelOriginatorIP :: Maybe Text
$sel:vpnTunnelOriginatorIP:VpnDetails' :: VpnDetails -> Maybe Text
vpnTunnelOriginatorIP} -> Maybe Text
vpnTunnelOriginatorIP) (\s :: VpnDetails
s@VpnDetails' {} Maybe Text
a -> VpnDetails
s {$sel:vpnTunnelOriginatorIP:VpnDetails' :: Maybe Text
vpnTunnelOriginatorIP = Maybe Text
a} :: VpnDetails)

-- | The ID of the VPN.
vpnDetails_vpnId :: Lens.Lens' VpnDetails (Prelude.Maybe Prelude.Text)
vpnDetails_vpnId :: (Maybe Text -> f (Maybe Text)) -> VpnDetails -> f VpnDetails
vpnDetails_vpnId = (VpnDetails -> Maybe Text)
-> (VpnDetails -> Maybe Text -> VpnDetails)
-> Lens VpnDetails VpnDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnDetails' {Maybe Text
vpnId :: Maybe Text
$sel:vpnId:VpnDetails' :: VpnDetails -> Maybe Text
vpnId} -> Maybe Text
vpnId) (\s :: VpnDetails
s@VpnDetails' {} Maybe Text
a -> VpnDetails
s {$sel:vpnId:VpnDetails' :: Maybe Text
vpnId = Maybe Text
a} :: VpnDetails)

-- | The state of the VPN.
vpnDetails_vpnState :: Lens.Lens' VpnDetails (Prelude.Maybe Prelude.Text)
vpnDetails_vpnState :: (Maybe Text -> f (Maybe Text)) -> VpnDetails -> f VpnDetails
vpnDetails_vpnState = (VpnDetails -> Maybe Text)
-> (VpnDetails -> Maybe Text -> VpnDetails)
-> Lens VpnDetails VpnDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnDetails' {Maybe Text
vpnState :: Maybe Text
$sel:vpnState:VpnDetails' :: VpnDetails -> Maybe Text
vpnState} -> Maybe Text
vpnState) (\s :: VpnDetails
s@VpnDetails' {} Maybe Text
a -> VpnDetails
s {$sel:vpnState:VpnDetails' :: Maybe Text
vpnState = Maybe Text
a} :: VpnDetails)

-- | The preshared key (PSK) for the VPN.
vpnDetails_vpnPSK :: Lens.Lens' VpnDetails (Prelude.Maybe Prelude.Text)
vpnDetails_vpnPSK :: (Maybe Text -> f (Maybe Text)) -> VpnDetails -> f VpnDetails
vpnDetails_vpnPSK = (VpnDetails -> Maybe (Sensitive Text))
-> (VpnDetails -> Maybe (Sensitive Text) -> VpnDetails)
-> Lens
     VpnDetails
     VpnDetails
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnDetails' {Maybe (Sensitive Text)
vpnPSK :: Maybe (Sensitive Text)
$sel:vpnPSK:VpnDetails' :: VpnDetails -> Maybe (Sensitive Text)
vpnPSK} -> Maybe (Sensitive Text)
vpnPSK) (\s :: VpnDetails
s@VpnDetails' {} Maybe (Sensitive Text)
a -> VpnDetails
s {$sel:vpnPSK:VpnDetails' :: Maybe (Sensitive Text)
vpnPSK = Maybe (Sensitive Text)
a} :: VpnDetails) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> VpnDetails -> f VpnDetails)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> VpnDetails
-> f VpnDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The IP address of network traffic from Amazon Web Services to your
-- on-premises data center.
vpnDetails_vpnGatewayIp :: Lens.Lens' VpnDetails (Prelude.Maybe Prelude.Text)
vpnDetails_vpnGatewayIp :: (Maybe Text -> f (Maybe Text)) -> VpnDetails -> f VpnDetails
vpnDetails_vpnGatewayIp = (VpnDetails -> Maybe Text)
-> (VpnDetails -> Maybe Text -> VpnDetails)
-> Lens VpnDetails VpnDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnDetails' {Maybe Text
vpnGatewayIp :: Maybe Text
$sel:vpnGatewayIp:VpnDetails' :: VpnDetails -> Maybe Text
vpnGatewayIp} -> Maybe Text
vpnGatewayIp) (\s :: VpnDetails
s@VpnDetails' {} Maybe Text
a -> VpnDetails
s {$sel:vpnGatewayIp:VpnDetails' :: Maybe Text
vpnGatewayIp = Maybe Text
a} :: VpnDetails)

instance Core.FromXML VpnDetails where
  parseXML :: [Node] -> Either String VpnDetails
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> VpnDetails
VpnDetails'
      (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe Text
 -> VpnDetails)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> VpnDetails)
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
"VpnName")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> VpnDetails)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> VpnDetails)
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
"VpnTunnelOriginatorIP")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> VpnDetails)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text -> Maybe (Sensitive Text) -> Maybe Text -> VpnDetails)
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
"VpnId")
      Either
  String
  (Maybe Text -> Maybe (Sensitive Text) -> Maybe Text -> VpnDetails)
-> Either String (Maybe Text)
-> Either
     String (Maybe (Sensitive Text) -> Maybe Text -> VpnDetails)
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
"VpnState")
      Either String (Maybe (Sensitive Text) -> Maybe Text -> VpnDetails)
-> Either String (Maybe (Sensitive Text))
-> Either String (Maybe Text -> VpnDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"VpnPSK")
      Either String (Maybe Text -> VpnDetails)
-> Either String (Maybe Text) -> Either String VpnDetails
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
"VpnGatewayIp")

instance Prelude.Hashable VpnDetails

instance Prelude.NFData VpnDetails