{-# 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.DescribeVpcEndpoints
-- 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 VPC endpoints.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeVpcEndpoints
  ( -- * Creating a Request
    DescribeVpcEndpoints (..),
    newDescribeVpcEndpoints,

    -- * Request Lenses
    describeVpcEndpoints_dryRun,
    describeVpcEndpoints_filters,
    describeVpcEndpoints_maxResults,
    describeVpcEndpoints_nextToken,
    describeVpcEndpoints_vpcEndpointIds,

    -- * Destructuring the Response
    DescribeVpcEndpointsResponse (..),
    newDescribeVpcEndpointsResponse,

    -- * Response Lenses
    describeVpcEndpointsResponse_nextToken,
    describeVpcEndpointsResponse_vpcEndpoints,
    describeVpcEndpointsResponse_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 DescribeVpcEndpoints.
--
-- /See:/ 'newDescribeVpcEndpoints' smart constructor.
data DescribeVpcEndpoints = DescribeVpcEndpoints'
  { -- | 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@.
    DescribeVpcEndpoints -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @ip-address-type@ - The IP address type (@ipv4@ | @ipv6@).
    --
    -- -   @service-name@ - The name of the service.
    --
    -- -   @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.
    --
    -- -   @vpc-id@ - The ID of the VPC in which the endpoint resides.
    --
    -- -   @vpc-endpoint-id@ - The ID of the endpoint.
    --
    -- -   @vpc-endpoint-state@ - The state of the endpoint
    --     (@pendingAcceptance@ | @pending@ | @available@ | @deleting@ |
    --     @deleted@ | @rejected@ | @failed@).
    --
    -- -   @vpc-endpoint-type@ - The type of VPC endpoint (@Interface@ |
    --     @Gateway@ | @GatewayLoadBalancer@).
    DescribeVpcEndpoints -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of items to return for this request. The request
    -- returns a token that you can specify in a subsequent call to get the
    -- next set of results.
    --
    -- Constraint: If the value is greater than 1,000, we return only 1,000
    -- items.
    DescribeVpcEndpoints -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | The token for the next set of items to return. (You received this token
    -- from a prior call.)
    DescribeVpcEndpoints -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | One or more endpoint IDs.
    DescribeVpcEndpoints -> Maybe [Text]
vpcEndpointIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeVpcEndpoints -> DescribeVpcEndpoints -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVpcEndpoints -> DescribeVpcEndpoints -> Bool
$c/= :: DescribeVpcEndpoints -> DescribeVpcEndpoints -> Bool
== :: DescribeVpcEndpoints -> DescribeVpcEndpoints -> Bool
$c== :: DescribeVpcEndpoints -> DescribeVpcEndpoints -> Bool
Prelude.Eq, ReadPrec [DescribeVpcEndpoints]
ReadPrec DescribeVpcEndpoints
Int -> ReadS DescribeVpcEndpoints
ReadS [DescribeVpcEndpoints]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVpcEndpoints]
$creadListPrec :: ReadPrec [DescribeVpcEndpoints]
readPrec :: ReadPrec DescribeVpcEndpoints
$creadPrec :: ReadPrec DescribeVpcEndpoints
readList :: ReadS [DescribeVpcEndpoints]
$creadList :: ReadS [DescribeVpcEndpoints]
readsPrec :: Int -> ReadS DescribeVpcEndpoints
$creadsPrec :: Int -> ReadS DescribeVpcEndpoints
Prelude.Read, Int -> DescribeVpcEndpoints -> ShowS
[DescribeVpcEndpoints] -> ShowS
DescribeVpcEndpoints -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVpcEndpoints] -> ShowS
$cshowList :: [DescribeVpcEndpoints] -> ShowS
show :: DescribeVpcEndpoints -> String
$cshow :: DescribeVpcEndpoints -> String
showsPrec :: Int -> DescribeVpcEndpoints -> ShowS
$cshowsPrec :: Int -> DescribeVpcEndpoints -> ShowS
Prelude.Show, forall x. Rep DescribeVpcEndpoints x -> DescribeVpcEndpoints
forall x. DescribeVpcEndpoints -> Rep DescribeVpcEndpoints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeVpcEndpoints x -> DescribeVpcEndpoints
$cfrom :: forall x. DescribeVpcEndpoints -> Rep DescribeVpcEndpoints x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVpcEndpoints' 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', 'describeVpcEndpoints_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', 'describeVpcEndpoints_filters' - One or more filters.
--
-- -   @ip-address-type@ - The IP address type (@ipv4@ | @ipv6@).
--
-- -   @service-name@ - The name of the service.
--
-- -   @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.
--
-- -   @vpc-id@ - The ID of the VPC in which the endpoint resides.
--
-- -   @vpc-endpoint-id@ - The ID of the endpoint.
--
-- -   @vpc-endpoint-state@ - The state of the endpoint
--     (@pendingAcceptance@ | @pending@ | @available@ | @deleting@ |
--     @deleted@ | @rejected@ | @failed@).
--
-- -   @vpc-endpoint-type@ - The type of VPC endpoint (@Interface@ |
--     @Gateway@ | @GatewayLoadBalancer@).
--
-- 'maxResults', 'describeVpcEndpoints_maxResults' - The maximum number of items to return for this request. The request
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
--
-- Constraint: If the value is greater than 1,000, we return only 1,000
-- items.
--
-- 'nextToken', 'describeVpcEndpoints_nextToken' - The token for the next set of items to return. (You received this token
-- from a prior call.)
--
-- 'vpcEndpointIds', 'describeVpcEndpoints_vpcEndpointIds' - One or more endpoint IDs.
newDescribeVpcEndpoints ::
  DescribeVpcEndpoints
newDescribeVpcEndpoints :: DescribeVpcEndpoints
newDescribeVpcEndpoints =
  DescribeVpcEndpoints'
    { $sel:dryRun:DescribeVpcEndpoints' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeVpcEndpoints' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeVpcEndpoints' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeVpcEndpoints' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:vpcEndpointIds:DescribeVpcEndpoints' :: Maybe [Text]
vpcEndpointIds = 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@.
describeVpcEndpoints_dryRun :: Lens.Lens' DescribeVpcEndpoints (Prelude.Maybe Prelude.Bool)
describeVpcEndpoints_dryRun :: Lens' DescribeVpcEndpoints (Maybe Bool)
describeVpcEndpoints_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpoints' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeVpcEndpoints
s@DescribeVpcEndpoints' {} Maybe Bool
a -> DescribeVpcEndpoints
s {$sel:dryRun:DescribeVpcEndpoints' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeVpcEndpoints)

-- | One or more filters.
--
-- -   @ip-address-type@ - The IP address type (@ipv4@ | @ipv6@).
--
-- -   @service-name@ - The name of the service.
--
-- -   @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.
--
-- -   @vpc-id@ - The ID of the VPC in which the endpoint resides.
--
-- -   @vpc-endpoint-id@ - The ID of the endpoint.
--
-- -   @vpc-endpoint-state@ - The state of the endpoint
--     (@pendingAcceptance@ | @pending@ | @available@ | @deleting@ |
--     @deleted@ | @rejected@ | @failed@).
--
-- -   @vpc-endpoint-type@ - The type of VPC endpoint (@Interface@ |
--     @Gateway@ | @GatewayLoadBalancer@).
describeVpcEndpoints_filters :: Lens.Lens' DescribeVpcEndpoints (Prelude.Maybe [Filter])
describeVpcEndpoints_filters :: Lens' DescribeVpcEndpoints (Maybe [Filter])
describeVpcEndpoints_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpoints' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeVpcEndpoints
s@DescribeVpcEndpoints' {} Maybe [Filter]
a -> DescribeVpcEndpoints
s {$sel:filters:DescribeVpcEndpoints' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeVpcEndpoints) 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 items to return for this request. The request
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
--
-- Constraint: If the value is greater than 1,000, we return only 1,000
-- items.
describeVpcEndpoints_maxResults :: Lens.Lens' DescribeVpcEndpoints (Prelude.Maybe Prelude.Int)
describeVpcEndpoints_maxResults :: Lens' DescribeVpcEndpoints (Maybe Int)
describeVpcEndpoints_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpoints' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeVpcEndpoints
s@DescribeVpcEndpoints' {} Maybe Int
a -> DescribeVpcEndpoints
s {$sel:maxResults:DescribeVpcEndpoints' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeVpcEndpoints)

-- | The token for the next set of items to return. (You received this token
-- from a prior call.)
describeVpcEndpoints_nextToken :: Lens.Lens' DescribeVpcEndpoints (Prelude.Maybe Prelude.Text)
describeVpcEndpoints_nextToken :: Lens' DescribeVpcEndpoints (Maybe Text)
describeVpcEndpoints_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpoints' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeVpcEndpoints
s@DescribeVpcEndpoints' {} Maybe Text
a -> DescribeVpcEndpoints
s {$sel:nextToken:DescribeVpcEndpoints' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeVpcEndpoints)

-- | One or more endpoint IDs.
describeVpcEndpoints_vpcEndpointIds :: Lens.Lens' DescribeVpcEndpoints (Prelude.Maybe [Prelude.Text])
describeVpcEndpoints_vpcEndpointIds :: Lens' DescribeVpcEndpoints (Maybe [Text])
describeVpcEndpoints_vpcEndpointIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpoints' {Maybe [Text]
vpcEndpointIds :: Maybe [Text]
$sel:vpcEndpointIds:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe [Text]
vpcEndpointIds} -> Maybe [Text]
vpcEndpointIds) (\s :: DescribeVpcEndpoints
s@DescribeVpcEndpoints' {} Maybe [Text]
a -> DescribeVpcEndpoints
s {$sel:vpcEndpointIds:DescribeVpcEndpoints' :: Maybe [Text]
vpcEndpointIds = Maybe [Text]
a} :: DescribeVpcEndpoints) 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.AWSPager DescribeVpcEndpoints where
  page :: DescribeVpcEndpoints
-> AWSResponse DescribeVpcEndpoints -> Maybe DescribeVpcEndpoints
page DescribeVpcEndpoints
rq AWSResponse DescribeVpcEndpoints
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeVpcEndpoints
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeVpcEndpointsResponse (Maybe Text)
describeVpcEndpointsResponse_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 DescribeVpcEndpoints
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeVpcEndpointsResponse (Maybe [VpcEndpoint])
describeVpcEndpointsResponse_vpcEndpoints
            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.$ DescribeVpcEndpoints
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeVpcEndpoints (Maybe Text)
describeVpcEndpoints_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeVpcEndpoints
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeVpcEndpointsResponse (Maybe Text)
describeVpcEndpointsResponse_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 DescribeVpcEndpoints where
  type
    AWSResponse DescribeVpcEndpoints =
      DescribeVpcEndpointsResponse
  request :: (Service -> Service)
-> DescribeVpcEndpoints -> Request DescribeVpcEndpoints
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 DescribeVpcEndpoints
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeVpcEndpoints)))
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 Text
-> Maybe [VpcEndpoint] -> Int -> DescribeVpcEndpointsResponse
DescribeVpcEndpointsResponse'
            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
"nextToken")
            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
"vpcEndpointSet"
                            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 DescribeVpcEndpoints where
  hashWithSalt :: Int -> DescribeVpcEndpoints -> Int
hashWithSalt Int
_salt DescribeVpcEndpoints' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Filter]
Maybe Text
vpcEndpointIds :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:vpcEndpointIds:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe [Text]
$sel:nextToken:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe Text
$sel:maxResults:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe Int
$sel:filters:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe [Filter]
$sel:dryRun:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> 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 Int
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
vpcEndpointIds

instance Prelude.NFData DescribeVpcEndpoints where
  rnf :: DescribeVpcEndpoints -> ()
rnf DescribeVpcEndpoints' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Filter]
Maybe Text
vpcEndpointIds :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:vpcEndpointIds:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe [Text]
$sel:nextToken:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe Text
$sel:maxResults:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe Int
$sel:filters:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe [Filter]
$sel:dryRun:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> 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 Int
maxResults
      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 Maybe [Text]
vpcEndpointIds

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

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

instance Data.ToQuery DescribeVpcEndpoints where
  toQuery :: DescribeVpcEndpoints -> QueryString
toQuery DescribeVpcEndpoints' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Filter]
Maybe Text
vpcEndpointIds :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:vpcEndpointIds:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe [Text]
$sel:nextToken:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe Text
$sel:maxResults:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe Int
$sel:filters:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe [Filter]
$sel:dryRun:DescribeVpcEndpoints' :: DescribeVpcEndpoints -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DescribeVpcEndpoints" :: 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),
        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,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"VpcEndpointId"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
