{-# 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.CreateVpcEndpointServiceConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a VPC endpoint service to which service consumers (Amazon Web
-- Services accounts, IAM users, and IAM roles) can connect.
--
-- Before you create an endpoint service, you must create one of the
-- following for your service:
--
-- -   A
--     <https://docs.aws.amazon.com/elasticloadbalancing/latest/network/ Network Load Balancer>.
--     Service consumers connect to your service using an interface
--     endpoint.
--
-- -   A
--     <https://docs.aws.amazon.com/elasticloadbalancing/latest/gateway/ Gateway Load Balancer>.
--     Service consumers connect to your service using a Gateway Load
--     Balancer endpoint.
--
-- If you set the private DNS name, you must prove that you own the private
-- DNS domain name.
--
-- For more information, see the
-- <https://docs.aws.amazon.com/vpc/latest/privatelink/ Amazon Web Services PrivateLink Guide>.
module Amazonka.EC2.CreateVpcEndpointServiceConfiguration
  ( -- * Creating a Request
    CreateVpcEndpointServiceConfiguration (..),
    newCreateVpcEndpointServiceConfiguration,

    -- * Request Lenses
    createVpcEndpointServiceConfiguration_acceptanceRequired,
    createVpcEndpointServiceConfiguration_clientToken,
    createVpcEndpointServiceConfiguration_dryRun,
    createVpcEndpointServiceConfiguration_gatewayLoadBalancerArns,
    createVpcEndpointServiceConfiguration_networkLoadBalancerArns,
    createVpcEndpointServiceConfiguration_privateDnsName,
    createVpcEndpointServiceConfiguration_supportedIpAddressTypes,
    createVpcEndpointServiceConfiguration_tagSpecifications,

    -- * Destructuring the Response
    CreateVpcEndpointServiceConfigurationResponse (..),
    newCreateVpcEndpointServiceConfigurationResponse,

    -- * Response Lenses
    createVpcEndpointServiceConfigurationResponse_clientToken,
    createVpcEndpointServiceConfigurationResponse_serviceConfiguration,
    createVpcEndpointServiceConfigurationResponse_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:/ 'newCreateVpcEndpointServiceConfiguration' smart constructor.
data CreateVpcEndpointServiceConfiguration = CreateVpcEndpointServiceConfiguration'
  { -- | Indicates whether requests from service consumers to create an endpoint
    -- to your service must be accepted manually.
    CreateVpcEndpointServiceConfiguration -> Maybe Bool
acceptanceRequired :: Prelude.Maybe Prelude.Bool,
    -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html How to ensure idempotency>.
    CreateVpcEndpointServiceConfiguration -> Maybe Text
clientToken :: 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@.
    CreateVpcEndpointServiceConfiguration -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Resource Names (ARNs) of one or more Gateway Load Balancers.
    CreateVpcEndpointServiceConfiguration -> Maybe [Text]
gatewayLoadBalancerArns :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon Resource Names (ARNs) of one or more Network Load Balancers
    -- for your service.
    CreateVpcEndpointServiceConfiguration -> Maybe [Text]
networkLoadBalancerArns :: Prelude.Maybe [Prelude.Text],
    -- | (Interface endpoint configuration) The private DNS name to assign to the
    -- VPC endpoint service.
    CreateVpcEndpointServiceConfiguration -> Maybe Text
privateDnsName :: Prelude.Maybe Prelude.Text,
    -- | The supported IP address types. The possible values are @ipv4@ and
    -- @ipv6@.
    CreateVpcEndpointServiceConfiguration -> Maybe [Text]
supportedIpAddressTypes :: Prelude.Maybe [Prelude.Text],
    -- | The tags to associate with the service.
    CreateVpcEndpointServiceConfiguration -> Maybe [TagSpecification]
tagSpecifications :: Prelude.Maybe [TagSpecification]
  }
  deriving (CreateVpcEndpointServiceConfiguration
-> CreateVpcEndpointServiceConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcEndpointServiceConfiguration
-> CreateVpcEndpointServiceConfiguration -> Bool
$c/= :: CreateVpcEndpointServiceConfiguration
-> CreateVpcEndpointServiceConfiguration -> Bool
== :: CreateVpcEndpointServiceConfiguration
-> CreateVpcEndpointServiceConfiguration -> Bool
$c== :: CreateVpcEndpointServiceConfiguration
-> CreateVpcEndpointServiceConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateVpcEndpointServiceConfiguration]
ReadPrec CreateVpcEndpointServiceConfiguration
Int -> ReadS CreateVpcEndpointServiceConfiguration
ReadS [CreateVpcEndpointServiceConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcEndpointServiceConfiguration]
$creadListPrec :: ReadPrec [CreateVpcEndpointServiceConfiguration]
readPrec :: ReadPrec CreateVpcEndpointServiceConfiguration
$creadPrec :: ReadPrec CreateVpcEndpointServiceConfiguration
readList :: ReadS [CreateVpcEndpointServiceConfiguration]
$creadList :: ReadS [CreateVpcEndpointServiceConfiguration]
readsPrec :: Int -> ReadS CreateVpcEndpointServiceConfiguration
$creadsPrec :: Int -> ReadS CreateVpcEndpointServiceConfiguration
Prelude.Read, Int -> CreateVpcEndpointServiceConfiguration -> ShowS
[CreateVpcEndpointServiceConfiguration] -> ShowS
CreateVpcEndpointServiceConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcEndpointServiceConfiguration] -> ShowS
$cshowList :: [CreateVpcEndpointServiceConfiguration] -> ShowS
show :: CreateVpcEndpointServiceConfiguration -> String
$cshow :: CreateVpcEndpointServiceConfiguration -> String
showsPrec :: Int -> CreateVpcEndpointServiceConfiguration -> ShowS
$cshowsPrec :: Int -> CreateVpcEndpointServiceConfiguration -> ShowS
Prelude.Show, forall x.
Rep CreateVpcEndpointServiceConfiguration x
-> CreateVpcEndpointServiceConfiguration
forall x.
CreateVpcEndpointServiceConfiguration
-> Rep CreateVpcEndpointServiceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVpcEndpointServiceConfiguration x
-> CreateVpcEndpointServiceConfiguration
$cfrom :: forall x.
CreateVpcEndpointServiceConfiguration
-> Rep CreateVpcEndpointServiceConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreateVpcEndpointServiceConfiguration' 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:
--
-- 'acceptanceRequired', 'createVpcEndpointServiceConfiguration_acceptanceRequired' - Indicates whether requests from service consumers to create an endpoint
-- to your service must be accepted manually.
--
-- 'clientToken', 'createVpcEndpointServiceConfiguration_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html How to ensure idempotency>.
--
-- 'dryRun', 'createVpcEndpointServiceConfiguration_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@.
--
-- 'gatewayLoadBalancerArns', 'createVpcEndpointServiceConfiguration_gatewayLoadBalancerArns' - The Amazon Resource Names (ARNs) of one or more Gateway Load Balancers.
--
-- 'networkLoadBalancerArns', 'createVpcEndpointServiceConfiguration_networkLoadBalancerArns' - The Amazon Resource Names (ARNs) of one or more Network Load Balancers
-- for your service.
--
-- 'privateDnsName', 'createVpcEndpointServiceConfiguration_privateDnsName' - (Interface endpoint configuration) The private DNS name to assign to the
-- VPC endpoint service.
--
-- 'supportedIpAddressTypes', 'createVpcEndpointServiceConfiguration_supportedIpAddressTypes' - The supported IP address types. The possible values are @ipv4@ and
-- @ipv6@.
--
-- 'tagSpecifications', 'createVpcEndpointServiceConfiguration_tagSpecifications' - The tags to associate with the service.
newCreateVpcEndpointServiceConfiguration ::
  CreateVpcEndpointServiceConfiguration
newCreateVpcEndpointServiceConfiguration :: CreateVpcEndpointServiceConfiguration
newCreateVpcEndpointServiceConfiguration =
  CreateVpcEndpointServiceConfiguration'
    { $sel:acceptanceRequired:CreateVpcEndpointServiceConfiguration' :: Maybe Bool
acceptanceRequired =
        forall a. Maybe a
Prelude.Nothing,
      $sel:clientToken:CreateVpcEndpointServiceConfiguration' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
      $sel:dryRun:CreateVpcEndpointServiceConfiguration' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
      $sel:gatewayLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: Maybe [Text]
gatewayLoadBalancerArns =
        forall a. Maybe a
Prelude.Nothing,
      $sel:networkLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: Maybe [Text]
networkLoadBalancerArns =
        forall a. Maybe a
Prelude.Nothing,
      $sel:privateDnsName:CreateVpcEndpointServiceConfiguration' :: Maybe Text
privateDnsName = forall a. Maybe a
Prelude.Nothing,
      $sel:supportedIpAddressTypes:CreateVpcEndpointServiceConfiguration' :: Maybe [Text]
supportedIpAddressTypes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:tagSpecifications:CreateVpcEndpointServiceConfiguration' :: Maybe [TagSpecification]
tagSpecifications = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether requests from service consumers to create an endpoint
-- to your service must be accepted manually.
createVpcEndpointServiceConfiguration_acceptanceRequired :: Lens.Lens' CreateVpcEndpointServiceConfiguration (Prelude.Maybe Prelude.Bool)
createVpcEndpointServiceConfiguration_acceptanceRequired :: Lens' CreateVpcEndpointServiceConfiguration (Maybe Bool)
createVpcEndpointServiceConfiguration_acceptanceRequired = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointServiceConfiguration' {Maybe Bool
acceptanceRequired :: Maybe Bool
$sel:acceptanceRequired:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Bool
acceptanceRequired} -> Maybe Bool
acceptanceRequired) (\s :: CreateVpcEndpointServiceConfiguration
s@CreateVpcEndpointServiceConfiguration' {} Maybe Bool
a -> CreateVpcEndpointServiceConfiguration
s {$sel:acceptanceRequired:CreateVpcEndpointServiceConfiguration' :: Maybe Bool
acceptanceRequired = Maybe Bool
a} :: CreateVpcEndpointServiceConfiguration)

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html How to ensure idempotency>.
createVpcEndpointServiceConfiguration_clientToken :: Lens.Lens' CreateVpcEndpointServiceConfiguration (Prelude.Maybe Prelude.Text)
createVpcEndpointServiceConfiguration_clientToken :: Lens' CreateVpcEndpointServiceConfiguration (Maybe Text)
createVpcEndpointServiceConfiguration_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointServiceConfiguration' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateVpcEndpointServiceConfiguration
s@CreateVpcEndpointServiceConfiguration' {} Maybe Text
a -> CreateVpcEndpointServiceConfiguration
s {$sel:clientToken:CreateVpcEndpointServiceConfiguration' :: Maybe Text
clientToken = Maybe Text
a} :: CreateVpcEndpointServiceConfiguration)

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

-- | The Amazon Resource Names (ARNs) of one or more Gateway Load Balancers.
createVpcEndpointServiceConfiguration_gatewayLoadBalancerArns :: Lens.Lens' CreateVpcEndpointServiceConfiguration (Prelude.Maybe [Prelude.Text])
createVpcEndpointServiceConfiguration_gatewayLoadBalancerArns :: Lens' CreateVpcEndpointServiceConfiguration (Maybe [Text])
createVpcEndpointServiceConfiguration_gatewayLoadBalancerArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointServiceConfiguration' {Maybe [Text]
gatewayLoadBalancerArns :: Maybe [Text]
$sel:gatewayLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
gatewayLoadBalancerArns} -> Maybe [Text]
gatewayLoadBalancerArns) (\s :: CreateVpcEndpointServiceConfiguration
s@CreateVpcEndpointServiceConfiguration' {} Maybe [Text]
a -> CreateVpcEndpointServiceConfiguration
s {$sel:gatewayLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: Maybe [Text]
gatewayLoadBalancerArns = Maybe [Text]
a} :: CreateVpcEndpointServiceConfiguration) 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 Amazon Resource Names (ARNs) of one or more Network Load Balancers
-- for your service.
createVpcEndpointServiceConfiguration_networkLoadBalancerArns :: Lens.Lens' CreateVpcEndpointServiceConfiguration (Prelude.Maybe [Prelude.Text])
createVpcEndpointServiceConfiguration_networkLoadBalancerArns :: Lens' CreateVpcEndpointServiceConfiguration (Maybe [Text])
createVpcEndpointServiceConfiguration_networkLoadBalancerArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointServiceConfiguration' {Maybe [Text]
networkLoadBalancerArns :: Maybe [Text]
$sel:networkLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
networkLoadBalancerArns} -> Maybe [Text]
networkLoadBalancerArns) (\s :: CreateVpcEndpointServiceConfiguration
s@CreateVpcEndpointServiceConfiguration' {} Maybe [Text]
a -> CreateVpcEndpointServiceConfiguration
s {$sel:networkLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: Maybe [Text]
networkLoadBalancerArns = Maybe [Text]
a} :: CreateVpcEndpointServiceConfiguration) 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

-- | (Interface endpoint configuration) The private DNS name to assign to the
-- VPC endpoint service.
createVpcEndpointServiceConfiguration_privateDnsName :: Lens.Lens' CreateVpcEndpointServiceConfiguration (Prelude.Maybe Prelude.Text)
createVpcEndpointServiceConfiguration_privateDnsName :: Lens' CreateVpcEndpointServiceConfiguration (Maybe Text)
createVpcEndpointServiceConfiguration_privateDnsName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointServiceConfiguration' {Maybe Text
privateDnsName :: Maybe Text
$sel:privateDnsName:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Text
privateDnsName} -> Maybe Text
privateDnsName) (\s :: CreateVpcEndpointServiceConfiguration
s@CreateVpcEndpointServiceConfiguration' {} Maybe Text
a -> CreateVpcEndpointServiceConfiguration
s {$sel:privateDnsName:CreateVpcEndpointServiceConfiguration' :: Maybe Text
privateDnsName = Maybe Text
a} :: CreateVpcEndpointServiceConfiguration)

-- | The supported IP address types. The possible values are @ipv4@ and
-- @ipv6@.
createVpcEndpointServiceConfiguration_supportedIpAddressTypes :: Lens.Lens' CreateVpcEndpointServiceConfiguration (Prelude.Maybe [Prelude.Text])
createVpcEndpointServiceConfiguration_supportedIpAddressTypes :: Lens' CreateVpcEndpointServiceConfiguration (Maybe [Text])
createVpcEndpointServiceConfiguration_supportedIpAddressTypes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointServiceConfiguration' {Maybe [Text]
supportedIpAddressTypes :: Maybe [Text]
$sel:supportedIpAddressTypes:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
supportedIpAddressTypes} -> Maybe [Text]
supportedIpAddressTypes) (\s :: CreateVpcEndpointServiceConfiguration
s@CreateVpcEndpointServiceConfiguration' {} Maybe [Text]
a -> CreateVpcEndpointServiceConfiguration
s {$sel:supportedIpAddressTypes:CreateVpcEndpointServiceConfiguration' :: Maybe [Text]
supportedIpAddressTypes = Maybe [Text]
a} :: CreateVpcEndpointServiceConfiguration) 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 tags to associate with the service.
createVpcEndpointServiceConfiguration_tagSpecifications :: Lens.Lens' CreateVpcEndpointServiceConfiguration (Prelude.Maybe [TagSpecification])
createVpcEndpointServiceConfiguration_tagSpecifications :: Lens'
  CreateVpcEndpointServiceConfiguration (Maybe [TagSpecification])
createVpcEndpointServiceConfiguration_tagSpecifications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointServiceConfiguration' {Maybe [TagSpecification]
tagSpecifications :: Maybe [TagSpecification]
$sel:tagSpecifications:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [TagSpecification]
tagSpecifications} -> Maybe [TagSpecification]
tagSpecifications) (\s :: CreateVpcEndpointServiceConfiguration
s@CreateVpcEndpointServiceConfiguration' {} Maybe [TagSpecification]
a -> CreateVpcEndpointServiceConfiguration
s {$sel:tagSpecifications:CreateVpcEndpointServiceConfiguration' :: Maybe [TagSpecification]
tagSpecifications = Maybe [TagSpecification]
a} :: CreateVpcEndpointServiceConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.AWSRequest
    CreateVpcEndpointServiceConfiguration
  where
  type
    AWSResponse
      CreateVpcEndpointServiceConfiguration =
      CreateVpcEndpointServiceConfigurationResponse
  request :: (Service -> Service)
-> CreateVpcEndpointServiceConfiguration
-> Request CreateVpcEndpointServiceConfiguration
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 CreateVpcEndpointServiceConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateVpcEndpointServiceConfiguration)))
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 ServiceConfiguration
-> Int
-> CreateVpcEndpointServiceConfigurationResponse
CreateVpcEndpointServiceConfigurationResponse'
            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
"clientToken")
            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
"serviceConfiguration")
            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
    CreateVpcEndpointServiceConfiguration
  where
  hashWithSalt :: Int -> CreateVpcEndpointServiceConfiguration -> Int
hashWithSalt
    Int
_salt
    CreateVpcEndpointServiceConfiguration' {Maybe Bool
Maybe [Text]
Maybe [TagSpecification]
Maybe Text
tagSpecifications :: Maybe [TagSpecification]
supportedIpAddressTypes :: Maybe [Text]
privateDnsName :: Maybe Text
networkLoadBalancerArns :: Maybe [Text]
gatewayLoadBalancerArns :: Maybe [Text]
dryRun :: Maybe Bool
clientToken :: Maybe Text
acceptanceRequired :: Maybe Bool
$sel:tagSpecifications:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [TagSpecification]
$sel:supportedIpAddressTypes:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
$sel:privateDnsName:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Text
$sel:networkLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
$sel:gatewayLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
$sel:dryRun:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Bool
$sel:clientToken:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Text
$sel:acceptanceRequired:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Bool
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
acceptanceRequired
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
gatewayLoadBalancerArns
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
networkLoadBalancerArns
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
privateDnsName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
supportedIpAddressTypes
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagSpecification]
tagSpecifications

instance
  Prelude.NFData
    CreateVpcEndpointServiceConfiguration
  where
  rnf :: CreateVpcEndpointServiceConfiguration -> ()
rnf CreateVpcEndpointServiceConfiguration' {Maybe Bool
Maybe [Text]
Maybe [TagSpecification]
Maybe Text
tagSpecifications :: Maybe [TagSpecification]
supportedIpAddressTypes :: Maybe [Text]
privateDnsName :: Maybe Text
networkLoadBalancerArns :: Maybe [Text]
gatewayLoadBalancerArns :: Maybe [Text]
dryRun :: Maybe Bool
clientToken :: Maybe Text
acceptanceRequired :: Maybe Bool
$sel:tagSpecifications:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [TagSpecification]
$sel:supportedIpAddressTypes:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
$sel:privateDnsName:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Text
$sel:networkLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
$sel:gatewayLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
$sel:dryRun:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Bool
$sel:clientToken:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Text
$sel:acceptanceRequired:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
acceptanceRequired
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      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 [Text]
gatewayLoadBalancerArns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
networkLoadBalancerArns
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
privateDnsName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
supportedIpAddressTypes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagSpecification]
tagSpecifications

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

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

instance
  Data.ToQuery
    CreateVpcEndpointServiceConfiguration
  where
  toQuery :: CreateVpcEndpointServiceConfiguration -> QueryString
toQuery CreateVpcEndpointServiceConfiguration' {Maybe Bool
Maybe [Text]
Maybe [TagSpecification]
Maybe Text
tagSpecifications :: Maybe [TagSpecification]
supportedIpAddressTypes :: Maybe [Text]
privateDnsName :: Maybe Text
networkLoadBalancerArns :: Maybe [Text]
gatewayLoadBalancerArns :: Maybe [Text]
dryRun :: Maybe Bool
clientToken :: Maybe Text
acceptanceRequired :: Maybe Bool
$sel:tagSpecifications:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [TagSpecification]
$sel:supportedIpAddressTypes:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
$sel:privateDnsName:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Text
$sel:networkLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
$sel:gatewayLoadBalancerArns:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe [Text]
$sel:dryRun:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Bool
$sel:clientToken:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Text
$sel:acceptanceRequired:CreateVpcEndpointServiceConfiguration' :: CreateVpcEndpointServiceConfiguration -> Maybe Bool
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"CreateVpcEndpointServiceConfiguration" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"AcceptanceRequired" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
acceptanceRequired,
        ByteString
"ClientToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clientToken,
        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
"GatewayLoadBalancerArn"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
gatewayLoadBalancerArns
          ),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"NetworkLoadBalancerArn"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
networkLoadBalancerArns
          ),
        ByteString
"PrivateDnsName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
privateDnsName,
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"SupportedIpAddressType"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
supportedIpAddressTypes
          ),
        forall a. ToQuery a => a -> QueryString
Data.toQuery
          ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"TagSpecification"
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagSpecification]
tagSpecifications
          )
      ]

-- | /See:/ 'newCreateVpcEndpointServiceConfigurationResponse' smart constructor.
data CreateVpcEndpointServiceConfigurationResponse = CreateVpcEndpointServiceConfigurationResponse'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateVpcEndpointServiceConfigurationResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the service configuration.
    CreateVpcEndpointServiceConfigurationResponse
-> Maybe ServiceConfiguration
serviceConfiguration :: Prelude.Maybe ServiceConfiguration,
    -- | The response's http status code.
    CreateVpcEndpointServiceConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateVpcEndpointServiceConfigurationResponse
-> CreateVpcEndpointServiceConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcEndpointServiceConfigurationResponse
-> CreateVpcEndpointServiceConfigurationResponse -> Bool
$c/= :: CreateVpcEndpointServiceConfigurationResponse
-> CreateVpcEndpointServiceConfigurationResponse -> Bool
== :: CreateVpcEndpointServiceConfigurationResponse
-> CreateVpcEndpointServiceConfigurationResponse -> Bool
$c== :: CreateVpcEndpointServiceConfigurationResponse
-> CreateVpcEndpointServiceConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [CreateVpcEndpointServiceConfigurationResponse]
ReadPrec CreateVpcEndpointServiceConfigurationResponse
Int -> ReadS CreateVpcEndpointServiceConfigurationResponse
ReadS [CreateVpcEndpointServiceConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcEndpointServiceConfigurationResponse]
$creadListPrec :: ReadPrec [CreateVpcEndpointServiceConfigurationResponse]
readPrec :: ReadPrec CreateVpcEndpointServiceConfigurationResponse
$creadPrec :: ReadPrec CreateVpcEndpointServiceConfigurationResponse
readList :: ReadS [CreateVpcEndpointServiceConfigurationResponse]
$creadList :: ReadS [CreateVpcEndpointServiceConfigurationResponse]
readsPrec :: Int -> ReadS CreateVpcEndpointServiceConfigurationResponse
$creadsPrec :: Int -> ReadS CreateVpcEndpointServiceConfigurationResponse
Prelude.Read, Int -> CreateVpcEndpointServiceConfigurationResponse -> ShowS
[CreateVpcEndpointServiceConfigurationResponse] -> ShowS
CreateVpcEndpointServiceConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcEndpointServiceConfigurationResponse] -> ShowS
$cshowList :: [CreateVpcEndpointServiceConfigurationResponse] -> ShowS
show :: CreateVpcEndpointServiceConfigurationResponse -> String
$cshow :: CreateVpcEndpointServiceConfigurationResponse -> String
showsPrec :: Int -> CreateVpcEndpointServiceConfigurationResponse -> ShowS
$cshowsPrec :: Int -> CreateVpcEndpointServiceConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep CreateVpcEndpointServiceConfigurationResponse x
-> CreateVpcEndpointServiceConfigurationResponse
forall x.
CreateVpcEndpointServiceConfigurationResponse
-> Rep CreateVpcEndpointServiceConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVpcEndpointServiceConfigurationResponse x
-> CreateVpcEndpointServiceConfigurationResponse
$cfrom :: forall x.
CreateVpcEndpointServiceConfigurationResponse
-> Rep CreateVpcEndpointServiceConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateVpcEndpointServiceConfigurationResponse' 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:
--
-- 'clientToken', 'createVpcEndpointServiceConfigurationResponse_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'serviceConfiguration', 'createVpcEndpointServiceConfigurationResponse_serviceConfiguration' - Information about the service configuration.
--
-- 'httpStatus', 'createVpcEndpointServiceConfigurationResponse_httpStatus' - The response's http status code.
newCreateVpcEndpointServiceConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateVpcEndpointServiceConfigurationResponse
newCreateVpcEndpointServiceConfigurationResponse :: Int -> CreateVpcEndpointServiceConfigurationResponse
newCreateVpcEndpointServiceConfigurationResponse
  Int
pHttpStatus_ =
    CreateVpcEndpointServiceConfigurationResponse'
      { $sel:clientToken:CreateVpcEndpointServiceConfigurationResponse' :: Maybe Text
clientToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:serviceConfiguration:CreateVpcEndpointServiceConfigurationResponse' :: Maybe ServiceConfiguration
serviceConfiguration =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateVpcEndpointServiceConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
createVpcEndpointServiceConfigurationResponse_clientToken :: Lens.Lens' CreateVpcEndpointServiceConfigurationResponse (Prelude.Maybe Prelude.Text)
createVpcEndpointServiceConfigurationResponse_clientToken :: Lens' CreateVpcEndpointServiceConfigurationResponse (Maybe Text)
createVpcEndpointServiceConfigurationResponse_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointServiceConfigurationResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateVpcEndpointServiceConfigurationResponse' :: CreateVpcEndpointServiceConfigurationResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateVpcEndpointServiceConfigurationResponse
s@CreateVpcEndpointServiceConfigurationResponse' {} Maybe Text
a -> CreateVpcEndpointServiceConfigurationResponse
s {$sel:clientToken:CreateVpcEndpointServiceConfigurationResponse' :: Maybe Text
clientToken = Maybe Text
a} :: CreateVpcEndpointServiceConfigurationResponse)

-- | Information about the service configuration.
createVpcEndpointServiceConfigurationResponse_serviceConfiguration :: Lens.Lens' CreateVpcEndpointServiceConfigurationResponse (Prelude.Maybe ServiceConfiguration)
createVpcEndpointServiceConfigurationResponse_serviceConfiguration :: Lens'
  CreateVpcEndpointServiceConfigurationResponse
  (Maybe ServiceConfiguration)
createVpcEndpointServiceConfigurationResponse_serviceConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointServiceConfigurationResponse' {Maybe ServiceConfiguration
serviceConfiguration :: Maybe ServiceConfiguration
$sel:serviceConfiguration:CreateVpcEndpointServiceConfigurationResponse' :: CreateVpcEndpointServiceConfigurationResponse
-> Maybe ServiceConfiguration
serviceConfiguration} -> Maybe ServiceConfiguration
serviceConfiguration) (\s :: CreateVpcEndpointServiceConfigurationResponse
s@CreateVpcEndpointServiceConfigurationResponse' {} Maybe ServiceConfiguration
a -> CreateVpcEndpointServiceConfigurationResponse
s {$sel:serviceConfiguration:CreateVpcEndpointServiceConfigurationResponse' :: Maybe ServiceConfiguration
serviceConfiguration = Maybe ServiceConfiguration
a} :: CreateVpcEndpointServiceConfigurationResponse)

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

instance
  Prelude.NFData
    CreateVpcEndpointServiceConfigurationResponse
  where
  rnf :: CreateVpcEndpointServiceConfigurationResponse -> ()
rnf
    CreateVpcEndpointServiceConfigurationResponse' {Int
Maybe Text
Maybe ServiceConfiguration
httpStatus :: Int
serviceConfiguration :: Maybe ServiceConfiguration
clientToken :: Maybe Text
$sel:httpStatus:CreateVpcEndpointServiceConfigurationResponse' :: CreateVpcEndpointServiceConfigurationResponse -> Int
$sel:serviceConfiguration:CreateVpcEndpointServiceConfigurationResponse' :: CreateVpcEndpointServiceConfigurationResponse
-> Maybe ServiceConfiguration
$sel:clientToken:CreateVpcEndpointServiceConfigurationResponse' :: CreateVpcEndpointServiceConfigurationResponse -> Maybe Text
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceConfiguration
serviceConfiguration
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus