{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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 Amazon Web Services
-- Signature Version 4. For information, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html Authenticating Requests (Amazon Web Services 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_contentType,
    invokeEndpoint_customAttributes,
    invokeEndpoint_enableExplanations,
    invokeEndpoint_inferenceId,
    invokeEndpoint_targetContainerHostname,
    invokeEndpoint_targetModel,
    invokeEndpoint_targetVariant,
    invokeEndpoint_endpointName,
    invokeEndpoint_body,

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

    -- * Response Lenses
    invokeEndpointResponse_contentType,
    invokeEndpointResponse_customAttributes,
    invokeEndpointResponse_invokedProductionVariant,
    invokeEndpointResponse_httpStatus,
    invokeEndpointResponse_body,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 MIME type of the input data in the request body.
    InvokeEndpoint -> Maybe Text
contentType :: 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 Amazon Web Services SDKs but
    -- not in the Amazon SageMaker Python SDK.
    InvokeEndpoint -> Maybe (Sensitive Text)
customAttributes :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | An optional JMESPath expression used to override the
    -- @EnableExplanations@ parameter of the @ClarifyExplainerConfig@ API. See
    -- the
    -- <https://docs.aws.amazon.com/clarify-online-explainability-create-endpoint.html#clarify-online-exaplainability-create-endpoint-enable EnableExplanations>
    -- section in the developer guide for more information.
    InvokeEndpoint -> Maybe Text
enableExplanations :: Prelude.Maybe 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,
    -- | 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 model to request for inference when invoking a multi-model endpoint.
    InvokeEndpoint -> Maybe Text
targetModel :: 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 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
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
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. 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.
--
-- 'contentType', 'invokeEndpoint_contentType' - The MIME type of the input data in the request body.
--
-- '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 Amazon Web Services SDKs but
-- not in the Amazon SageMaker Python SDK.
--
-- 'enableExplanations', 'invokeEndpoint_enableExplanations' - An optional JMESPath expression used to override the
-- @EnableExplanations@ parameter of the @ClarifyExplainerConfig@ API. See
-- the
-- <https://docs.aws.amazon.com/clarify-online-explainability-create-endpoint.html#clarify-online-exaplainability-create-endpoint-enable EnableExplanations>
-- section in the developer guide for more information.
--
-- '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>.
--
-- '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.
--
-- 'targetModel', 'invokeEndpoint_targetModel' - The model to request for inference when invoking a multi-model endpoint.
--
-- '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>
--
-- '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'
    { $sel:accept:InvokeEndpoint' :: Maybe Text
accept = forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:InvokeEndpoint' :: Maybe Text
contentType = forall a. Maybe a
Prelude.Nothing,
      $sel:customAttributes:InvokeEndpoint' :: Maybe (Sensitive Text)
customAttributes = forall a. Maybe a
Prelude.Nothing,
      $sel:enableExplanations:InvokeEndpoint' :: Maybe Text
enableExplanations = forall a. Maybe a
Prelude.Nothing,
      $sel:inferenceId:InvokeEndpoint' :: Maybe Text
inferenceId = forall a. Maybe a
Prelude.Nothing,
      $sel:targetContainerHostname:InvokeEndpoint' :: Maybe Text
targetContainerHostname = forall a. Maybe a
Prelude.Nothing,
      $sel:targetModel:InvokeEndpoint' :: Maybe Text
targetModel = forall a. Maybe a
Prelude.Nothing,
      $sel:targetVariant:InvokeEndpoint' :: Maybe Text
targetVariant = 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 :: Lens' InvokeEndpoint (Maybe Text)
invokeEndpoint_accept = 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 MIME type of the input data in the request body.
invokeEndpoint_contentType :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_contentType :: Lens' InvokeEndpoint (Maybe Text)
invokeEndpoint_contentType = 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)

-- | 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 Amazon Web Services SDKs but
-- not in the Amazon SageMaker Python SDK.
invokeEndpoint_customAttributes :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_customAttributes :: Lens' InvokeEndpoint (Maybe Text)
invokeEndpoint_customAttributes = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | An optional JMESPath expression used to override the
-- @EnableExplanations@ parameter of the @ClarifyExplainerConfig@ API. See
-- the
-- <https://docs.aws.amazon.com/clarify-online-explainability-create-endpoint.html#clarify-online-exaplainability-create-endpoint-enable EnableExplanations>
-- section in the developer guide for more information.
invokeEndpoint_enableExplanations :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_enableExplanations :: Lens' InvokeEndpoint (Maybe Text)
invokeEndpoint_enableExplanations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InvokeEndpoint' {Maybe Text
enableExplanations :: Maybe Text
$sel:enableExplanations:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
enableExplanations} -> Maybe Text
enableExplanations) (\s :: InvokeEndpoint
s@InvokeEndpoint' {} Maybe Text
a -> InvokeEndpoint
s {$sel:enableExplanations:InvokeEndpoint' :: Maybe Text
enableExplanations = Maybe Text
a} :: InvokeEndpoint)

-- | 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 :: Lens' InvokeEndpoint (Maybe Text)
invokeEndpoint_inferenceId = 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)

-- | 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 :: Lens' InvokeEndpoint (Maybe Text)
invokeEndpoint_targetContainerHostname = 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 model to request for inference when invoking a multi-model endpoint.
invokeEndpoint_targetModel :: Lens.Lens' InvokeEndpoint (Prelude.Maybe Prelude.Text)
invokeEndpoint_targetModel :: Lens' InvokeEndpoint (Maybe Text)
invokeEndpoint_targetModel = 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)

-- | 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 :: Lens' InvokeEndpoint (Maybe Text)
invokeEndpoint_targetVariant = 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 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 :: Lens' InvokeEndpoint Text
invokeEndpoint_endpointName = 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 :: Lens' InvokeEndpoint Text
invokeEndpoint_body = 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 :: (Service -> Service) -> InvokeEndpoint -> Request InvokeEndpoint
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy InvokeEndpoint
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse InvokeEndpoint)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Int
-> Text
-> InvokeEndpointResponse
InvokeEndpointResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"Content-Type")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"X-Amzn-SageMaker-Custom-Attributes")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"x-Amzn-Invoked-Production-Variant")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
      )

instance Prelude.Hashable InvokeEndpoint where
  hashWithSalt :: Int -> InvokeEndpoint -> Int
hashWithSalt Int
_salt InvokeEndpoint' {Maybe Text
Maybe (Sensitive Text)
Text
body :: Text
endpointName :: Text
targetVariant :: Maybe Text
targetModel :: Maybe Text
targetContainerHostname :: Maybe Text
inferenceId :: Maybe Text
enableExplanations :: Maybe Text
customAttributes :: Maybe (Sensitive Text)
contentType :: Maybe Text
accept :: Maybe Text
$sel:body:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:endpointName:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:targetVariant:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:targetModel:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:targetContainerHostname:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:inferenceId:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:enableExplanations:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:customAttributes:InvokeEndpoint' :: InvokeEndpoint -> Maybe (Sensitive Text)
$sel:contentType:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:accept:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accept
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contentType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
customAttributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
enableExplanations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
inferenceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetContainerHostname
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetModel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
targetVariant
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
endpointName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
body

instance Prelude.NFData InvokeEndpoint where
  rnf :: InvokeEndpoint -> ()
rnf InvokeEndpoint' {Maybe Text
Maybe (Sensitive Text)
Text
body :: Text
endpointName :: Text
targetVariant :: Maybe Text
targetModel :: Maybe Text
targetContainerHostname :: Maybe Text
inferenceId :: Maybe Text
enableExplanations :: Maybe Text
customAttributes :: Maybe (Sensitive Text)
contentType :: Maybe Text
accept :: Maybe Text
$sel:body:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:endpointName:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:targetVariant:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:targetModel:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:targetContainerHostname:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:inferenceId:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:enableExplanations:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:customAttributes:InvokeEndpoint' :: InvokeEndpoint -> Maybe (Sensitive Text)
$sel:contentType:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:accept:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accept
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contentType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
customAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
enableExplanations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
inferenceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetContainerHostname
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetModel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
targetVariant
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
endpointName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
body

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

instance Data.ToJSON InvokeEndpoint where
  toJSON :: InvokeEndpoint -> Value
toJSON InvokeEndpoint' {Maybe Text
Maybe (Sensitive Text)
Text
body :: Text
endpointName :: Text
targetVariant :: Maybe Text
targetModel :: Maybe Text
targetContainerHostname :: Maybe Text
inferenceId :: Maybe Text
enableExplanations :: Maybe Text
customAttributes :: Maybe (Sensitive Text)
contentType :: Maybe Text
accept :: Maybe Text
$sel:body:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:endpointName:InvokeEndpoint' :: InvokeEndpoint -> Text
$sel:targetVariant:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:targetModel:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:targetContainerHostname:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:inferenceId:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:enableExplanations:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:customAttributes:InvokeEndpoint' :: InvokeEndpoint -> Maybe (Sensitive Text)
$sel:contentType:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
$sel:accept:InvokeEndpoint' :: InvokeEndpoint -> Maybe Text
..} = forall a. ToJSON a => a -> Value
Data.toJSON Text
body

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

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