vpcEndpointIds
          )
      ]

-- | Contains the output of DescribeVpcEndpoints.
--
-- /See:/ 'newDescribeVpcEndpointsResponse' smart constructor.
data DescribeVpcEndpointsResponse = DescribeVpcEndpointsResponse'
  { -- | The token to use when requesting the next set of items. If there are no
    -- additional items to return, the string is empty.
    DescribeVpcEndpointsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the endpoints.
    DescribeVpcEndpointsResponse -> Maybe [VpcEndpoint]
vpcEndpoints :: Prelude.Maybe [VpcEndpoint],
    -- | The response's http status code.
    DescribeVpcEndpointsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeVpcEndpointsResponse
-> DescribeVpcEndpointsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVpcEndpointsResponse
-> DescribeVpcEndpointsResponse -> Bool
$c/= :: DescribeVpcEndpointsResponse
-> DescribeVpcEndpointsResponse -> Bool
== :: DescribeVpcEndpointsResponse
-> DescribeVpcEndpointsResponse -> Bool
$c== :: DescribeVpcEndpointsResponse
-> DescribeVpcEndpointsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeVpcEndpointsResponse]
ReadPrec DescribeVpcEndpointsResponse
Int -> ReadS DescribeVpcEndpointsResponse
ReadS [DescribeVpcEndpointsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVpcEndpointsResponse]
$creadListPrec :: ReadPrec [DescribeVpcEndpointsResponse]
readPrec :: ReadPrec DescribeVpcEndpointsResponse
$creadPrec :: ReadPrec DescribeVpcEndpointsResponse
readList :: ReadS [DescribeVpcEndpointsResponse]
$creadList :: ReadS [DescribeVpcEndpointsResponse]
readsPrec :: Int -> ReadS DescribeVpcEndpointsResponse
$creadsPrec :: Int -> ReadS DescribeVpcEndpointsResponse
Prelude.Read, Int -> DescribeVpcEndpointsResponse -> ShowS
[DescribeVpcEndpointsResponse] -> ShowS
DescribeVpcEndpointsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVpcEndpointsResponse] -> ShowS
$cshowList :: [DescribeVpcEndpointsResponse] -> ShowS
show :: DescribeVpcEndpointsResponse -> String
$cshow :: DescribeVpcEndpointsResponse -> String
showsPrec :: Int -> DescribeVpcEndpointsResponse -> ShowS
$cshowsPrec :: Int -> DescribeVpcEndpointsResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeVpcEndpointsResponse x -> DescribeVpcEndpointsResponse
forall x.
DescribeVpcEndpointsResponse -> Rep DescribeVpcEndpointsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeVpcEndpointsResponse x -> DescribeVpcEndpointsResponse
$cfrom :: forall x.
DescribeVpcEndpointsResponse -> Rep DescribeVpcEndpointsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVpcEndpointsResponse' 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:
--
-- 'nextToken', 'describeVpcEndpointsResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'vpcEndpoints', 'describeVpcEndpointsResponse_vpcEndpoints' - Information about the endpoints.
--
-- 'httpStatus', 'describeVpcEndpointsResponse_httpStatus' - The response's http status code.
newDescribeVpcEndpointsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeVpcEndpointsResponse
newDescribeVpcEndpointsResponse :: Int -> DescribeVpcEndpointsResponse
newDescribeVpcEndpointsResponse Int
pHttpStatus_ =
  DescribeVpcEndpointsResponse'
    { $sel:nextToken:DescribeVpcEndpointsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:vpcEndpoints:DescribeVpcEndpointsResponse' :: Maybe [VpcEndpoint]
vpcEndpoints = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeVpcEndpointsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
describeVpcEndpointsResponse_nextToken :: Lens.Lens' DescribeVpcEndpointsResponse (Prelude.Maybe Prelude.Text)
describeVpcEndpointsResponse_nextToken :: Lens' DescribeVpcEndpointsResponse (Maybe Text)
describeVpcEndpointsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeVpcEndpointsResponse' :: DescribeVpcEndpointsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeVpcEndpointsResponse
s@DescribeVpcEndpointsResponse' {} Maybe Text
a -> DescribeVpcEndpointsResponse
s {$sel:nextToken:DescribeVpcEndpointsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeVpcEndpointsResponse)

-- | Information about the endpoints.
describeVpcEndpointsResponse_vpcEndpoints :: Lens.Lens' DescribeVpcEndpointsResponse (Prelude.Maybe [VpcEndpoint])
describeVpcEndpointsResponse_vpcEndpoints :: Lens' DescribeVpcEndpointsResponse (Maybe [VpcEndpoint])
describeVpcEndpointsResponse_vpcEndpoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointsResponse' {Maybe [VpcEndpoint]
vpcEndpoints :: Maybe [VpcEndpoint]
$sel:vpcEndpoints:DescribeVpcEndpointsResponse' :: DescribeVpcEndpointsResponse -> Maybe [VpcEndpoint]
vpcEndpoints} -> Maybe [VpcEndpoint]
vpcEndpoints) (\s :: DescribeVpcEndpointsResponse
s@DescribeVpcEndpointsResponse' {} Maybe [VpcEndpoint]
a -> DescribeVpcEndpointsResponse
s {$sel:vpcEndpoints:DescribeVpcEndpointsResponse' :: Maybe [VpcEndpoint]
vpcEndpoints = Maybe [VpcEndpoint]
a} :: DescribeVpcEndpointsResponse) 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.
describeVpcEndpointsResponse_httpStatus :: Lens.Lens' DescribeVpcEndpointsResponse Prelude.Int
describeVpcEndpointsResponse_httpStatus :: Lens' DescribeVpcEndpointsResponse Int
describeVpcEndpointsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeVpcEndpointsResponse' :: DescribeVpcEndpointsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeVpcEndpointsResponse
s@DescribeVpcEndpointsResponse' {} Int
a -> DescribeVpcEndpointsResponse
s {$sel:httpStatus:DescribeVpcEndpointsResponse' :: Int
httpStatus = Int
a} :: DescribeVpcEndpointsResponse)

instance Prelude.NFData DescribeVpcEndpointsResponse where
  rnf :: DescribeVpcEndpointsResponse -> ()
rnf DescribeVpcEndpointsResponse' {Int
Maybe [VpcEndpoint]
Maybe Text
httpStatus :: Int
vpcEndpoints :: Maybe [VpcEndpoint]
nextToken :: Maybe Text
$sel:httpStatus:DescribeVpcEndpointsResponse' :: DescribeVpcEndpointsResponse -> Int
$sel:vpcEndpoints:DescribeVpcEndpointsResponse' :: DescribeVpcEndpointsResponse -> Maybe [VpcEndpoint]
$sel:nextToken:DescribeVpcEndpointsResponse' :: DescribeVpcEndpointsResponse -> Maybe Text
..} =
    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 Maybe [VpcEndpoint]
vpcEndpoints
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus