{-# 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.DescribeVpcEndpointServices
-- 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 available services to which you can create a VPC endpoint.
--
-- When the service provider and the consumer have different accounts in
-- multiple Availability Zones, and the consumer views the VPC endpoint
-- service information, the response only includes the common Availability
-- Zones. For example, when the service provider account uses @us-east-1a@
-- and @us-east-1c@ and the consumer uses @us-east-1a@ and @us-east-1b@,
-- the response includes the VPC endpoint services in the common
-- Availability Zone, @us-east-1a@.
--
-- This operation returns paginated results.
module Amazonka.EC2.DescribeVpcEndpointServices
  ( -- * Creating a Request
    DescribeVpcEndpointServices (..),
    newDescribeVpcEndpointServices,

    -- * Request Lenses
    describeVpcEndpointServices_dryRun,
    describeVpcEndpointServices_filters,
    describeVpcEndpointServices_maxResults,
    describeVpcEndpointServices_nextToken,
    describeVpcEndpointServices_serviceNames,

    -- * Destructuring the Response
    DescribeVpcEndpointServicesResponse (..),
    newDescribeVpcEndpointServicesResponse,

    -- * Response Lenses
    describeVpcEndpointServicesResponse_nextToken,
    describeVpcEndpointServicesResponse_serviceDetails,
    describeVpcEndpointServicesResponse_serviceNames,
    describeVpcEndpointServicesResponse_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 DescribeVpcEndpointServices.
--
-- /See:/ 'newDescribeVpcEndpointServices' smart constructor.
data DescribeVpcEndpointServices = DescribeVpcEndpointServices'
  { -- | 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@.
    DescribeVpcEndpointServices -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | One or more filters.
    --
    -- -   @owner@ - The ID or alias of the Amazon Web Services account that
    --     owns the service.
    --
    -- -   @service-name@ - The name of the service.
    --
    -- -   @service-type@ - The type of service (@Interface@ | @Gateway@ |
    --     @GatewayLoadBalancer@).
    --
    -- -   @supported-ip-address-types@ - The IP address type (@ipv4@ |
    --     @ipv6@).
    --
    -- -   @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.
    DescribeVpcEndpointServices -> 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.
    DescribeVpcEndpointServices -> 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.)
    DescribeVpcEndpointServices -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | One or more service names.
    DescribeVpcEndpointServices -> Maybe [Text]
serviceNames :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeVpcEndpointServices -> DescribeVpcEndpointServices -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVpcEndpointServices -> DescribeVpcEndpointServices -> Bool
$c/= :: DescribeVpcEndpointServices -> DescribeVpcEndpointServices -> Bool
== :: DescribeVpcEndpointServices -> DescribeVpcEndpointServices -> Bool
$c== :: DescribeVpcEndpointServices -> DescribeVpcEndpointServices -> Bool
Prelude.Eq, ReadPrec [DescribeVpcEndpointServices]
ReadPrec DescribeVpcEndpointServices
Int -> ReadS DescribeVpcEndpointServices
ReadS [DescribeVpcEndpointServices]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVpcEndpointServices]
$creadListPrec :: ReadPrec [DescribeVpcEndpointServices]
readPrec :: ReadPrec DescribeVpcEndpointServices
$creadPrec :: ReadPrec DescribeVpcEndpointServices
readList :: ReadS [DescribeVpcEndpointServices]
$creadList :: ReadS [DescribeVpcEndpointServices]
readsPrec :: Int -> ReadS DescribeVpcEndpointServices
$creadsPrec :: Int -> ReadS DescribeVpcEndpointServices
Prelude.Read, Int -> DescribeVpcEndpointServices -> ShowS
[DescribeVpcEndpointServices] -> ShowS
DescribeVpcEndpointServices -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVpcEndpointServices] -> ShowS
$cshowList :: [DescribeVpcEndpointServices] -> ShowS
show :: DescribeVpcEndpointServices -> String
$cshow :: DescribeVpcEndpointServices -> String
showsPrec :: Int -> DescribeVpcEndpointServices -> ShowS
$cshowsPrec :: Int -> DescribeVpcEndpointServices -> ShowS
Prelude.Show, forall x.
Rep DescribeVpcEndpointServices x -> DescribeVpcEndpointServices
forall x.
DescribeVpcEndpointServices -> Rep DescribeVpcEndpointServices x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeVpcEndpointServices x -> DescribeVpcEndpointServices
$cfrom :: forall x.
DescribeVpcEndpointServices -> Rep DescribeVpcEndpointServices x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVpcEndpointServices' 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', 'describeVpcEndpointServices_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', 'describeVpcEndpointServices_filters' - One or more filters.
--
-- -   @owner@ - The ID or alias of the Amazon Web Services account that
--     owns the service.
--
-- -   @service-name@ - The name of the service.
--
-- -   @service-type@ - The type of service (@Interface@ | @Gateway@ |
--     @GatewayLoadBalancer@).
--
-- -   @supported-ip-address-types@ - The IP address type (@ipv4@ |
--     @ipv6@).
--
-- -   @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.
--
-- 'maxResults', 'describeVpcEndpointServices_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', 'describeVpcEndpointServices_nextToken' - The token for the next set of items to return. (You received this token
-- from a prior call.)
--
-- 'serviceNames', 'describeVpcEndpointServices_serviceNames' - One or more service names.
newDescribeVpcEndpointServices ::
  DescribeVpcEndpointServices
newDescribeVpcEndpointServices :: DescribeVpcEndpointServices
newDescribeVpcEndpointServices =
  DescribeVpcEndpointServices'
    { $sel:dryRun:DescribeVpcEndpointServices' :: Maybe Bool
dryRun =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeVpcEndpointServices' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeVpcEndpointServices' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeVpcEndpointServices' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceNames:DescribeVpcEndpointServices' :: Maybe [Text]
serviceNames = 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@.
describeVpcEndpointServices_dryRun :: Lens.Lens' DescribeVpcEndpointServices (Prelude.Maybe Prelude.Bool)
describeVpcEndpointServices_dryRun :: Lens' DescribeVpcEndpointServices (Maybe Bool)
describeVpcEndpointServices_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointServices' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:DescribeVpcEndpointServices' :: DescribeVpcEndpointServices -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: DescribeVpcEndpointServices
s@DescribeVpcEndpointServices' {} Maybe Bool
a -> DescribeVpcEndpointServices
s {$sel:dryRun:DescribeVpcEndpointServices' :: Maybe Bool
dryRun = Maybe Bool
a} :: DescribeVpcEndpointServices)

-- | One or more filters.
--
-- -   @owner@ - The ID or alias of the Amazon Web Services account that
--     owns the service.
--
-- -   @service-name@ - The name of the service.
--
-- -   @service-type@ - The type of service (@Interface@ | @Gateway@ |
--     @GatewayLoadBalancer@).
--
-- -   @supported-ip-address-types@ - The IP address type (@ipv4@ |
--     @ipv6@).
--
-- -   @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.
describeVpcEndpointServices_filters :: Lens.Lens' DescribeVpcEndpointServices (Prelude.Maybe [Filter])
describeVpcEndpointServices_filters :: Lens' DescribeVpcEndpointServices (Maybe [Filter])
describeVpcEndpointServices_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointServices' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeVpcEndpointServices' :: DescribeVpcEndpointServices -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeVpcEndpointServices
s@DescribeVpcEndpointServices' {} Maybe [Filter]
a -> DescribeVpcEndpointServices
s {$sel:filters:DescribeVpcEndpointServices' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeVpcEndpointServices) 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.
describeVpcEndpointServices_maxResults :: Lens.Lens' DescribeVpcEndpointServices (Prelude.Maybe Prelude.Int)
describeVpcEndpointServices_maxResults :: Lens' DescribeVpcEndpointServices (Maybe Int)
describeVpcEndpointServices_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointServices' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:DescribeVpcEndpointServices' :: DescribeVpcEndpointServices -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: DescribeVpcEndpointServices
s@DescribeVpcEndpointServices' {} Maybe Int
a -> DescribeVpcEndpointServices
s {$sel:maxResults:DescribeVpcEndpointServices' :: Maybe Int
maxResults = Maybe Int
a} :: DescribeVpcEndpointServices)

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

