{-# 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.EC2.Types.VpnConnection
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.VpnConnection where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.GatewayAssociationState
import Amazonka.EC2.Types.GatewayType
import Amazonka.EC2.Types.Tag
import Amazonka.EC2.Types.VgwTelemetry
import Amazonka.EC2.Types.VpnConnectionOptions
import Amazonka.EC2.Types.VpnState
import Amazonka.EC2.Types.VpnStaticRoute
import qualified Amazonka.Prelude as Prelude

-- | Describes a VPN connection.
--
-- /See:/ 'newVpnConnection' smart constructor.
data VpnConnection = VpnConnection'
  { -- | The category of the VPN connection. A value of @VPN@ indicates an Amazon
    -- Web Services VPN connection. A value of @VPN-Classic@ indicates an
    -- Amazon Web Services Classic VPN connection.
    VpnConnection -> Maybe Text
category :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the core network.
    VpnConnection -> Maybe Text
coreNetworkArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the core network attachment.
    VpnConnection -> Maybe Text
coreNetworkAttachmentArn :: Prelude.Maybe Prelude.Text,
    -- | The configuration information for the VPN connection\'s customer gateway
    -- (in the native XML format). This element is always present in the
    -- CreateVpnConnection response; however, it\'s present in the
    -- DescribeVpnConnections response only if the VPN connection is in the
    -- @pending@ or @available@ state.
    VpnConnection -> Maybe Text
customerGatewayConfiguration :: Prelude.Maybe Prelude.Text,
    -- | The current state of the gateway association.
    VpnConnection -> Maybe GatewayAssociationState
gatewayAssociationState :: Prelude.Maybe GatewayAssociationState,
    -- | The VPN connection options.
    VpnConnection -> Maybe VpnConnectionOptions
options :: Prelude.Maybe VpnConnectionOptions,
    -- | The static routes associated with the VPN connection.
    VpnConnection -> Maybe [VpnStaticRoute]
routes :: Prelude.Maybe [VpnStaticRoute],
    -- | Any tags assigned to the VPN connection.
    VpnConnection -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The ID of the transit gateway associated with the VPN connection.
    VpnConnection -> Maybe Text
transitGatewayId :: Prelude.Maybe Prelude.Text,
    -- | Information about the VPN tunnel.
    VpnConnection -> Maybe [VgwTelemetry]
vgwTelemetry :: Prelude.Maybe [VgwTelemetry],
    -- | The ID of the virtual private gateway at the Amazon Web Services side of
    -- the VPN connection.
    VpnConnection -> Maybe Text
vpnGatewayId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the VPN connection.
    VpnConnection -> Text
vpnConnectionId :: Prelude.Text,
    -- | The ID of the customer gateway at your end of the VPN connection.
    VpnConnection -> Text
customerGatewayId :: Prelude.Text,
    -- | The current state of the VPN connection.
    VpnConnection -> VpnState
state :: VpnState,
    -- | The type of VPN connection.
    VpnConnection -> GatewayType
type' :: GatewayType
  }
  deriving (VpnConnection -> VpnConnection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VpnConnection -> VpnConnection -> Bool
$c/= :: VpnConnection -> VpnConnection -> Bool
== :: VpnConnection -> VpnConnection -> Bool
$c== :: VpnConnection -> VpnConnection -> Bool
Prelude.Eq, ReadPrec [VpnConnection]
ReadPrec VpnConnection
Int -> ReadS VpnConnection
ReadS [VpnConnection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VpnConnection]
$creadListPrec :: ReadPrec [VpnConnection]
readPrec :: ReadPrec VpnConnection
$creadPrec :: ReadPrec VpnConnection
readList :: ReadS [VpnConnection]
$creadList :: ReadS [VpnConnection]
readsPrec :: Int -> ReadS VpnConnection
$creadsPrec :: Int -> ReadS VpnConnection
Prelude.Read, Int -> VpnConnection -> ShowS
[VpnConnection] -> ShowS
VpnConnection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VpnConnection] -> ShowS
$cshowList :: [VpnConnection] -> ShowS
show :: VpnConnection -> String
$cshow :: VpnConnection -> String
showsPrec :: Int -> VpnConnection -> ShowS
$cshowsPrec :: Int -> VpnConnection -> ShowS
Prelude.Show, forall x. Rep VpnConnection x -> VpnConnection
forall x. VpnConnection -> Rep VpnConnection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VpnConnection x -> VpnConnection
$cfrom :: forall x. VpnConnection -> Rep VpnConnection x
Prelude.Generic)

