{-# 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.DescribeVpcEndpointConnectionNotifications
-- 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 the connection notifications for VPC endpoints and VPC
-- endpoint services.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeVpcEndpointConnectionNotifications
  ( -- * Creating a Request
    DescribeVpcEndpointConnectionNotifications (..),
    newDescribeVpcEndpointConnectionNotifications,

    -- * Request Lenses
    describeVpcEndpointConnectionNotifications_connectionNotificationId,
    describeVpcEndpointConnectionNotifications_dryRun,
    describeVpcEndpointConnectionNotifications_filters,
    describeVpcEndpointConnectionNotifications_maxResults,
    describeVpcEndpointConnectionNotifications_nextToken,

    -- * Destructuring the Response
    DescribeVpcEndpointConnectionNotificationsResponse (..),
    newDescribeVpcEndpointConnectionNotificationsResponse,

    -- * Response Lenses
    describeVpcEndpointConnectionNotificationsResponse_connectionNotificationSet,
    describeVpcEndpointConnectionNotificationsResponse_nextToken,
    describeVpcEndpointConnectionNotificationsResponse_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

-- | /See:/ 'newDescribeVpcEndpointConnectionNotifications' smart constructor.
data DescribeVpcEndpointConnectionNotifications = DescribeVpcEndpointConnectionNotifications'
  { -- | The ID of the notification.
    DescribeVpcEndpointConnectionNotifications -> Maybe Text
connectionNotificationId :: Prelude.Maybe Prelude.Text,
    -- | 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@.
    DescribeVpcEndpointConnectionNotifications -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @connection-notification-arn@ - The ARN of the SNS topic for the
    --     notification.
    --
    -- -   @connection-notification-id@ - The ID of the notification.
    --
    -- -   @connection-notification-state@ - The state of the notification
    --     (@Enabled@ | @Disabled@).
    --
    -- -   @connection-notification-type@ - The type of notification (@Topic@).
    --
    -- -   @service-id@ - The ID of the endpoint service.
    --
    -- -   @vpc-endpoint-id@ - The ID of the VPC endpoint.
    DescribeVpcEndpointConnectionNotifications -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to return in a single call. To retrieve
    -- the remaining results, make another request with the returned
    -- @NextToken@ value.
    DescribeVpcEndpointConnectionNotifications -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The token to request the next page of results.
    DescribeVpcEndpointConnectionNotifications -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeVpcEndpointConnectionNotifications
-> DescribeVpcEndpointConnectionNotifications -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVpcEndpointConnectionNotifications
-> DescribeVpcEndpointConnectionNotifications -> Bool
$c/= :: DescribeVpcEndpointConnectionNotifications
-> DescribeVpcEndpointConnectionNotifications -> Bool
== :: DescribeVpcEndpointConnectionNotifications
-> DescribeVpcEndpointConnectionNotifications -> Bool
$c== :: DescribeVpcEndpointConnectionNotifications
-> DescribeVpcEndpointConnectionNotifications -> Bool
Prelude.Eq, ReadPrec [DescribeVpcEndpointConnectionNotifications]
ReadPrec DescribeVpcEndpointConnectionNotifications
Int -> ReadS DescribeVpcEndpointConnectionNotifications
ReadS [DescribeVpcEndpointConnectionNotifications]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVpcEndpointConnectionNotifications]
$creadListPrec :: ReadPrec [DescribeVpcEndpointConnectionNotifications]
readPrec :: ReadPrec DescribeVpcEndpointConnectionNotifications
$creadPrec :: ReadPrec DescribeVpcEndpointConnectionNotifications
readList :: ReadS [DescribeVpcEndpointConnectionNotifications]
$creadList :: ReadS [DescribeVpcEndpointConnectionNotifications]
readsPrec :: Int -> ReadS DescribeVpcEndpointConnectionNotifications
$creadsPrec :: Int -> ReadS DescribeVpcEndpointConnectionNotifications
Prelude.Read, Int -> DescribeVpcEndpointConnectionNotifications -> ShowS
[DescribeVpcEndpointConnectionNotifications] -> ShowS
DescribeVpcEndpointConnectionNotifications -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVpcEndpointConnectionNotifications] -> ShowS
$cshowList :: [DescribeVpcEndpointConnectionNotifications] -> ShowS
show :: DescribeVpcEndpointConnectionNotifications -> String
$cshow :: DescribeVpcEndpointConnectionNotifications -> String
showsPrec :: Int -> DescribeVpcEndpointConnectionNotifications -> ShowS
$cshowsPrec :: Int -> DescribeVpcEndpointConnectionNotifications -> ShowS
Prelude.Show, forall x.
Rep DescribeVpcEndpointConnectionNotifications x
-> DescribeVpcEndpointConnectionNotifications
forall x.
DescribeVpcEndpointConnectionNotifications
-> Rep DescribeVpcEndpointConnectionNotifications x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeVpcEndpointConnectionNotifications x
-> DescribeVpcEndpointConnectionNotifications
$cfrom :: forall x.
DescribeVpcEndpointConnectionNotifications
-> Rep DescribeVpcEndpointConnectionNotifications x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVpcEndpointConnectionNotifications' 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:
--
-- 'connectionNotificationId', 'describeVpcEndpointConnectionNotifications_connectionNotificationId' - The ID of the notification.
--
-- 'dryRun', 'describeVpcEndpointConnectionNotifications_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', 'describeVpcEndpointConnectionNotifications_filters' - One or more filters.
--
-- -   @connection-notification-arn@ - The ARN of the SNS topic for the
--     notification.
--
-- -   @connection-notification-id@ - The ID of the notification.
--
-- -   @connection-notification-state@ - The state of the notification
--     (@Enabled@ | @Disabled@).
--
-- -   @connection-notification-type@ - The type of notification (@Topic@).
--
-- -   @service-id@ - The ID of the endpoint service.
--
-- -   @vpc-endpoint-id@ - The ID of the VPC endpoint.
--
-- 'maxResults', 'describeVpcEndpointConnectionNotifications_maxResults' - The maximum number of results to return in a single call. To retrieve
-- the remaining results, make another request with the returned
-- @NextToken@ value.
--
-- 'nextToken', 'describeVpcEndpointConnectionNotifications_nextToken' - The token to request the next page of results.
newDescribeVpcEndpointConnectionNotifications ::
  DescribeVpcEndpointConnectionNotifications
newDescribeVpcEndpointConnectionNotifications :: DescribeVpcEndpointConnectionNotifications
newDescribeVpcEndpointConnectionNotifications =
  DescribeVpcEndpointConnectionNotifications'
    { $sel:connectionNotificationId:DescribeVpcEndpointConnectionNotifications' :: Maybe Text
connectionNotificationId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:DescribeVpcEndpointConnectionNotifications' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeVpcEndpointConnectionNotifications' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeVpcEndpointConnectionNotifications' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeVpcEndpointConnectionNotifications' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the notification.
describeVpcEndpointConnectionNotifications_connectionNotificationId :: Lens.Lens' DescribeVpcEndpointConnectionNotifications (Prelude.Maybe Prelude.Text)
describeVpcEndpointConnectionNotifications_connectionNotificationId :: Lens' DescribeVpcEndpointConnectionNotifications (Maybe Text)
describeVpcEndpointConnectionNotifications_connectionNotificationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointConnectionNotifications' {Maybe Text
connectionNotificationId :: Maybe Text
$sel:connectionNotificationId:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Text
connectionNotificationId} -> Maybe Text
connectionNotificationId) (\s :: DescribeVpcEndpointConnectionNotifications
s@DescribeVpcEndpointConnectionNotifications' {} Maybe Text
a -> DescribeVpcEndpointConnectionNotifications
s {$sel:connectionNotificationId:DescribeVpcEndpointConnectionNotifications' :: Maybe Text
connectionNotificationId = Maybe Text
a} :: DescribeVpcEndpointConnectionNotifications)