-- | One or more service names.
describeVpcEndpointServices_serviceNames :: Lens.Lens' DescribeVpcEndpointServices (Prelude.Maybe [Prelude.Text])
describeVpcEndpointServices_serviceNames :: Lens' DescribeVpcEndpointServices (Maybe [Text])
describeVpcEndpointServices_serviceNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointServices' {Maybe [Text]
serviceNames :: Maybe [Text]
$sel:serviceNames:DescribeVpcEndpointServices' :: DescribeVpcEndpointServices -> Maybe [Text]
serviceNames} -> Maybe [Text]
serviceNames) (\s :: DescribeVpcEndpointServices
s@DescribeVpcEndpointServices' {} Maybe [Text]
a -> DescribeVpcEndpointServices
s {$sel:serviceNames:DescribeVpcEndpointServices' :: Maybe [Text]
serviceNames = Maybe [Text]
a} :: DescribeVpcEndpointServices) 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 DescribeVpcEndpointServices where
  page :: DescribeVpcEndpointServices
-> AWSResponse DescribeVpcEndpointServices
-> Maybe DescribeVpcEndpointServices
page DescribeVpcEndpointServices
rq AWSResponse DescribeVpcEndpointServices
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeVpcEndpointServices
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeVpcEndpointServicesResponse (Maybe Text)
describeVpcEndpointServicesResponse_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 DescribeVpcEndpointServices
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeVpcEndpointServicesResponse (Maybe [ServiceDetail])
describeVpcEndpointServicesResponse_serviceDetails
            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 DescribeVpcEndpointServices
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeVpcEndpointServicesResponse (Maybe [Text])
describeVpcEndpointServicesResponse_serviceNames
            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.$ DescribeVpcEndpointServices
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeVpcEndpointServices (Maybe Text)
describeVpcEndpointServices_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeVpcEndpointServices
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeVpcEndpointServicesResponse (Maybe Text)
describeVpcEndpointServicesResponse_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 DescribeVpcEndpointServices where
  type
    AWSResponse DescribeVpcEndpointServices =
      DescribeVpcEndpointServicesResponse
  request :: (Service -> Service)
-> DescribeVpcEndpointServices
-> Request DescribeVpcEndpointServices
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 DescribeVpcEndpointServices
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeVpcEndpointServices)))
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 [ServiceDetail]
-> Maybe [Text]
-> Int
-> DescribeVpcEndpointServicesResponse
DescribeVpcEndpointServicesResponse'
            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
"serviceDetailSet"
                            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
"serviceNameSet"
                            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 DescribeVpcEndpointServices where
  hashWithSalt :: Int -> DescribeVpcEndpointServices -> Int
hashWithSalt Int
_salt DescribeVpcEndpointServices' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe [Filter]
Maybe Text
serviceNames :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Int
filters :: Maybe [Filter]
dryRun :: Maybe Bool
$sel:serviceNames:DescribeVpcEndpointServices' :: DescribeVpcEndpointServices -> Maybe [Text]
$sel:nextToken:DescribeVpcEndpointServices' :: DescribeVpcEndpointServices -> Maybe Text
$sel:maxResults:DescribeVpcEndpointServices' :: DescribeVpcEndpointServices -> Maybe Int
$sel:filters:DescribeVpcEndpointServices' :: DescribeVpcEndpointServices -> Maybe [Filter]
$sel:dryRun:DescribeVpcEndpointServices' :: DescribeVpcEndpointServices -> 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]
serviceNames

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

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

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

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

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