-- |
-- Create a value of 'VpnConnection' 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:
--
-- 'category', 'vpnConnection_category' - The category of the VPN connection. A value of @VPN@ indicates an Amazon
-- Web Services VPN connection. A value of @VPN-Classic@ indicates an
-- Amazon Web Services Classic VPN connection.
--
-- 'coreNetworkArn', 'vpnConnection_coreNetworkArn' - The ARN of the core network.
--
-- 'coreNetworkAttachmentArn', 'vpnConnection_coreNetworkAttachmentArn' - The ARN of the core network attachment.
--
-- 'customerGatewayConfiguration', 'vpnConnection_customerGatewayConfiguration' - The configuration information for the VPN connection\'s customer gateway
-- (in the native XML format). This element is always present in the
-- CreateVpnConnection response; however, it\'s present in the
-- DescribeVpnConnections response only if the VPN connection is in the
-- @pending@ or @available@ state.
--
-- 'gatewayAssociationState', 'vpnConnection_gatewayAssociationState' - The current state of the gateway association.
--
-- 'options', 'vpnConnection_options' - The VPN connection options.
--
-- 'routes', 'vpnConnection_routes' - The static routes associated with the VPN connection.
--
-- 'tags', 'vpnConnection_tags' - Any tags assigned to the VPN connection.
--
-- 'transitGatewayId', 'vpnConnection_transitGatewayId' - The ID of the transit gateway associated with the VPN connection.
--
-- 'vgwTelemetry', 'vpnConnection_vgwTelemetry' - Information about the VPN tunnel.
--
-- 'vpnGatewayId', 'vpnConnection_vpnGatewayId' - The ID of the virtual private gateway at the Amazon Web Services side of
-- the VPN connection.
--
-- 'vpnConnectionId', 'vpnConnection_vpnConnectionId' - The ID of the VPN connection.
--
-- 'customerGatewayId', 'vpnConnection_customerGatewayId' - The ID of the customer gateway at your end of the VPN connection.
--
-- 'state', 'vpnConnection_state' - The current state of the VPN connection.
--
-- 'type'', 'vpnConnection_type' - The type of VPN connection.
newVpnConnection ::
  -- | 'vpnConnectionId'
  Prelude.Text ->
  -- | 'customerGatewayId'
  Prelude.Text ->
  -- | 'state'
  VpnState ->
  -- | 'type''
  GatewayType ->
  VpnConnection
newVpnConnection :: Text -> Text -> VpnState -> GatewayType -> VpnConnection
newVpnConnection
  Text
pVpnConnectionId_
  Text
pCustomerGatewayId_
  VpnState
pState_
  GatewayType
pType_ =
    VpnConnection'
      { $sel:category:VpnConnection' :: Maybe Text
category = forall a. Maybe a
Prelude.Nothing,
        $sel:coreNetworkArn:VpnConnection' :: Maybe Text
coreNetworkArn = forall a. Maybe a
Prelude.Nothing,
        $sel:coreNetworkAttachmentArn:VpnConnection' :: Maybe Text
coreNetworkAttachmentArn = forall a. Maybe a
Prelude.Nothing,
        $sel:customerGatewayConfiguration:VpnConnection' :: Maybe Text
customerGatewayConfiguration = forall a. Maybe a
Prelude.Nothing,
        $sel:gatewayAssociationState:VpnConnection' :: Maybe GatewayAssociationState
gatewayAssociationState = forall a. Maybe a
Prelude.Nothing,
        $sel:options:VpnConnection' :: Maybe VpnConnectionOptions
options = forall a. Maybe a
Prelude.Nothing,
        $sel:routes:VpnConnection' :: Maybe [VpnStaticRoute]
routes = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:VpnConnection' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:transitGatewayId:VpnConnection' :: Maybe Text
transitGatewayId = forall a. Maybe a
Prelude.Nothing,
        $sel:vgwTelemetry:VpnConnection' :: Maybe [VgwTelemetry]
vgwTelemetry = forall a. Maybe a
Prelude.Nothing,
        $sel:vpnGatewayId:VpnConnection' :: Maybe Text
vpnGatewayId = forall a. Maybe a
Prelude.Nothing,
        $sel:vpnConnectionId:VpnConnection' :: Text
vpnConnectionId = Text
pVpnConnectionId_,
        $sel:customerGatewayId:VpnConnection' :: Text
customerGatewayId = Text
pCustomerGatewayId_,
        $sel:state:VpnConnection' :: VpnState
state = VpnState
pState_,
        $sel:type':VpnConnection' :: GatewayType
type' = GatewayType
pType_
      }

