{-# 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.S3Outposts.CreateEndpoint
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Amazon S3 on Outposts Access Points simplify managing data access at
-- scale for shared datasets in S3 on Outposts. S3 on Outposts uses
-- endpoints to connect to Outposts buckets so that you can perform actions
-- within your virtual private cloud (VPC). For more information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/AccessingS3Outposts.html Accessing S3 on Outposts using VPC only access points>.
--
-- This action creates an endpoint and associates it with the specified
-- Outposts.
--
-- It can take up to 5 minutes for this action to complete.
--
-- Related actions include:
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html DeleteEndpoint>
--
-- -   <https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListEndpoints.html ListEndpoints>
module Amazonka.S3Outposts.CreateEndpoint
  ( -- * Creating a Request
    CreateEndpoint (..),
    newCreateEndpoint,

    -- * Request Lenses
    createEndpoint_accessType,
    createEndpoint_customerOwnedIpv4Pool,
    createEndpoint_outpostId,
    createEndpoint_subnetId,
    createEndpoint_securityGroupId,

    -- * Destructuring the Response
    CreateEndpointResponse (..),
    newCreateEndpointResponse,

    -- * Response Lenses
    createEndpointResponse_endpointArn,
    createEndpointResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.S3Outposts.Types

-- | /See:/ 'newCreateEndpoint' smart constructor.
data CreateEndpoint = CreateEndpoint'
  { -- | The type of access for the on-premise network connectivity for the
    -- Outpost endpoint. To access the endpoint from an on-premises network,
    -- you must specify the access type and provide the customer owned IPv4
    -- pool.
    CreateEndpoint -> Maybe EndpointAccessType
accessType :: Prelude.Maybe EndpointAccessType,
    -- | The ID of the customer-owned IPv4 pool for the endpoint. IP addresses
    -- will be allocated from this pool for the endpoint.
    CreateEndpoint -> Maybe Text
customerOwnedIpv4Pool :: Prelude.Maybe Prelude.Text,
    -- | The ID of the AWS Outposts.
    CreateEndpoint -> Text
outpostId :: Prelude.Text,
    -- | The ID of the subnet in the selected VPC. The endpoint subnet must
    -- belong to the Outpost that has the Amazon S3 on Outposts provisioned.
    CreateEndpoint -> Text
subnetId :: Prelude.Text,
    -- | The ID of the security group to use with the endpoint.
    CreateEndpoint -> Text
securityGroupId :: Prelude.Text
  }
  deriving (CreateEndpoint -> CreateEndpoint -> Bool
(CreateEndpoint -> CreateEndpoint -> Bool)
-> (CreateEndpoint -> CreateEndpoint -> Bool) -> Eq CreateEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEndpoint -> CreateEndpoint -> Bool
$c/= :: CreateEndpoint -> CreateEndpoint -> Bool
== :: CreateEndpoint -> CreateEndpoint -> Bool
$c== :: CreateEndpoint -> CreateEndpoint -> Bool
Prelude.Eq, ReadPrec [CreateEndpoint]
ReadPrec CreateEndpoint
Int -> ReadS CreateEndpoint
ReadS [CreateEndpoint]
(Int -> ReadS CreateEndpoint)
-> ReadS [CreateEndpoint]
-> ReadPrec CreateEndpoint
-> ReadPrec [CreateEndpoint]
-> Read CreateEndpoint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEndpoint]
$creadListPrec :: ReadPrec [CreateEndpoint]
readPrec :: ReadPrec CreateEndpoint
$creadPrec :: ReadPrec CreateEndpoint
readList :: ReadS [CreateEndpoint]
$creadList :: ReadS [CreateEndpoint]
readsPrec :: Int -> ReadS CreateEndpoint
$creadsPrec :: Int -> ReadS CreateEndpoint
Prelude.Read, Int -> CreateEndpoint -> ShowS
[CreateEndpoint] -> ShowS
CreateEndpoint -> String
(Int -> CreateEndpoint -> ShowS)
-> (CreateEndpoint -> String)
-> ([CreateEndpoint] -> ShowS)
-> Show CreateEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEndpoint] -> ShowS
$cshowList :: [CreateEndpoint] -> ShowS
show :: CreateEndpoint -> String
$cshow :: CreateEndpoint -> String
showsPrec :: Int -> CreateEndpoint -> ShowS
$cshowsPrec :: Int -> CreateEndpoint -> ShowS
Prelude.Show, (forall x. CreateEndpoint -> Rep CreateEndpoint x)
-> (forall x. Rep CreateEndpoint x -> CreateEndpoint)
-> Generic CreateEndpoint
forall x. Rep CreateEndpoint x -> CreateEndpoint
forall x. CreateEndpoint -> Rep CreateEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateEndpoint x -> CreateEndpoint
$cfrom :: forall x. CreateEndpoint -> Rep CreateEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'CreateEndpoint' 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:
--
-- 'accessType', 'createEndpoint_accessType' - The type of access for the on-premise network connectivity for the
-- Outpost endpoint. To access the endpoint from an on-premises network,
-- you must specify the access type and provide the customer owned IPv4
-- pool.
--
-- 'customerOwnedIpv4Pool', 'createEndpoint_customerOwnedIpv4Pool' - The ID of the customer-owned IPv4 pool for the endpoint. IP addresses
-- will be allocated from this pool for the endpoint.
--
-- 'outpostId', 'createEndpoint_outpostId' - The ID of the AWS Outposts.
--
-- 'subnetId', 'createEndpoint_subnetId' - The ID of the subnet in the selected VPC. The endpoint subnet must
-- belong to the Outpost that has the Amazon S3 on Outposts provisioned.
--
-- 'securityGroupId', 'createEndpoint_securityGroupId' - The ID of the security group to use with the endpoint.
newCreateEndpoint ::
  -- | 'outpostId'
  Prelude.Text ->
  -- | 'subnetId'
  Prelude.Text ->
  -- | 'securityGroupId'
  Prelude.Text ->
  CreateEndpoint
newCreateEndpoint :: Text -> Text -> Text -> CreateEndpoint
newCreateEndpoint
  Text
pOutpostId_
  Text
pSubnetId_
  Text
pSecurityGroupId_ =
    CreateEndpoint' :: Maybe EndpointAccessType
-> Maybe Text -> Text -> Text -> Text -> CreateEndpoint
CreateEndpoint'
      { $sel:accessType:CreateEndpoint' :: Maybe EndpointAccessType
accessType = Maybe EndpointAccessType
forall a. Maybe a
Prelude.Nothing,
        $sel:customerOwnedIpv4Pool:CreateEndpoint' :: Maybe Text
customerOwnedIpv4Pool = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:outpostId:CreateEndpoint' :: Text
outpostId = Text
pOutpostId_,
        $sel:subnetId:CreateEndpoint' :: Text
subnetId = Text
pSubnetId_,
        $sel:securityGroupId:CreateEndpoint' :: Text
securityGroupId = Text
pSecurityGroupId_
      }

-- | The type of access for the on-premise network connectivity for the
-- Outpost endpoint. To access the endpoint from an on-premises network,
-- you must specify the access type and provide the customer owned IPv4
-- pool.
createEndpoint_accessType :: Lens.Lens' CreateEndpoint (Prelude.Maybe EndpointAccessType)
createEndpoint_accessType :: (Maybe EndpointAccessType -> f (Maybe EndpointAccessType))
-> CreateEndpoint -> f CreateEndpoint
createEndpoint_accessType = (CreateEndpoint -> Maybe EndpointAccessType)
-> (CreateEndpoint -> Maybe EndpointAccessType -> CreateEndpoint)
-> Lens
     CreateEndpoint
     CreateEndpoint
     (Maybe EndpointAccessType)
     (Maybe EndpointAccessType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpoint' {Maybe EndpointAccessType
accessType :: Maybe EndpointAccessType
$sel:accessType:CreateEndpoint' :: CreateEndpoint -> Maybe EndpointAccessType
accessType} -> Maybe EndpointAccessType
accessType) (\s :: CreateEndpoint
s@CreateEndpoint' {} Maybe EndpointAccessType
a -> CreateEndpoint
s {$sel:accessType:CreateEndpoint' :: Maybe EndpointAccessType
accessType = Maybe EndpointAccessType
a} :: CreateEndpoint)

-- | The ID of the customer-owned IPv4 pool for the endpoint. IP addresses
-- will be allocated from this pool for the endpoint.
createEndpoint_customerOwnedIpv4Pool :: Lens.Lens' CreateEndpoint (Prelude.Maybe Prelude.Text)
createEndpoint_customerOwnedIpv4Pool :: (Maybe Text -> f (Maybe Text))
-> CreateEndpoint -> f CreateEndpoint
createEndpoint_customerOwnedIpv4Pool = (CreateEndpoint -> Maybe Text)
-> (CreateEndpoint -> Maybe Text -> CreateEndpoint)
-> Lens CreateEndpoint CreateEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpoint' {Maybe Text
customerOwnedIpv4Pool :: Maybe Text
$sel:customerOwnedIpv4Pool:CreateEndpoint' :: CreateEndpoint -> Maybe Text
customerOwnedIpv4Pool} -> Maybe Text
customerOwnedIpv4Pool) (\s :: CreateEndpoint
s@CreateEndpoint' {} Maybe Text
a -> CreateEndpoint
s {$sel:customerOwnedIpv4Pool:CreateEndpoint' :: Maybe Text
customerOwnedIpv4Pool = Maybe Text
a} :: CreateEndpoint)

-- | The ID of the AWS Outposts.
createEndpoint_outpostId :: Lens.Lens' CreateEndpoint Prelude.Text
createEndpoint_outpostId :: (Text -> f Text) -> CreateEndpoint -> f CreateEndpoint
createEndpoint_outpostId = (CreateEndpoint -> Text)
-> (CreateEndpoint -> Text -> CreateEndpoint)
-> Lens CreateEndpoint CreateEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpoint' {Text
outpostId :: Text
$sel:outpostId:CreateEndpoint' :: CreateEndpoint -> Text
outpostId} -> Text
outpostId) (\s :: CreateEndpoint
s@CreateEndpoint' {} Text
a -> CreateEndpoint
s {$sel:outpostId:CreateEndpoint' :: Text
outpostId = Text
a} :: CreateEndpoint)

-- | The ID of the subnet in the selected VPC. The endpoint subnet must
-- belong to the Outpost that has the Amazon S3 on Outposts provisioned.
createEndpoint_subnetId :: Lens.Lens' CreateEndpoint Prelude.Text
createEndpoint_subnetId :: (Text -> f Text) -> CreateEndpoint -> f CreateEndpoint
createEndpoint_subnetId = (CreateEndpoint -> Text)
-> (CreateEndpoint -> Text -> CreateEndpoint)
-> Lens CreateEndpoint CreateEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpoint' {Text
subnetId :: Text
$sel:subnetId:CreateEndpoint' :: CreateEndpoint -> Text
subnetId} -> Text
subnetId) (\s :: CreateEndpoint
s@CreateEndpoint' {} Text
a -> CreateEndpoint
s {$sel:subnetId:CreateEndpoint' :: Text
subnetId = Text
a} :: CreateEndpoint)

-- | The ID of the security group to use with the endpoint.
createEndpoint_securityGroupId :: Lens.Lens' CreateEndpoint Prelude.Text
createEndpoint_securityGroupId :: (Text -> f Text) -> CreateEndpoint -> f CreateEndpoint
createEndpoint_securityGroupId = (CreateEndpoint -> Text)
-> (CreateEndpoint -> Text -> CreateEndpoint)
-> Lens CreateEndpoint CreateEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpoint' {Text
securityGroupId :: Text
$sel:securityGroupId:CreateEndpoint' :: CreateEndpoint -> Text
securityGroupId} -> Text
securityGroupId) (\s :: CreateEndpoint
s@CreateEndpoint' {} Text
a -> CreateEndpoint
s {$sel:securityGroupId:CreateEndpoint' :: Text
securityGroupId = Text
a} :: CreateEndpoint)

instance Core.AWSRequest CreateEndpoint where
  type
    AWSResponse CreateEndpoint =
      CreateEndpointResponse
  request :: CreateEndpoint -> Request CreateEndpoint
request = Service -> CreateEndpoint -> Request CreateEndpoint
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateEndpoint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateEndpoint)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateEndpoint))
-> Logger
-> Service
-> Proxy CreateEndpoint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateEndpoint)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateEndpointResponse
CreateEndpointResponse'
            (Maybe Text -> Int -> CreateEndpointResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateEndpointResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EndpointArn")
            Either String (Int -> CreateEndpointResponse)
-> Either String Int -> Either String CreateEndpointResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateEndpoint

instance Prelude.NFData CreateEndpoint

instance Core.ToHeaders CreateEndpoint where
  toHeaders :: CreateEndpoint -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateEndpoint -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateEndpoint where
  toJSON :: CreateEndpoint -> Value
toJSON CreateEndpoint' {Maybe Text
Maybe EndpointAccessType
Text
securityGroupId :: Text
subnetId :: Text
outpostId :: Text
customerOwnedIpv4Pool :: Maybe Text
accessType :: Maybe EndpointAccessType
$sel:securityGroupId:CreateEndpoint' :: CreateEndpoint -> Text
$sel:subnetId:CreateEndpoint' :: CreateEndpoint -> Text
$sel:outpostId:CreateEndpoint' :: CreateEndpoint -> Text
$sel:customerOwnedIpv4Pool:CreateEndpoint' :: CreateEndpoint -> Maybe Text
$sel:accessType:CreateEndpoint' :: CreateEndpoint -> Maybe EndpointAccessType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AccessType" Text -> EndpointAccessType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EndpointAccessType -> Pair)
-> Maybe EndpointAccessType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EndpointAccessType
accessType,
            (Text
"CustomerOwnedIpv4Pool" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
customerOwnedIpv4Pool,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"OutpostId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
outpostId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SubnetId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
subnetId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"SecurityGroupId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
securityGroupId)
          ]
      )

instance Core.ToPath CreateEndpoint where
  toPath :: CreateEndpoint -> ByteString
toPath = ByteString -> CreateEndpoint -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/S3Outposts/CreateEndpoint"

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

-- | /See:/ 'newCreateEndpointResponse' smart constructor.
data CreateEndpointResponse = CreateEndpointResponse'
  { -- | The Amazon Resource Name (ARN) of the endpoint.
    CreateEndpointResponse -> Maybe Text
endpointArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateEndpointResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateEndpointResponse -> CreateEndpointResponse -> Bool
(CreateEndpointResponse -> CreateEndpointResponse -> Bool)
-> (CreateEndpointResponse -> CreateEndpointResponse -> Bool)
-> Eq CreateEndpointResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEndpointResponse -> CreateEndpointResponse -> Bool
$c/= :: CreateEndpointResponse -> CreateEndpointResponse -> Bool
== :: CreateEndpointResponse -> CreateEndpointResponse -> Bool
$c== :: CreateEndpointResponse -> CreateEndpointResponse -> Bool
Prelude.Eq, ReadPrec [CreateEndpointResponse]
ReadPrec CreateEndpointResponse
Int -> ReadS CreateEndpointResponse
ReadS [CreateEndpointResponse]
(Int -> ReadS CreateEndpointResponse)
-> ReadS [CreateEndpointResponse]
-> ReadPrec CreateEndpointResponse
-> ReadPrec [CreateEndpointResponse]
-> Read CreateEndpointResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEndpointResponse]
$creadListPrec :: ReadPrec [CreateEndpointResponse]
readPrec :: ReadPrec CreateEndpointResponse
$creadPrec :: ReadPrec CreateEndpointResponse
readList :: ReadS [CreateEndpointResponse]
$creadList :: ReadS [CreateEndpointResponse]
readsPrec :: Int -> ReadS CreateEndpointResponse
$creadsPrec :: Int -> ReadS CreateEndpointResponse
Prelude.Read, Int -> CreateEndpointResponse -> ShowS
[CreateEndpointResponse] -> ShowS
CreateEndpointResponse -> String
(Int -> CreateEndpointResponse -> ShowS)
-> (CreateEndpointResponse -> String)
-> ([CreateEndpointResponse] -> ShowS)
-> Show CreateEndpointResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEndpointResponse] -> ShowS
$cshowList :: [CreateEndpointResponse] -> ShowS
show :: CreateEndpointResponse -> String
$cshow :: CreateEndpointResponse -> String
showsPrec :: Int -> CreateEndpointResponse -> ShowS
$cshowsPrec :: Int -> CreateEndpointResponse -> ShowS
Prelude.Show, (forall x. CreateEndpointResponse -> Rep CreateEndpointResponse x)
-> (forall x.
    Rep CreateEndpointResponse x -> CreateEndpointResponse)
-> Generic CreateEndpointResponse
forall x. Rep CreateEndpointResponse x -> CreateEndpointResponse
forall x. CreateEndpointResponse -> Rep CreateEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateEndpointResponse x -> CreateEndpointResponse
$cfrom :: forall x. CreateEndpointResponse -> Rep CreateEndpointResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateEndpointResponse' 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:
--
-- 'endpointArn', 'createEndpointResponse_endpointArn' - The Amazon Resource Name (ARN) of the endpoint.
--
-- 'httpStatus', 'createEndpointResponse_httpStatus' - The response's http status code.
newCreateEndpointResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateEndpointResponse
newCreateEndpointResponse :: Int -> CreateEndpointResponse
newCreateEndpointResponse Int
pHttpStatus_ =
  CreateEndpointResponse' :: Maybe Text -> Int -> CreateEndpointResponse
CreateEndpointResponse'
    { $sel:endpointArn:CreateEndpointResponse' :: Maybe Text
endpointArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the endpoint.
createEndpointResponse_endpointArn :: Lens.Lens' CreateEndpointResponse (Prelude.Maybe Prelude.Text)
createEndpointResponse_endpointArn :: (Maybe Text -> f (Maybe Text))
-> CreateEndpointResponse -> f CreateEndpointResponse
createEndpointResponse_endpointArn = (CreateEndpointResponse -> Maybe Text)
-> (CreateEndpointResponse -> Maybe Text -> CreateEndpointResponse)
-> Lens
     CreateEndpointResponse
     CreateEndpointResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpointResponse' {Maybe Text
endpointArn :: Maybe Text
$sel:endpointArn:CreateEndpointResponse' :: CreateEndpointResponse -> Maybe Text
endpointArn} -> Maybe Text
endpointArn) (\s :: CreateEndpointResponse
s@CreateEndpointResponse' {} Maybe Text
a -> CreateEndpointResponse
s {$sel:endpointArn:CreateEndpointResponse' :: Maybe Text
endpointArn = Maybe Text
a} :: CreateEndpointResponse)

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

instance Prelude.NFData CreateEndpointResponse