{-# 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.StepFunctions.SendTaskFailure
(
SendTaskFailure (..),
newSendTaskFailure,
sendTaskFailure_error,
sendTaskFailure_cause,
sendTaskFailure_taskToken,
SendTaskFailureResponse (..),
newSendTaskFailureResponse,
sendTaskFailureResponse_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.StepFunctions.Types
data SendTaskFailure = SendTaskFailure'
{
SendTaskFailure -> Maybe (Sensitive Text)
error :: Prelude.Maybe (Core.Sensitive Prelude.Text),
SendTaskFailure -> Maybe (Sensitive Text)
cause :: Prelude.Maybe (Core.Sensitive Prelude.Text),
SendTaskFailure -> Text
taskToken :: Prelude.Text
}
deriving (SendTaskFailure -> SendTaskFailure -> Bool
(SendTaskFailure -> SendTaskFailure -> Bool)
-> (SendTaskFailure -> SendTaskFailure -> Bool)
-> Eq SendTaskFailure
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendTaskFailure -> SendTaskFailure -> Bool
$c/= :: SendTaskFailure -> SendTaskFailure -> Bool
== :: SendTaskFailure -> SendTaskFailure -> Bool
$c== :: SendTaskFailure -> SendTaskFailure -> Bool
Prelude.Eq, Int -> SendTaskFailure -> ShowS
[SendTaskFailure] -> ShowS
SendTaskFailure -> String
(Int -> SendTaskFailure -> ShowS)
-> (SendTaskFailure -> String)
-> ([SendTaskFailure] -> ShowS)
-> Show SendTaskFailure
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendTaskFailure] -> ShowS
$cshowList :: [SendTaskFailure] -> ShowS
show :: SendTaskFailure -> String
$cshow :: SendTaskFailure -> String
showsPrec :: Int -> SendTaskFailure -> ShowS
$cshowsPrec :: Int -> SendTaskFailure -> ShowS
Prelude.Show, (forall x. SendTaskFailure -> Rep SendTaskFailure x)
-> (forall x. Rep SendTaskFailure x -> SendTaskFailure)
-> Generic SendTaskFailure
forall x. Rep SendTaskFailure x -> SendTaskFailure
forall x. SendTaskFailure -> Rep SendTaskFailure x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendTaskFailure x -> SendTaskFailure
$cfrom :: forall x. SendTaskFailure -> Rep SendTaskFailure x
Prelude.Generic)
newSendTaskFailure ::
Prelude.Text ->
SendTaskFailure
newSendTaskFailure :: Text -> SendTaskFailure
newSendTaskFailure Text
pTaskToken_ =
SendTaskFailure' :: Maybe (Sensitive Text)
-> Maybe (Sensitive Text) -> Text -> SendTaskFailure
SendTaskFailure'
{ $sel:error:SendTaskFailure' :: Maybe (Sensitive Text)
error = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:cause:SendTaskFailure' :: Maybe (Sensitive Text)
cause = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:taskToken:SendTaskFailure' :: Text
taskToken = Text
pTaskToken_
}
sendTaskFailure_error :: Lens.Lens' SendTaskFailure (Prelude.Maybe Prelude.Text)
sendTaskFailure_error :: (Maybe Text -> f (Maybe Text))
-> SendTaskFailure -> f SendTaskFailure
sendTaskFailure_error = (SendTaskFailure -> Maybe (Sensitive Text))
-> (SendTaskFailure -> Maybe (Sensitive Text) -> SendTaskFailure)
-> Lens
SendTaskFailure
SendTaskFailure
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTaskFailure' {Maybe (Sensitive Text)
error :: Maybe (Sensitive Text)
$sel:error:SendTaskFailure' :: SendTaskFailure -> Maybe (Sensitive Text)
error} -> Maybe (Sensitive Text)
error) (\s :: SendTaskFailure
s@SendTaskFailure' {} Maybe (Sensitive Text)
a -> SendTaskFailure
s {$sel:error:SendTaskFailure' :: Maybe (Sensitive Text)
error = Maybe (Sensitive Text)
a} :: SendTaskFailure) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> SendTaskFailure -> f SendTaskFailure)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> SendTaskFailure
-> f SendTaskFailure
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
sendTaskFailure_cause :: Lens.Lens' SendTaskFailure (Prelude.Maybe Prelude.Text)
sendTaskFailure_cause :: (Maybe Text -> f (Maybe Text))
-> SendTaskFailure -> f SendTaskFailure
sendTaskFailure_cause = (SendTaskFailure -> Maybe (Sensitive Text))
-> (SendTaskFailure -> Maybe (Sensitive Text) -> SendTaskFailure)
-> Lens
SendTaskFailure
SendTaskFailure
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTaskFailure' {Maybe (Sensitive Text)
cause :: Maybe (Sensitive Text)
$sel:cause:SendTaskFailure' :: SendTaskFailure -> Maybe (Sensitive Text)
cause} -> Maybe (Sensitive Text)
cause) (\s :: SendTaskFailure
s@SendTaskFailure' {} Maybe (Sensitive Text)
a -> SendTaskFailure
s {$sel:cause:SendTaskFailure' :: Maybe (Sensitive Text)
cause = Maybe (Sensitive Text)
a} :: SendTaskFailure) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> SendTaskFailure -> f SendTaskFailure)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> SendTaskFailure
-> f SendTaskFailure
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
sendTaskFailure_taskToken :: Lens.Lens' SendTaskFailure Prelude.Text
sendTaskFailure_taskToken :: (Text -> f Text) -> SendTaskFailure -> f SendTaskFailure
sendTaskFailure_taskToken = (SendTaskFailure -> Text)
-> (SendTaskFailure -> Text -> SendTaskFailure)
-> Lens SendTaskFailure SendTaskFailure Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTaskFailure' {Text
taskToken :: Text
$sel:taskToken:SendTaskFailure' :: SendTaskFailure -> Text
taskToken} -> Text
taskToken) (\s :: SendTaskFailure
s@SendTaskFailure' {} Text
a -> SendTaskFailure
s {$sel:taskToken:SendTaskFailure' :: Text
taskToken = Text
a} :: SendTaskFailure)
instance Core.AWSRequest SendTaskFailure where
type
AWSResponse SendTaskFailure =
SendTaskFailureResponse
request :: SendTaskFailure -> Request SendTaskFailure
request = Service -> SendTaskFailure -> Request SendTaskFailure
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendTaskFailure
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendTaskFailure)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse SendTaskFailure))
-> Logger
-> Service
-> Proxy SendTaskFailure
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendTaskFailure)))
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 -> SendTaskFailureResponse
SendTaskFailureResponse'
(Int -> SendTaskFailureResponse)
-> Either String Int -> Either String SendTaskFailureResponse
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 SendTaskFailure
instance Prelude.NFData SendTaskFailure
instance Core.ToHeaders SendTaskFailure where
toHeaders :: SendTaskFailure -> ResponseHeaders
toHeaders =
ResponseHeaders -> SendTaskFailure -> 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
"AWSStepFunctions.SendTaskFailure" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON SendTaskFailure where
toJSON :: SendTaskFailure -> Value
toJSON SendTaskFailure' {Maybe (Sensitive Text)
Text
taskToken :: Text
cause :: Maybe (Sensitive Text)
error :: Maybe (Sensitive Text)
$sel:taskToken:SendTaskFailure' :: SendTaskFailure -> Text
$sel:cause:SendTaskFailure' :: SendTaskFailure -> Maybe (Sensitive Text)
$sel:error:SendTaskFailure' :: SendTaskFailure -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"error" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
error,
(Text
"cause" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
cause,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"taskToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskToken)
]
)
instance Core.ToPath SendTaskFailure where
toPath :: SendTaskFailure -> ByteString
toPath = ByteString -> SendTaskFailure -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SendTaskFailure where
toQuery :: SendTaskFailure -> QueryString
toQuery = QueryString -> SendTaskFailure -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendTaskFailureResponse = SendTaskFailureResponse'
{
SendTaskFailureResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendTaskFailureResponse -> SendTaskFailureResponse -> Bool
(SendTaskFailureResponse -> SendTaskFailureResponse -> Bool)
-> (SendTaskFailureResponse -> SendTaskFailureResponse -> Bool)
-> Eq SendTaskFailureResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendTaskFailureResponse -> SendTaskFailureResponse -> Bool
$c/= :: SendTaskFailureResponse -> SendTaskFailureResponse -> Bool
== :: SendTaskFailureResponse -> SendTaskFailureResponse -> Bool
$c== :: SendTaskFailureResponse -> SendTaskFailureResponse -> Bool
Prelude.Eq, ReadPrec [SendTaskFailureResponse]
ReadPrec SendTaskFailureResponse
Int -> ReadS SendTaskFailureResponse
ReadS [SendTaskFailureResponse]
(Int -> ReadS SendTaskFailureResponse)
-> ReadS [SendTaskFailureResponse]
-> ReadPrec SendTaskFailureResponse
-> ReadPrec [SendTaskFailureResponse]
-> Read SendTaskFailureResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendTaskFailureResponse]
$creadListPrec :: ReadPrec [SendTaskFailureResponse]
readPrec :: ReadPrec SendTaskFailureResponse
$creadPrec :: ReadPrec SendTaskFailureResponse
readList :: ReadS [SendTaskFailureResponse]
$creadList :: ReadS [SendTaskFailureResponse]
readsPrec :: Int -> ReadS SendTaskFailureResponse
$creadsPrec :: Int -> ReadS SendTaskFailureResponse
Prelude.Read, Int -> SendTaskFailureResponse -> ShowS
[SendTaskFailureResponse] -> ShowS
SendTaskFailureResponse -> String
(Int -> SendTaskFailureResponse -> ShowS)
-> (SendTaskFailureResponse -> String)
-> ([SendTaskFailureResponse] -> ShowS)
-> Show SendTaskFailureResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendTaskFailureResponse] -> ShowS
$cshowList :: [SendTaskFailureResponse] -> ShowS
show :: SendTaskFailureResponse -> String
$cshow :: SendTaskFailureResponse -> String
showsPrec :: Int -> SendTaskFailureResponse -> ShowS
$cshowsPrec :: Int -> SendTaskFailureResponse -> ShowS
Prelude.Show, (forall x.
SendTaskFailureResponse -> Rep SendTaskFailureResponse x)
-> (forall x.
Rep SendTaskFailureResponse x -> SendTaskFailureResponse)
-> Generic SendTaskFailureResponse
forall x. Rep SendTaskFailureResponse x -> SendTaskFailureResponse
forall x. SendTaskFailureResponse -> Rep SendTaskFailureResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendTaskFailureResponse x -> SendTaskFailureResponse
$cfrom :: forall x. SendTaskFailureResponse -> Rep SendTaskFailureResponse x
Prelude.Generic)
newSendTaskFailureResponse ::
Prelude.Int ->
SendTaskFailureResponse
newSendTaskFailureResponse :: Int -> SendTaskFailureResponse
newSendTaskFailureResponse Int
pHttpStatus_ =
SendTaskFailureResponse' :: Int -> SendTaskFailureResponse
SendTaskFailureResponse' {$sel:httpStatus:SendTaskFailureResponse' :: Int
httpStatus = Int
pHttpStatus_}
sendTaskFailureResponse_httpStatus :: Lens.Lens' SendTaskFailureResponse Prelude.Int
sendTaskFailureResponse_httpStatus :: (Int -> f Int)
-> SendTaskFailureResponse -> f SendTaskFailureResponse
sendTaskFailureResponse_httpStatus = (SendTaskFailureResponse -> Int)
-> (SendTaskFailureResponse -> Int -> SendTaskFailureResponse)
-> Lens SendTaskFailureResponse SendTaskFailureResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTaskFailureResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendTaskFailureResponse' :: SendTaskFailureResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendTaskFailureResponse
s@SendTaskFailureResponse' {} Int
a -> SendTaskFailureResponse
s {$sel:httpStatus:SendTaskFailureResponse' :: Int
httpStatus = Int
a} :: SendTaskFailureResponse)
instance Prelude.NFData SendTaskFailureResponse