-- | The category of the VPN connection. A value of @VPN@ indicates an Amazon
-- Web Services VPN connection. A value of @VPN-Classic@ indicates an
-- Amazon Web Services Classic VPN connection.
vpnConnection_category :: Lens.Lens' VpnConnection (Prelude.Maybe Prelude.Text)
vpnConnection_category :: Lens' VpnConnection (Maybe Text)
vpnConnection_category = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe Text
category :: Maybe Text
$sel:category:VpnConnection' :: VpnConnection -> Maybe Text
category} -> Maybe Text
category) (\s :: VpnConnection
s@VpnConnection' {} Maybe Text
a -> VpnConnection
s {$sel:category:VpnConnection' :: Maybe Text
category = Maybe Text
a} :: VpnConnection)

-- | The ARN of the core network.
vpnConnection_coreNetworkArn :: Lens.Lens' VpnConnection (Prelude.Maybe Prelude.Text)
vpnConnection_coreNetworkArn :: Lens' VpnConnection (Maybe Text)
vpnConnection_coreNetworkArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe Text
coreNetworkArn :: Maybe Text
$sel:coreNetworkArn:VpnConnection' :: VpnConnection -> Maybe Text
coreNetworkArn} -> Maybe Text
coreNetworkArn) (\s :: VpnConnection
s@VpnConnection' {} Maybe Text
a -> VpnConnection
s {$sel:coreNetworkArn:VpnConnection' :: Maybe Text
coreNetworkArn = Maybe Text
a} :: VpnConnection)

-- | The ARN of the core network attachment.
vpnConnection_coreNetworkAttachmentArn :: Lens.Lens' VpnConnection (Prelude.Maybe Prelude.Text)
vpnConnection_coreNetworkAttachmentArn :: Lens' VpnConnection (Maybe Text)
vpnConnection_coreNetworkAttachmentArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe Text
coreNetworkAttachmentArn :: Maybe Text
$sel:coreNetworkAttachmentArn:VpnConnection' :: VpnConnection -> Maybe Text
coreNetworkAttachmentArn} -> Maybe Text
coreNetworkAttachmentArn) (\s :: VpnConnection
s@VpnConnection' {} Maybe Text
a -> VpnConnection
s {$sel:coreNetworkAttachmentArn:VpnConnection' :: Maybe Text
coreNetworkAttachmentArn = Maybe Text
a} :: VpnConnection)

-- | The configuration information for the VPN connection\'s customer gateway
-- (in the native XML format). This element is always present in the
-- CreateVpnConnection response; however, it\'s present in the
-- DescribeVpnConnections response only if the VPN connection is in the
-- @pending@ or @available@ state.
vpnConnection_customerGatewayConfiguration :: Lens.Lens' VpnConnection (Prelude.Maybe Prelude.Text)
vpnConnection_customerGatewayConfiguration :: Lens' VpnConnection (Maybe Text)
vpnConnection_customerGatewayConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe Text
customerGatewayConfiguration :: Maybe Text
$sel:customerGatewayConfiguration:VpnConnection' :: VpnConnection -> Maybe Text
customerGatewayConfiguration} -> Maybe Text
customerGatewayConfiguration) (\s :: VpnConnection
s@VpnConnection' {} Maybe Text
a -> VpnConnection
s {$sel:customerGatewayConfiguration:VpnConnection' :: Maybe Text
customerGatewayConfiguration = Maybe Text
a} :: VpnConnection)

-- | The current state of the gateway association.
vpnConnection_gatewayAssociationState :: Lens.Lens' VpnConnection (Prelude.Maybe GatewayAssociationState)
vpnConnection_gatewayAssociationState :: Lens' VpnConnection (Maybe GatewayAssociationState)
vpnConnection_gatewayAssociationState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe GatewayAssociationState
gatewayAssociationState :: Maybe GatewayAssociationState
$sel:gatewayAssociationState:VpnConnection' :: VpnConnection -> Maybe GatewayAssociationState
gatewayAssociationState} -> Maybe GatewayAssociationState
gatewayAssociationState) (\s :: VpnConnection
s@VpnConnection' {} Maybe GatewayAssociationState
a -> VpnConnection
s {$sel:gatewayAssociationState:VpnConnection' :: Maybe GatewayAssociationState
gatewayAssociationState = Maybe GatewayAssociationState
a} :: VpnConnection)

