{-# 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.SageMaker.StopPipelineExecution
(
StopPipelineExecution (..),
newStopPipelineExecution,
stopPipelineExecution_pipelineExecutionArn,
stopPipelineExecution_clientRequestToken,
StopPipelineExecutionResponse (..),
newStopPipelineExecutionResponse,
stopPipelineExecutionResponse_pipelineExecutionArn,
stopPipelineExecutionResponse_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.SageMaker.Types
data StopPipelineExecution = StopPipelineExecution'
{
StopPipelineExecution -> Text
pipelineExecutionArn :: Prelude.Text,
StopPipelineExecution -> Text
clientRequestToken :: Prelude.Text
}
deriving (StopPipelineExecution -> StopPipelineExecution -> Bool
(StopPipelineExecution -> StopPipelineExecution -> Bool)
-> (StopPipelineExecution -> StopPipelineExecution -> Bool)
-> Eq StopPipelineExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopPipelineExecution -> StopPipelineExecution -> Bool
$c/= :: StopPipelineExecution -> StopPipelineExecution -> Bool
== :: StopPipelineExecution -> StopPipelineExecution -> Bool
$c== :: StopPipelineExecution -> StopPipelineExecution -> Bool
Prelude.Eq, ReadPrec [StopPipelineExecution]
ReadPrec StopPipelineExecution
Int -> ReadS StopPipelineExecution
ReadS [StopPipelineExecution]
(Int -> ReadS StopPipelineExecution)
-> ReadS [StopPipelineExecution]
-> ReadPrec StopPipelineExecution
-> ReadPrec [StopPipelineExecution]
-> Read StopPipelineExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopPipelineExecution]
$creadListPrec :: ReadPrec [StopPipelineExecution]
readPrec :: ReadPrec StopPipelineExecution
$creadPrec :: ReadPrec StopPipelineExecution
readList :: ReadS [StopPipelineExecution]
$creadList :: ReadS [StopPipelineExecution]
readsPrec :: Int -> ReadS StopPipelineExecution
$creadsPrec :: Int -> ReadS StopPipelineExecution
Prelude.Read, Int -> StopPipelineExecution -> ShowS
[StopPipelineExecution] -> ShowS
StopPipelineExecution -> String
(Int -> StopPipelineExecution -> ShowS)
-> (StopPipelineExecution -> String)
-> ([StopPipelineExecution] -> ShowS)
-> Show StopPipelineExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopPipelineExecution] -> ShowS
$cshowList :: [StopPipelineExecution] -> ShowS
show :: StopPipelineExecution -> String
$cshow :: StopPipelineExecution -> String
showsPrec :: Int -> StopPipelineExecution -> ShowS
$cshowsPrec :: Int -> StopPipelineExecution -> ShowS
Prelude.Show, (forall x. StopPipelineExecution -> Rep StopPipelineExecution x)
-> (forall x. Rep StopPipelineExecution x -> StopPipelineExecution)
-> Generic StopPipelineExecution
forall x. Rep StopPipelineExecution x -> StopPipelineExecution
forall x. StopPipelineExecution -> Rep StopPipelineExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopPipelineExecution x -> StopPipelineExecution
$cfrom :: forall x. StopPipelineExecution -> Rep StopPipelineExecution x
Prelude.Generic)
newStopPipelineExecution ::
Prelude.Text ->
Prelude.Text ->
StopPipelineExecution
newStopPipelineExecution :: Text -> Text -> StopPipelineExecution
newStopPipelineExecution
Text
pPipelineExecutionArn_
Text
pClientRequestToken_ =
StopPipelineExecution' :: Text -> Text -> StopPipelineExecution
StopPipelineExecution'
{ $sel:pipelineExecutionArn:StopPipelineExecution' :: Text
pipelineExecutionArn =
Text
pPipelineExecutionArn_,
$sel:clientRequestToken:StopPipelineExecution' :: Text
clientRequestToken = Text
pClientRequestToken_
}
stopPipelineExecution_pipelineExecutionArn :: Lens.Lens' StopPipelineExecution Prelude.Text
stopPipelineExecution_pipelineExecutionArn :: (Text -> f Text)
-> StopPipelineExecution -> f StopPipelineExecution
stopPipelineExecution_pipelineExecutionArn = (StopPipelineExecution -> Text)
-> (StopPipelineExecution -> Text -> StopPipelineExecution)
-> Lens StopPipelineExecution StopPipelineExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopPipelineExecution' {Text
pipelineExecutionArn :: Text
$sel:pipelineExecutionArn:StopPipelineExecution' :: StopPipelineExecution -> Text
pipelineExecutionArn} -> Text
pipelineExecutionArn) (\s :: StopPipelineExecution
s@StopPipelineExecution' {} Text
a -> StopPipelineExecution
s {$sel:pipelineExecutionArn:StopPipelineExecution' :: Text
pipelineExecutionArn = Text
a} :: StopPipelineExecution)
stopPipelineExecution_clientRequestToken :: Lens.Lens' StopPipelineExecution Prelude.Text
stopPipelineExecution_clientRequestToken :: (Text -> f Text)
-> StopPipelineExecution -> f StopPipelineExecution
stopPipelineExecution_clientRequestToken = (StopPipelineExecution -> Text)
-> (StopPipelineExecution -> Text -> StopPipelineExecution)
-> Lens StopPipelineExecution StopPipelineExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopPipelineExecution' {Text
clientRequestToken :: Text
$sel:clientRequestToken:StopPipelineExecution' :: StopPipelineExecution -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: StopPipelineExecution
s@StopPipelineExecution' {} Text
a -> StopPipelineExecution
s {$sel:clientRequestToken:StopPipelineExecution' :: Text
clientRequestToken = Text
a} :: StopPipelineExecution)
instance Core.AWSRequest StopPipelineExecution where
type
AWSResponse StopPipelineExecution =
StopPipelineExecutionResponse
request :: StopPipelineExecution -> Request StopPipelineExecution
request = Service -> StopPipelineExecution -> Request StopPipelineExecution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopPipelineExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopPipelineExecution)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StopPipelineExecution))
-> Logger
-> Service
-> Proxy StopPipelineExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopPipelineExecution)))
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 -> Int -> StopPipelineExecutionResponse
StopPipelineExecutionResponse'
(Maybe Text -> Int -> StopPipelineExecutionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StopPipelineExecutionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PipelineExecutionArn")
Either String (Int -> StopPipelineExecutionResponse)
-> Either String Int -> Either String StopPipelineExecutionResponse
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))
)
instance Prelude.Hashable StopPipelineExecution
instance Prelude.NFData StopPipelineExecution
instance Core.ToHeaders StopPipelineExecution where
toHeaders :: StopPipelineExecution -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopPipelineExecution -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SageMaker.StopPipelineExecution" ::
Prelude.ByteString
),
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 StopPipelineExecution where
toJSON :: StopPipelineExecution -> Value
toJSON StopPipelineExecution' {Text
clientRequestToken :: Text
pipelineExecutionArn :: Text
$sel:clientRequestToken:StopPipelineExecution' :: StopPipelineExecution -> Text
$sel:pipelineExecutionArn:StopPipelineExecution' :: StopPipelineExecution -> 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
"PipelineExecutionArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
pipelineExecutionArn
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ClientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientRequestToken)
]
)
instance Core.ToPath StopPipelineExecution where
toPath :: StopPipelineExecution -> ByteString
toPath = ByteString -> StopPipelineExecution -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery StopPipelineExecution where
toQuery :: StopPipelineExecution -> QueryString
toQuery = QueryString -> StopPipelineExecution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopPipelineExecutionResponse = StopPipelineExecutionResponse'
{
StopPipelineExecutionResponse -> Maybe Text
pipelineExecutionArn :: Prelude.Maybe Prelude.Text,
StopPipelineExecutionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopPipelineExecutionResponse
-> StopPipelineExecutionResponse -> Bool
(StopPipelineExecutionResponse
-> StopPipelineExecutionResponse -> Bool)
-> (StopPipelineExecutionResponse
-> StopPipelineExecutionResponse -> Bool)
-> Eq StopPipelineExecutionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopPipelineExecutionResponse
-> StopPipelineExecutionResponse -> Bool
$c/= :: StopPipelineExecutionResponse
-> StopPipelineExecutionResponse -> Bool
== :: StopPipelineExecutionResponse
-> StopPipelineExecutionResponse -> Bool
$c== :: StopPipelineExecutionResponse
-> StopPipelineExecutionResponse -> Bool
Prelude.Eq, ReadPrec [StopPipelineExecutionResponse]
ReadPrec StopPipelineExecutionResponse
Int -> ReadS StopPipelineExecutionResponse
ReadS [StopPipelineExecutionResponse]
(Int -> ReadS StopPipelineExecutionResponse)
-> ReadS [StopPipelineExecutionResponse]
-> ReadPrec StopPipelineExecutionResponse
-> ReadPrec [StopPipelineExecutionResponse]
-> Read StopPipelineExecutionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopPipelineExecutionResponse]
$creadListPrec :: ReadPrec [StopPipelineExecutionResponse]
readPrec :: ReadPrec StopPipelineExecutionResponse
$creadPrec :: ReadPrec StopPipelineExecutionResponse
readList :: ReadS [StopPipelineExecutionResponse]
$creadList :: ReadS [StopPipelineExecutionResponse]
readsPrec :: Int -> ReadS StopPipelineExecutionResponse
$creadsPrec :: Int -> ReadS StopPipelineExecutionResponse
Prelude.Read, Int -> StopPipelineExecutionResponse -> ShowS
[StopPipelineExecutionResponse] -> ShowS
StopPipelineExecutionResponse -> String
(Int -> StopPipelineExecutionResponse -> ShowS)
-> (StopPipelineExecutionResponse -> String)
-> ([StopPipelineExecutionResponse] -> ShowS)
-> Show StopPipelineExecutionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopPipelineExecutionResponse] -> ShowS
$cshowList :: [StopPipelineExecutionResponse] -> ShowS
show :: StopPipelineExecutionResponse -> String
$cshow :: StopPipelineExecutionResponse -> String
showsPrec :: Int -> StopPipelineExecutionResponse -> ShowS
$cshowsPrec :: Int -> StopPipelineExecutionResponse -> ShowS
Prelude.Show, (forall x.
StopPipelineExecutionResponse
-> Rep StopPipelineExecutionResponse x)
-> (forall x.
Rep StopPipelineExecutionResponse x
-> StopPipelineExecutionResponse)
-> Generic StopPipelineExecutionResponse
forall x.
Rep StopPipelineExecutionResponse x
-> StopPipelineExecutionResponse
forall x.
StopPipelineExecutionResponse
-> Rep StopPipelineExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopPipelineExecutionResponse x
-> StopPipelineExecutionResponse
$cfrom :: forall x.
StopPipelineExecutionResponse
-> Rep StopPipelineExecutionResponse x
Prelude.Generic)
newStopPipelineExecutionResponse ::
Prelude.Int ->
StopPipelineExecutionResponse
newStopPipelineExecutionResponse :: Int -> StopPipelineExecutionResponse
newStopPipelineExecutionResponse Int
pHttpStatus_ =
StopPipelineExecutionResponse' :: Maybe Text -> Int -> StopPipelineExecutionResponse
StopPipelineExecutionResponse'
{ $sel:pipelineExecutionArn:StopPipelineExecutionResponse' :: Maybe Text
pipelineExecutionArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopPipelineExecutionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopPipelineExecutionResponse_pipelineExecutionArn :: Lens.Lens' StopPipelineExecutionResponse (Prelude.Maybe Prelude.Text)
stopPipelineExecutionResponse_pipelineExecutionArn :: (Maybe Text -> f (Maybe Text))
-> StopPipelineExecutionResponse -> f StopPipelineExecutionResponse
stopPipelineExecutionResponse_pipelineExecutionArn = (StopPipelineExecutionResponse -> Maybe Text)
-> (StopPipelineExecutionResponse
-> Maybe Text -> StopPipelineExecutionResponse)
-> Lens
StopPipelineExecutionResponse
StopPipelineExecutionResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopPipelineExecutionResponse' {Maybe Text
pipelineExecutionArn :: Maybe Text
$sel:pipelineExecutionArn:StopPipelineExecutionResponse' :: StopPipelineExecutionResponse -> Maybe Text
pipelineExecutionArn} -> Maybe Text
pipelineExecutionArn) (\s :: StopPipelineExecutionResponse
s@StopPipelineExecutionResponse' {} Maybe Text
a -> StopPipelineExecutionResponse
s {$sel:pipelineExecutionArn:StopPipelineExecutionResponse' :: Maybe Text
pipelineExecutionArn = Maybe Text
a} :: StopPipelineExecutionResponse)
stopPipelineExecutionResponse_httpStatus :: Lens.Lens' StopPipelineExecutionResponse Prelude.Int
stopPipelineExecutionResponse_httpStatus :: (Int -> f Int)
-> StopPipelineExecutionResponse -> f StopPipelineExecutionResponse
stopPipelineExecutionResponse_httpStatus = (StopPipelineExecutionResponse -> Int)
-> (StopPipelineExecutionResponse
-> Int -> StopPipelineExecutionResponse)
-> Lens
StopPipelineExecutionResponse StopPipelineExecutionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopPipelineExecutionResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopPipelineExecutionResponse' :: StopPipelineExecutionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopPipelineExecutionResponse
s@StopPipelineExecutionResponse' {} Int
a -> StopPipelineExecutionResponse
s {$sel:httpStatus:StopPipelineExecutionResponse' :: Int
httpStatus = Int
a} :: StopPipelineExecutionResponse)
instance Prelude.NFData StopPipelineExecutionResponse