-- |
-- Create a value of 'DescribeVpcEndpointServicesResponse' 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', 'describeVpcEndpointServicesResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'serviceDetails', 'describeVpcEndpointServicesResponse_serviceDetails' - Information about the service.
--
-- 'serviceNames', 'describeVpcEndpointServicesResponse_serviceNames' - A list of supported services.
--
-- 'httpStatus', 'describeVpcEndpointServicesResponse_httpStatus' - The response's http status code.
newDescribeVpcEndpointServicesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeVpcEndpointServicesResponse
newDescribeVpcEndpointServicesResponse :: Int -> DescribeVpcEndpointServicesResponse
newDescribeVpcEndpointServicesResponse Int
pHttpStatus_ =
  DescribeVpcEndpointServicesResponse'
    { $sel:nextToken:DescribeVpcEndpointServicesResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:serviceDetails:DescribeVpcEndpointServicesResponse' :: Maybe [ServiceDetail]
serviceDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceNames:DescribeVpcEndpointServicesResponse' :: Maybe [Text]
serviceNames = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeVpcEndpointServicesResponse' :: 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.
describeVpcEndpointServicesResponse_nextToken :: Lens.Lens' DescribeVpcEndpointServicesResponse (Prelude.Maybe Prelude.Text)
describeVpcEndpointServicesResponse_nextToken :: Lens' DescribeVpcEndpointServicesResponse (Maybe Text)
describeVpcEndpointServicesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointServicesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeVpcEndpointServicesResponse' :: DescribeVpcEndpointServicesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeVpcEndpointServicesResponse
s@DescribeVpcEndpointServicesResponse' {} Maybe Text
a -> DescribeVpcEndpointServicesResponse
s {$sel:nextToken:DescribeVpcEndpointServicesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeVpcEndpointServicesResponse)

-- | Information about the service.
describeVpcEndpointServicesResponse_serviceDetails :: Lens.Lens' DescribeVpcEndpointServicesResponse (Prelude.Maybe [ServiceDetail])
describeVpcEndpointServicesResponse_serviceDetails :: Lens' DescribeVpcEndpointServicesResponse (Maybe [ServiceDetail])
describeVpcEndpointServicesResponse_serviceDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointServicesResponse' {Maybe [ServiceDetail]
serviceDetails :: Maybe [ServiceDetail]
$sel:serviceDetails:DescribeVpcEndpointServicesResponse' :: DescribeVpcEndpointServicesResponse -> Maybe [ServiceDetail]
serviceDetails} -> Maybe [ServiceDetail]
serviceDetails) (\s :: DescribeVpcEndpointServicesResponse
s@DescribeVpcEndpointServicesResponse' {} Maybe [ServiceDetail]
a -> DescribeVpcEndpointServicesResponse
s {$sel:serviceDetails:DescribeVpcEndpointServicesResponse' :: Maybe [ServiceDetail]
serviceDetails = Maybe [ServiceDetail]
a} :: DescribeVpcEndpointServicesResponse) 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

-- | A list of supported services.
describeVpcEndpointServicesResponse_serviceNames :: Lens.Lens' DescribeVpcEndpointServicesResponse (Prelude.Maybe [Prelude.Text])
describeVpcEndpointServicesResponse_serviceNames :: Lens' DescribeVpcEndpointServicesResponse (Maybe [Text])
describeVpcEndpointServicesResponse_serviceNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointServicesResponse' {Maybe [Text]
serviceNames :: Maybe [Text]
$sel:serviceNames:DescribeVpcEndpointServicesResponse' :: DescribeVpcEndpointServicesResponse -> Maybe [Text]
serviceNames} -> Maybe [Text]
serviceNames) (\s :: DescribeVpcEndpointServicesResponse
s@DescribeVpcEndpointServicesResponse' {} Maybe [Text]
a -> DescribeVpcEndpointServicesResponse
s {$sel:serviceNames:DescribeVpcEndpointServicesResponse' :: Maybe [Text]
serviceNames = Maybe [Text]
a} :: DescribeVpcEndpointServicesResponse) 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.
describeVpcEndpointServicesResponse_httpStatus :: Lens.Lens' DescribeVpcEndpointServicesResponse Prelude.Int
describeVpcEndpointServicesResponse_httpStatus :: Lens' DescribeVpcEndpointServicesResponse Int
describeVpcEndpointServicesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVpcEndpointServicesResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeVpcEndpointServicesResponse' :: DescribeVpcEndpointServicesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeVpcEndpointServicesResponse
s@DescribeVpcEndpointServicesResponse' {} Int
a -> DescribeVpcEndpointServicesResponse
s {$sel:httpStatus:DescribeVpcEndpointServicesResponse' :: Int
httpStatus = Int
a} :: DescribeVpcEndpointServicesResponse)

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