-- | The VPN connection options.
vpnConnection_options :: Lens.Lens' VpnConnection (Prelude.Maybe VpnConnectionOptions)
vpnConnection_options :: Lens' VpnConnection (Maybe VpnConnectionOptions)
vpnConnection_options = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe VpnConnectionOptions
options :: Maybe VpnConnectionOptions
$sel:options:VpnConnection' :: VpnConnection -> Maybe VpnConnectionOptions
options} -> Maybe VpnConnectionOptions
options) (\s :: VpnConnection
s@VpnConnection' {} Maybe VpnConnectionOptions
a -> VpnConnection
s {$sel:options:VpnConnection' :: Maybe VpnConnectionOptions
options = Maybe VpnConnectionOptions
a} :: VpnConnection)

-- | The static routes associated with the VPN connection.
vpnConnection_routes :: Lens.Lens' VpnConnection (Prelude.Maybe [VpnStaticRoute])
vpnConnection_routes :: Lens' VpnConnection (Maybe [VpnStaticRoute])
vpnConnection_routes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe [VpnStaticRoute]
routes :: Maybe [VpnStaticRoute]
$sel:routes:VpnConnection' :: VpnConnection -> Maybe [VpnStaticRoute]
routes} -> Maybe [VpnStaticRoute]
routes) (\s :: VpnConnection
s@VpnConnection' {} Maybe [VpnStaticRoute]
a -> VpnConnection
s {$sel:routes:VpnConnection' :: Maybe [VpnStaticRoute]
routes = Maybe [VpnStaticRoute]
a} :: VpnConnection) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Any tags assigned to the VPN connection.
vpnConnection_tags :: Lens.Lens' VpnConnection (Prelude.Maybe [Tag])
vpnConnection_tags :: Lens' VpnConnection (Maybe [Tag])
vpnConnection_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:VpnConnection' :: VpnConnection -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: VpnConnection
s@VpnConnection' {} Maybe [Tag]
a -> VpnConnection
s {$sel:tags:VpnConnection' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: VpnConnection) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the transit gateway associated with the VPN connection.
vpnConnection_transitGatewayId :: Lens.Lens' VpnConnection (Prelude.Maybe Prelude.Text)
vpnConnection_transitGatewayId :: Lens' VpnConnection (Maybe Text)
vpnConnection_transitGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe Text
transitGatewayId :: Maybe Text
$sel:transitGatewayId:VpnConnection' :: VpnConnection -> Maybe Text
transitGatewayId} -> Maybe Text
transitGatewayId) (\s :: VpnConnection
s@VpnConnection' {} Maybe Text
a -> VpnConnection
s {$sel:transitGatewayId:VpnConnection' :: Maybe Text
transitGatewayId = Maybe Text
a} :: VpnConnection)

-- | Information about the VPN tunnel.
vpnConnection_vgwTelemetry :: Lens.Lens' VpnConnection (Prelude.Maybe [VgwTelemetry])
vpnConnection_vgwTelemetry :: Lens' VpnConnection (Maybe [VgwTelemetry])
vpnConnection_vgwTelemetry = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe [VgwTelemetry]
vgwTelemetry :: Maybe [VgwTelemetry]
$sel:vgwTelemetry:VpnConnection' :: VpnConnection -> Maybe [VgwTelemetry]
vgwTelemetry} -> Maybe [VgwTelemetry]
vgwTelemetry) (\s :: VpnConnection
s@VpnConnection' {} Maybe [VgwTelemetry]
a -> VpnConnection
s {$sel:vgwTelemetry:VpnConnection' :: Maybe [VgwTelemetry]
vgwTelemetry = Maybe [VgwTelemetry]
a} :: VpnConnection) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the virtual private gateway at the Amazon Web Services side of
-- the VPN connection.
vpnConnection_vpnGatewayId :: Lens.Lens' VpnConnection (Prelude.Maybe Prelude.Text)
vpnConnection_vpnGatewayId :: Lens' VpnConnection (Maybe Text)
vpnConnection_vpnGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Maybe Text
vpnGatewayId :: Maybe Text
$sel:vpnGatewayId:VpnConnection' :: VpnConnection -> Maybe Text
vpnGatewayId} -> Maybe Text
vpnGatewayId) (\s :: VpnConnection
s@VpnConnection' {} Maybe Text
a -> VpnConnection
s {$sel:vpnGatewayId:VpnConnection' :: Maybe Text
vpnGatewayId = Maybe Text
a} :: VpnConnection)

