{-# 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.SWF.RespondActivityTaskFailed
(
RespondActivityTaskFailed (..),
newRespondActivityTaskFailed,
respondActivityTaskFailed_reason,
respondActivityTaskFailed_details,
respondActivityTaskFailed_taskToken,
RespondActivityTaskFailedResponse (..),
newRespondActivityTaskFailedResponse,
)
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.SWF.Types
data RespondActivityTaskFailed = RespondActivityTaskFailed'
{
RespondActivityTaskFailed -> Maybe Text
reason :: Prelude.Maybe Prelude.Text,
RespondActivityTaskFailed -> Maybe Text
details :: Prelude.Maybe Prelude.Text,
RespondActivityTaskFailed -> Text
taskToken :: Prelude.Text
}
deriving (RespondActivityTaskFailed -> RespondActivityTaskFailed -> Bool
(RespondActivityTaskFailed -> RespondActivityTaskFailed -> Bool)
-> (RespondActivityTaskFailed -> RespondActivityTaskFailed -> Bool)
-> Eq RespondActivityTaskFailed
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RespondActivityTaskFailed -> RespondActivityTaskFailed -> Bool
$c/= :: RespondActivityTaskFailed -> RespondActivityTaskFailed -> Bool
== :: RespondActivityTaskFailed -> RespondActivityTaskFailed -> Bool
$c== :: RespondActivityTaskFailed -> RespondActivityTaskFailed -> Bool
Prelude.Eq, ReadPrec [RespondActivityTaskFailed]
ReadPrec RespondActivityTaskFailed
Int -> ReadS RespondActivityTaskFailed
ReadS [RespondActivityTaskFailed]
(Int -> ReadS RespondActivityTaskFailed)
-> ReadS [RespondActivityTaskFailed]
-> ReadPrec RespondActivityTaskFailed
-> ReadPrec [RespondActivityTaskFailed]
-> Read RespondActivityTaskFailed
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RespondActivityTaskFailed]
$creadListPrec :: ReadPrec [RespondActivityTaskFailed]
readPrec :: ReadPrec RespondActivityTaskFailed
$creadPrec :: ReadPrec RespondActivityTaskFailed
readList :: ReadS [RespondActivityTaskFailed]
$creadList :: ReadS [RespondActivityTaskFailed]
readsPrec :: Int -> ReadS RespondActivityTaskFailed
$creadsPrec :: Int -> ReadS RespondActivityTaskFailed
Prelude.Read, Int -> RespondActivityTaskFailed -> ShowS
[RespondActivityTaskFailed] -> ShowS
RespondActivityTaskFailed -> String
(Int -> RespondActivityTaskFailed -> ShowS)
-> (RespondActivityTaskFailed -> String)
-> ([RespondActivityTaskFailed] -> ShowS)
-> Show RespondActivityTaskFailed
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RespondActivityTaskFailed] -> ShowS
$cshowList :: [RespondActivityTaskFailed] -> ShowS
show :: RespondActivityTaskFailed -> String
$cshow :: RespondActivityTaskFailed -> String
showsPrec :: Int -> RespondActivityTaskFailed -> ShowS
$cshowsPrec :: Int -> RespondActivityTaskFailed -> ShowS
Prelude.Show, (forall x.
RespondActivityTaskFailed -> Rep RespondActivityTaskFailed x)
-> (forall x.
Rep RespondActivityTaskFailed x -> RespondActivityTaskFailed)
-> Generic RespondActivityTaskFailed
forall x.
Rep RespondActivityTaskFailed x -> RespondActivityTaskFailed
forall x.
RespondActivityTaskFailed -> Rep RespondActivityTaskFailed x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RespondActivityTaskFailed x -> RespondActivityTaskFailed
$cfrom :: forall x.
RespondActivityTaskFailed -> Rep RespondActivityTaskFailed x
Prelude.Generic)
newRespondActivityTaskFailed ::
Prelude.Text ->
RespondActivityTaskFailed
newRespondActivityTaskFailed :: Text -> RespondActivityTaskFailed
newRespondActivityTaskFailed Text
pTaskToken_ =
RespondActivityTaskFailed' :: Maybe Text -> Maybe Text -> Text -> RespondActivityTaskFailed
RespondActivityTaskFailed'
{ $sel:reason:RespondActivityTaskFailed' :: Maybe Text
reason =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:details:RespondActivityTaskFailed' :: Maybe Text
details = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:taskToken:RespondActivityTaskFailed' :: Text
taskToken = Text
pTaskToken_
}
respondActivityTaskFailed_reason :: Lens.Lens' RespondActivityTaskFailed (Prelude.Maybe Prelude.Text)
respondActivityTaskFailed_reason :: (Maybe Text -> f (Maybe Text))
-> RespondActivityTaskFailed -> f RespondActivityTaskFailed
respondActivityTaskFailed_reason = (RespondActivityTaskFailed -> Maybe Text)
-> (RespondActivityTaskFailed
-> Maybe Text -> RespondActivityTaskFailed)
-> Lens
RespondActivityTaskFailed
RespondActivityTaskFailed
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondActivityTaskFailed' {Maybe Text
reason :: Maybe Text
$sel:reason:RespondActivityTaskFailed' :: RespondActivityTaskFailed -> Maybe Text
reason} -> Maybe Text
reason) (\s :: RespondActivityTaskFailed
s@RespondActivityTaskFailed' {} Maybe Text
a -> RespondActivityTaskFailed
s {$sel:reason:RespondActivityTaskFailed' :: Maybe Text
reason = Maybe Text
a} :: RespondActivityTaskFailed)
respondActivityTaskFailed_details :: Lens.Lens' RespondActivityTaskFailed (Prelude.Maybe Prelude.Text)
respondActivityTaskFailed_details :: (Maybe Text -> f (Maybe Text))
-> RespondActivityTaskFailed -> f RespondActivityTaskFailed
respondActivityTaskFailed_details = (RespondActivityTaskFailed -> Maybe Text)
-> (RespondActivityTaskFailed
-> Maybe Text -> RespondActivityTaskFailed)
-> Lens
RespondActivityTaskFailed
RespondActivityTaskFailed
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondActivityTaskFailed' {Maybe Text
details :: Maybe Text
$sel:details:RespondActivityTaskFailed' :: RespondActivityTaskFailed -> Maybe Text
details} -> Maybe Text
details) (\s :: RespondActivityTaskFailed
s@RespondActivityTaskFailed' {} Maybe Text
a -> RespondActivityTaskFailed
s {$sel:details:RespondActivityTaskFailed' :: Maybe Text
details = Maybe Text
a} :: RespondActivityTaskFailed)
respondActivityTaskFailed_taskToken :: Lens.Lens' RespondActivityTaskFailed Prelude.Text
respondActivityTaskFailed_taskToken :: (Text -> f Text)
-> RespondActivityTaskFailed -> f RespondActivityTaskFailed
respondActivityTaskFailed_taskToken = (RespondActivityTaskFailed -> Text)
-> (RespondActivityTaskFailed -> Text -> RespondActivityTaskFailed)
-> Lens
RespondActivityTaskFailed RespondActivityTaskFailed Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondActivityTaskFailed' {Text
taskToken :: Text
$sel:taskToken:RespondActivityTaskFailed' :: RespondActivityTaskFailed -> Text
taskToken} -> Text
taskToken) (\s :: RespondActivityTaskFailed
s@RespondActivityTaskFailed' {} Text
a -> RespondActivityTaskFailed
s {$sel:taskToken:RespondActivityTaskFailed' :: Text
taskToken = Text
a} :: RespondActivityTaskFailed)
instance Core.AWSRequest RespondActivityTaskFailed where
type
AWSResponse RespondActivityTaskFailed =
RespondActivityTaskFailedResponse
request :: RespondActivityTaskFailed -> Request RespondActivityTaskFailed
request = Service
-> RespondActivityTaskFailed -> Request RespondActivityTaskFailed
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RespondActivityTaskFailed
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RespondActivityTaskFailed)))
response =
AWSResponse RespondActivityTaskFailed
-> Logger
-> Service
-> Proxy RespondActivityTaskFailed
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RespondActivityTaskFailed)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse RespondActivityTaskFailed
RespondActivityTaskFailedResponse
RespondActivityTaskFailedResponse'
instance Prelude.Hashable RespondActivityTaskFailed
instance Prelude.NFData RespondActivityTaskFailed
instance Core.ToHeaders RespondActivityTaskFailed where
toHeaders :: RespondActivityTaskFailed -> [Header]
toHeaders =
[Header] -> RespondActivityTaskFailed -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"SimpleWorkflowService.RespondActivityTaskFailed" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON RespondActivityTaskFailed where
toJSON :: RespondActivityTaskFailed -> Value
toJSON RespondActivityTaskFailed' {Maybe Text
Text
taskToken :: Text
details :: Maybe Text
reason :: Maybe Text
$sel:taskToken:RespondActivityTaskFailed' :: RespondActivityTaskFailed -> Text
$sel:details:RespondActivityTaskFailed' :: RespondActivityTaskFailed -> Maybe Text
$sel:reason:RespondActivityTaskFailed' :: RespondActivityTaskFailed -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"reason" 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
reason,
(Text
"details" 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
details,
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 RespondActivityTaskFailed where
toPath :: RespondActivityTaskFailed -> ByteString
toPath = ByteString -> RespondActivityTaskFailed -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RespondActivityTaskFailed where
toQuery :: RespondActivityTaskFailed -> QueryString
toQuery = QueryString -> RespondActivityTaskFailed -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RespondActivityTaskFailedResponse = RespondActivityTaskFailedResponse'
{
}
deriving (RespondActivityTaskFailedResponse
-> RespondActivityTaskFailedResponse -> Bool
(RespondActivityTaskFailedResponse
-> RespondActivityTaskFailedResponse -> Bool)
-> (RespondActivityTaskFailedResponse
-> RespondActivityTaskFailedResponse -> Bool)
-> Eq RespondActivityTaskFailedResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RespondActivityTaskFailedResponse
-> RespondActivityTaskFailedResponse -> Bool
$c/= :: RespondActivityTaskFailedResponse
-> RespondActivityTaskFailedResponse -> Bool
== :: RespondActivityTaskFailedResponse
-> RespondActivityTaskFailedResponse -> Bool
$c== :: RespondActivityTaskFailedResponse
-> RespondActivityTaskFailedResponse -> Bool
Prelude.Eq, ReadPrec [RespondActivityTaskFailedResponse]
ReadPrec RespondActivityTaskFailedResponse
Int -> ReadS RespondActivityTaskFailedResponse
ReadS [RespondActivityTaskFailedResponse]
(Int -> ReadS RespondActivityTaskFailedResponse)
-> ReadS [RespondActivityTaskFailedResponse]
-> ReadPrec RespondActivityTaskFailedResponse
-> ReadPrec [RespondActivityTaskFailedResponse]
-> Read RespondActivityTaskFailedResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RespondActivityTaskFailedResponse]
$creadListPrec :: ReadPrec [RespondActivityTaskFailedResponse]
readPrec :: ReadPrec RespondActivityTaskFailedResponse
$creadPrec :: ReadPrec RespondActivityTaskFailedResponse
readList :: ReadS [RespondActivityTaskFailedResponse]
$creadList :: ReadS [RespondActivityTaskFailedResponse]
readsPrec :: Int -> ReadS RespondActivityTaskFailedResponse
$creadsPrec :: Int -> ReadS RespondActivityTaskFailedResponse
Prelude.Read, Int -> RespondActivityTaskFailedResponse -> ShowS
[RespondActivityTaskFailedResponse] -> ShowS
RespondActivityTaskFailedResponse -> String
(Int -> RespondActivityTaskFailedResponse -> ShowS)
-> (RespondActivityTaskFailedResponse -> String)
-> ([RespondActivityTaskFailedResponse] -> ShowS)
-> Show RespondActivityTaskFailedResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RespondActivityTaskFailedResponse] -> ShowS
$cshowList :: [RespondActivityTaskFailedResponse] -> ShowS
show :: RespondActivityTaskFailedResponse -> String
$cshow :: RespondActivityTaskFailedResponse -> String
showsPrec :: Int -> RespondActivityTaskFailedResponse -> ShowS
$cshowsPrec :: Int -> RespondActivityTaskFailedResponse -> ShowS
Prelude.Show, (forall x.
RespondActivityTaskFailedResponse
-> Rep RespondActivityTaskFailedResponse x)
-> (forall x.
Rep RespondActivityTaskFailedResponse x
-> RespondActivityTaskFailedResponse)
-> Generic RespondActivityTaskFailedResponse
forall x.
Rep RespondActivityTaskFailedResponse x
-> RespondActivityTaskFailedResponse
forall x.
RespondActivityTaskFailedResponse
-> Rep RespondActivityTaskFailedResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RespondActivityTaskFailedResponse x
-> RespondActivityTaskFailedResponse
$cfrom :: forall x.
RespondActivityTaskFailedResponse
-> Rep RespondActivityTaskFailedResponse x
Prelude.Generic)
newRespondActivityTaskFailedResponse ::
RespondActivityTaskFailedResponse
newRespondActivityTaskFailedResponse :: RespondActivityTaskFailedResponse
newRespondActivityTaskFailedResponse =
RespondActivityTaskFailedResponse
RespondActivityTaskFailedResponse'
instance
Prelude.NFData
RespondActivityTaskFailedResponse