{-# 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.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.SageMakerA2IRuntime.Types
data StopHumanLoop = StopHumanLoop'
{
StopHumanLoop -> Text
humanLoopName :: Prelude.Text
}
deriving (StopHumanLoop -> StopHumanLoop -> Bool
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]
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
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. 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' {$sel:humanLoopName:StopHumanLoop' :: Text
humanLoopName = Text
pHumanLoopName_}
stopHumanLoop_humanLoopName :: Lens.Lens' StopHumanLoop Prelude.Text
stopHumanLoop_humanLoopName :: Lens' StopHumanLoop Text
stopHumanLoop_humanLoopName = 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 :: (Service -> Service) -> StopHumanLoop -> Request StopHumanLoop
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 StopHumanLoop
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopHumanLoop)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> StopHumanLoopResponse
StopHumanLoopResponse'
forall (f :: * -> *) a b. Functor 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))
)
instance Prelude.Hashable StopHumanLoop where
hashWithSalt :: Int -> StopHumanLoop -> Int
hashWithSalt Int
_salt StopHumanLoop' {Text
humanLoopName :: Text
$sel:humanLoopName:StopHumanLoop' :: StopHumanLoop -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
humanLoopName
instance Prelude.NFData StopHumanLoop where
rnf :: StopHumanLoop -> ()
rnf StopHumanLoop' {Text
humanLoopName :: Text
$sel:humanLoopName:StopHumanLoop' :: StopHumanLoop -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
humanLoopName
instance Data.ToHeaders StopHumanLoop where
toHeaders :: StopHumanLoop -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON StopHumanLoop where
toJSON :: StopHumanLoop -> Value
toJSON StopHumanLoop' {Text
humanLoopName :: Text
$sel:humanLoopName:StopHumanLoop' :: StopHumanLoop -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"HumanLoopName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
humanLoopName)
]
)
instance Data.ToPath StopHumanLoop where
toPath :: StopHumanLoop -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/human-loops/stop"
instance Data.ToQuery StopHumanLoop where
toQuery :: StopHumanLoop -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopHumanLoopResponse = StopHumanLoopResponse'
{
StopHumanLoopResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopHumanLoopResponse -> StopHumanLoopResponse -> Bool
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]
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
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. 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' {$sel:httpStatus:StopHumanLoopResponse' :: Int
httpStatus = Int
pHttpStatus_}
stopHumanLoopResponse_httpStatus :: Lens.Lens' StopHumanLoopResponse Prelude.Int
stopHumanLoopResponse_httpStatus :: Lens' StopHumanLoopResponse Int
stopHumanLoopResponse_httpStatus = 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 where
rnf :: StopHumanLoopResponse -> ()
rnf StopHumanLoopResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopHumanLoopResponse' :: StopHumanLoopResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus