{-# 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.SageMakerA2IRuntime.StopHumanLoop
(
StopHumanLoop (..),
newStopHumanLoop,
stopHumanLoop_humanLoopName,
StopHumanLoopResponse (..),
newStopHumanLoopResponse,
stopHumanLoopResponse_httpStatus,
)
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.SageMakerA2IRuntime.Types
data StopHumanLoop = StopHumanLoop'
{
StopHumanLoop -> Text
humanLoopName :: Prelude.Text
}
deriving (StopHumanLoop -> StopHumanLoop -> Bool
(StopHumanLoop -> StopHumanLoop -> Bool)
-> (StopHumanLoop -> StopHumanLoop -> Bool) -> Eq StopHumanLoop
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopHumanLoop -> StopHumanLoop -> Bool
$c/= :: StopHumanLoop -> StopHumanLoop -> Bool
== :: StopHumanLoop -> StopHumanLoop -> Bool
$c== :: StopHumanLoop -> StopHumanLoop -> Bool
Prelude.Eq, ReadPrec [StopHumanLoop]
ReadPrec StopHumanLoop
Int -> ReadS StopHumanLoop
ReadS [StopHumanLoop]
(Int -> ReadS StopHumanLoop)
-> ReadS [StopHumanLoop]
-> ReadPrec StopHumanLoop
-> ReadPrec [StopHumanLoop]
-> Read StopHumanLoop
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopHumanLoop]
$creadListPrec :: ReadPrec [StopHumanLoop]
readPrec :: ReadPrec StopHumanLoop
$creadPrec :: ReadPrec StopHumanLoop
readList :: ReadS [StopHumanLoop]
$creadList :: ReadS [StopHumanLoop]
readsPrec :: Int -> ReadS StopHumanLoop
$creadsPrec :: Int -> ReadS StopHumanLoop
Prelude.Read, Int -> StopHumanLoop -> ShowS
[StopHumanLoop] -> ShowS
StopHumanLoop -> String
(Int -> StopHumanLoop -> ShowS)
-> (StopHumanLoop -> String)
-> ([StopHumanLoop] -> ShowS)
-> Show StopHumanLoop
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopHumanLoop] -> ShowS
$cshowList :: [StopHumanLoop] -> ShowS
show :: StopHumanLoop -> String
$cshow :: StopHumanLoop -> String
showsPrec :: Int -> StopHumanLoop -> ShowS
$cshowsPrec :: Int -> StopHumanLoop -> ShowS
Prelude.Show, (forall x. StopHumanLoop -> Rep StopHumanLoop x)
-> (forall x. Rep StopHumanLoop x -> StopHumanLoop)
-> Generic StopHumanLoop
forall x. Rep StopHumanLoop x -> StopHumanLoop
forall x. StopHumanLoop -> Rep StopHumanLoop x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopHumanLoop x -> StopHumanLoop
$cfrom :: forall x. StopHumanLoop -> Rep StopHumanLoop x
Prelude.Generic)
newStopHumanLoop ::
Prelude.Text ->
StopHumanLoop
newStopHumanLoop :: Text -> StopHumanLoop
newStopHumanLoop Text
pHumanLoopName_ =
StopHumanLoop' :: Text -> StopHumanLoop
StopHumanLoop' {$sel:humanLoopName:StopHumanLoop' :: Text
humanLoopName = Text
pHumanLoopName_}
stopHumanLoop_humanLoopName :: Lens.Lens' StopHumanLoop Prelude.Text
stopHumanLoop_humanLoopName :: (Text -> f Text) -> StopHumanLoop -> f StopHumanLoop
stopHumanLoop_humanLoopName = (StopHumanLoop -> Text)
-> (StopHumanLoop -> Text -> StopHumanLoop)
-> Lens StopHumanLoop StopHumanLoop Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopHumanLoop' {Text
humanLoopName :: Text
$sel:humanLoopName:StopHumanLoop' :: StopHumanLoop -> Text
humanLoopName} -> Text
humanLoopName) (\s :: StopHumanLoop
s@StopHumanLoop' {} Text
a -> StopHumanLoop
s {$sel:humanLoopName:StopHumanLoop' :: Text
humanLoopName = Text
a} :: StopHumanLoop)
instance Core.AWSRequest StopHumanLoop where
type
AWSResponse StopHumanLoop =
StopHumanLoopResponse
request :: StopHumanLoop -> Request StopHumanLoop
request = Service -> StopHumanLoop -> Request StopHumanLoop
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopHumanLoop
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopHumanLoop)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse StopHumanLoop))
-> Logger
-> Service
-> Proxy StopHumanLoop
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopHumanLoop)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> StopHumanLoopResponse
StopHumanLoopResponse'
(Int -> StopHumanLoopResponse)
-> Either String Int -> Either String StopHumanLoopResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StopHumanLoop
instance Prelude.NFData StopHumanLoop
instance Core.ToHeaders StopHumanLoop where
toHeaders :: StopHumanLoop -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopHumanLoop -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON StopHumanLoop where
toJSON :: StopHumanLoop -> Value
toJSON StopHumanLoop' {Text
humanLoopName :: Text
$sel:humanLoopName:StopHumanLoop' :: StopHumanLoop -> 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
"HumanLoopName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
humanLoopName)
]
)
instance Core.ToPath StopHumanLoop where
toPath :: StopHumanLoop -> ByteString
toPath = ByteString -> StopHumanLoop -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/human-loops/stop"
instance Core.ToQuery StopHumanLoop where
toQuery :: StopHumanLoop -> QueryString
toQuery = QueryString -> StopHumanLoop -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopHumanLoopResponse = StopHumanLoopResponse'
{
StopHumanLoopResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopHumanLoopResponse -> StopHumanLoopResponse -> Bool
(StopHumanLoopResponse -> StopHumanLoopResponse -> Bool)
-> (StopHumanLoopResponse -> StopHumanLoopResponse -> Bool)
-> Eq StopHumanLoopResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopHumanLoopResponse -> StopHumanLoopResponse -> Bool
$c/= :: StopHumanLoopResponse -> StopHumanLoopResponse -> Bool
== :: StopHumanLoopResponse -> StopHumanLoopResponse -> Bool
$c== :: StopHumanLoopResponse -> StopHumanLoopResponse -> Bool
Prelude.Eq, ReadPrec [StopHumanLoopResponse]
ReadPrec StopHumanLoopResponse
Int -> ReadS StopHumanLoopResponse
ReadS [StopHumanLoopResponse]
(Int -> ReadS StopHumanLoopResponse)
-> ReadS [StopHumanLoopResponse]
-> ReadPrec StopHumanLoopResponse
-> ReadPrec [StopHumanLoopResponse]
-> Read StopHumanLoopResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopHumanLoopResponse]
$creadListPrec :: ReadPrec [StopHumanLoopResponse]
readPrec :: ReadPrec StopHumanLoopResponse
$creadPrec :: ReadPrec StopHumanLoopResponse
readList :: ReadS [StopHumanLoopResponse]
$creadList :: ReadS [StopHumanLoopResponse]
readsPrec :: Int -> ReadS StopHumanLoopResponse
$creadsPrec :: Int -> ReadS StopHumanLoopResponse
Prelude.Read, Int -> StopHumanLoopResponse -> ShowS
[StopHumanLoopResponse] -> ShowS
StopHumanLoopResponse -> String
(Int -> StopHumanLoopResponse -> ShowS)
-> (StopHumanLoopResponse -> String)
-> ([StopHumanLoopResponse] -> ShowS)
-> Show StopHumanLoopResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopHumanLoopResponse] -> ShowS
$cshowList :: [StopHumanLoopResponse] -> ShowS
show :: StopHumanLoopResponse -> String
$cshow :: StopHumanLoopResponse -> String
showsPrec :: Int -> StopHumanLoopResponse -> ShowS
$cshowsPrec :: Int -> StopHumanLoopResponse -> ShowS
Prelude.Show, (forall x. StopHumanLoopResponse -> Rep StopHumanLoopResponse x)
-> (forall x. Rep StopHumanLoopResponse x -> StopHumanLoopResponse)
-> Generic StopHumanLoopResponse
forall x. Rep StopHumanLoopResponse x -> StopHumanLoopResponse
forall x. StopHumanLoopResponse -> Rep StopHumanLoopResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopHumanLoopResponse x -> StopHumanLoopResponse
$cfrom :: forall x. StopHumanLoopResponse -> Rep StopHumanLoopResponse x
Prelude.Generic)
newStopHumanLoopResponse ::
Prelude.Int ->
StopHumanLoopResponse
newStopHumanLoopResponse :: Int -> StopHumanLoopResponse
newStopHumanLoopResponse Int
pHttpStatus_ =
StopHumanLoopResponse' :: Int -> StopHumanLoopResponse
StopHumanLoopResponse' {$sel:httpStatus:StopHumanLoopResponse' :: Int
httpStatus = Int
pHttpStatus_}
stopHumanLoopResponse_httpStatus :: Lens.Lens' StopHumanLoopResponse Prelude.Int
stopHumanLoopResponse_httpStatus :: (Int -> f Int) -> StopHumanLoopResponse -> f StopHumanLoopResponse
stopHumanLoopResponse_httpStatus = (StopHumanLoopResponse -> Int)
-> (StopHumanLoopResponse -> Int -> StopHumanLoopResponse)
-> Lens StopHumanLoopResponse StopHumanLoopResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopHumanLoopResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopHumanLoopResponse' :: StopHumanLoopResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopHumanLoopResponse
s@StopHumanLoopResponse' {} Int
a -> StopHumanLoopResponse
s {$sel:httpStatus:StopHumanLoopResponse' :: Int
httpStatus = Int
a} :: StopHumanLoopResponse)
instance Prelude.NFData StopHumanLoopResponse