-- | /See:/ 'newInvokeEndpointResponse' smart constructor.
data InvokeEndpointResponse = InvokeEndpointResponse'
  { -- | The MIME type of the inference returned in the response body.
    InvokeEndpointResponse -> Maybe Text
contentType :: 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 Amazon Web Services SDKs but
    -- not in the Amazon SageMaker Python SDK.
    InvokeEndpointResponse -> Maybe (Sensitive Text)
customAttributes :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | Identifies the production variant that was invoked.
    InvokeEndpointResponse -> Maybe Text
invokedProductionVariant :: 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>.
    --
    -- If the explainer is activated, the body includes the explanations
    -- provided by the model. For more information, see the __Response
    -- section__ under
    -- <https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-invoke-endpoint.html#clarify-online-explainability-response Invoke the Endpoint>
    -- in the Developer Guide.
    InvokeEndpointResponse -> Text
body :: Prelude.Text
  }
  deriving (InvokeEndpointResponse -> InvokeEndpointResponse -> Bool
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
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. 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:
--
-- 'contentType', 'invokeEndpointResponse_contentType' - The MIME type of the inference returned in the response body.
--
-- '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 Amazon Web Services SDKs but
-- not in the Amazon SageMaker Python SDK.
--
-- 'invokedProductionVariant', 'invokeEndpointResponse_invokedProductionVariant' - Identifies the production variant that was invoked.
--
-- '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>.
--
-- If the explainer is activated, the body includes the explanations
-- provided by the model. For more information, see the __Response
-- section__ under
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-invoke-endpoint.html#clarify-online-explainability-response Invoke the Endpoint>
-- in the Developer Guide.
newInvokeEndpointResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'body'
  Prelude.Text ->
  InvokeEndpointResponse
newInvokeEndpointResponse :: Int -> Text -> InvokeEndpointResponse
newInvokeEndpointResponse Int
pHttpStatus_ Text
pBody_ =
  InvokeEndpointResponse'
    { $sel:contentType:InvokeEndpointResponse' :: Maybe Text
contentType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:customAttributes:InvokeEndpointResponse' :: Maybe (Sensitive Text)
customAttributes = forall a. Maybe a
Prelude.Nothing,
      $sel:invokedProductionVariant:InvokeEndpointResponse' :: Maybe Text
invokedProductionVariant = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:InvokeEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:body:InvokeEndpointResponse' :: Text
body = Text
pBody_
    }

-- | The MIME type of the inference returned in the response body.
invokeEndpointResponse_contentType :: Lens.Lens' InvokeEndpointResponse (Prelude.Maybe Prelude.Text)
invokeEndpointResponse_contentType :: Lens' InvokeEndpointResponse (Maybe Text)
invokeEndpointResponse_contentType = 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)

-- | 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 Amazon Web Services SDKs but
-- not in the Amazon SageMaker Python SDK.
invokeEndpointResponse_customAttributes :: Lens.Lens' InvokeEndpointResponse (Prelude.Maybe Prelude.Text)
invokeEndpointResponse_customAttributes :: Lens' InvokeEndpointResponse (Maybe Text)
invokeEndpointResponse_customAttributes = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | Identifies the production variant that was invoked.
invokeEndpointResponse_invokedProductionVariant :: Lens.Lens' InvokeEndpointResponse (Prelude.Maybe Prelude.Text)
invokeEndpointResponse_invokedProductionVariant :: Lens' InvokeEndpointResponse (Maybe Text)
invokeEndpointResponse_invokedProductionVariant = 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)

-- | The response's http status code.
invokeEndpointResponse_httpStatus :: Lens.Lens' InvokeEndpointResponse Prelude.Int
invokeEndpointResponse_httpStatus :: Lens' InvokeEndpointResponse Int
invokeEndpointResponse_httpStatus = 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>.
--
-- If the explainer is activated, the body includes the explanations
-- provided by the model. For more information, see the __Response
-- section__ under
-- <https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-invoke-endpoint.html#clarify-online-explainability-response Invoke the Endpoint>
-- in the Developer Guide.
invokeEndpointResponse_body :: Lens.Lens' InvokeEndpointResponse Prelude.Text
invokeEndpointResponse_body :: Lens' InvokeEndpointResponse Text
invokeEndpointResponse_body = 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 where
  rnf :: InvokeEndpointResponse -> ()
rnf InvokeEndpointResponse' {Int
Maybe Text
Maybe (Sensitive Text)
Text
body :: Text
httpStatus :: Int
invokedProductionVariant :: Maybe Text
customAttributes :: Maybe (Sensitive Text)
contentType :: Maybe Text
$sel:body:InvokeEndpointResponse' :: InvokeEndpointResponse -> Text
$sel:httpStatus:InvokeEndpointResponse' :: InvokeEndpointResponse -> Int
$sel:invokedProductionVariant:InvokeEndpointResponse' :: InvokeEndpointResponse -> Maybe Text
$sel:customAttributes:InvokeEndpointResponse' :: InvokeEndpointResponse -> Maybe (Sensitive Text)
$sel:contentType:InvokeEndpointResponse' :: InvokeEndpointResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contentType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
customAttributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
invokedProductionVariant
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
body