{-# 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.SageMakerRuntime.InvokeEndpoint
-- 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)
--
-- After you deploy a model into production using Amazon SageMaker hosting
-- services, your client applications use this API to get inferences from
-- the model hosted at the specified endpoint.
--
-- For an overview of Amazon SageMaker, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works.html How It Works>.
--
-- Amazon SageMaker strips all POST headers except those supported by the
-- API. Amazon SageMaker might add additional headers. You should not rely
-- on the behavior of headers outside those enumerated in the request
-- syntax.
--
-- Calls to @InvokeEndpoint@ are authenticated by using AWS Signature
-- Version 4. For information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html Authenticating Requests (AWS Signature Version 4)>
-- in the /Amazon S3 API Reference/.
--
-- A customer\'s model containers must respond to requests within 60
-- seconds. The model itself can have a maximum processing time of 60
-- seconds before responding to invocations. If your model is going to take
-- 50-60 seconds of processing time, the SDK socket timeout should be set
-- to be 70 seconds.
--
-- Endpoints are scoped to an individual account, and are not public. The
-- URL does not contain the account ID, but Amazon SageMaker determines the
-- account ID from the authentication token that is supplied by the caller.
module Amazonka.SageMakerRuntime.InvokeEndpoint
  ( -- * Creating a Request
    InvokeEndpoint (..),
    newInvokeEndpoint,

    -- * Request Lenses
    invokeEndpoint_accept,
    invokeEndpoint_targetModel,
    invokeEndpoint_customAttributes,
    invokeEndpoint_inferenceId,
    invokeEndpoint_targetVariant,
    invokeEndpoint_contentType,
    invokeEndpoint_targetContainerHostname,
    invokeEndpoint_endpointName,
    invokeEndpoint_body,

    -- * Destructuring the Response
    InvokeEndpointResponse (..),
    newInvokeEndpointResponse,

    -- * Response Lenses
    invokeEndpointResponse_invokedProductionVariant,
    invokeEndpointResponse_customAttributes,
    invokeEndpointResponse_contentType,
    invokeEndpointResponse_httpStatus,
    invokeEndpointResponse_body,
  )
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.SageMakerRuntime.Types

-- | /See:/ 'newInvokeEndpoint' smart constructor.
data InvokeEndpoint = InvokeEndpoint'
  { -- | The desired MIME type of the inference in the response.
    InvokeEndpoint -> Maybe Text
accept :: Prelude.Maybe Prelude.Text,
    -- | The model to request for inference when invoking a multi-model endpoint.
    InvokeEndpoint -> Maybe Text
targetModel :: Prelude.Maybe Prelude.Text,
    -- | Provides additional information about a request for an inference
    -- submitted to a model hosted at an Amazon SageMaker endpoint. The
    -- information is an opaque value that is forwarded verbatim. You could use
    -- this value, for example, to provide an ID that you can use to track a
    -- request or to provide other metadata that a service endpoint was
    -- programmed to process. The value must consist of no more than 1024
    -- visible US-ASCII characters as specified in
    -- <https://tools.ietf.org/html/rfc7230#section-3.2.6 Section 3.3.6. Field Value Components>
    -- of the Hypertext Transfer Protocol (HTTP\/1.1).
    --
    -- The code in your model is responsible for setting or updating any custom
    -- attributes in the response. If your code does not set this value in the
    -- response, an empty value is returned. For example, if a custom attribute
    -- represents the trace ID, your model can prepend the custom attribute
    -- with @Trace ID:@ in your post-processing function.
    --
    -- This feature is currently supported in the AWS SDKs but not in the
    -- Amazon SageMaker Python SDK.
    InvokeEndpoint -> Maybe (Sensitive Text)
customAttributes :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | If you provide a value, it is added to the captured data when you enable
    -- data capture on the endpoint. For information about data capture, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html Capture Data>.
    InvokeEndpoint -> Maybe Text
inferenceId :: Prelude.Maybe Prelude.Text,
    -- | Specify the production variant to send the inference request to when
    -- invoking an endpoint that is running two or more variants. Note that
    -- this parameter overrides the default behavior for the endpoint, which is
    -- to distribute the invocation traffic based on the variant weights.
    --
    -- For information about how to use variant targeting to perform a\/b
    -- testing, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html Test models in production>
    InvokeEndpoint -> Maybe Text
targetVariant :: Prelude.Maybe Prelude.Text,
    -- | The MIME type of the input data in the request body.
    InvokeEndpoint -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | If the endpoint hosts multiple containers and is configured to use
    -- direct invocation, this parameter specifies the host name of the
    -- container to invoke.
    InvokeEndpoint -> Maybe Text
targetContainerHostname :: Prelude.Maybe Prelude.Text,
    -- | The name of the endpoint that you specified when you created the
    -- endpoint using the
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html CreateEndpoint>
    -- API.
    InvokeEndpoint -> Text
endpointName :: Prelude.Text,
    -- | Provides input data, in the format specified in the @ContentType@
    -- request header. Amazon SageMaker passes all of the data in the body to
    -- the model.
    --
    -- For information about the format of the request body, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html Common Data Formats-Inference>.
    InvokeEndpoint -> Text
body :: Prelude.Text
  }
  deriving (InvokeEndpoint -> InvokeEndpoint -> Bool
(InvokeEndpoint -> InvokeEndpoint -> Bool)
-> (InvokeEndpoint -> InvokeEndpoint -> Bool) -> Eq InvokeEndpoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvokeEndpoint -> InvokeEndpoint -> Bool
$c/= :: InvokeEndpoint -> InvokeEndpoint -> Bool
== :: InvokeEndpoint -> InvokeEndpoint -> Bool
$c== :: InvokeEndpoint -> InvokeEndpoint -> Bool
Prelude.Eq, Int -> InvokeEndpoint -> ShowS
[InvokeEndpoint] -> ShowS
InvokeEndpoint -> String
(Int -> InvokeEndpoint -> ShowS)
-> (InvokeEndpoint -> String)
-> ([InvokeEndpoint] -> ShowS)
-> Show InvokeEndpoint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InvokeEndpoint] -> ShowS
$cshowList :: [InvokeEndpoint] -> ShowS
show :: InvokeEndpoint -> String
$cshow :: InvokeEndpoint -> String
showsPrec :: Int -> InvokeEndpoint -> ShowS
$cshowsPrec :: Int -> InvokeEndpoint -> ShowS
Prelude.Show, (forall x. InvokeEndpoint -> Rep InvokeEndpoint x)
-> (forall x. Rep InvokeEndpoint x -> InvokeEndpoint)
-> Generic InvokeEndpoint
forall x. Rep InvokeEndpoint x -> InvokeEndpoint
forall x. InvokeEndpoint -> Rep InvokeEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InvokeEndpoint x -> InvokeEndpoint
$cfrom :: forall x. InvokeEndpoint -> Rep InvokeEndpoint x
Prelude.Generic)

