{-# 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.DataPipeline.SetTaskStatus
(
SetTaskStatus (..),
newSetTaskStatus,
setTaskStatus_errorStackTrace,
setTaskStatus_errorId,
setTaskStatus_errorMessage,
setTaskStatus_taskId,
setTaskStatus_taskStatus,
SetTaskStatusResponse (..),
newSetTaskStatusResponse,
setTaskStatusResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DataPipeline.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data SetTaskStatus = SetTaskStatus'
{
SetTaskStatus -> Maybe Text
errorStackTrace :: Prelude.Maybe Prelude.Text,
SetTaskStatus -> Maybe Text
errorId :: Prelude.Maybe Prelude.Text,
SetTaskStatus -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
SetTaskStatus -> Text
taskId :: Prelude.Text,
SetTaskStatus -> TaskStatus
taskStatus :: TaskStatus
}
deriving (SetTaskStatus -> SetTaskStatus -> Bool
(SetTaskStatus -> SetTaskStatus -> Bool)
-> (SetTaskStatus -> SetTaskStatus -> Bool) -> Eq SetTaskStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetTaskStatus -> SetTaskStatus -> Bool
$c/= :: SetTaskStatus -> SetTaskStatus -> Bool
== :: SetTaskStatus -> SetTaskStatus -> Bool
$c== :: SetTaskStatus -> SetTaskStatus -> Bool
Prelude.Eq, ReadPrec [SetTaskStatus]
ReadPrec SetTaskStatus
Int -> ReadS SetTaskStatus
ReadS [SetTaskStatus]
(Int -> ReadS SetTaskStatus)
-> ReadS [SetTaskStatus]
-> ReadPrec SetTaskStatus
-> ReadPrec [SetTaskStatus]
-> Read SetTaskStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetTaskStatus]
$creadListPrec :: ReadPrec [SetTaskStatus]
readPrec :: ReadPrec SetTaskStatus
$creadPrec :: ReadPrec SetTaskStatus
readList :: ReadS [SetTaskStatus]
$creadList :: ReadS [SetTaskStatus]
readsPrec :: Int -> ReadS SetTaskStatus
$creadsPrec :: Int -> ReadS SetTaskStatus
Prelude.Read, Int -> SetTaskStatus -> ShowS
[SetTaskStatus] -> ShowS
SetTaskStatus -> String
(Int -> SetTaskStatus -> ShowS)
-> (SetTaskStatus -> String)
-> ([SetTaskStatus] -> ShowS)
-> Show SetTaskStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetTaskStatus] -> ShowS
$cshowList :: [SetTaskStatus] -> ShowS
show :: SetTaskStatus -> String
$cshow :: SetTaskStatus -> String
showsPrec :: Int -> SetTaskStatus -> ShowS
$cshowsPrec :: Int -> SetTaskStatus -> ShowS
Prelude.Show, (forall x. SetTaskStatus -> Rep SetTaskStatus x)
-> (forall x. Rep SetTaskStatus x -> SetTaskStatus)
-> Generic SetTaskStatus
forall x. Rep SetTaskStatus x -> SetTaskStatus
forall x. SetTaskStatus -> Rep SetTaskStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetTaskStatus x -> SetTaskStatus
$cfrom :: forall x. SetTaskStatus -> Rep SetTaskStatus x
Prelude.Generic)
newSetTaskStatus ::
Prelude.Text ->
TaskStatus ->
SetTaskStatus
newSetTaskStatus :: Text -> TaskStatus -> SetTaskStatus
newSetTaskStatus Text
pTaskId_ TaskStatus
pTaskStatus_ =
SetTaskStatus' :: Maybe Text
-> Maybe Text -> Maybe Text -> Text -> TaskStatus -> SetTaskStatus
SetTaskStatus'
{ $sel:errorStackTrace:SetTaskStatus' :: Maybe Text
errorStackTrace = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorId:SetTaskStatus' :: Maybe Text
errorId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:SetTaskStatus' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:taskId:SetTaskStatus' :: Text
taskId = Text
pTaskId_,
$sel:taskStatus:SetTaskStatus' :: TaskStatus
taskStatus = TaskStatus
pTaskStatus_
}
setTaskStatus_errorStackTrace :: Lens.Lens' SetTaskStatus (Prelude.Maybe Prelude.Text)
setTaskStatus_errorStackTrace :: (Maybe Text -> f (Maybe Text)) -> SetTaskStatus -> f SetTaskStatus
setTaskStatus_errorStackTrace = (SetTaskStatus -> Maybe Text)
-> (SetTaskStatus -> Maybe Text -> SetTaskStatus)
-> Lens SetTaskStatus SetTaskStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTaskStatus' {Maybe Text
errorStackTrace :: Maybe Text
$sel:errorStackTrace:SetTaskStatus' :: SetTaskStatus -> Maybe Text
errorStackTrace} -> Maybe Text
errorStackTrace) (\s :: SetTaskStatus
s@SetTaskStatus' {} Maybe Text
a -> SetTaskStatus
s {$sel:errorStackTrace:SetTaskStatus' :: Maybe Text
errorStackTrace = Maybe Text
a} :: SetTaskStatus)
setTaskStatus_errorId :: Lens.Lens' SetTaskStatus (Prelude.Maybe Prelude.Text)
setTaskStatus_errorId :: (Maybe Text -> f (Maybe Text)) -> SetTaskStatus -> f SetTaskStatus
setTaskStatus_errorId = (SetTaskStatus -> Maybe Text)
-> (SetTaskStatus -> Maybe Text -> SetTaskStatus)
-> Lens SetTaskStatus SetTaskStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTaskStatus' {Maybe Text
errorId :: Maybe Text
$sel:errorId:SetTaskStatus' :: SetTaskStatus -> Maybe Text
errorId} -> Maybe Text
errorId) (\s :: SetTaskStatus
s@SetTaskStatus' {} Maybe Text
a -> SetTaskStatus
s {$sel:errorId:SetTaskStatus' :: Maybe Text
errorId = Maybe Text
a} :: SetTaskStatus)
setTaskStatus_errorMessage :: Lens.Lens' SetTaskStatus (Prelude.Maybe Prelude.Text)
setTaskStatus_errorMessage :: (Maybe Text -> f (Maybe Text)) -> SetTaskStatus -> f SetTaskStatus
setTaskStatus_errorMessage = (SetTaskStatus -> Maybe Text)
-> (SetTaskStatus -> Maybe Text -> SetTaskStatus)
-> Lens SetTaskStatus SetTaskStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTaskStatus' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:SetTaskStatus' :: SetTaskStatus -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: SetTaskStatus
s@SetTaskStatus' {} Maybe Text
a -> SetTaskStatus
s {$sel:errorMessage:SetTaskStatus' :: Maybe Text
errorMessage = Maybe Text
a} :: SetTaskStatus)
setTaskStatus_taskId :: Lens.Lens' SetTaskStatus Prelude.Text
setTaskStatus_taskId :: (Text -> f Text) -> SetTaskStatus -> f SetTaskStatus
setTaskStatus_taskId = (SetTaskStatus -> Text)
-> (SetTaskStatus -> Text -> SetTaskStatus)
-> Lens SetTaskStatus SetTaskStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTaskStatus' {Text
taskId :: Text
$sel:taskId:SetTaskStatus' :: SetTaskStatus -> Text
taskId} -> Text
taskId) (\s :: SetTaskStatus
s@SetTaskStatus' {} Text
a -> SetTaskStatus
s {$sel:taskId:SetTaskStatus' :: Text
taskId = Text
a} :: SetTaskStatus)
setTaskStatus_taskStatus :: Lens.Lens' SetTaskStatus TaskStatus
setTaskStatus_taskStatus :: (TaskStatus -> f TaskStatus) -> SetTaskStatus -> f SetTaskStatus
setTaskStatus_taskStatus = (SetTaskStatus -> TaskStatus)
-> (SetTaskStatus -> TaskStatus -> SetTaskStatus)
-> Lens SetTaskStatus SetTaskStatus TaskStatus TaskStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTaskStatus' {TaskStatus
taskStatus :: TaskStatus
$sel:taskStatus:SetTaskStatus' :: SetTaskStatus -> TaskStatus
taskStatus} -> TaskStatus
taskStatus) (\s :: SetTaskStatus
s@SetTaskStatus' {} TaskStatus
a -> SetTaskStatus
s {$sel:taskStatus:SetTaskStatus' :: TaskStatus
taskStatus = TaskStatus
a} :: SetTaskStatus)
instance Core.AWSRequest SetTaskStatus where
type
AWSResponse SetTaskStatus =
SetTaskStatusResponse
request :: SetTaskStatus -> Request SetTaskStatus
request = Service -> SetTaskStatus -> Request SetTaskStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SetTaskStatus
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SetTaskStatus)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse SetTaskStatus))
-> Logger
-> Service
-> Proxy SetTaskStatus
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SetTaskStatus)))
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 -> SetTaskStatusResponse
SetTaskStatusResponse'
(Int -> SetTaskStatusResponse)
-> Either String Int -> Either String SetTaskStatusResponse
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 SetTaskStatus
instance Prelude.NFData SetTaskStatus
instance Core.ToHeaders SetTaskStatus where
toHeaders :: SetTaskStatus -> ResponseHeaders
toHeaders =
ResponseHeaders -> SetTaskStatus -> 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
"DataPipeline.SetTaskStatus" :: 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 SetTaskStatus where
toJSON :: SetTaskStatus -> Value
toJSON SetTaskStatus' {Maybe Text
Text
TaskStatus
taskStatus :: TaskStatus
taskId :: Text
errorMessage :: Maybe Text
errorId :: Maybe Text
errorStackTrace :: Maybe Text
$sel:taskStatus:SetTaskStatus' :: SetTaskStatus -> TaskStatus
$sel:taskId:SetTaskStatus' :: SetTaskStatus -> Text
$sel:errorMessage:SetTaskStatus' :: SetTaskStatus -> Maybe Text
$sel:errorId:SetTaskStatus' :: SetTaskStatus -> Maybe Text
$sel:errorStackTrace:SetTaskStatus' :: SetTaskStatus -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"errorStackTrace" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
errorStackTrace,
(Text
"errorId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
errorId,
(Text
"errorMessage" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
errorMessage,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"taskId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"taskStatus" Text -> TaskStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TaskStatus
taskStatus)
]
)
instance Core.ToPath SetTaskStatus where
toPath :: SetTaskStatus -> ByteString
toPath = ByteString -> SetTaskStatus -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SetTaskStatus where
toQuery :: SetTaskStatus -> QueryString
toQuery = QueryString -> SetTaskStatus -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SetTaskStatusResponse = SetTaskStatusResponse'
{
SetTaskStatusResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SetTaskStatusResponse -> SetTaskStatusResponse -> Bool
(SetTaskStatusResponse -> SetTaskStatusResponse -> Bool)
-> (SetTaskStatusResponse -> SetTaskStatusResponse -> Bool)
-> Eq SetTaskStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SetTaskStatusResponse -> SetTaskStatusResponse -> Bool
$c/= :: SetTaskStatusResponse -> SetTaskStatusResponse -> Bool
== :: SetTaskStatusResponse -> SetTaskStatusResponse -> Bool
$c== :: SetTaskStatusResponse -> SetTaskStatusResponse -> Bool
Prelude.Eq, ReadPrec [SetTaskStatusResponse]
ReadPrec SetTaskStatusResponse
Int -> ReadS SetTaskStatusResponse
ReadS [SetTaskStatusResponse]
(Int -> ReadS SetTaskStatusResponse)
-> ReadS [SetTaskStatusResponse]
-> ReadPrec SetTaskStatusResponse
-> ReadPrec [SetTaskStatusResponse]
-> Read SetTaskStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SetTaskStatusResponse]
$creadListPrec :: ReadPrec [SetTaskStatusResponse]
readPrec :: ReadPrec SetTaskStatusResponse
$creadPrec :: ReadPrec SetTaskStatusResponse
readList :: ReadS [SetTaskStatusResponse]
$creadList :: ReadS [SetTaskStatusResponse]
readsPrec :: Int -> ReadS SetTaskStatusResponse
$creadsPrec :: Int -> ReadS SetTaskStatusResponse
Prelude.Read, Int -> SetTaskStatusResponse -> ShowS
[SetTaskStatusResponse] -> ShowS
SetTaskStatusResponse -> String
(Int -> SetTaskStatusResponse -> ShowS)
-> (SetTaskStatusResponse -> String)
-> ([SetTaskStatusResponse] -> ShowS)
-> Show SetTaskStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SetTaskStatusResponse] -> ShowS
$cshowList :: [SetTaskStatusResponse] -> ShowS
show :: SetTaskStatusResponse -> String
$cshow :: SetTaskStatusResponse -> String
showsPrec :: Int -> SetTaskStatusResponse -> ShowS
$cshowsPrec :: Int -> SetTaskStatusResponse -> ShowS
Prelude.Show, (forall x. SetTaskStatusResponse -> Rep SetTaskStatusResponse x)
-> (forall x. Rep SetTaskStatusResponse x -> SetTaskStatusResponse)
-> Generic SetTaskStatusResponse
forall x. Rep SetTaskStatusResponse x -> SetTaskStatusResponse
forall x. SetTaskStatusResponse -> Rep SetTaskStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SetTaskStatusResponse x -> SetTaskStatusResponse
$cfrom :: forall x. SetTaskStatusResponse -> Rep SetTaskStatusResponse x
Prelude.Generic)
newSetTaskStatusResponse ::
Prelude.Int ->
SetTaskStatusResponse
newSetTaskStatusResponse :: Int -> SetTaskStatusResponse
newSetTaskStatusResponse Int
pHttpStatus_ =
SetTaskStatusResponse' :: Int -> SetTaskStatusResponse
SetTaskStatusResponse' {$sel:httpStatus:SetTaskStatusResponse' :: Int
httpStatus = Int
pHttpStatus_}
setTaskStatusResponse_httpStatus :: Lens.Lens' SetTaskStatusResponse Prelude.Int
setTaskStatusResponse_httpStatus :: (Int -> f Int) -> SetTaskStatusResponse -> f SetTaskStatusResponse
setTaskStatusResponse_httpStatus = (SetTaskStatusResponse -> Int)
-> (SetTaskStatusResponse -> Int -> SetTaskStatusResponse)
-> Lens SetTaskStatusResponse SetTaskStatusResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SetTaskStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:SetTaskStatusResponse' :: SetTaskStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SetTaskStatusResponse
s@SetTaskStatusResponse' {} Int
a -> SetTaskStatusResponse
s {$sel:httpStatus:SetTaskStatusResponse' :: Int
httpStatus = Int
a} :: SetTaskStatusResponse)
instance Prelude.NFData SetTaskStatusResponse