{-# 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.RetryPipelineExecution
(
RetryPipelineExecution (..),
newRetryPipelineExecution,
retryPipelineExecution_pipelineExecutionArn,
retryPipelineExecution_clientRequestToken,
RetryPipelineExecutionResponse (..),
newRetryPipelineExecutionResponse,
retryPipelineExecutionResponse_pipelineExecutionArn,
retryPipelineExecutionResponse_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 RetryPipelineExecution = RetryPipelineExecution'
{
RetryPipelineExecution -> Text
pipelineExecutionArn :: Prelude.Text,
RetryPipelineExecution -> Text
clientRequestToken :: Prelude.Text
}
deriving (RetryPipelineExecution -> RetryPipelineExecution -> Bool
(RetryPipelineExecution -> RetryPipelineExecution -> Bool)
-> (RetryPipelineExecution -> RetryPipelineExecution -> Bool)
-> Eq RetryPipelineExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RetryPipelineExecution -> RetryPipelineExecution -> Bool
$c/= :: RetryPipelineExecution -> RetryPipelineExecution -> Bool
== :: RetryPipelineExecution -> RetryPipelineExecution -> Bool
$c== :: RetryPipelineExecution -> RetryPipelineExecution -> Bool
Prelude.Eq, ReadPrec [RetryPipelineExecution]
ReadPrec RetryPipelineExecution
Int -> ReadS RetryPipelineExecution
ReadS [RetryPipelineExecution]
(Int -> ReadS RetryPipelineExecution)
-> ReadS [RetryPipelineExecution]
-> ReadPrec RetryPipelineExecution
-> ReadPrec [RetryPipelineExecution]
-> Read RetryPipelineExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RetryPipelineExecution]
$creadListPrec :: ReadPrec [RetryPipelineExecution]
readPrec :: ReadPrec RetryPipelineExecution
$creadPrec :: ReadPrec RetryPipelineExecution
readList :: ReadS [RetryPipelineExecution]
$creadList :: ReadS [RetryPipelineExecution]
readsPrec :: Int -> ReadS RetryPipelineExecution
$creadsPrec :: Int -> ReadS RetryPipelineExecution
Prelude.Read, Int -> RetryPipelineExecution -> ShowS
[RetryPipelineExecution] -> ShowS
RetryPipelineExecution -> String
(Int -> RetryPipelineExecution -> ShowS)
-> (RetryPipelineExecution -> String)
-> ([RetryPipelineExecution] -> ShowS)
-> Show RetryPipelineExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RetryPipelineExecution] -> ShowS
$cshowList :: [RetryPipelineExecution] -> ShowS
show :: RetryPipelineExecution -> String
$cshow :: RetryPipelineExecution -> String
showsPrec :: Int -> RetryPipelineExecution -> ShowS
$cshowsPrec :: Int -> RetryPipelineExecution -> ShowS
Prelude.Show, (forall x. RetryPipelineExecution -> Rep RetryPipelineExecution x)
-> (forall x.
Rep RetryPipelineExecution x -> RetryPipelineExecution)
-> Generic RetryPipelineExecution
forall x. Rep RetryPipelineExecution x -> RetryPipelineExecution
forall x. RetryPipelineExecution -> Rep RetryPipelineExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RetryPipelineExecution x -> RetryPipelineExecution
$cfrom :: forall x. RetryPipelineExecution -> Rep RetryPipelineExecution x
Prelude.Generic)
newRetryPipelineExecution ::
Prelude.Text ->
Prelude.Text ->
RetryPipelineExecution
newRetryPipelineExecution :: Text -> Text -> RetryPipelineExecution
newRetryPipelineExecution
Text
pPipelineExecutionArn_
Text
pClientRequestToken_ =
RetryPipelineExecution' :: Text -> Text -> RetryPipelineExecution
RetryPipelineExecution'
{ $sel:pipelineExecutionArn:RetryPipelineExecution' :: Text
pipelineExecutionArn =
Text
pPipelineExecutionArn_,
$sel:clientRequestToken:RetryPipelineExecution' :: Text
clientRequestToken = Text
pClientRequestToken_
}
retryPipelineExecution_pipelineExecutionArn :: Lens.Lens' RetryPipelineExecution Prelude.Text
retryPipelineExecution_pipelineExecutionArn :: (Text -> f Text)
-> RetryPipelineExecution -> f RetryPipelineExecution
retryPipelineExecution_pipelineExecutionArn = (RetryPipelineExecution -> Text)
-> (RetryPipelineExecution -> Text -> RetryPipelineExecution)
-> Lens RetryPipelineExecution RetryPipelineExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetryPipelineExecution' {Text
pipelineExecutionArn :: Text
$sel:pipelineExecutionArn:RetryPipelineExecution' :: RetryPipelineExecution -> Text
pipelineExecutionArn} -> Text
pipelineExecutionArn) (\s :: RetryPipelineExecution
s@RetryPipelineExecution' {} Text
a -> RetryPipelineExecution
s {$sel:pipelineExecutionArn:RetryPipelineExecution' :: Text
pipelineExecutionArn = Text
a} :: RetryPipelineExecution)
retryPipelineExecution_clientRequestToken :: Lens.Lens' RetryPipelineExecution Prelude.Text
retryPipelineExecution_clientRequestToken :: (Text -> f Text)
-> RetryPipelineExecution -> f RetryPipelineExecution
retryPipelineExecution_clientRequestToken = (RetryPipelineExecution -> Text)
-> (RetryPipelineExecution -> Text -> RetryPipelineExecution)
-> Lens RetryPipelineExecution RetryPipelineExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetryPipelineExecution' {Text
clientRequestToken :: Text
$sel:clientRequestToken:RetryPipelineExecution' :: RetryPipelineExecution -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: RetryPipelineExecution
s@RetryPipelineExecution' {} Text
a -> RetryPipelineExecution
s {$sel:clientRequestToken:RetryPipelineExecution' :: Text
clientRequestToken = Text
a} :: RetryPipelineExecution)
instance Core.AWSRequest RetryPipelineExecution where
type
AWSResponse RetryPipelineExecution =
RetryPipelineExecutionResponse
request :: RetryPipelineExecution -> Request RetryPipelineExecution
request = Service -> RetryPipelineExecution -> Request RetryPipelineExecution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RetryPipelineExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RetryPipelineExecution)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RetryPipelineExecution))
-> Logger
-> Service
-> Proxy RetryPipelineExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RetryPipelineExecution)))
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 -> RetryPipelineExecutionResponse
RetryPipelineExecutionResponse'
(Maybe Text -> Int -> RetryPipelineExecutionResponse)
-> Either String (Maybe Text)
-> Either String (Int -> RetryPipelineExecutionResponse)
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 -> RetryPipelineExecutionResponse)
-> Either String Int
-> Either String RetryPipelineExecutionResponse
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 RetryPipelineExecution
instance Prelude.NFData RetryPipelineExecution
instance Core.ToHeaders RetryPipelineExecution where
toHeaders :: RetryPipelineExecution -> ResponseHeaders
toHeaders =
ResponseHeaders -> RetryPipelineExecution -> 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.RetryPipelineExecution" ::
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 RetryPipelineExecution where
toJSON :: RetryPipelineExecution -> Value
toJSON RetryPipelineExecution' {Text
clientRequestToken :: Text
pipelineExecutionArn :: Text
$sel:clientRequestToken:RetryPipelineExecution' :: RetryPipelineExecution -> Text
$sel:pipelineExecutionArn:RetryPipelineExecution' :: RetryPipelineExecution -> 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 RetryPipelineExecution where
toPath :: RetryPipelineExecution -> ByteString
toPath = ByteString -> RetryPipelineExecution -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RetryPipelineExecution where
toQuery :: RetryPipelineExecution -> QueryString
toQuery = QueryString -> RetryPipelineExecution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RetryPipelineExecutionResponse = RetryPipelineExecutionResponse'
{
RetryPipelineExecutionResponse -> Maybe Text
pipelineExecutionArn :: Prelude.Maybe Prelude.Text,
RetryPipelineExecutionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RetryPipelineExecutionResponse
-> RetryPipelineExecutionResponse -> Bool
(RetryPipelineExecutionResponse
-> RetryPipelineExecutionResponse -> Bool)
-> (RetryPipelineExecutionResponse
-> RetryPipelineExecutionResponse -> Bool)
-> Eq RetryPipelineExecutionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RetryPipelineExecutionResponse
-> RetryPipelineExecutionResponse -> Bool
$c/= :: RetryPipelineExecutionResponse
-> RetryPipelineExecutionResponse -> Bool
== :: RetryPipelineExecutionResponse
-> RetryPipelineExecutionResponse -> Bool
$c== :: RetryPipelineExecutionResponse
-> RetryPipelineExecutionResponse -> Bool
Prelude.Eq, ReadPrec [RetryPipelineExecutionResponse]
ReadPrec RetryPipelineExecutionResponse
Int -> ReadS RetryPipelineExecutionResponse
ReadS [RetryPipelineExecutionResponse]
(Int -> ReadS RetryPipelineExecutionResponse)
-> ReadS [RetryPipelineExecutionResponse]
-> ReadPrec RetryPipelineExecutionResponse
-> ReadPrec [RetryPipelineExecutionResponse]
-> Read RetryPipelineExecutionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RetryPipelineExecutionResponse]
$creadListPrec :: ReadPrec [RetryPipelineExecutionResponse]
readPrec :: ReadPrec RetryPipelineExecutionResponse
$creadPrec :: ReadPrec RetryPipelineExecutionResponse
readList :: ReadS [RetryPipelineExecutionResponse]
$creadList :: ReadS [RetryPipelineExecutionResponse]
readsPrec :: Int -> ReadS RetryPipelineExecutionResponse
$creadsPrec :: Int -> ReadS RetryPipelineExecutionResponse
Prelude.Read, Int -> RetryPipelineExecutionResponse -> ShowS
[RetryPipelineExecutionResponse] -> ShowS
RetryPipelineExecutionResponse -> String
(Int -> RetryPipelineExecutionResponse -> ShowS)
-> (RetryPipelineExecutionResponse -> String)
-> ([RetryPipelineExecutionResponse] -> ShowS)
-> Show RetryPipelineExecutionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RetryPipelineExecutionResponse] -> ShowS
$cshowList :: [RetryPipelineExecutionResponse] -> ShowS
show :: RetryPipelineExecutionResponse -> String
$cshow :: RetryPipelineExecutionResponse -> String
showsPrec :: Int -> RetryPipelineExecutionResponse -> ShowS
$cshowsPrec :: Int -> RetryPipelineExecutionResponse -> ShowS
Prelude.Show, (forall x.
RetryPipelineExecutionResponse
-> Rep RetryPipelineExecutionResponse x)
-> (forall x.
Rep RetryPipelineExecutionResponse x
-> RetryPipelineExecutionResponse)
-> Generic RetryPipelineExecutionResponse
forall x.
Rep RetryPipelineExecutionResponse x
-> RetryPipelineExecutionResponse
forall x.
RetryPipelineExecutionResponse
-> Rep RetryPipelineExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RetryPipelineExecutionResponse x
-> RetryPipelineExecutionResponse
$cfrom :: forall x.
RetryPipelineExecutionResponse
-> Rep RetryPipelineExecutionResponse x
Prelude.Generic)
newRetryPipelineExecutionResponse ::
Prelude.Int ->
RetryPipelineExecutionResponse
newRetryPipelineExecutionResponse :: Int -> RetryPipelineExecutionResponse
newRetryPipelineExecutionResponse Int
pHttpStatus_ =
RetryPipelineExecutionResponse' :: Maybe Text -> Int -> RetryPipelineExecutionResponse
RetryPipelineExecutionResponse'
{ $sel:pipelineExecutionArn:RetryPipelineExecutionResponse' :: Maybe Text
pipelineExecutionArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RetryPipelineExecutionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
retryPipelineExecutionResponse_pipelineExecutionArn :: Lens.Lens' RetryPipelineExecutionResponse (Prelude.Maybe Prelude.Text)
retryPipelineExecutionResponse_pipelineExecutionArn :: (Maybe Text -> f (Maybe Text))
-> RetryPipelineExecutionResponse
-> f RetryPipelineExecutionResponse
retryPipelineExecutionResponse_pipelineExecutionArn = (RetryPipelineExecutionResponse -> Maybe Text)
-> (RetryPipelineExecutionResponse
-> Maybe Text -> RetryPipelineExecutionResponse)
-> Lens
RetryPipelineExecutionResponse
RetryPipelineExecutionResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetryPipelineExecutionResponse' {Maybe Text
pipelineExecutionArn :: Maybe Text
$sel:pipelineExecutionArn:RetryPipelineExecutionResponse' :: RetryPipelineExecutionResponse -> Maybe Text
pipelineExecutionArn} -> Maybe Text
pipelineExecutionArn) (\s :: RetryPipelineExecutionResponse
s@RetryPipelineExecutionResponse' {} Maybe Text
a -> RetryPipelineExecutionResponse
s {$sel:pipelineExecutionArn:RetryPipelineExecutionResponse' :: Maybe Text
pipelineExecutionArn = Maybe Text
a} :: RetryPipelineExecutionResponse)
retryPipelineExecutionResponse_httpStatus :: Lens.Lens' RetryPipelineExecutionResponse Prelude.Int
retryPipelineExecutionResponse_httpStatus :: (Int -> f Int)
-> RetryPipelineExecutionResponse
-> f RetryPipelineExecutionResponse
retryPipelineExecutionResponse_httpStatus = (RetryPipelineExecutionResponse -> Int)
-> (RetryPipelineExecutionResponse
-> Int -> RetryPipelineExecutionResponse)
-> Lens
RetryPipelineExecutionResponse
RetryPipelineExecutionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetryPipelineExecutionResponse' {Int
httpStatus :: Int
$sel:httpStatus:RetryPipelineExecutionResponse' :: RetryPipelineExecutionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RetryPipelineExecutionResponse
s@RetryPipelineExecutionResponse' {} Int
a -> RetryPipelineExecutionResponse
s {$sel:httpStatus:RetryPipelineExecutionResponse' :: Int
httpStatus = Int
a} :: RetryPipelineExecutionResponse)
instance
Prelude.NFData
RetryPipelineExecutionResponse