-- | The ID of the VPN connection.
vpnConnection_vpnConnectionId :: Lens.Lens' VpnConnection Prelude.Text
vpnConnection_vpnConnectionId :: Lens' VpnConnection Text
vpnConnection_vpnConnectionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Text
vpnConnectionId :: Text
$sel:vpnConnectionId:VpnConnection' :: VpnConnection -> Text
vpnConnectionId} -> Text
vpnConnectionId) (\s :: VpnConnection
s@VpnConnection' {} Text
a -> VpnConnection
s {$sel:vpnConnectionId:VpnConnection' :: Text
vpnConnectionId = Text
a} :: VpnConnection)

-- | The ID of the customer gateway at your end of the VPN connection.
vpnConnection_customerGatewayId :: Lens.Lens' VpnConnection Prelude.Text
vpnConnection_customerGatewayId :: Lens' VpnConnection Text
vpnConnection_customerGatewayId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {Text
customerGatewayId :: Text
$sel:customerGatewayId:VpnConnection' :: VpnConnection -> Text
customerGatewayId} -> Text
customerGatewayId) (\s :: VpnConnection
s@VpnConnection' {} Text
a -> VpnConnection
s {$sel:customerGatewayId:VpnConnection' :: Text
customerGatewayId = Text
a} :: VpnConnection)

-- | The current state of the VPN connection.
vpnConnection_state :: Lens.Lens' VpnConnection VpnState
vpnConnection_state :: Lens' VpnConnection VpnState
vpnConnection_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {VpnState
state :: VpnState
$sel:state:VpnConnection' :: VpnConnection -> VpnState
state} -> VpnState
state) (\s :: VpnConnection
s@VpnConnection' {} VpnState
a -> VpnConnection
s {$sel:state:VpnConnection' :: VpnState
state = VpnState
a} :: VpnConnection)

-- | The type of VPN connection.
vpnConnection_type :: Lens.Lens' VpnConnection GatewayType
vpnConnection_type :: Lens' VpnConnection GatewayType
vpnConnection_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VpnConnection' {GatewayType
type' :: GatewayType
$sel:type':VpnConnection' :: VpnConnection -> GatewayType
type'} -> GatewayType
type') (\s :: VpnConnection
s@VpnConnection' {} GatewayType
a -> VpnConnection
s {$sel:type':VpnConnection' :: GatewayType
type' = GatewayType
a} :: VpnConnection)

instance Data.FromXML VpnConnection where
  parseXML :: [Node] -> Either String VpnConnection
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe GatewayAssociationState
-> Maybe VpnConnectionOptions
-> Maybe [VpnStaticRoute]
-> Maybe [Tag]
-> Maybe Text
-> Maybe [VgwTelemetry]
-> Maybe Text
-> Text
-> Text
-> VpnState
-> GatewayType
-> VpnConnection
VpnConnection'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"category")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"coreNetworkArn")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"coreNetworkAttachmentArn")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"customerGatewayConfiguration")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"gatewayAssociationState")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"options")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"routes"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"tagSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"transitGatewayId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"vgwTelemetry"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"vpnGatewayId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"vpnConnectionId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"customerGatewayId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"state")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"type")

instance Prelude.Hashable VpnConnection where
  hashWithSalt :: Int -> VpnConnection -> Int
hashWithSalt Int
_salt VpnConnection' {Maybe [Tag]
Maybe [VgwTelemetry]
Maybe [VpnStaticRoute]
Maybe Text
Maybe GatewayAssociationState
Maybe VpnConnectionOptions
Text
GatewayType
VpnState
type' :: GatewayType
state :: VpnState
customerGatewayId :: Text
vpnConnectionId :: Text
vpnGatewayId :: Maybe Text
vgwTelemetry :: Maybe [VgwTelemetry]
transitGatewayId :: Maybe Text
tags :: Maybe [Tag]
routes :: Maybe [VpnStaticRoute]
options :: Maybe VpnConnectionOptions
gatewayAssociationState :: Maybe GatewayAssociationState
customerGatewayConfiguration :: Maybe Text
coreNetworkAttachmentArn :: Maybe Text
coreNetworkArn :: Maybe Text
category :: Maybe Text
$sel:type':VpnConnection' :: VpnConnection -> GatewayType
$sel:state:VpnConnection' :: VpnConnection -> VpnState
$sel:customerGatewayId:VpnConnection' :: VpnConnection -> Text
$sel:vpnConnectionId:VpnConnection' :: VpnConnection -> Text
$sel:vpnGatewayId:VpnConnection' :: VpnConnection -> Maybe Text
$sel:vgwTelemetry:VpnConnection' :: VpnConnection -> Maybe [VgwTelemetry]
$sel:transitGatewayId:VpnConnection' :: VpnConnection -> Maybe Text
$sel:tags:VpnConnection' :: VpnConnection -> Maybe [Tag]
$sel:routes:VpnConnection' :: VpnConnection -> Maybe [VpnStaticRoute]
$sel:options:VpnConnection' :: VpnConnection -> Maybe VpnConnectionOptions
$sel:gatewayAssociationState:VpnConnection' :: VpnConnection -> Maybe GatewayAssociationState
$sel:customerGatewayConfiguration:VpnConnection' :: VpnConnection -> Maybe Text
$sel:coreNetworkAttachmentArn:VpnConnection' :: VpnConnection -> Maybe Text
$sel:coreNetworkArn:VpnConnection' :: VpnConnection -> Maybe Text
$sel:category:VpnConnection' :: VpnConnection -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
category
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
coreNetworkArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
coreNetworkAttachmentArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
customerGatewayConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GatewayAssociationState
gatewayAssociationState
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VpnConnectionOptions
options
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [VpnStaticRoute]
routes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
transitGatewayId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [VgwTelemetry]
vgwTelemetry
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpnGatewayId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpnConnectionId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
customerGatewayId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VpnState
state
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` GatewayType
type'

instance Prelude.NFData VpnConnection where
  rnf :: VpnConnection -> ()
rnf VpnConnection' {Maybe [Tag]
Maybe [VgwTelemetry]
Maybe [VpnStaticRoute]
Maybe Text
Maybe GatewayAssociationState
Maybe VpnConnectionOptions
Text
GatewayType
VpnState
type' :: GatewayType
state :: VpnState
customerGatewayId :: Text
vpnConnectionId :: Text
vpnGatewayId :: Maybe Text
vgwTelemetry :: Maybe [VgwTelemetry]
transitGatewayId :: Maybe Text
tags :: Maybe [Tag]
routes :: Maybe [VpnStaticRoute]
options :: Maybe VpnConnectionOptions
gatewayAssociationState :: Maybe GatewayAssociationState
customerGatewayConfiguration :: Maybe Text
coreNetworkAttachmentArn :: Maybe Text
coreNetworkArn :: Maybe Text
category :: Maybe Text
$sel:type':VpnConnection' :: VpnConnection -> GatewayType
$sel:state:VpnConnection' :: VpnConnection -> VpnState
$sel:customerGatewayId:VpnConnection' :: VpnConnection -> Text
$sel:vpnConnectionId:VpnConnection' :: VpnConnection -> Text
$sel:vpnGatewayId:VpnConnection' :: VpnConnection -> Maybe Text
$sel:vgwTelemetry:VpnConnection' :: VpnConnection -> Maybe [VgwTelemetry]
$sel:transitGatewayId:VpnConnection' :: VpnConnection -> Maybe Text
$sel:tags:VpnConnection' :: VpnConnection -> Maybe [Tag]
$sel:routes:VpnConnection' :: VpnConnection -> Maybe [VpnStaticRoute]
$sel:options:VpnConnection' :: VpnConnection -> Maybe VpnConnectionOptions
$sel:gatewayAssociationState:VpnConnection' :: VpnConnection -> Maybe GatewayAssociationState
$sel:customerGatewayConfiguration:VpnConnection' :: VpnConnection -> Maybe Text
$sel:coreNetworkAttachmentArn:VpnConnection' :: VpnConnection -> Maybe Text
$sel:coreNetworkArn:VpnConnection' :: VpnConnection -> Maybe Text
$sel:category:VpnConnection' :: VpnConnection -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
category
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
coreNetworkArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
coreNetworkAttachmentArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
customerGatewayConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GatewayAssociationState
gatewayAssociationState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VpnConnectionOptions
options
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VpnStaticRoute]
routes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
transitGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VgwTelemetry]
vgwTelemetry
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpnGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vpnConnectionId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
customerGatewayId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VpnState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf GatewayType
type'