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