{-# 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.OpenSearchServerless.CreateVpcEndpoint
-- 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 an OpenSearch Serverless-managed interface VPC endpoint. For
-- more information, see
-- <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/serverless-vpc.html Access Amazon OpenSearch Serverless using an interface endpoint>.
module Amazonka.OpenSearchServerless.CreateVpcEndpoint
  ( -- * Creating a Request
    CreateVpcEndpoint (..),
    newCreateVpcEndpoint,

    -- * Request Lenses
    createVpcEndpoint_clientToken,
    createVpcEndpoint_securityGroupIds,
    createVpcEndpoint_name,
    createVpcEndpoint_subnetIds,
    createVpcEndpoint_vpcId,

    -- * Destructuring the Response
    CreateVpcEndpointResponse (..),
    newCreateVpcEndpointResponse,

    -- * Response Lenses
    createVpcEndpointResponse_createVpcEndpointDetail,
    createVpcEndpointResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateVpcEndpoint' smart constructor.
data CreateVpcEndpoint = CreateVpcEndpoint'
  { -- | Unique, case-sensitive identifier to ensure idempotency of the request.
    CreateVpcEndpoint -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The unique identifiers of the security groups that define the ports,
    -- protocols, and sources for inbound traffic that you are authorizing into
    -- your endpoint.
    CreateVpcEndpoint -> Maybe (NonEmpty Text)
securityGroupIds :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The name of the interface endpoint.
    CreateVpcEndpoint -> Text
name :: Prelude.Text,
    -- | The ID of one or more subnets from which you\'ll access OpenSearch
    -- Serverless.
    CreateVpcEndpoint -> NonEmpty Text
subnetIds :: Prelude.NonEmpty Prelude.Text,
    -- | The ID of the VPC from which you\'ll access OpenSearch Serverless.
    CreateVpcEndpoint -> Text
vpcId :: Prelude.Text
  }
  deriving (CreateVpcEndpoint -> CreateVpcEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcEndpoint -> CreateVpcEndpoint -> Bool
$c/= :: CreateVpcEndpoint -> CreateVpcEndpoint -> Bool
== :: CreateVpcEndpoint -> CreateVpcEndpoint -> Bool
$c== :: CreateVpcEndpoint -> CreateVpcEndpoint -> Bool
Prelude.Eq, ReadPrec [CreateVpcEndpoint]
ReadPrec CreateVpcEndpoint
Int -> ReadS CreateVpcEndpoint
ReadS [CreateVpcEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcEndpoint]
$creadListPrec :: ReadPrec [CreateVpcEndpoint]
readPrec :: ReadPrec CreateVpcEndpoint
$creadPrec :: ReadPrec CreateVpcEndpoint
readList :: ReadS [CreateVpcEndpoint]
$creadList :: ReadS [CreateVpcEndpoint]
readsPrec :: Int -> ReadS CreateVpcEndpoint
$creadsPrec :: Int -> ReadS CreateVpcEndpoint
Prelude.Read, Int -> CreateVpcEndpoint -> ShowS
[CreateVpcEndpoint] -> ShowS
CreateVpcEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcEndpoint] -> ShowS
$cshowList :: [CreateVpcEndpoint] -> ShowS
show :: CreateVpcEndpoint -> String
$cshow :: CreateVpcEndpoint -> String
showsPrec :: Int -> CreateVpcEndpoint -> ShowS
$cshowsPrec :: Int -> CreateVpcEndpoint -> ShowS
Prelude.Show, forall x. Rep CreateVpcEndpoint x -> CreateVpcEndpoint
forall x. CreateVpcEndpoint -> Rep CreateVpcEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateVpcEndpoint x -> CreateVpcEndpoint
$cfrom :: forall x. CreateVpcEndpoint -> Rep CreateVpcEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'CreateVpcEndpoint' 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', 'createVpcEndpoint_clientToken' - Unique, case-sensitive identifier to ensure idempotency of the request.
--
-- 'securityGroupIds', 'createVpcEndpoint_securityGroupIds' - The unique identifiers of the security groups that define the ports,
-- protocols, and sources for inbound traffic that you are authorizing into
-- your endpoint.
--
-- 'name', 'createVpcEndpoint_name' - The name of the interface endpoint.
--
-- 'subnetIds', 'createVpcEndpoint_subnetIds' - The ID of one or more subnets from which you\'ll access OpenSearch
-- Serverless.
--
-- 'vpcId', 'createVpcEndpoint_vpcId' - The ID of the VPC from which you\'ll access OpenSearch Serverless.
newCreateVpcEndpoint ::
  -- | 'name'
  Prelude.Text ->
  -- | 'subnetIds'
  Prelude.NonEmpty Prelude.Text ->
  -- | 'vpcId'
  Prelude.Text ->
  CreateVpcEndpoint
newCreateVpcEndpoint :: Text -> NonEmpty Text -> Text -> CreateVpcEndpoint
newCreateVpcEndpoint Text
pName_ NonEmpty Text
pSubnetIds_ Text
pVpcId_ =
  CreateVpcEndpoint'
    { $sel:clientToken:CreateVpcEndpoint' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
      $sel:securityGroupIds:CreateVpcEndpoint' :: Maybe (NonEmpty Text)
securityGroupIds = forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateVpcEndpoint' :: Text
name = Text
pName_,
      $sel:subnetIds:CreateVpcEndpoint' :: NonEmpty Text
subnetIds = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pSubnetIds_,
      $sel:vpcId:CreateVpcEndpoint' :: Text
vpcId = Text
pVpcId_
    }

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

-- | The unique identifiers of the security groups that define the ports,
-- protocols, and sources for inbound traffic that you are authorizing into
-- your endpoint.
createVpcEndpoint_securityGroupIds :: Lens.Lens' CreateVpcEndpoint (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
createVpcEndpoint_securityGroupIds :: Lens' CreateVpcEndpoint (Maybe (NonEmpty Text))
createVpcEndpoint_securityGroupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpoint' {Maybe (NonEmpty Text)
securityGroupIds :: Maybe (NonEmpty Text)
$sel:securityGroupIds:CreateVpcEndpoint' :: CreateVpcEndpoint -> Maybe (NonEmpty Text)
securityGroupIds} -> Maybe (NonEmpty Text)
securityGroupIds) (\s :: CreateVpcEndpoint
s@CreateVpcEndpoint' {} Maybe (NonEmpty Text)
a -> CreateVpcEndpoint
s {$sel:securityGroupIds:CreateVpcEndpoint' :: Maybe (NonEmpty Text)
securityGroupIds = Maybe (NonEmpty Text)
a} :: CreateVpcEndpoint) 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 name of the interface endpoint.
createVpcEndpoint_name :: Lens.Lens' CreateVpcEndpoint Prelude.Text
createVpcEndpoint_name :: Lens' CreateVpcEndpoint Text
createVpcEndpoint_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpoint' {Text
name :: Text
$sel:name:CreateVpcEndpoint' :: CreateVpcEndpoint -> Text
name} -> Text
name) (\s :: CreateVpcEndpoint
s@CreateVpcEndpoint' {} Text
a -> CreateVpcEndpoint
s {$sel:name:CreateVpcEndpoint' :: Text
name = Text
a} :: CreateVpcEndpoint)

-- | The ID of one or more subnets from which you\'ll access OpenSearch
-- Serverless.
createVpcEndpoint_subnetIds :: Lens.Lens' CreateVpcEndpoint (Prelude.NonEmpty Prelude.Text)
createVpcEndpoint_subnetIds :: Lens' CreateVpcEndpoint (NonEmpty Text)
createVpcEndpoint_subnetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpoint' {NonEmpty Text
subnetIds :: NonEmpty Text
$sel:subnetIds:CreateVpcEndpoint' :: CreateVpcEndpoint -> NonEmpty Text
subnetIds} -> NonEmpty Text
subnetIds) (\s :: CreateVpcEndpoint
s@CreateVpcEndpoint' {} NonEmpty Text
a -> CreateVpcEndpoint
s {$sel:subnetIds:CreateVpcEndpoint' :: NonEmpty Text
subnetIds = NonEmpty Text
a} :: CreateVpcEndpoint) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the VPC from which you\'ll access OpenSearch Serverless.
createVpcEndpoint_vpcId :: Lens.Lens' CreateVpcEndpoint Prelude.Text
createVpcEndpoint_vpcId :: Lens' CreateVpcEndpoint Text
createVpcEndpoint_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpoint' {Text
vpcId :: Text
$sel:vpcId:CreateVpcEndpoint' :: CreateVpcEndpoint -> Text
vpcId} -> Text
vpcId) (\s :: CreateVpcEndpoint
s@CreateVpcEndpoint' {} Text
a -> CreateVpcEndpoint
s {$sel:vpcId:CreateVpcEndpoint' :: Text
vpcId = Text
a} :: CreateVpcEndpoint)

instance Core.AWSRequest CreateVpcEndpoint where
  type
    AWSResponse CreateVpcEndpoint =
      CreateVpcEndpointResponse
  request :: (Service -> Service)
-> CreateVpcEndpoint -> Request CreateVpcEndpoint
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateVpcEndpoint
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateVpcEndpoint)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe CreateVpcEndpointDetail -> Int -> CreateVpcEndpointResponse
CreateVpcEndpointResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"createVpcEndpointDetail")
            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 CreateVpcEndpoint where
  hashWithSalt :: Int -> CreateVpcEndpoint -> Int
hashWithSalt Int
_salt CreateVpcEndpoint' {Maybe (NonEmpty Text)
Maybe Text
NonEmpty Text
Text
vpcId :: Text
subnetIds :: NonEmpty Text
name :: Text
securityGroupIds :: Maybe (NonEmpty Text)
clientToken :: Maybe Text
$sel:vpcId:CreateVpcEndpoint' :: CreateVpcEndpoint -> Text
$sel:subnetIds:CreateVpcEndpoint' :: CreateVpcEndpoint -> NonEmpty Text
$sel:name:CreateVpcEndpoint' :: CreateVpcEndpoint -> Text
$sel:securityGroupIds:CreateVpcEndpoint' :: CreateVpcEndpoint -> Maybe (NonEmpty Text)
$sel:clientToken:CreateVpcEndpoint' :: CreateVpcEndpoint -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
securityGroupIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
subnetIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpcId

instance Prelude.NFData CreateVpcEndpoint where
  rnf :: CreateVpcEndpoint -> ()
rnf CreateVpcEndpoint' {Maybe (NonEmpty Text)
Maybe Text
NonEmpty Text
Text
vpcId :: Text
subnetIds :: NonEmpty Text
name :: Text
securityGroupIds :: Maybe (NonEmpty Text)
clientToken :: Maybe Text
$sel:vpcId:CreateVpcEndpoint' :: CreateVpcEndpoint -> Text
$sel:subnetIds:CreateVpcEndpoint' :: CreateVpcEndpoint -> NonEmpty Text
$sel:name:CreateVpcEndpoint' :: CreateVpcEndpoint -> Text
$sel:securityGroupIds:CreateVpcEndpoint' :: CreateVpcEndpoint -> Maybe (NonEmpty Text)
$sel:clientToken:CreateVpcEndpoint' :: CreateVpcEndpoint -> 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 (NonEmpty Text)
securityGroupIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
subnetIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vpcId

instance Data.ToHeaders CreateVpcEndpoint where
  toHeaders :: CreateVpcEndpoint -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"OpenSearchServerless.CreateVpcEndpoint" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateVpcEndpoint where
  toJSON :: CreateVpcEndpoint -> Value
toJSON CreateVpcEndpoint' {Maybe (NonEmpty Text)
Maybe Text
NonEmpty Text
Text
vpcId :: Text
subnetIds :: NonEmpty Text
name :: Text
securityGroupIds :: Maybe (NonEmpty Text)
clientToken :: Maybe Text
$sel:vpcId:CreateVpcEndpoint' :: CreateVpcEndpoint -> Text
$sel:subnetIds:CreateVpcEndpoint' :: CreateVpcEndpoint -> NonEmpty Text
$sel:name:CreateVpcEndpoint' :: CreateVpcEndpoint -> Text
$sel:securityGroupIds:CreateVpcEndpoint' :: CreateVpcEndpoint -> Maybe (NonEmpty Text)
$sel:clientToken:CreateVpcEndpoint' :: CreateVpcEndpoint -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Key
"securityGroupIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
securityGroupIds,
            forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
            forall a. a -> Maybe a
Prelude.Just (Key
"subnetIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
subnetIds),
            forall a. a -> Maybe a
Prelude.Just (Key
"vpcId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
vpcId)
          ]
      )

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

instance Data.ToQuery CreateVpcEndpoint where
  toQuery :: CreateVpcEndpoint -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateVpcEndpointResponse' smart constructor.
data CreateVpcEndpointResponse = CreateVpcEndpointResponse'
  { -- | Details about the created interface VPC endpoint.
    CreateVpcEndpointResponse -> Maybe CreateVpcEndpointDetail
createVpcEndpointDetail :: Prelude.Maybe CreateVpcEndpointDetail,
    -- | The response's http status code.
    CreateVpcEndpointResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateVpcEndpointResponse -> CreateVpcEndpointResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcEndpointResponse -> CreateVpcEndpointResponse -> Bool
$c/= :: CreateVpcEndpointResponse -> CreateVpcEndpointResponse -> Bool
== :: CreateVpcEndpointResponse -> CreateVpcEndpointResponse -> Bool
$c== :: CreateVpcEndpointResponse -> CreateVpcEndpointResponse -> Bool
Prelude.Eq, ReadPrec [CreateVpcEndpointResponse]
ReadPrec CreateVpcEndpointResponse
Int -> ReadS CreateVpcEndpointResponse
ReadS [CreateVpcEndpointResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcEndpointResponse]
$creadListPrec :: ReadPrec [CreateVpcEndpointResponse]
readPrec :: ReadPrec CreateVpcEndpointResponse
$creadPrec :: ReadPrec CreateVpcEndpointResponse
readList :: ReadS [CreateVpcEndpointResponse]
$creadList :: ReadS [CreateVpcEndpointResponse]
readsPrec :: Int -> ReadS CreateVpcEndpointResponse
$creadsPrec :: Int -> ReadS CreateVpcEndpointResponse
Prelude.Read, Int -> CreateVpcEndpointResponse -> ShowS
[CreateVpcEndpointResponse] -> ShowS
CreateVpcEndpointResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcEndpointResponse] -> ShowS
$cshowList :: [CreateVpcEndpointResponse] -> ShowS
show :: CreateVpcEndpointResponse -> String
$cshow :: CreateVpcEndpointResponse -> String
showsPrec :: Int -> CreateVpcEndpointResponse -> ShowS
$cshowsPrec :: Int -> CreateVpcEndpointResponse -> ShowS
Prelude.Show, forall x.
Rep CreateVpcEndpointResponse x -> CreateVpcEndpointResponse
forall x.
CreateVpcEndpointResponse -> Rep CreateVpcEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVpcEndpointResponse x -> CreateVpcEndpointResponse
$cfrom :: forall x.
CreateVpcEndpointResponse -> Rep CreateVpcEndpointResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateVpcEndpointResponse' 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:
--
-- 'createVpcEndpointDetail', 'createVpcEndpointResponse_createVpcEndpointDetail' - Details about the created interface VPC endpoint.
--
-- 'httpStatus', 'createVpcEndpointResponse_httpStatus' - The response's http status code.
newCreateVpcEndpointResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateVpcEndpointResponse
newCreateVpcEndpointResponse :: Int -> CreateVpcEndpointResponse
newCreateVpcEndpointResponse Int
pHttpStatus_ =
  CreateVpcEndpointResponse'
    { $sel:createVpcEndpointDetail:CreateVpcEndpointResponse' :: Maybe CreateVpcEndpointDetail
createVpcEndpointDetail =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateVpcEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Details about the created interface VPC endpoint.
createVpcEndpointResponse_createVpcEndpointDetail :: Lens.Lens' CreateVpcEndpointResponse (Prelude.Maybe CreateVpcEndpointDetail)
createVpcEndpointResponse_createVpcEndpointDetail :: Lens' CreateVpcEndpointResponse (Maybe CreateVpcEndpointDetail)
createVpcEndpointResponse_createVpcEndpointDetail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointResponse' {Maybe CreateVpcEndpointDetail
createVpcEndpointDetail :: Maybe CreateVpcEndpointDetail
$sel:createVpcEndpointDetail:CreateVpcEndpointResponse' :: CreateVpcEndpointResponse -> Maybe CreateVpcEndpointDetail
createVpcEndpointDetail} -> Maybe CreateVpcEndpointDetail
createVpcEndpointDetail) (\s :: CreateVpcEndpointResponse
s@CreateVpcEndpointResponse' {} Maybe CreateVpcEndpointDetail
a -> CreateVpcEndpointResponse
s {$sel:createVpcEndpointDetail:CreateVpcEndpointResponse' :: Maybe CreateVpcEndpointDetail
createVpcEndpointDetail = Maybe CreateVpcEndpointDetail
a} :: CreateVpcEndpointResponse)

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

instance Prelude.NFData CreateVpcEndpointResponse where
  rnf :: CreateVpcEndpointResponse -> ()
rnf CreateVpcEndpointResponse' {Int
Maybe CreateVpcEndpointDetail
httpStatus :: Int
createVpcEndpointDetail :: Maybe CreateVpcEndpointDetail
$sel:httpStatus:CreateVpcEndpointResponse' :: CreateVpcEndpointResponse -> Int
$sel:createVpcEndpointDetail:CreateVpcEndpointResponse' :: CreateVpcEndpointResponse -> Maybe CreateVpcEndpointDetail
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CreateVpcEndpointDetail
createVpcEndpointDetail
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus