{-# 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.Comprehend.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 a model-specific endpoint for synchronous inference for a
-- previously trained custom model
module Amazonka.Comprehend.CreateEndpoint
  ( -- * Creating a Request
    CreateEndpoint (..),
    newCreateEndpoint,

    -- * Request Lenses
    createEndpoint_dataAccessRoleArn,
    createEndpoint_clientRequestToken,
    createEndpoint_tags,
    createEndpoint_endpointName,
    createEndpoint_modelArn,
    createEndpoint_desiredInferenceUnits,

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

    -- * Response Lenses
    createEndpointResponse_endpointArn,
    createEndpointResponse_httpStatus,
  )
where

import Amazonka.Comprehend.Types
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

-- | /See:/ 'newCreateEndpoint' smart constructor.
data CreateEndpoint = CreateEndpoint'
  { -- | The Amazon Resource Name (ARN) of the AWS identity and Access Management
    -- (IAM) role that grants Amazon Comprehend read access to trained custom
    -- models encrypted with a customer managed key (ModelKmsKeyId).
    CreateEndpoint -> Maybe Text
dataAccessRoleArn :: Prelude.Maybe Prelude.Text,
    -- | An idempotency token provided by the customer. If this token matches a
    -- previous endpoint creation request, Amazon Comprehend will not return a
    -- @ResourceInUseException@.
    CreateEndpoint -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | Tags associated with the endpoint being created. A tag is a key-value
    -- pair that adds metadata to the endpoint. For example, a tag with
    -- \"Sales\" as the key might be added to an endpoint to indicate its use
    -- by the sales department.
    CreateEndpoint -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | This is the descriptive suffix that becomes part of the @EndpointArn@
    -- used for all subsequent requests to this resource.
    CreateEndpoint -> Text
endpointName :: Prelude.Text,
    -- | The Amazon Resource Number (ARN) of the model to which the endpoint will
    -- be attached.
    CreateEndpoint -> Text
modelArn :: Prelude.Text,
    -- | The desired number of inference units to be used by the model using this
    -- endpoint. Each inference unit represents of a throughput of 100
    -- characters per second.
    CreateEndpoint -> Natural
desiredInferenceUnits :: Prelude.Natural
  }
  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:
--
-- 'dataAccessRoleArn', 'createEndpoint_dataAccessRoleArn' - The Amazon Resource Name (ARN) of the AWS identity and Access Management
-- (IAM) role that grants Amazon Comprehend read access to trained custom
-- models encrypted with a customer managed key (ModelKmsKeyId).
--
-- 'clientRequestToken', 'createEndpoint_clientRequestToken' - An idempotency token provided by the customer. If this token matches a
-- previous endpoint creation request, Amazon Comprehend will not return a
-- @ResourceInUseException@.
--
-- 'tags', 'createEndpoint_tags' - Tags associated with the endpoint being created. A tag is a key-value
-- pair that adds metadata to the endpoint. For example, a tag with
-- \"Sales\" as the key might be added to an endpoint to indicate its use
-- by the sales department.
--
-- 'endpointName', 'createEndpoint_endpointName' - This is the descriptive suffix that becomes part of the @EndpointArn@
-- used for all subsequent requests to this resource.
--
-- 'modelArn', 'createEndpoint_modelArn' - The Amazon Resource Number (ARN) of the model to which the endpoint will
-- be attached.
--
-- 'desiredInferenceUnits', 'createEndpoint_desiredInferenceUnits' - The desired number of inference units to be used by the model using this
-- endpoint. Each inference unit represents of a throughput of 100
-- characters per second.
newCreateEndpoint ::
  -- | 'endpointName'
  Prelude.Text ->
  -- | 'modelArn'
  Prelude.Text ->
  -- | 'desiredInferenceUnits'
  Prelude.Natural ->
  CreateEndpoint
newCreateEndpoint :: Text -> Text -> Natural -> CreateEndpoint
newCreateEndpoint
  Text
pEndpointName_
  Text
pModelArn_
  Natural
pDesiredInferenceUnits_ =
    CreateEndpoint' :: Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> Natural
-> CreateEndpoint
CreateEndpoint'
      { $sel:dataAccessRoleArn:CreateEndpoint' :: Maybe Text
dataAccessRoleArn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clientRequestToken:CreateEndpoint' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateEndpoint' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:endpointName:CreateEndpoint' :: Text
endpointName = Text
pEndpointName_,
        $sel:modelArn:CreateEndpoint' :: Text
modelArn = Text
pModelArn_,
        $sel:desiredInferenceUnits:CreateEndpoint' :: Natural
desiredInferenceUnits = Natural
pDesiredInferenceUnits_
      }

-- | The Amazon Resource Name (ARN) of the AWS identity and Access Management
-- (IAM) role that grants Amazon Comprehend read access to trained custom
-- models encrypted with a customer managed key (ModelKmsKeyId).
createEndpoint_dataAccessRoleArn :: Lens.Lens' CreateEndpoint (Prelude.Maybe Prelude.Text)
createEndpoint_dataAccessRoleArn :: (Maybe Text -> f (Maybe Text))
-> CreateEndpoint -> f CreateEndpoint
createEndpoint_dataAccessRoleArn = (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
dataAccessRoleArn :: Maybe Text
$sel:dataAccessRoleArn:CreateEndpoint' :: CreateEndpoint -> Maybe Text
dataAccessRoleArn} -> Maybe Text
dataAccessRoleArn) (\s :: CreateEndpoint
s@CreateEndpoint' {} Maybe Text
a -> CreateEndpoint
s {$sel:dataAccessRoleArn:CreateEndpoint' :: Maybe Text
dataAccessRoleArn = Maybe Text
a} :: CreateEndpoint)

-- | An idempotency token provided by the customer. If this token matches a
-- previous endpoint creation request, Amazon Comprehend will not return a
-- @ResourceInUseException@.
createEndpoint_clientRequestToken :: Lens.Lens' CreateEndpoint (Prelude.Maybe Prelude.Text)
createEndpoint_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateEndpoint -> f CreateEndpoint
createEndpoint_clientRequestToken = (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
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateEndpoint' :: CreateEndpoint -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateEndpoint
s@CreateEndpoint' {} Maybe Text
a -> CreateEndpoint
s {$sel:clientRequestToken:CreateEndpoint' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateEndpoint)

-- | Tags associated with the endpoint being created. A tag is a key-value
-- pair that adds metadata to the endpoint. For example, a tag with
-- \"Sales\" as the key might be added to an endpoint to indicate its use
-- by the sales department.
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

-- | This is the descriptive suffix that becomes part of the @EndpointArn@
-- used for all subsequent requests to this resource.
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 Amazon Resource Number (ARN) of the model to which the endpoint will
-- be attached.
createEndpoint_modelArn :: Lens.Lens' CreateEndpoint Prelude.Text
createEndpoint_modelArn :: (Text -> f Text) -> CreateEndpoint -> f CreateEndpoint
createEndpoint_modelArn = (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
modelArn :: Text
$sel:modelArn:CreateEndpoint' :: CreateEndpoint -> Text
modelArn} -> Text
modelArn) (\s :: CreateEndpoint
s@CreateEndpoint' {} Text
a -> CreateEndpoint
s {$sel:modelArn:CreateEndpoint' :: Text
modelArn = Text
a} :: CreateEndpoint)

-- | The desired number of inference units to be used by the model using this
-- endpoint. Each inference unit represents of a throughput of 100
-- characters per second.
createEndpoint_desiredInferenceUnits :: Lens.Lens' CreateEndpoint Prelude.Natural
createEndpoint_desiredInferenceUnits :: (Natural -> f Natural) -> CreateEndpoint -> f CreateEndpoint
createEndpoint_desiredInferenceUnits = (CreateEndpoint -> Natural)
-> (CreateEndpoint -> Natural -> CreateEndpoint)
-> Lens CreateEndpoint CreateEndpoint Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEndpoint' {Natural
desiredInferenceUnits :: Natural
$sel:desiredInferenceUnits:CreateEndpoint' :: CreateEndpoint -> Natural
desiredInferenceUnits} -> Natural
desiredInferenceUnits) (\s :: CreateEndpoint
s@CreateEndpoint' {} Natural
a -> CreateEndpoint
s {$sel:desiredInferenceUnits:CreateEndpoint' :: Natural
desiredInferenceUnits = Natural
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
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Comprehend_20171127.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' {Natural
Maybe [Tag]
Maybe Text
Text
desiredInferenceUnits :: Natural
modelArn :: Text
endpointName :: Text
tags :: Maybe [Tag]
clientRequestToken :: Maybe Text
dataAccessRoleArn :: Maybe Text
$sel:desiredInferenceUnits:CreateEndpoint' :: CreateEndpoint -> Natural
$sel:modelArn:CreateEndpoint' :: CreateEndpoint -> Text
$sel:endpointName:CreateEndpoint' :: CreateEndpoint -> Text
$sel:tags:CreateEndpoint' :: CreateEndpoint -> Maybe [Tag]
$sel:clientRequestToken:CreateEndpoint' :: CreateEndpoint -> Maybe Text
$sel:dataAccessRoleArn:CreateEndpoint' :: CreateEndpoint -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DataAccessRoleArn" 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
dataAccessRoleArn,
            (Text
"ClientRequestToken" 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
clientRequestToken,
            (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
"ModelArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
modelArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"DesiredInferenceUnits"
                  Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
desiredInferenceUnits
              )
          ]
      )

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 Amazon Resource Number (ARN) of the endpoint being created.
    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 Number (ARN) of the endpoint being created.
--
-- '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 Number (ARN) of the endpoint being created.
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