-- |
-- Create a value of 'InvokeEndpoint' 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:
--
-- 'accept', 'invokeEndpoint_accept' - The desired MIME type of the inference in the response.
--
-- 'targetModel', 'invokeEndpoint_targetModel' - The model to request for inference when invoking a multi-model endpoint.
--
-- 'customAttributes', 'invokeEndpoint_customAttributes' - Provides additional information about a request for an inference
-- submitted to a model hosted at an Amazon SageMaker endpoint. The
-- information is an opaque value that is forwarded verbatim. You could use
-- this value, for example, to provide an ID that you can use to track a
-- request or to provide other metadata that a service endpoint was
-- programmed to process. The value must consist of no more than 1024
-- visible US-ASCII characters as specified in
-- <https://tools.ietf.org/html/rfc7230#section-3.2.6 Section 3.3.6. Field Value Components>
-- of the Hypertext Transfer Protocol (HTTP\/1.1).
--
-- The code in your model is responsible for setting or updating any custom
-- attributes in the response. If your code does not set this value in the
-- response, an empty value is returned. For example, if a custom attribute
-- represents the trace ID, your model can prepend the custom attribute
-- with @Trace ID:@ in your post-processing function.
--
-- This feature is currently supported in the AWS SDKs but not in the
-- Amazon SageMaker Python SDK.
--
-- 'inferenceId', 'invokeEndpoint_inferenceId' - If you provide a value, it is added to the captured data when you enable
-- data capture on the endpoint. For information about data capture, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html Capture Data>.
--
-- 'targetVariant', 'invokeEndpoint_targetVariant' - Specify the production variant to send the inference request to when
-- invoking an endpoint that is running two or more variants. Note that
-- this parameter overrides the default behavior for the endpoint, which is
-- to distribute the invocation traffic based on the variant weights.
--
-- For information about how to use variant targeting to perform a\/b
-- testing, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html Test models in production>
--
-- 'contentType', 'invokeEndpoint_contentType' - The MIME type of the input data in the request body.
--
-- 'targetContainerHostname', 'invokeEndpoint_targetContainerHostname' - If the endpoint hosts multiple containers and is configured to use
-- direct invocation, this parameter specifies the host name of the
-- container to invoke.
--
-- 'endpointName', 'invokeEndpoint_endpointName' - The name of the endpoint that you specified when you created the
-- endpoint using the
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html CreateEndpoint>
-- API.
--
-- 'body', 'invokeEndpoint_body' - Provides input data, in the format specified in the @ContentType@
-- request header. Amazon SageMaker passes all of the data in the body to
-- the model.
--
-- For information about the format of the request body, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html Common Data Formats-Inference>.
newInvokeEndpoint ::
  -- | 'endpointName'
  Prelude.Text ->
  -- | 'body'
  Prelude.Text ->
  InvokeEndpoint