-- | 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@.
describeVpcEndpointConnectionNotifications_dryRun :: Lens.Lens' DescribeVpcEndpointConnectionNotifications (Prelude.Maybe Prelude.Bool)
describeVpcEndpointConnectionNotifications_dryRun :: Lens' DescribeVpcEndpointConnectionNotifications (Maybe Bool)
describeVpcEndpointConnectionNotifications_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointConnectionNotifications' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeVpcEndpointConnectionNotifications
s@DescribeVpcEndpointConnectionNotifications' {} Maybe Bool
a -> DescribeVpcEndpointConnectionNotifications
s {$sel:dryRun:DescribeVpcEndpointConnectionNotifications' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeVpcEndpointConnectionNotifications)

-- | One or more filters.
--
-- -   @connection-notification-arn@ - The ARN of the SNS topic for the
--     notification.
--
-- -   @connection-notification-id@ - The ID of the notification.
--
-- -   @connection-notification-state@ - The state of the notification
--     (@Enabled@ | @Disabled@).
--
-- -   @connection-notification-type@ - The type of notification (@Topic@).
--
-- -   @service-id@ - The ID of the endpoint service.
--
-- -   @vpc-endpoint-id@ - The ID of the VPC endpoint.
describeVpcEndpointConnectionNotifications_filters :: Lens.Lens' DescribeVpcEndpointConnectionNotifications (Prelude.Maybe [Filter])
describeVpcEndpointConnectionNotifications_filters :: Lens' DescribeVpcEndpointConnectionNotifications (Maybe [Filter])
describeVpcEndpointConnectionNotifications_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointConnectionNotifications' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeVpcEndpointConnectionNotifications
s@DescribeVpcEndpointConnectionNotifications' {} Maybe [Filter]
a -> DescribeVpcEndpointConnectionNotifications
s {$sel:filters:DescribeVpcEndpointConnectionNotifications' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeVpcEndpointConnectionNotifications) 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 maximum number of results to return in a single call. To retrieve
-- the remaining results, make another request with the returned
-- @NextToken@ value.
describeVpcEndpointConnectionNotifications_maxResults :: Lens.Lens' DescribeVpcEndpointConnectionNotifications (Prelude.Maybe Prelude.Int)
describeVpcEndpointConnectionNotifications_maxResults :: Lens' DescribeVpcEndpointConnectionNotifications (Maybe Int)
describeVpcEndpointConnectionNotifications_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointConnectionNotifications' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeVpcEndpointConnectionNotifications
s@DescribeVpcEndpointConnectionNotifications' {} Maybe Int
a -> DescribeVpcEndpointConnectionNotifications
s {$sel:maxResults:DescribeVpcEndpointConnectionNotifications' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeVpcEndpointConnectionNotifications)

-- | The token to request the next page of results.
describeVpcEndpointConnectionNotifications_nextToken :: Lens.Lens' DescribeVpcEndpointConnectionNotifications (Prelude.Maybe Prelude.Text)
describeVpcEndpointConnectionNotifications_nextToken :: Lens' DescribeVpcEndpointConnectionNotifications (Maybe Text)
describeVpcEndpointConnectionNotifications_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointConnectionNotifications' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeVpcEndpointConnectionNotifications
s@DescribeVpcEndpointConnectionNotifications' {} Maybe Text
a -> DescribeVpcEndpointConnectionNotifications
s {$sel:nextToken:DescribeVpcEndpointConnectionNotifications' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeVpcEndpointConnectionNotifications)

instance
  Core.AWSPager
    DescribeVpcEndpointConnectionNotifications
  where
  page :: DescribeVpcEndpointConnectionNotifications
-> AWSResponse DescribeVpcEndpointConnectionNotifications
-> Maybe DescribeVpcEndpointConnectionNotifications
page DescribeVpcEndpointConnectionNotifications
rq AWSResponse DescribeVpcEndpointConnectionNotifications
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeVpcEndpointConnectionNotifications
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeVpcEndpointConnectionNotificationsResponse (Maybe Text)
describeVpcEndpointConnectionNotificationsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeVpcEndpointConnectionNotifications
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeVpcEndpointConnectionNotificationsResponse
  (Maybe [ConnectionNotification])
describeVpcEndpointConnectionNotificationsResponse_connectionNotificationSet
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeVpcEndpointConnectionNotifications
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeVpcEndpointConnectionNotifications (Maybe Text)
describeVpcEndpointConnectionNotifications_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeVpcEndpointConnectionNotifications
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeVpcEndpointConnectionNotificationsResponse (Maybe Text)
describeVpcEndpointConnectionNotificationsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    DescribeVpcEndpointConnectionNotifications
  where
  type
    AWSResponse
      DescribeVpcEndpointConnectionNotifications =
      DescribeVpcEndpointConnectionNotificationsResponse
  request :: (Service -> Service)
-> DescribeVpcEndpointConnectionNotifications
-> Request DescribeVpcEndpointConnectionNotifications
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 DescribeVpcEndpointConnectionNotifications
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeVpcEndpointConnectionNotifications)))
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 [ConnectionNotification]
-> Maybe Text
-> Int
-> DescribeVpcEndpointConnectionNotificationsResponse
DescribeVpcEndpointConnectionNotificationsResponse'
            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
"connectionNotificationSet"
                            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
"nextToken")
            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
    DescribeVpcEndpointConnectionNotifications
  where
  hashWithSalt :: Int -> DescribeVpcEndpointConnectionNotifications -> Int
hashWithSalt
    Int
_salt
    DescribeVpcEndpointConnectionNotifications' {Maybe Bool
Maybe Int
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
connectionNotificationId :: Maybe Text
$sel:nextToken:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Text
$sel:maxResults:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Int
$sel:filters:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe [Filter]
$sel:dryRun:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Bool
$sel:connectionNotificationId:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionNotificationId
        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 Int
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance
  Prelude.NFData
    DescribeVpcEndpointConnectionNotifications
  where
  rnf :: DescribeVpcEndpointConnectionNotifications -> ()
rnf DescribeVpcEndpointConnectionNotifications' {Maybe Bool
Maybe Int
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
connectionNotificationId :: Maybe Text
$sel:nextToken:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Text
$sel:maxResults:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Int
$sel:filters:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe [Filter]
$sel:dryRun:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Bool
$sel:connectionNotificationId:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionNotificationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Int
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

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

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

instance
  Data.ToQuery
    DescribeVpcEndpointConnectionNotifications
  where
  toQuery :: DescribeVpcEndpointConnectionNotifications -> QueryString
toQuery
    DescribeVpcEndpointConnectionNotifications' {Maybe Bool
Maybe Int
Maybe [Filter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
connectionNotificationId :: Maybe Text
$sel:nextToken:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Text
$sel:maxResults:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Int
$sel:filters:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe [Filter]
$sel:dryRun:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Bool
$sel:connectionNotificationId:DescribeVpcEndpointConnectionNotifications' :: DescribeVpcEndpointConnectionNotifications -> Maybe Text
..} =
      forall a. Monoid a => [a] -> a
