{-# 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.RespondDecisionTaskCompleted
(
RespondDecisionTaskCompleted (..),
newRespondDecisionTaskCompleted,
respondDecisionTaskCompleted_decisions,
respondDecisionTaskCompleted_executionContext,
respondDecisionTaskCompleted_taskToken,
RespondDecisionTaskCompletedResponse (..),
newRespondDecisionTaskCompletedResponse,
)
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 RespondDecisionTaskCompleted = RespondDecisionTaskCompleted'
{
RespondDecisionTaskCompleted -> Maybe [Decision]
decisions :: Prelude.Maybe [Decision],
RespondDecisionTaskCompleted -> Maybe Text
executionContext :: Prelude.Maybe Prelude.Text,
RespondDecisionTaskCompleted -> Text
taskToken :: Prelude.Text
}
deriving (RespondDecisionTaskCompleted
-> RespondDecisionTaskCompleted -> Bool
(RespondDecisionTaskCompleted
-> RespondDecisionTaskCompleted -> Bool)
-> (RespondDecisionTaskCompleted
-> RespondDecisionTaskCompleted -> Bool)
-> Eq RespondDecisionTaskCompleted
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RespondDecisionTaskCompleted
-> RespondDecisionTaskCompleted -> Bool
$c/= :: RespondDecisionTaskCompleted
-> RespondDecisionTaskCompleted -> Bool
== :: RespondDecisionTaskCompleted
-> RespondDecisionTaskCompleted -> Bool
$c== :: RespondDecisionTaskCompleted
-> RespondDecisionTaskCompleted -> Bool
Prelude.Eq, ReadPrec [RespondDecisionTaskCompleted]
ReadPrec RespondDecisionTaskCompleted
Int -> ReadS RespondDecisionTaskCompleted
ReadS [RespondDecisionTaskCompleted]
(Int -> ReadS RespondDecisionTaskCompleted)
-> ReadS [RespondDecisionTaskCompleted]
-> ReadPrec RespondDecisionTaskCompleted
-> ReadPrec [RespondDecisionTaskCompleted]
-> Read RespondDecisionTaskCompleted
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RespondDecisionTaskCompleted]
$creadListPrec :: ReadPrec [RespondDecisionTaskCompleted]
readPrec :: ReadPrec RespondDecisionTaskCompleted
$creadPrec :: ReadPrec RespondDecisionTaskCompleted
readList :: ReadS [RespondDecisionTaskCompleted]
$creadList :: ReadS [RespondDecisionTaskCompleted]
readsPrec :: Int -> ReadS RespondDecisionTaskCompleted
$creadsPrec :: Int -> ReadS RespondDecisionTaskCompleted
Prelude.Read, Int -> RespondDecisionTaskCompleted -> ShowS
[RespondDecisionTaskCompleted] -> ShowS
RespondDecisionTaskCompleted -> String
(Int -> RespondDecisionTaskCompleted -> ShowS)
-> (RespondDecisionTaskCompleted -> String)
-> ([RespondDecisionTaskCompleted] -> ShowS)
-> Show RespondDecisionTaskCompleted
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RespondDecisionTaskCompleted] -> ShowS
$cshowList :: [RespondDecisionTaskCompleted] -> ShowS
show :: RespondDecisionTaskCompleted -> String
$cshow :: RespondDecisionTaskCompleted -> String
showsPrec :: Int -> RespondDecisionTaskCompleted -> ShowS
$cshowsPrec :: Int -> RespondDecisionTaskCompleted -> ShowS
Prelude.Show, (forall x.
RespondDecisionTaskCompleted -> Rep RespondDecisionTaskCompleted x)
-> (forall x.
Rep RespondDecisionTaskCompleted x -> RespondDecisionTaskCompleted)
-> Generic RespondDecisionTaskCompleted
forall x.
Rep RespondDecisionTaskCompleted x -> RespondDecisionTaskCompleted
forall x.
RespondDecisionTaskCompleted -> Rep RespondDecisionTaskCompleted x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RespondDecisionTaskCompleted x -> RespondDecisionTaskCompleted
$cfrom :: forall x.
RespondDecisionTaskCompleted -> Rep RespondDecisionTaskCompleted x
Prelude.Generic)
newRespondDecisionTaskCompleted ::
Prelude.Text ->
RespondDecisionTaskCompleted
newRespondDecisionTaskCompleted :: Text -> RespondDecisionTaskCompleted
newRespondDecisionTaskCompleted Text
pTaskToken_ =
RespondDecisionTaskCompleted' :: Maybe [Decision]
-> Maybe Text -> Text -> RespondDecisionTaskCompleted
RespondDecisionTaskCompleted'
{ $sel:decisions:RespondDecisionTaskCompleted' :: Maybe [Decision]
decisions =
Maybe [Decision]
forall a. Maybe a
Prelude.Nothing,
$sel:executionContext:RespondDecisionTaskCompleted' :: Maybe Text
executionContext = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:taskToken:RespondDecisionTaskCompleted' :: Text
taskToken = Text
pTaskToken_
}
respondDecisionTaskCompleted_decisions :: Lens.Lens' RespondDecisionTaskCompleted (Prelude.Maybe [Decision])
respondDecisionTaskCompleted_decisions :: (Maybe [Decision] -> f (Maybe [Decision]))
-> RespondDecisionTaskCompleted -> f RespondDecisionTaskCompleted
respondDecisionTaskCompleted_decisions = (RespondDecisionTaskCompleted -> Maybe [Decision])
-> (RespondDecisionTaskCompleted
-> Maybe [Decision] -> RespondDecisionTaskCompleted)
-> Lens
RespondDecisionTaskCompleted
RespondDecisionTaskCompleted
(Maybe [Decision])
(Maybe [Decision])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondDecisionTaskCompleted' {Maybe [Decision]
decisions :: Maybe [Decision]
$sel:decisions:RespondDecisionTaskCompleted' :: RespondDecisionTaskCompleted -> Maybe [Decision]
decisions} -> Maybe [Decision]
decisions) (\s :: RespondDecisionTaskCompleted
s@RespondDecisionTaskCompleted' {} Maybe [Decision]
a -> RespondDecisionTaskCompleted
s {$sel:decisions:RespondDecisionTaskCompleted' :: Maybe [Decision]
decisions = Maybe [Decision]
a} :: RespondDecisionTaskCompleted) ((Maybe [Decision] -> f (Maybe [Decision]))
-> RespondDecisionTaskCompleted -> f RespondDecisionTaskCompleted)
-> ((Maybe [Decision] -> f (Maybe [Decision]))
-> Maybe [Decision] -> f (Maybe [Decision]))
-> (Maybe [Decision] -> f (Maybe [Decision]))
-> RespondDecisionTaskCompleted
-> f RespondDecisionTaskCompleted
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Decision] [Decision] [Decision] [Decision]
-> Iso
(Maybe [Decision])
(Maybe [Decision])
(Maybe [Decision])
(Maybe [Decision])
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 [Decision] [Decision] [Decision] [Decision]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
respondDecisionTaskCompleted_executionContext :: Lens.Lens' RespondDecisionTaskCompleted (Prelude.Maybe Prelude.Text)
respondDecisionTaskCompleted_executionContext :: (Maybe Text -> f (Maybe Text))
-> RespondDecisionTaskCompleted -> f RespondDecisionTaskCompleted
respondDecisionTaskCompleted_executionContext = (RespondDecisionTaskCompleted -> Maybe Text)
-> (RespondDecisionTaskCompleted
-> Maybe Text -> RespondDecisionTaskCompleted)
-> Lens
RespondDecisionTaskCompleted
RespondDecisionTaskCompleted
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondDecisionTaskCompleted' {Maybe Text
executionContext :: Maybe Text
$sel:executionContext:RespondDecisionTaskCompleted' :: RespondDecisionTaskCompleted -> Maybe Text
executionContext} -> Maybe Text
executionContext) (\s :: RespondDecisionTaskCompleted
s@RespondDecisionTaskCompleted' {} Maybe Text
a -> RespondDecisionTaskCompleted
s {$sel:executionContext:RespondDecisionTaskCompleted' :: Maybe Text
executionContext = Maybe Text
a} :: RespondDecisionTaskCompleted)
respondDecisionTaskCompleted_taskToken :: Lens.Lens' RespondDecisionTaskCompleted Prelude.Text
respondDecisionTaskCompleted_taskToken :: (Text -> f Text)
-> RespondDecisionTaskCompleted -> f RespondDecisionTaskCompleted
respondDecisionTaskCompleted_taskToken = (RespondDecisionTaskCompleted -> Text)
-> (RespondDecisionTaskCompleted
-> Text -> RespondDecisionTaskCompleted)
-> Lens
RespondDecisionTaskCompleted RespondDecisionTaskCompleted Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RespondDecisionTaskCompleted' {Text
taskToken :: Text
$sel:taskToken:RespondDecisionTaskCompleted' :: RespondDecisionTaskCompleted -> Text
taskToken} -> Text
taskToken) (\s :: RespondDecisionTaskCompleted
s@RespondDecisionTaskCompleted' {} Text
a -> RespondDecisionTaskCompleted
s {$sel:taskToken:RespondDecisionTaskCompleted' :: Text
taskToken = Text
a} :: RespondDecisionTaskCompleted)
instance Core.AWSRequest RespondDecisionTaskCompleted where
type
AWSResponse RespondDecisionTaskCompleted =
RespondDecisionTaskCompletedResponse
request :: RespondDecisionTaskCompleted
-> Request RespondDecisionTaskCompleted
request = Service
-> RespondDecisionTaskCompleted
-> Request RespondDecisionTaskCompleted
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RespondDecisionTaskCompleted
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RespondDecisionTaskCompleted)))
response =
AWSResponse RespondDecisionTaskCompleted
-> Logger
-> Service
-> Proxy RespondDecisionTaskCompleted
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RespondDecisionTaskCompleted)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse RespondDecisionTaskCompleted
RespondDecisionTaskCompletedResponse
RespondDecisionTaskCompletedResponse'
instance
Prelude.Hashable
RespondDecisionTaskCompleted
instance Prelude.NFData RespondDecisionTaskCompleted
instance Core.ToHeaders RespondDecisionTaskCompleted where
toHeaders :: RespondDecisionTaskCompleted -> [Header]
toHeaders =
[Header] -> RespondDecisionTaskCompleted -> [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.RespondDecisionTaskCompleted" ::
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 RespondDecisionTaskCompleted where
toJSON :: RespondDecisionTaskCompleted -> Value
toJSON RespondDecisionTaskCompleted' {Maybe [Decision]
Maybe Text
Text
taskToken :: Text
executionContext :: Maybe Text
decisions :: Maybe [Decision]
$sel:taskToken:RespondDecisionTaskCompleted' :: RespondDecisionTaskCompleted -> Text
$sel:executionContext:RespondDecisionTaskCompleted' :: RespondDecisionTaskCompleted -> Maybe Text
$sel:decisions:RespondDecisionTaskCompleted' :: RespondDecisionTaskCompleted -> Maybe [Decision]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"decisions" Text -> [Decision] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Decision] -> Pair) -> Maybe [Decision] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Decision]
decisions,
(Text
"executionContext" 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
executionContext,
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 RespondDecisionTaskCompleted where
toPath :: RespondDecisionTaskCompleted -> ByteString
toPath = ByteString -> RespondDecisionTaskCompleted -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RespondDecisionTaskCompleted where
toQuery :: RespondDecisionTaskCompleted -> QueryString
toQuery = QueryString -> RespondDecisionTaskCompleted -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RespondDecisionTaskCompletedResponse = RespondDecisionTaskCompletedResponse'
{
}
deriving (RespondDecisionTaskCompletedResponse
-> RespondDecisionTaskCompletedResponse -> Bool
(RespondDecisionTaskCompletedResponse
-> RespondDecisionTaskCompletedResponse -> Bool)
-> (RespondDecisionTaskCompletedResponse
-> RespondDecisionTaskCompletedResponse -> Bool)
-> Eq RespondDecisionTaskCompletedResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RespondDecisionTaskCompletedResponse
-> RespondDecisionTaskCompletedResponse -> Bool
$c/= :: RespondDecisionTaskCompletedResponse
-> RespondDecisionTaskCompletedResponse -> Bool
== :: RespondDecisionTaskCompletedResponse
-> RespondDecisionTaskCompletedResponse -> Bool
$c== :: RespondDecisionTaskCompletedResponse
-> RespondDecisionTaskCompletedResponse -> Bool
Prelude.Eq, ReadPrec [RespondDecisionTaskCompletedResponse]
ReadPrec RespondDecisionTaskCompletedResponse
Int -> ReadS RespondDecisionTaskCompletedResponse
ReadS [RespondDecisionTaskCompletedResponse]
(Int -> ReadS RespondDecisionTaskCompletedResponse)
-> ReadS [RespondDecisionTaskCompletedResponse]
-> ReadPrec RespondDecisionTaskCompletedResponse
-> ReadPrec [RespondDecisionTaskCompletedResponse]
-> Read RespondDecisionTaskCompletedResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RespondDecisionTaskCompletedResponse]
$creadListPrec :: ReadPrec [RespondDecisionTaskCompletedResponse]
readPrec :: ReadPrec RespondDecisionTaskCompletedResponse
$creadPrec :: ReadPrec RespondDecisionTaskCompletedResponse
readList :: ReadS [RespondDecisionTaskCompletedResponse]
$creadList :: ReadS [RespondDecisionTaskCompletedResponse]
readsPrec :: Int -> ReadS RespondDecisionTaskCompletedResponse
$creadsPrec :: Int -> ReadS RespondDecisionTaskCompletedResponse
Prelude.Read, Int -> RespondDecisionTaskCompletedResponse -> ShowS
[RespondDecisionTaskCompletedResponse] -> ShowS
RespondDecisionTaskCompletedResponse -> String
(Int -> RespondDecisionTaskCompletedResponse -> ShowS)
-> (RespondDecisionTaskCompletedResponse -> String)
-> ([RespondDecisionTaskCompletedResponse] -> ShowS)
-> Show RespondDecisionTaskCompletedResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RespondDecisionTaskCompletedResponse] -> ShowS
$cshowList :: [RespondDecisionTaskCompletedResponse] -> ShowS
show :: RespondDecisionTaskCompletedResponse -> String
$cshow :: RespondDecisionTaskCompletedResponse -> String
showsPrec :: Int -> RespondDecisionTaskCompletedResponse -> ShowS
$cshowsPrec :: Int -> RespondDecisionTaskCompletedResponse -> ShowS
Prelude.Show, (forall x.
RespondDecisionTaskCompletedResponse
-> Rep RespondDecisionTaskCompletedResponse x)
-> (forall x.
Rep RespondDecisionTaskCompletedResponse x
-> RespondDecisionTaskCompletedResponse)
-> Generic RespondDecisionTaskCompletedResponse
forall x.
Rep RespondDecisionTaskCompletedResponse x
-> RespondDecisionTaskCompletedResponse
forall x.
RespondDecisionTaskCompletedResponse
-> Rep RespondDecisionTaskCompletedResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RespondDecisionTaskCompletedResponse x
-> RespondDecisionTaskCompletedResponse
$cfrom :: forall x.
RespondDecisionTaskCompletedResponse
-> Rep RespondDecisionTaskCompletedResponse x
Prelude.Generic)
newRespondDecisionTaskCompletedResponse ::
RespondDecisionTaskCompletedResponse
newRespondDecisionTaskCompletedResponse :: RespondDecisionTaskCompletedResponse
newRespondDecisionTaskCompletedResponse =
RespondDecisionTaskCompletedResponse
RespondDecisionTaskCompletedResponse'
instance
Prelude.NFData
RespondDecisionTaskCompletedResponse