newInvokeEndpoint :: Text -> Text -> InvokeEndpoint
newInvokeEndpoint Text
pEndpointName_ Text
pBody_ =
  InvokeEndpoint' :: Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> InvokeEndpoint
InvokeEndpoint'
    { $sel:accept:InvokeEndpoint' :: Maybe Text
accept = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetModel:InvokeEndpoint' :: Maybe Text
targetModel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customAttributes:InvokeEndpoint' :: Maybe (Sensitive Text)
customAttributes = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:inferenceId:InvokeEndpoint' :: Maybe Text
inferenceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetVariant:InvokeEndpoint' :: Maybe Text
targetVariant = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:InvokeEndpoint' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetContainerHostname:InvokeEndpoint' :: Maybe Text
targetContainerHostname = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endpointName:InvokeEndpoint' :: Text
endpointName = Text
pEndpointName_,
      $sel:body:InvokeEndpoint' :: Text
body = Text
pBody_
    }

-- | The desired MIME type of the inference in the response.
invokeEndpoint_accept :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_accept :: (Maybe Text -> f (Maybe Text))
-> InvokeEndpoint -> f InvokeEndpoint
invokeEndpoint_accept = (InvokeEndpoint -> Maybe Text)
-> (InvokeEndpoint -> Maybe Text -> InvokeEndpoint)
-> Lens InvokeEndpoint InvokeEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpoint' {Maybe Text
accept :: Maybe Text
$sel:accept:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
accept} -> Maybe Text
accept) (\s :: InvokeEndpoint
s@InvokeEndpoint' {} Maybe Text
a -> InvokeEndpoint
s {$sel:accept:InvokeEndpoint' :: Maybe Text
accept = Maybe Text
a} :: InvokeEndpoint)

-- | The model to request for inference when invoking a multi-model endpoint.
invokeEndpoint_targetModel :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_targetModel :: (Maybe Text -> f (Maybe Text))
-> InvokeEndpoint -> f InvokeEndpoint
invokeEndpoint_targetModel = (InvokeEndpoint -> Maybe Text)
-> (InvokeEndpoint -> Maybe Text -> InvokeEndpoint)
-> Lens InvokeEndpoint InvokeEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpoint' {Maybe Text
targetModel :: Maybe Text
$sel:targetModel:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
targetModel} -> Maybe Text
targetModel) (\s :: InvokeEndpoint
s@InvokeEndpoint' {} Maybe Text
a -> InvokeEndpoint
s {$sel:targetModel:InvokeEndpoint' :: Maybe Text
targetModel = Maybe Text
a} :: InvokeEndpoint)

-- | Provides additional information about a request for an inference
-- submitted to a model hosted at an Amazon SageMaker endpoint. The
-- information is an opaque value that is forwarded verbatim. You could use
-- this value, for example, to provide an ID that you can use to track a
-- request or to provide other metadata that a service endpoint was
-- programmed to process. The value must consist of no more than 1024
-- visible US-ASCII characters as specified in
-- <https://tools.ietf.org/html/rfc7230#section-3.2.6 Section 3.3.6. Field Value Components>
-- of the Hypertext Transfer Protocol (HTTP\/1.1).
--
-- The code in your model is responsible for setting or updating any custom
-- attributes in the response. If your code does not set this value in the
-- response, an empty value is returned. For example, if a custom attribute
-- represents the trace ID, your model can prepend the custom attribute
-- with @Trace ID:@ in your post-processing function.
--
-- This feature is currently supported in the AWS SDKs but not in the
-- Amazon SageMaker Python SDK.
invokeEndpoint_customAttributes :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_customAttributes :: (Maybe Text -> f (Maybe Text))
-> InvokeEndpoint -> f InvokeEndpoint
invokeEndpoint_customAttributes = (InvokeEndpoint -> Maybe (Sensitive Text))
-> (InvokeEndpoint -> Maybe (Sensitive Text) -> InvokeEndpoint)
-> Lens
     InvokeEndpoint
     InvokeEndpoint
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpoint' {Maybe (Sensitive Text)
customAttributes :: Maybe (Sensitive Text)
$sel:customAttributes:InvokeEndpoint' :: InvokeEndpoint -> Maybe (Sensitive Text)
customAttributes} -> Maybe (Sensitive Text)
customAttributes) (\s :: InvokeEndpoint
s@InvokeEndpoint' {} Maybe (Sensitive Text)
a -> InvokeEndpoint
s {$sel:customAttributes:InvokeEndpoint' :: Maybe (Sensitive Text)
customAttributes = Maybe (Sensitive Text)
a} :: InvokeEndpoint) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> InvokeEndpoint -> f InvokeEndpoint)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> InvokeEndpoint
-> f InvokeEndpoint
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | If you provide a value, it is added to the captured data when you enable
-- data capture on the endpoint. For information about data capture, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/model-monitor-data-capture.html Capture Data>.
invokeEndpoint_inferenceId :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_inferenceId :: (Maybe Text -> f (Maybe Text))
-> InvokeEndpoint -> f InvokeEndpoint
invokeEndpoint_inferenceId = (InvokeEndpoint -> Maybe Text)
-> (InvokeEndpoint -> Maybe Text -> InvokeEndpoint)
-> Lens InvokeEndpoint InvokeEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpoint' {Maybe Text
inferenceId :: Maybe Text
$sel:inferenceId:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
inferenceId} -> Maybe Text
inferenceId) (\s :: InvokeEndpoint
s@InvokeEndpoint' {} Maybe Text
a -> InvokeEndpoint
s {$sel:inferenceId:InvokeEndpoint' :: Maybe Text
inferenceId = Maybe Text
a} :: InvokeEndpoint)

-- | Specify the production variant to send the inference request to when
-- invoking an endpoint that is running two or more variants. Note that
-- this parameter overrides the default behavior for the endpoint, which is
-- to distribute the invocation traffic based on the variant weights.
--
-- For information about how to use variant targeting to perform a\/b
-- testing, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html Test models in production>
invokeEndpoint_targetVariant :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_targetVariant :: (Maybe Text -> f (Maybe Text))
-> InvokeEndpoint -> f InvokeEndpoint
invokeEndpoint_targetVariant = (InvokeEndpoint -> Maybe Text)
-> (InvokeEndpoint -> Maybe Text -> InvokeEndpoint)
-> Lens InvokeEndpoint InvokeEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpoint' {Maybe Text
targetVariant :: Maybe Text
$sel:targetVariant:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
targetVariant} -> Maybe Text
targetVariant) (\s :: InvokeEndpoint
s@InvokeEndpoint' {} Maybe Text
a -> InvokeEndpoint
s {$sel:targetVariant:InvokeEndpoint' :: Maybe Text
targetVariant = Maybe Text
a} :: InvokeEndpoint)

-- | The MIME type of the input data in the request body.
invokeEndpoint_contentType :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_contentType :: (Maybe Text -> f (Maybe Text))
-> InvokeEndpoint -> f InvokeEndpoint
invokeEndpoint_contentType = (InvokeEndpoint -> Maybe Text)
-> (InvokeEndpoint -> Maybe Text -> InvokeEndpoint)
-> Lens InvokeEndpoint InvokeEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpoint' {Maybe Text
contentType :: Maybe Text
$sel:contentType:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: InvokeEndpoint
s@InvokeEndpoint' {} Maybe Text
a -> InvokeEndpoint
s {$sel:contentType:InvokeEndpoint' :: Maybe Text
contentType = Maybe Text
a} :: InvokeEndpoint)

-- | If the endpoint hosts multiple containers and is configured to use
-- direct invocation, this parameter specifies the host name of the
-- container to invoke.
invokeEndpoint_targetContainerHostname :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_targetContainerHostname :: (Maybe Text -> f (Maybe Text))
-> InvokeEndpoint -> f InvokeEndpoint
invokeEndpoint_targetContainerHostname = (InvokeEndpoint -> Maybe Text)
-> (InvokeEndpoint -> Maybe Text -> InvokeEndpoint)
-> Lens InvokeEndpoint InvokeEndpoint (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpoint' {Maybe Text
targetContainerHostname :: Maybe Text
$sel:targetContainerHostname:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
targetContainerHostname} -> Maybe Text
targetContainerHostname) (\s :: InvokeEndpoint
s@InvokeEndpoint' {} Maybe Text
a -> InvokeEndpoint
s {$sel:targetContainerHostname:InvokeEndpoint' :: Maybe Text
targetContainerHostname = Maybe Text
a} :: InvokeEndpoint)

-- | The name of the endpoint that you specified when you created the
-- endpoint using the
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html CreateEndpoint>
-- API.
invokeEndpoint_endpointName :: Lens.Lens' InvokeEndpoint Prelude.Text
invokeEndpoint_endpointName :: (Text -> f Text) -> InvokeEndpoint -> f InvokeEndpoint
invokeEndpoint_endpointName = (InvokeEndpoint -> Text)
-> (InvokeEndpoint -> Text -> InvokeEndpoint)
-> Lens InvokeEndpoint InvokeEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpoint' {Text
endpointName :: Text
$sel:endpointName:InvokeEndpoint' :: InvokeEndpoint -> Text
endpointName} -> Text
endpointName) (\s :: InvokeEndpoint
s@InvokeEndpoint' {} Text
a -> InvokeEndpoint
s {$sel:endpointName:InvokeEndpoint' :: Text
endpointName = Text
a} :: InvokeEndpoint)

-- | Provides input data, in the format specified in the @ContentType@
-- request header. Amazon SageMaker passes all of the data in the body to
-- the model.
--
-- For information about the format of the request body, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html Common Data Formats-Inference>.
invokeEndpoint_body :: Lens.Lens' InvokeEndpoint Prelude.Text
invokeEndpoint_body :: (Text -> f Text) -> InvokeEndpoint -> f InvokeEndpoint
invokeEndpoint_body = (InvokeEndpoint -> Text)
-> (InvokeEndpoint -> Text -> InvokeEndpoint)
-> Lens InvokeEndpoint InvokeEndpoint Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpoint' {Text
body :: Text
$sel:body:InvokeEndpoint' :: InvokeEndpoint -> Text
body} -> Text
body) (\s :: InvokeEndpoint
s@InvokeEndpoint' {} Text
a -> InvokeEndpoint
s {$sel:body:InvokeEndpoint' :: Text
body = Text
a} :: InvokeEndpoint)

instance Core.AWSRequest InvokeEndpoint where
  type
    AWSResponse InvokeEndpoint =
      InvokeEndpointResponse
  request :: InvokeEndpoint -> Request InvokeEndpoint
request = Service -> InvokeEndpoint -> Request InvokeEndpoint
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy InvokeEndpoint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse InvokeEndpoint)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse InvokeEndpoint))
-> Logger
-> Service
-> Proxy InvokeEndpoint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse InvokeEndpoint)))
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
-> Maybe (Sensitive Text)
-> Maybe Text
-> Int
-> Text
-> InvokeEndpointResponse
InvokeEndpointResponse'
            (Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe Text
 -> Int
 -> Text
 -> InvokeEndpointResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (Sensitive Text)
      -> Maybe Text -> Int -> Text -> InvokeEndpointResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-Amzn-Invoked-Production-Variant")
            Either
  String
  (Maybe (Sensitive Text)
   -> Maybe Text -> Int -> Text -> InvokeEndpointResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String (Maybe Text -> Int -> Text -> InvokeEndpointResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe (Sensitive Text))
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"X-Amzn-SageMaker-Custom-Attributes")
            Either String (Maybe Text -> Int -> Text -> InvokeEndpointResponse)
-> Either String (Maybe Text)
-> Either String (Int -> Text -> InvokeEndpointResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Type")
            Either String (Int -> Text -> InvokeEndpointResponse)
-> Either String Int
-> Either String (Text -> InvokeEndpointResponse)
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))
            Either String (Text -> InvokeEndpointResponse)
-> Either String Text -> Either String InvokeEndpointResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String Text
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
      )

instance Prelude.Hashable InvokeEndpoint

instance Prelude.NFData InvokeEndpoint

instance Core.ToHeaders InvokeEndpoint where
  toHeaders :: InvokeEndpoint -> ResponseHeaders
toHeaders InvokeEndpoint' {Maybe Text
Maybe (Sensitive Text)
Text
body :: Text
endpointName :: Text
targetContainerHostname :: Maybe Text
contentType :: Maybe Text
targetVariant :: Maybe Text
inferenceId :: Maybe Text
customAttributes :: Maybe (Sensitive Text)
targetModel :: Maybe Text
accept :: Maybe Text
$sel:body:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:endpointName:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:targetContainerHostname:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:contentType:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:targetVariant:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:inferenceId:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:customAttributes:InvokeEndpoint' :: InvokeEndpoint -> Maybe (Sensitive Text)
$sel:targetModel:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:accept:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"Accept" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
accept,
        HeaderName
"X-Amzn-SageMaker-Target-Model" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
targetModel,
        HeaderName
"X-Amzn-SageMaker-Custom-Attributes"
          HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
customAttributes,
        HeaderName
"X-Amzn-SageMaker-Inference-Id" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
inferenceId,
        HeaderName
"X-Amzn-SageMaker-Target-Variant"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
targetVariant,
        HeaderName
"Content-Type" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
contentType,
        HeaderName
"X-Amzn-SageMaker-Target-Container-Hostname"
          HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
targetContainerHostname
      ]

instance Core.ToJSON InvokeEndpoint where
  toJSON :: InvokeEndpoint -> Value
toJSON InvokeEndpoint' {Maybe Text
Maybe (Sensitive Text)
Text
body :: Text
endpointName :: Text
targetContainerHostname :: Maybe Text
contentType :: Maybe Text
targetVariant :: Maybe Text
inferenceId :: Maybe Text
customAttributes :: Maybe (Sensitive Text)
targetModel :: Maybe Text
accept :: Maybe Text
$sel:body:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:endpointName:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:targetContainerHostname:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:contentType:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:targetVariant:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:inferenceId:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:customAttributes:InvokeEndpoint' :: InvokeEndpoint -> Maybe (Sensitive Text)
$sel:targetModel:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:accept:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Body" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
body)]
      )

instance Core.ToPath InvokeEndpoint where
  toPath :: InvokeEndpoint -> ByteString
toPath InvokeEndpoint' {Maybe Text
Maybe (Sensitive Text)
Text
body :: Text
endpointName :: Text
targetContainerHostname :: Maybe Text
contentType :: Maybe Text
targetVariant :: Maybe Text
inferenceId :: Maybe Text
customAttributes :: Maybe (Sensitive Text)
targetModel :: Maybe Text
accept :: Maybe Text
$sel:body:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:endpointName:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:targetContainerHostname:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:contentType:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:targetVariant:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:inferenceId:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:customAttributes:InvokeEndpoint' :: InvokeEndpoint -> Maybe (Sensitive Text)
$sel:targetModel:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:accept:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/endpoints/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
endpointName,
        ByteString
"/invocations"
      ]

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

-- | /See:/ 'newInvokeEndpointResponse' smart constructor.
data InvokeEndpointResponse = InvokeEndpointResponse'
  { -- | Identifies the production variant that was invoked.
    InvokeEndpointResponse -> Maybe Text
invokedProductionVariant :: Prelude.Maybe Prelude.Text,
    -- | Provides additional information in the response about the inference
    -- returned by a model hosted at an Amazon SageMaker endpoint. The
    -- information is an opaque value that is forwarded verbatim. You could use
    -- this value, for example, to return an ID received in the
    -- @CustomAttributes@ header of a request or other metadata that a service
    -- endpoint was programmed to produce. The value must consist of no more
    -- than 1024 visible US-ASCII characters as specified in
    -- <https://tools.ietf.org/html/rfc7230#section-3.2.6 Section 3.3.6. Field Value Components>
    -- of the Hypertext Transfer Protocol (HTTP\/1.1). If the customer wants
    -- the custom attribute returned, the model must set the custom attribute
    -- to be included on the way back.
    --
    -- The code in your model is responsible for setting or updating any custom
    -- attributes in the response. If your code does not set this value in the
    -- response, an empty value is returned. For example, if a custom attribute
    -- represents the trace ID, your model can prepend the custom attribute
    -- with @Trace ID:@ in your post-processing function.
    --
    -- This feature is currently supported in the AWS SDKs but not in the
    -- Amazon SageMaker Python SDK.
    InvokeEndpointResponse -> Maybe (Sensitive Text)
customAttributes :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The MIME type of the inference returned in the response body.
    InvokeEndpointResponse -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    InvokeEndpointResponse -> Int
httpStatus :: Prelude.Int,
    -- | Includes the inference provided by the model.
    --
    -- For information about the format of the response body, see
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html Common Data Formats-Inference>.
    InvokeEndpointResponse -> Text
body :: Prelude.Text
  }
  deriving (InvokeEndpointResponse -> InvokeEndpointResponse -> Bool
(InvokeEndpointResponse -> InvokeEndpointResponse -> Bool)
-> (InvokeEndpointResponse -> InvokeEndpointResponse -> Bool)
-> Eq InvokeEndpointResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InvokeEndpointResponse -> InvokeEndpointResponse -> Bool
$c/= :: InvokeEndpointResponse -> InvokeEndpointResponse -> Bool
== :: InvokeEndpointResponse -> InvokeEndpointResponse -> Bool
$c== :: InvokeEndpointResponse -> InvokeEndpointResponse -> Bool
Prelude.Eq, Int -> InvokeEndpointResponse -> ShowS
[InvokeEndpointResponse] -> ShowS
InvokeEndpointResponse -> String
(Int -> InvokeEndpointResponse -> ShowS)
-> (InvokeEndpointResponse -> String)
-> ([InvokeEndpointResponse] -> ShowS)
-> Show InvokeEndpointResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InvokeEndpointResponse] -> ShowS
$cshowList :: [InvokeEndpointResponse] -> ShowS
show :: InvokeEndpointResponse -> String
$cshow :: InvokeEndpointResponse -> String
showsPrec :: Int -> InvokeEndpointResponse -> ShowS
$cshowsPrec :: Int -> InvokeEndpointResponse -> ShowS
Prelude.Show, (forall x. InvokeEndpointResponse -> Rep InvokeEndpointResponse x)
-> (forall x.
    Rep InvokeEndpointResponse x -> InvokeEndpointResponse)
-> Generic InvokeEndpointResponse
forall x. Rep InvokeEndpointResponse x -> InvokeEndpointResponse
forall x. InvokeEndpointResponse -> Rep InvokeEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InvokeEndpointResponse x -> InvokeEndpointResponse
$cfrom :: forall x. InvokeEndpointResponse -> Rep InvokeEndpointResponse x
Prelude.Generic)

-- |
-- Create a value of 'InvokeEndpointResponse' 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:
--
-- 'invokedProductionVariant', 'invokeEndpointResponse_invokedProductionVariant' - Identifies the production variant that was invoked.
--
-- 'customAttributes', 'invokeEndpointResponse_customAttributes' - Provides additional information in the response about the inference
-- returned by a model hosted at an Amazon SageMaker endpoint. The
-- information is an opaque value that is forwarded verbatim. You could use
-- this value, for example, to return an ID received in the
-- @CustomAttributes@ header of a request or other metadata that a service
-- endpoint was programmed to produce. The value must consist of no more
-- than 1024 visible US-ASCII characters as specified in
-- <https://tools.ietf.org/html/rfc7230#section-3.2.6 Section 3.3.6. Field Value Components>
-- of the Hypertext Transfer Protocol (HTTP\/1.1). If the customer wants
-- the custom attribute returned, the model must set the custom attribute
-- to be included on the way back.
--
-- The code in your model is responsible for setting or updating any custom
-- attributes in the response. If your code does not set this value in the
-- response, an empty value is returned. For example, if a custom attribute
-- represents the trace ID, your model can prepend the custom attribute
-- with @Trace ID:@ in your post-processing function.
--
-- This feature is currently supported in the AWS SDKs but not in the
-- Amazon SageMaker Python SDK.
--
-- 'contentType', 'invokeEndpointResponse_contentType' - The MIME type of the inference returned in the response body.
--
-- 'httpStatus', 'invokeEndpointResponse_httpStatus' - The response's http status code.
--
-- 'body', 'invokeEndpointResponse_body' - Includes the inference provided by the model.
--
-- For information about the format of the response body, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html Common Data Formats-Inference>.
newInvokeEndpointResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'body'
  Prelude.Text ->
  InvokeEndpointResponse
newInvokeEndpointResponse :: Int -> Text -> InvokeEndpointResponse
newInvokeEndpointResponse Int
pHttpStatus_ Text
pBody_ =
  InvokeEndpointResponse' :: Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Int
-> Text
-> InvokeEndpointResponse
InvokeEndpointResponse'
    { $sel:invokedProductionVariant:InvokeEndpointResponse' :: Maybe Text
invokedProductionVariant =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customAttributes:InvokeEndpointResponse' :: Maybe (Sensitive Text)
customAttributes = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:InvokeEndpointResponse' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:InvokeEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:body:InvokeEndpointResponse' :: Text
body = Text
pBody_
    }

-- | Identifies the production variant that was invoked.
invokeEndpointResponse_invokedProductionVariant :: Lens.Lens' InvokeEndpointResponse (Prelude.Maybe Prelude.Text)
invokeEndpointResponse_invokedProductionVariant :: (Maybe Text -> f (Maybe Text))
-> InvokeEndpointResponse -> f InvokeEndpointResponse
invokeEndpointResponse_invokedProductionVariant = (InvokeEndpointResponse -> Maybe Text)
-> (InvokeEndpointResponse -> Maybe Text -> InvokeEndpointResponse)
-> Lens
     InvokeEndpointResponse
     InvokeEndpointResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpointResponse' {Maybe Text
invokedProductionVariant :: Maybe Text
$sel:invokedProductionVariant:InvokeEndpointResponse' :: InvokeEndpointResponse -> Maybe Text
invokedProductionVariant} -> Maybe Text
invokedProductionVariant) (\s :: InvokeEndpointResponse
s@InvokeEndpointResponse' {} Maybe Text
a -> InvokeEndpointResponse
s {$sel:invokedProductionVariant:InvokeEndpointResponse' :: Maybe Text
invokedProductionVariant = Maybe Text
a} :: InvokeEndpointResponse)

-- | Provides additional information in the response about the inference
-- returned by a model hosted at an Amazon SageMaker endpoint. The
-- information is an opaque value that is forwarded verbatim. You could use
-- this value, for example, to return an ID received in the
-- @CustomAttributes@ header of a request or other metadata that a service
-- endpoint was programmed to produce. The value must consist of no more
-- than 1024 visible US-ASCII characters as specified in
-- <https://tools.ietf.org/html/rfc7230#section-3.2.6 Section 3.3.6. Field Value Components>
-- of the Hypertext Transfer Protocol (HTTP\/1.1). If the customer wants
-- the custom attribute returned, the model must set the custom attribute
-- to be included on the way back.
--
-- The code in your model is responsible for setting or updating any custom
-- attributes in the response. If your code does not set this value in the
-- response, an empty value is returned. For example, if a custom attribute
-- represents the trace ID, your model can prepend the custom attribute
-- with @Trace ID:@ in your post-processing function.
--
-- This feature is currently supported in the AWS SDKs but not in the
-- Amazon SageMaker Python SDK.
invokeEndpointResponse_customAttributes :: Lens.Lens' InvokeEndpointResponse (Prelude.Maybe Prelude.Text)
invokeEndpointResponse_customAttributes :: (Maybe Text -> f (Maybe Text))
-> InvokeEndpointResponse -> f InvokeEndpointResponse
invokeEndpointResponse_customAttributes = (InvokeEndpointResponse -> Maybe (Sensitive Text))
-> (InvokeEndpointResponse
    -> Maybe (Sensitive Text) -> InvokeEndpointResponse)
-> Lens
     InvokeEndpointResponse
     InvokeEndpointResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpointResponse' {Maybe (Sensitive Text)
customAttributes :: Maybe (Sensitive Text)
$sel:customAttributes:InvokeEndpointResponse' :: InvokeEndpointResponse -> Maybe (Sensitive Text)
customAttributes} -> Maybe (Sensitive Text)
customAttributes) (\s :: InvokeEndpointResponse
s@InvokeEndpointResponse' {} Maybe (Sensitive Text)
a -> InvokeEndpointResponse
s {$sel:customAttributes:InvokeEndpointResponse' :: Maybe (Sensitive Text)
customAttributes = Maybe (Sensitive Text)
a} :: InvokeEndpointResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> InvokeEndpointResponse -> f InvokeEndpointResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> InvokeEndpointResponse
-> f InvokeEndpointResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The MIME type of the inference returned in the response body.
invokeEndpointResponse_contentType :: Lens.Lens' InvokeEndpointResponse (Prelude.Maybe Prelude.Text)
invokeEndpointResponse_contentType :: (Maybe Text -> f (Maybe Text))
-> InvokeEndpointResponse -> f InvokeEndpointResponse
invokeEndpointResponse_contentType = (InvokeEndpointResponse -> Maybe Text)
-> (InvokeEndpointResponse -> Maybe Text -> InvokeEndpointResponse)
-> Lens
     InvokeEndpointResponse
     InvokeEndpointResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpointResponse' {Maybe Text
contentType :: Maybe Text
$sel:contentType:InvokeEndpointResponse' :: InvokeEndpointResponse -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: InvokeEndpointResponse
s@InvokeEndpointResponse' {} Maybe Text
a -> InvokeEndpointResponse
s {$sel:contentType:InvokeEndpointResponse' :: Maybe Text
contentType = Maybe Text
a} :: InvokeEndpointResponse)

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

-- | Includes the inference provided by the model.
--
-- For information about the format of the response body, see
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/cdf-inference.html Common Data Formats-Inference>.
invokeEndpointResponse_body :: Lens.Lens' InvokeEndpointResponse Prelude.Text
invokeEndpointResponse_body :: (Text -> f Text)
-> InvokeEndpointResponse -> f InvokeEndpointResponse
invokeEndpointResponse_body = (InvokeEndpointResponse -> Text)
-> (InvokeEndpointResponse -> Text -> InvokeEndpointResponse)
-> Lens InvokeEndpointResponse InvokeEndpointResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpointResponse' {Text
body :: Text
$sel:body:InvokeEndpointResponse' :: InvokeEndpointResponse -> Text
body} -> Text
body) (\s :: InvokeEndpointResponse
s@InvokeEndpointResponse' {} Text
a -> InvokeEndpointResponse
s {$sel:body:InvokeEndpointResponse' :: Text
body = Text
a} :: InvokeEndpointResponse)

instance Prelude.NFData InvokeEndpointResponse