Prelude.mconcat
        [ ByteString
"Action"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DescribeVpcEndpointConnectionNotifications" ::
                        Prelude.ByteString
                    ),
          ByteString
"Version"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
          ByteString
"ConnectionNotificationId"
            forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
connectionNotificationId,
          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),
          ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Int
maxResults,
          ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
        ]

-- | /See:/ 'newDescribeVpcEndpointConnectionNotificationsResponse' smart constructor.
data DescribeVpcEndpointConnectionNotificationsResponse = DescribeVpcEndpointConnectionNotificationsResponse'
  { -- | One or more notifications.
    DescribeVpcEndpointConnectionNotificationsResponse
-> Maybe [ConnectionNotification]
connectionNotificationSet :: Prelude.Maybe [ConnectionNotification],
    -- | The token to use to retrieve the next page of results. This value is
    -- @null@ when there are no more results to return.
    DescribeVpcEndpointConnectionNotificationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeVpcEndpointConnectionNotificationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeVpcEndpointConnectionNotificationsResponse
-> DescribeVpcEndpointConnectionNotificationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVpcEndpointConnectionNotificationsResponse
-> DescribeVpcEndpointConnectionNotificationsResponse -> Bool
$c/= :: DescribeVpcEndpointConnectionNotificationsResponse
-> DescribeVpcEndpointConnectionNotificationsResponse -> Bool
== :: DescribeVpcEndpointConnectionNotificationsResponse
-> DescribeVpcEndpointConnectionNotificationsResponse -> Bool
$c== :: DescribeVpcEndpointConnectionNotificationsResponse
-> DescribeVpcEndpointConnectionNotificationsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeVpcEndpointConnectionNotificationsResponse]
ReadPrec DescribeVpcEndpointConnectionNotificationsResponse
Int -> ReadS DescribeVpcEndpointConnectionNotificationsResponse
ReadS [DescribeVpcEndpointConnectionNotificationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVpcEndpointConnectionNotificationsResponse]
$creadListPrec :: ReadPrec [DescribeVpcEndpointConnectionNotificationsResponse]
readPrec :: ReadPrec DescribeVpcEndpointConnectionNotificationsResponse
$creadPrec :: ReadPrec DescribeVpcEndpointConnectionNotificationsResponse
readList :: ReadS [DescribeVpcEndpointConnectionNotificationsResponse]
$creadList :: ReadS [DescribeVpcEndpointConnectionNotificationsResponse]
readsPrec :: Int -> ReadS DescribeVpcEndpointConnectionNotificationsResponse
$creadsPrec :: Int -> ReadS DescribeVpcEndpointConnectionNotificationsResponse
Prelude.Read, Int -> DescribeVpcEndpointConnectionNotificationsResponse -> ShowS
[DescribeVpcEndpointConnectionNotificationsResponse] -> ShowS
DescribeVpcEndpointConnectionNotificationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVpcEndpointConnectionNotificationsResponse] -> ShowS
$cshowList :: [DescribeVpcEndpointConnectionNotificationsResponse] -> ShowS
show :: DescribeVpcEndpointConnectionNotificationsResponse -> String
$cshow :: DescribeVpcEndpointConnectionNotificationsResponse -> String
showsPrec :: Int -> DescribeVpcEndpointConnectionNotificationsResponse -> ShowS
$cshowsPrec :: Int -> DescribeVpcEndpointConnectionNotificationsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeVpcEndpointConnectionNotificationsResponse x
-> DescribeVpcEndpointConnectionNotificationsResponse
forall x.
DescribeVpcEndpointConnectionNotificationsResponse
-> Rep DescribeVpcEndpointConnectionNotificationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeVpcEndpointConnectionNotificationsResponse x
-> DescribeVpcEndpointConnectionNotificationsResponse
$cfrom :: forall x.
DescribeVpcEndpointConnectionNotificationsResponse
-> Rep DescribeVpcEndpointConnectionNotificationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVpcEndpointConnectionNotificationsResponse' 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:
--
-- 'connectionNotificationSet', 'describeVpcEndpointConnectionNotificationsResponse_connectionNotificationSet' - One or more notifications.
--
-- 'nextToken', 'describeVpcEndpointConnectionNotificationsResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
--
-- 'httpStatus', 'describeVpcEndpointConnectionNotificationsResponse_httpStatus' - The response's http status code.
newDescribeVpcEndpointConnectionNotificationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeVpcEndpointConnectionNotificationsResponse
newDescribeVpcEndpointConnectionNotificationsResponse :: Int -> DescribeVpcEndpointConnectionNotificationsResponse
newDescribeVpcEndpointConnectionNotificationsResponse
  Int
pHttpStatus_ =
    DescribeVpcEndpointConnectionNotificationsResponse'
      { $sel:connectionNotificationSet:DescribeVpcEndpointConnectionNotificationsResponse' :: Maybe [ConnectionNotification]
connectionNotificationSet =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeVpcEndpointConnectionNotificationsResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeVpcEndpointConnectionNotificationsResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | One or more notifications.
describeVpcEndpointConnectionNotificationsResponse_connectionNotificationSet :: Lens.Lens' DescribeVpcEndpointConnectionNotificationsResponse (Prelude.Maybe [ConnectionNotification])
describeVpcEndpointConnectionNotificationsResponse_connectionNotificationSet :: Lens'
  DescribeVpcEndpointConnectionNotificationsResponse
  (Maybe [ConnectionNotification])
describeVpcEndpointConnectionNotificationsResponse_connectionNotificationSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointConnectionNotificationsResponse' {Maybe [ConnectionNotification]
connectionNotificationSet :: Maybe [ConnectionNotification]
$sel:connectionNotificationSet:DescribeVpcEndpointConnectionNotificationsResponse' :: DescribeVpcEndpointConnectionNotificationsResponse
-> Maybe [ConnectionNotification]
connectionNotificationSet} -> Maybe [ConnectionNotification]
connectionNotificationSet) (\s :: DescribeVpcEndpointConnectionNotificationsResponse
s@DescribeVpcEndpointConnectionNotificationsResponse' {} Maybe [ConnectionNotification]
a -> DescribeVpcEndpointConnectionNotificationsResponse
s {$sel:connectionNotificationSet:DescribeVpcEndpointConnectionNotificationsResponse' :: Maybe [ConnectionNotification]
connectionNotificationSet = Maybe [ConnectionNotification]
a} :: DescribeVpcEndpointConnectionNotificationsResponse) 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 token to use to retrieve the next page of results. This value is
-- @null@ when there are no more results to return.
describeVpcEndpointConnectionNotificationsResponse_nextToken :: Lens.Lens' DescribeVpcEndpointConnectionNotificationsResponse (Prelude.Maybe Prelude.Text)
describeVpcEndpointConnectionNotificationsResponse_nextToken :: Lens'
  DescribeVpcEndpointConnectionNotificationsResponse (Maybe Text)
describeVpcEndpointConnectionNotificationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointConnectionNotificationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeVpcEndpointConnectionNotificationsResponse' :: DescribeVpcEndpointConnectionNotificationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeVpcEndpointConnectionNotificationsResponse
s@DescribeVpcEndpointConnectionNotificationsResponse' {} Maybe Text
a -> DescribeVpcEndpointConnectionNotificationsResponse
s {$sel:nextToken:DescribeVpcEndpointConnectionNotificationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeVpcEndpointConnectionNotificationsResponse)

-- | The response's http status code.
describeVpcEndpointConnectionNotificationsResponse_httpStatus :: Lens.Lens' DescribeVpcEndpointConnectionNotificationsResponse Prelude.Int
describeVpcEndpointConnectionNotificationsResponse_httpStatus :: Lens' DescribeVpcEndpointConnectionNotificationsResponse Int
describeVpcEndpointConnectionNotificationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointConnectionNotificationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeVpcEndpointConnectionNotificationsResponse' :: DescribeVpcEndpointConnectionNotificationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeVpcEndpointConnectionNotificationsResponse
s@DescribeVpcEndpointConnectionNotificationsResponse' {} Int
a -> DescribeVpcEndpointConnectionNotificationsResponse
s {$sel:httpStatus:DescribeVpcEndpointConnectionNotificationsResponse' :: Int
httpStatus = Int
a} :: DescribeVpcEndpointConnectionNotificationsResponse)

instance
  Prelude.NFData
    DescribeVpcEndpointConnectionNotificationsResponse
  where
  rnf :: DescribeVpcEndpointConnectionNotificationsResponse -> ()
rnf
    DescribeVpcEndpointConnectionNotificationsResponse' {Int
Maybe [ConnectionNotification]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
connectionNotificationSet :: Maybe [ConnectionNotification]
$sel:httpStatus:DescribeVpcEndpointConnectionNotificationsResponse' :: DescribeVpcEndpointConnectionNotificationsResponse -> Int
$sel:nextToken:DescribeVpcEndpointConnectionNotificationsResponse' :: DescribeVpcEndpointConnectionNotificationsResponse -> Maybe Text
$sel:connectionNotificationSet:DescribeVpcEndpointConnectionNotificationsResponse' :: DescribeVpcEndpointConnectionNotificationsResponse
-> Maybe [ConnectionNotification]
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe [ConnectionNotification]
connectionNotificationSet
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus