{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.DescribeVpnConnections
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes one or more of your VPN connections.
--
-- For more information, see
-- <https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html Amazon Web Services Site-to-Site VPN>
-- in the /Amazon Web Services Site-to-Site VPN User Guide/.
module Amazonka.EC2.DescribeVpnConnections
  ( -- * Creating a Request
    DescribeVpnConnections (..),
    newDescribeVpnConnections,

    -- * Request Lenses
    describeVpnConnections_dryRun,
    describeVpnConnections_filters,
    describeVpnConnections_vpnConnectionIds,

    -- * Destructuring the Response
    DescribeVpnConnectionsResponse (..),
    newDescribeVpnConnectionsResponse,

    -- * Response Lenses
    describeVpnConnectionsResponse_vpnConnections,
    describeVpnConnectionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Contains the parameters for DescribeVpnConnections.
--
-- /See:/ 'newDescribeVpnConnections' smart constructor.
data DescribeVpnConnections = DescribeVpnConnections'
  { -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    DescribeVpnConnections -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @customer-gateway-configuration@ - The configuration information for
    --     the customer gateway.
    --
    -- -   @customer-gateway-id@ - The ID of a customer gateway associated with
    --     the VPN connection.
    --
    -- -   @state@ - The state of the VPN connection (@pending@ | @available@ |
    --     @deleting@ | @deleted@).
    --
    -- -   @option.static-routes-only@ - Indicates whether the connection has
    --     static routes only. Used for devices that do not support Border
    --     Gateway Protocol (BGP).
    --
    -- -   @route.destination-cidr-block@ - The destination CIDR block. This
    --     corresponds to the subnet used in a customer data center.
    --
    -- -   @bgp-asn@ - The BGP Autonomous System Number (ASN) associated with a
    --     BGP device.
    --
    -- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
    --     resource. Use the tag key in the filter name and the tag value as
    --     the filter value. For example, to find all resources that have a tag
    --     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
    --     the filter name and @TeamA@ for the filter value.
    --
    -- -   @tag-key@ - The key of a tag assigned to the resource. Use this
    --     filter to find all resources assigned a tag with a specific key,
    --     regardless of the tag value.
    --
    -- -   @type@ - The type of VPN connection. Currently the only supported
    --     type is @ipsec.1@.
    --
    -- -   @vpn-connection-id@ - The ID of the VPN connection.
    --
    -- -   @vpn-gateway-id@ - The ID of a virtual private gateway associated
    --     with the VPN connection.
    --
    -- -   @transit-gateway-id@ - The ID of a transit gateway associated with
    --     the VPN connection.
    DescribeVpnConnections -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | One or more VPN connection IDs.
    --
    -- Default: Describes your VPN connections.
    DescribeVpnConnections -> Maybe [Text]
vpnConnectionIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeVpnConnections -> DescribeVpnConnections -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVpnConnections -> DescribeVpnConnections -> Bool
$c/= :: DescribeVpnConnections -> DescribeVpnConnections -> Bool
== :: DescribeVpnConnections -> DescribeVpnConnections -> Bool
$c== :: DescribeVpnConnections -> DescribeVpnConnections -> Bool
Prelude.Eq, ReadPrec [DescribeVpnConnections]
ReadPrec DescribeVpnConnections
Int -> ReadS DescribeVpnConnections
ReadS [DescribeVpnConnections]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVpnConnections]
$creadListPrec :: ReadPrec [DescribeVpnConnections]
readPrec :: ReadPrec DescribeVpnConnections
$creadPrec :: ReadPrec DescribeVpnConnections
readList :: ReadS [DescribeVpnConnections]
$creadList :: ReadS [DescribeVpnConnections]
readsPrec :: Int -> ReadS DescribeVpnConnections
$creadsPrec :: Int -> ReadS DescribeVpnConnections
Prelude.Read, Int -> DescribeVpnConnections -> ShowS
[DescribeVpnConnections] -> ShowS
DescribeVpnConnections -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVpnConnections] -> ShowS
$cshowList :: [DescribeVpnConnections] -> ShowS
show :: DescribeVpnConnections -> String
$cshow :: DescribeVpnConnections -> String
showsPrec :: Int -> DescribeVpnConnections -> ShowS
$cshowsPrec :: Int -> DescribeVpnConnections -> ShowS
Prelude.Show, forall x. Rep DescribeVpnConnections x -> DescribeVpnConnections
forall x. DescribeVpnConnections -> Rep DescribeVpnConnections x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeVpnConnections x -> DescribeVpnConnections
$cfrom :: forall x. DescribeVpnConnections -> Rep DescribeVpnConnections x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVpnConnections' 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:
--
-- 'dryRun', 'describeVpnConnections_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'filters', 'describeVpnConnections_filters' - One or more filters.
--
-- -   @customer-gateway-configuration@ - The configuration information for
--     the customer gateway.
--
-- -   @customer-gateway-id@ - The ID of a customer gateway associated with
--     the VPN connection.
--
-- -   @state@ - The state of the VPN connection (@pending@ | @available@ |
--     @deleting@ | @deleted@).
--
-- -   @option.static-routes-only@ - Indicates whether the connection has
--     static routes only. Used for devices that do not support Border
--     Gateway Protocol (BGP).
--
-- -   @route.destination-cidr-block@ - The destination CIDR block. This
--     corresponds to the subnet used in a customer data center.
--
-- -   @bgp-asn@ - The BGP Autonomous System Number (ASN) associated with a
--     BGP device.
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources assigned a tag with a specific key,
--     regardless of the tag value.
--
-- -   @type@ - The type of VPN connection. Currently the only supported
--     type is @ipsec.1@.
--
-- -   @vpn-connection-id@ - The ID of the VPN connection.
--
-- -   @vpn-gateway-id@ - The ID of a virtual private gateway associated
--     with the VPN connection.
--
-- -   @transit-gateway-id@ - The ID of a transit gateway associated with
--     the VPN connection.
--
-- 'vpnConnectionIds', 'describeVpnConnections_vpnConnectionIds' - One or more VPN connection IDs.
--
-- Default: Describes your VPN connections.
newDescribeVpnConnections ::
  DescribeVpnConnections
newDescribeVpnConnections :: DescribeVpnConnections
newDescribeVpnConnections =
  DescribeVpnConnections'
    { $sel:dryRun:DescribeVpnConnections' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeVpnConnections' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:vpnConnectionIds:DescribeVpnConnections' :: Maybe [Text]
vpnConnectionIds = forall a. Maybe a
Prelude.Nothing
    }

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
describeVpnConnections_dryRun :: Lens.Lens' DescribeVpnConnections (Prelude.Maybe Prelude.Bool)
describeVpnConnections_dryRun :: Lens' DescribeVpnConnections (Maybe Bool)
describeVpnConnections_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpnConnections' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeVpnConnections
s@DescribeVpnConnections' {} Maybe Bool
a -> DescribeVpnConnections
s {$sel:dryRun:DescribeVpnConnections' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeVpnConnections)

-- | One or more filters.
--
-- -   @customer-gateway-configuration@ - The configuration information for
--     the customer gateway.
--
-- -   @customer-gateway-id@ - The ID of a customer gateway associated with
--     the VPN connection.
--
-- -   @state@ - The state of the VPN connection (@pending@ | @available@ |
--     @deleting@ | @deleted@).
--
-- -   @option.static-routes-only@ - Indicates whether the connection has
--     static routes only. Used for devices that do not support Border
--     Gateway Protocol (BGP).
--
-- -   @route.destination-cidr-block@ - The destination CIDR block. This
--     corresponds to the subnet used in a customer data center.
--
-- -   @bgp-asn@ - The BGP Autonomous System Number (ASN) associated with a
--     BGP device.
--
-- -   @tag@:\<key> - The key\/value combination of a tag assigned to the
--     resource. Use the tag key in the filter name and the tag value as
--     the filter value. For example, to find all resources that have a tag
--     with the key @Owner@ and the value @TeamA@, specify @tag:Owner@ for
--     the filter name and @TeamA@ for the filter value.
--
-- -   @tag-key@ - The key of a tag assigned to the resource. Use this
--     filter to find all resources assigned a tag with a specific key,
--     regardless of the tag value.
--
-- -   @type@ - The type of VPN connection. Currently the only supported
--     type is @ipsec.1@.
--
-- -   @vpn-connection-id@ - The ID of the VPN connection.
--
-- -   @vpn-gateway-id@ - The ID of a virtual private gateway associated
--     with the VPN connection.
--
-- -   @transit-gateway-id@ - The ID of a transit gateway associated with
--     the VPN connection.
describeVpnConnections_filters :: Lens.Lens' DescribeVpnConnections (Prelude.Maybe [Filter])
describeVpnConnections_filters :: Lens' DescribeVpnConnections (Maybe [Filter])
describeVpnConnections_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpnConnections' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeVpnConnections
s@DescribeVpnConnections' {} Maybe [Filter]
a -> DescribeVpnConnections
s {$sel:filters:DescribeVpnConnections' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeVpnConnections) 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

-- | One or more VPN connection IDs.
--
-- Default: Describes your VPN connections.
describeVpnConnections_vpnConnectionIds :: Lens.Lens' DescribeVpnConnections (Prelude.Maybe [Prelude.Text])
describeVpnConnections_vpnConnectionIds :: Lens' DescribeVpnConnections (Maybe [Text])
describeVpnConnections_vpnConnectionIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpnConnections' {Maybe [Text]
vpnConnectionIds :: Maybe [Text]
$sel:vpnConnectionIds:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe [Text]
vpnConnectionIds} -> Maybe [Text]
vpnConnectionIds) (\s :: DescribeVpnConnections
s@DescribeVpnConnections' {} Maybe [Text]
a -> DescribeVpnConnections
s {$sel:vpnConnectionIds:DescribeVpnConnections' :: Maybe [Text]
vpnConnectionIds = Maybe [Text]
a} :: DescribeVpnConnections) 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

instance Core.AWSRequest DescribeVpnConnections where
  type
    AWSResponse DescribeVpnConnections =
      DescribeVpnConnectionsResponse
  request :: (Service -> Service)
-> DescribeVpnConnections -> Request DescribeVpnConnections
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeVpnConnections
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeVpnConnections)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [VpnConnection] -> Int -> DescribeVpnConnectionsResponse
DescribeVpnConnectionsResponse'
            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
"vpnConnectionSet"
                            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeVpnConnections where
  hashWithSalt :: Int -> DescribeVpnConnections -> Int
hashWithSalt Int
_salt DescribeVpnConnections' {Maybe Bool
Maybe [Text]
Maybe [Filter]
vpnConnectionIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:vpnConnectionIds:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe [Text]
$sel:filters:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe [Filter]
$sel:dryRun:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
vpnConnectionIds

instance Prelude.NFData DescribeVpnConnections where
  rnf :: DescribeVpnConnections -> ()
rnf DescribeVpnConnections' {Maybe Bool
Maybe [Text]
Maybe [Filter]
vpnConnectionIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:vpnConnectionIds:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe [Text]
$sel:filters:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe [Filter]
$sel:dryRun:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
vpnConnectionIds

instance Data.ToHeaders DescribeVpnConnections where
  toHeaders :: DescribeVpnConnections -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DescribeVpnConnections where
  toPath :: DescribeVpnConnections -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DescribeVpnConnections where
  toQuery :: DescribeVpnConnections -> QueryString
toQuery DescribeVpnConnections' {Maybe Bool
Maybe [Text]
Maybe [Filter]
vpnConnectionIds :: Maybe [Text]
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:vpnConnectionIds:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe [Text]
$sel:filters:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe [Filter]
$sel:dryRun:DescribeVpnConnections' :: DescribeVpnConnections -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeVpnConnections" :: Prelude.ByteString),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          (forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"Filter" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"VpnConnectionId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
vpnConnectionIds
          )
      ]

-- | Contains the output of DescribeVpnConnections.
--
-- /See:/ 'newDescribeVpnConnectionsResponse' smart constructor.
data DescribeVpnConnectionsResponse = DescribeVpnConnectionsResponse'
  { -- | Information about one or more VPN connections.
    DescribeVpnConnectionsResponse -> Maybe [VpnConnection]
vpnConnections :: Prelude.Maybe [VpnConnection],
    -- | The response's http status code.
    DescribeVpnConnectionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeVpnConnectionsResponse
-> DescribeVpnConnectionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVpnConnectionsResponse
-> DescribeVpnConnectionsResponse -> Bool
$c/= :: DescribeVpnConnectionsResponse
-> DescribeVpnConnectionsResponse -> Bool
== :: DescribeVpnConnectionsResponse
-> DescribeVpnConnectionsResponse -> Bool
$c== :: DescribeVpnConnectionsResponse
-> DescribeVpnConnectionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeVpnConnectionsResponse]
ReadPrec DescribeVpnConnectionsResponse
Int -> ReadS DescribeVpnConnectionsResponse
ReadS [DescribeVpnConnectionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVpnConnectionsResponse]
$creadListPrec :: ReadPrec [DescribeVpnConnectionsResponse]
readPrec :: ReadPrec DescribeVpnConnectionsResponse
$creadPrec :: ReadPrec DescribeVpnConnectionsResponse
readList :: ReadS [DescribeVpnConnectionsResponse]
$creadList :: ReadS [DescribeVpnConnectionsResponse]
readsPrec :: Int -> ReadS DescribeVpnConnectionsResponse
$creadsPrec :: Int -> ReadS DescribeVpnConnectionsResponse
Prelude.Read, Int -> DescribeVpnConnectionsResponse -> ShowS
[DescribeVpnConnectionsResponse] -> ShowS
DescribeVpnConnectionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVpnConnectionsResponse] -> ShowS
$cshowList :: [DescribeVpnConnectionsResponse] -> ShowS
show :: DescribeVpnConnectionsResponse -> String
$cshow :: DescribeVpnConnectionsResponse -> String
showsPrec :: Int -> DescribeVpnConnectionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeVpnConnectionsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeVpnConnectionsResponse x
-> DescribeVpnConnectionsResponse
forall x.
DescribeVpnConnectionsResponse
-> Rep DescribeVpnConnectionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeVpnConnectionsResponse x
-> DescribeVpnConnectionsResponse
$cfrom :: forall x.
DescribeVpnConnectionsResponse
-> Rep DescribeVpnConnectionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVpnConnectionsResponse' 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:
--
-- 'vpnConnections', 'describeVpnConnectionsResponse_vpnConnections' - Information about one or more VPN connections.
--
-- 'httpStatus', 'describeVpnConnectionsResponse_httpStatus' - The response's http status code.
newDescribeVpnConnectionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeVpnConnectionsResponse
newDescribeVpnConnectionsResponse :: Int -> DescribeVpnConnectionsResponse
newDescribeVpnConnectionsResponse Int
pHttpStatus_ =
  DescribeVpnConnectionsResponse'
    { $sel:vpnConnections:DescribeVpnConnectionsResponse' :: Maybe [VpnConnection]
vpnConnections =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeVpnConnectionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about one or more VPN connections.
describeVpnConnectionsResponse_vpnConnections :: Lens.Lens' DescribeVpnConnectionsResponse (Prelude.Maybe [VpnConnection])
describeVpnConnectionsResponse_vpnConnections :: Lens' DescribeVpnConnectionsResponse (Maybe [VpnConnection])
describeVpnConnectionsResponse_vpnConnections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpnConnectionsResponse' {Maybe [VpnConnection]
vpnConnections :: Maybe [VpnConnection]
$sel:vpnConnections:DescribeVpnConnectionsResponse' :: DescribeVpnConnectionsResponse -> Maybe [VpnConnection]
vpnConnections} -> Maybe [VpnConnection]
vpnConnections) (\s :: DescribeVpnConnectionsResponse
s@DescribeVpnConnectionsResponse' {} Maybe [VpnConnection]
a -> DescribeVpnConnectionsResponse
s {$sel:vpnConnections:DescribeVpnConnectionsResponse' :: Maybe [VpnConnection]
vpnConnections = Maybe [VpnConnection]
a} :: DescribeVpnConnectionsResponse) 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 response's http status code.
describeVpnConnectionsResponse_httpStatus :: Lens.Lens' DescribeVpnConnectionsResponse Prelude.Int
describeVpnConnectionsResponse_httpStatus :: Lens' DescribeVpnConnectionsResponse Int
describeVpnConnectionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpnConnectionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeVpnConnectionsResponse' :: DescribeVpnConnectionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeVpnConnectionsResponse
s@DescribeVpnConnectionsResponse' {} Int
a -> DescribeVpnConnectionsResponse
s {$sel:httpStatus:DescribeVpnConnectionsResponse' :: Int
httpStatus = Int
a} :: DescribeVpnConnectionsResponse)

instance
  Prelude.NFData
    DescribeVpnConnectionsResponse
  where
  rnf :: DescribeVpnConnectionsResponse -> ()
rnf DescribeVpnConnectionsResponse' {Int
Maybe [VpnConnection]
httpStatus :: Int
vpnConnections :: Maybe [VpnConnection]
$sel:httpStatus:DescribeVpnConnectionsResponse' :: DescribeVpnConnectionsResponse -> Int
$sel:vpnConnections:DescribeVpnConnectionsResponse' :: DescribeVpnConnectionsResponse -> Maybe [VpnConnection]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [VpnConnection]
vpnConnections
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus