{-# 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.SageMaker.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)
--
-- Creates an endpoint using the endpoint configuration specified in the
-- request. Amazon SageMaker uses the endpoint to provision resources and
-- deploy models. You create the endpoint configuration with the
-- CreateEndpointConfig API.
--
-- Use this API to deploy models using Amazon SageMaker hosting services.
--
-- For an example that calls this method when deploying a model to Amazon
-- SageMaker hosting services, see the
-- <https://github.com/aws/amazon-sagemaker-examples/blob/master/sagemaker-fundamentals/create-endpoint/create_endpoint.ipynb Create Endpoint example notebook.>
--
-- You must not delete an @EndpointConfig@ that is in use by an endpoint
-- that is live or while the @UpdateEndpoint@ or @CreateEndpoint@
-- operations are being performed on the endpoint. To update an endpoint,
-- you must create a new @EndpointConfig@.
--
-- The endpoint name must be unique within an Amazon Web Services Region in
-- your Amazon Web Services account.
--
-- When it receives the request, Amazon SageMaker creates the endpoint,
-- launches the resources (ML compute instances), and deploys the model(s)
-- on them.
--
-- When you call CreateEndpoint, a load call is made to DynamoDB to verify
-- that your endpoint configuration exists. When you read data from a
-- DynamoDB table supporting
-- <https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadConsistency.html Eventually Consistent Reads>
-- , the response might not reflect the results of a recently completed
-- write operation. The response might include some stale data. If the
-- dependent entities are not yet in DynamoDB, this causes a validation
-- error. If you repeat your read request after a short time, the response
-- should return the latest data. So retry logic is recommended to handle
-- these possible issues. We also recommend that customers call
-- DescribeEndpointConfig before calling CreateEndpoint to minimize the
-- potential impact of a DynamoDB eventually consistent read.
--
-- When Amazon SageMaker receives the request, it sets the endpoint status
-- to @Creating@. After it creates the endpoint, it sets the status to
-- @InService@. Amazon SageMaker can then process incoming requests for
-- inferences. To check the status of an endpoint, use the DescribeEndpoint
-- API.
--
-- If any of the models hosted at this endpoint get model data from an
-- Amazon S3 location, Amazon SageMaker uses Amazon Web Services Security
-- Token Service to download model artifacts from the S3 path you provided.
-- Amazon Web Services STS is activated in your IAM user account by
-- default. If you previously deactivated Amazon Web Services STS for a
-- region, you need to reactivate Amazon Web Services STS for that region.
-- For more information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html Activating and Deactivating Amazon Web Services STS in an Amazon Web Services Region>
-- in the /Amazon Web Services Identity and Access Management User Guide/.
--
-- To add the IAM role policies for using this API operation, go to the
-- <https://console.aws.amazon.com/iam/ IAM console>, and choose Roles in
-- the left navigation pane. Search the IAM role that you want to grant
-- access to use the CreateEndpoint and CreateEndpointConfig API
-- operations, add the following policies to the role.
--
-- -   Option 1: For a full SageMaker access, search and attach the
--     @AmazonSageMakerFullAccess@ policy.
--
-- -   Option 2: For granting a limited access to an IAM role, paste the
--     following Action elements manually into the JSON file of the IAM
--     role:
--
--     @\"Action\": [\"sagemaker:CreateEndpoint\", \"sagemaker:CreateEndpointConfig\"]@
--
--     @\"Resource\": [@
--
--     @\"arn:aws:sagemaker:region:account-id:endpoint\/endpointName\"@
--
--     @\"arn:aws:sagemaker:region:account-id:endpoint-config\/endpointConfigName\"@
--
--     @]@
--
--     For more information, see
--     <https://docs.aws.amazon.com/sagemaker/latest/dg/api-permissions-reference.html SageMaker API Permissions: Actions, Permissions, and Resources Reference>.
module Amazonka.SageMaker.CreateEndpoint
  ( -- * Creating a Request
    CreateEndpoint (..),
    newCreateEndpoint,

    -- * Request Lenses
    createEndpoint_tags,
    createEndpoint_endpointName,
    createEndpoint_endpointConfigName,

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

    -- * Response Lenses
    createEndpointResponse_httpStatus,
    createEndpointResponse_endpointArn,
  )
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.SageMaker.Types

-- | /See:/ 'newCreateEndpoint' smart constructor.
data CreateEndpoint = CreateEndpoint'
  { -- | An array of key-value pairs. You can use tags to categorize your Amazon
    -- Web Services resources in different ways, for example, by purpose,
    -- owner, or environment. For more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>.
    CreateEndpoint -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the endpoint.The name must be unique within an Amazon Web
    -- Services Region in your Amazon Web Services account. The name is
    -- case-insensitive in @CreateEndpoint@, but the case is preserved and must
    -- be matched in .
    CreateEndpoint -> Text
endpointName :: Prelude.Text,
    -- | The name of an endpoint configuration. For more information, see
    -- CreateEndpointConfig.
    CreateEndpoint -> Text
endpointConfigName :: 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:
--
-- 'tags', 'createEndpoint_tags' - An array of key-value pairs. You can use tags to categorize your Amazon
-- Web Services resources in different ways, for example, by purpose,
-- owner, or environment. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>.
--
-- 'endpointName', 'createEndpoint_endpointName' - The name of the endpoint.The name must be unique within an Amazon Web
-- Services Region in your Amazon Web Services account. The name is
-- case-insensitive in @CreateEndpoint@, but the case is preserved and must
-- be matched in .
--
-- 'endpointConfigName', 'createEndpoint_endpointConfigName' - The name of an endpoint configuration. For more information, see
-- CreateEndpointConfig.
newCreateEndpoint ::
  -- | 'endpointName'
  Prelude.Text ->
  -- | 'endpointConfigName'
  Prelude.Text ->
  CreateEndpoint
newCreateEndpoint :: Text -> Text -> CreateEndpoint
newCreateEndpoint Text
pEndpointName_ Text
pEndpointConfigName_ =
  CreateEndpoint' :: Maybe [Tag] -> Text -> Text -> CreateEndpoint
CreateEndpoint'
    { $sel:tags:CreateEndpoint' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointName:CreateEndpoint' :: Text
endpointName = Text
pEndpointName_,
      $sel:endpointConfigName:CreateEndpoint' :: Text
endpointConfigName = Text
pEndpointConfigName_
    }

-- | An array of key-value pairs. You can use tags to categorize your Amazon
-- Web Services resources in different ways, for example, by purpose,
-- owner, or environment. For more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html Tagging Amazon Web Services Resources>.
createEndpoint_tags :: Lens.Lens' CreateEndpoint (Prelude.Maybe [Tag])
createEndpoint_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateEndpoint -> f CreateEndpoint
createEndpoint_tags = (CreateEndpoint -> Maybe [Tag])
-> (CreateEndpoint -> Maybe [Tag] -> CreateEndpoint)
-> Lens CreateEndpoint CreateEndpoint (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpoint' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateEndpoint' :: CreateEndpoint -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateEndpoint
s@CreateEndpoint' {} Maybe [Tag]
a -> CreateEndpoint
s {$sel:tags:CreateEndpoint' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateEndpoint) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateEndpoint -> f CreateEndpoint)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateEndpoint
-> f CreateEndpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the endpoint.The name must be unique within an Amazon Web
-- Services Region in your Amazon Web Services account. The name is
-- case-insensitive in @CreateEndpoint@, but the case is preserved and must
-- be matched in .
createEndpoint_endpointName :: Lens.Lens' CreateEndpoint Prelude.Text
createEndpoint_endpointName :: (Text -> f Text) -> CreateEndpoint -> f CreateEndpoint
createEndpoint_endpointName = (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
endpointName :: Text
$sel:endpointName:CreateEndpoint' :: CreateEndpoint -> Text
endpointName} -> Text
endpointName) (\s :: CreateEndpoint
s@CreateEndpoint' {} Text
a -> CreateEndpoint
s {$sel:endpointName:CreateEndpoint' :: Text
endpointName = Text
a} :: CreateEndpoint)

-- | The name of an endpoint configuration. For more information, see
-- CreateEndpointConfig.
createEndpoint_endpointConfigName :: Lens.Lens' CreateEndpoint Prelude.Text
createEndpoint_endpointConfigName :: (Text -> f Text) -> CreateEndpoint -> f CreateEndpoint
createEndpoint_endpointConfigName = (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
endpointConfigName :: Text
$sel:endpointConfigName:CreateEndpoint' :: CreateEndpoint -> Text
endpointConfigName} -> Text
endpointConfigName) (\s :: CreateEndpoint
s@CreateEndpoint' {} Text
a -> CreateEndpoint
s {$sel:endpointConfigName:CreateEndpoint' :: Text
endpointConfigName = 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 ->
          Int -> Text -> CreateEndpointResponse
CreateEndpointResponse'
            (Int -> Text -> CreateEndpointResponse)
-> Either String Int
-> Either String (Text -> CreateEndpointResponse)
forall (f :: * -> *) a b. Functor 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))
            Either String (Text -> CreateEndpointResponse)
-> Either String Text -> Either String CreateEndpointResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"EndpointArn")
      )

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
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"SageMaker.CreateEndpoint" :: Prelude.ByteString),
            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 [Tag]
Text
endpointConfigName :: Text
endpointName :: Text
tags :: Maybe [Tag]
$sel:endpointConfigName:CreateEndpoint' :: CreateEndpoint -> Text
$sel:endpointName:CreateEndpoint' :: CreateEndpoint -> Text
$sel:tags:CreateEndpoint' :: CreateEndpoint -> Maybe [Tag]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EndpointName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpointName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"EndpointConfigName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
endpointConfigName)
          ]
      )

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

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

-- | 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)

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

instance Prelude.NFData CreateEndpointResponse