{-# 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 #-}
module Amazonka.SageMakerRuntime.InvokeEndpoint
(
InvokeEndpoint (..),
newInvokeEndpoint,
invokeEndpoint_accept,
invokeEndpoint_contentType,
invokeEndpoint_customAttributes,
invokeEndpoint_enableExplanations,
invokeEndpoint_inferenceId,
invokeEndpoint_targetContainerHostname,
invokeEndpoint_targetModel,
invokeEndpoint_targetVariant,
invokeEndpoint_endpointName,
invokeEndpoint_body,
InvokeEndpointResponse (..),
newInvokeEndpointResponse,
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
data InvokeEndpoint = InvokeEndpoint'
{
InvokeEndpoint -> Maybe Text
accept :: Prelude.Maybe Prelude.Text,
InvokeEndpoint -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
InvokeEndpoint -> Maybe (Sensitive Text)
customAttributes :: Prelude.Maybe (Data.Sensitive Prelude.Text),
InvokeEndpoint -> Maybe Text
enableExplanations :: Prelude.Maybe Prelude.Text,
InvokeEndpoint -> Maybe Text
inferenceId :: Prelude.Maybe Prelude.Text,
InvokeEndpoint -> Maybe Text
targetContainerHostname :: Prelude.Maybe Prelude.Text,
InvokeEndpoint -> Maybe Text
targetModel :: Prelude.Maybe Prelude.Text,
InvokeEndpoint -> Maybe Text
targetVariant :: Prelude.Maybe Prelude.Text,
InvokeEndpoint -> Text
endpointName :: Prelude.Text,
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)
newInvokeEndpoint ::
Prelude.Text ->
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_
}
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)
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)
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
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)
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)
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)
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)
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)
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)
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
data InvokeEndpointResponse = InvokeEndpointResponse'
{
InvokeEndpointResponse -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
InvokeEndpointResponse -> Maybe (Sensitive Text)
customAttributes :: Prelude.Maybe (Data.Sensitive Prelude.Text),
InvokeEndpointResponse -> Maybe Text
invokedProductionVariant :: Prelude.Maybe Prelude.Text,
InvokeEndpointResponse -> Int
httpStatus :: Prelude.Int,
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)
newInvokeEndpointResponse ::
Prelude.Int ->
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_
}
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)
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
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)
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)
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