{-# 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.TerminateWorkflowExecution
(
TerminateWorkflowExecution (..),
newTerminateWorkflowExecution,
terminateWorkflowExecution_reason,
terminateWorkflowExecution_runId,
terminateWorkflowExecution_childPolicy,
terminateWorkflowExecution_details,
terminateWorkflowExecution_domain,
terminateWorkflowExecution_workflowId,
TerminateWorkflowExecutionResponse (..),
newTerminateWorkflowExecutionResponse,
)
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 TerminateWorkflowExecution = TerminateWorkflowExecution'
{
TerminateWorkflowExecution -> Maybe Text
reason :: Prelude.Maybe Prelude.Text,
TerminateWorkflowExecution -> Maybe Text
runId :: Prelude.Maybe Prelude.Text,
TerminateWorkflowExecution -> Maybe ChildPolicy
childPolicy :: Prelude.Maybe ChildPolicy,
TerminateWorkflowExecution -> Maybe Text
details :: Prelude.Maybe Prelude.Text,
TerminateWorkflowExecution -> Text
domain :: Prelude.Text,
TerminateWorkflowExecution -> Text
workflowId :: Prelude.Text
}
deriving (TerminateWorkflowExecution -> TerminateWorkflowExecution -> Bool
(TerminateWorkflowExecution -> TerminateWorkflowExecution -> Bool)
-> (TerminateWorkflowExecution
-> TerminateWorkflowExecution -> Bool)
-> Eq TerminateWorkflowExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TerminateWorkflowExecution -> TerminateWorkflowExecution -> Bool
$c/= :: TerminateWorkflowExecution -> TerminateWorkflowExecution -> Bool
== :: TerminateWorkflowExecution -> TerminateWorkflowExecution -> Bool
$c== :: TerminateWorkflowExecution -> TerminateWorkflowExecution -> Bool
Prelude.Eq, ReadPrec [TerminateWorkflowExecution]
ReadPrec TerminateWorkflowExecution
Int -> ReadS TerminateWorkflowExecution
ReadS [TerminateWorkflowExecution]
(Int -> ReadS TerminateWorkflowExecution)
-> ReadS [TerminateWorkflowExecution]
-> ReadPrec TerminateWorkflowExecution
-> ReadPrec [TerminateWorkflowExecution]
-> Read TerminateWorkflowExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TerminateWorkflowExecution]
$creadListPrec :: ReadPrec [TerminateWorkflowExecution]
readPrec :: ReadPrec TerminateWorkflowExecution
$creadPrec :: ReadPrec TerminateWorkflowExecution
readList :: ReadS [TerminateWorkflowExecution]
$creadList :: ReadS [TerminateWorkflowExecution]
readsPrec :: Int -> ReadS TerminateWorkflowExecution
$creadsPrec :: Int -> ReadS TerminateWorkflowExecution
Prelude.Read, Int -> TerminateWorkflowExecution -> ShowS
[TerminateWorkflowExecution] -> ShowS
TerminateWorkflowExecution -> String
(Int -> TerminateWorkflowExecution -> ShowS)
-> (TerminateWorkflowExecution -> String)
-> ([TerminateWorkflowExecution] -> ShowS)
-> Show TerminateWorkflowExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TerminateWorkflowExecution] -> ShowS
$cshowList :: [TerminateWorkflowExecution] -> ShowS
show :: TerminateWorkflowExecution -> String
$cshow :: TerminateWorkflowExecution -> String
showsPrec :: Int -> TerminateWorkflowExecution -> ShowS
$cshowsPrec :: Int -> TerminateWorkflowExecution -> ShowS
Prelude.Show, (forall x.
TerminateWorkflowExecution -> Rep TerminateWorkflowExecution x)
-> (forall x.
Rep TerminateWorkflowExecution x -> TerminateWorkflowExecution)
-> Generic TerminateWorkflowExecution
forall x.
Rep TerminateWorkflowExecution x -> TerminateWorkflowExecution
forall x.
TerminateWorkflowExecution -> Rep TerminateWorkflowExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TerminateWorkflowExecution x -> TerminateWorkflowExecution
$cfrom :: forall x.
TerminateWorkflowExecution -> Rep TerminateWorkflowExecution x
Prelude.Generic)
newTerminateWorkflowExecution ::
Prelude.Text ->
Prelude.Text ->
TerminateWorkflowExecution
newTerminateWorkflowExecution :: Text -> Text -> TerminateWorkflowExecution
newTerminateWorkflowExecution Text
pDomain_ Text
pWorkflowId_ =
TerminateWorkflowExecution' :: Maybe Text
-> Maybe Text
-> Maybe ChildPolicy
-> Maybe Text
-> Text
-> Text
-> TerminateWorkflowExecution
TerminateWorkflowExecution'
{ $sel:reason:TerminateWorkflowExecution' :: Maybe Text
reason =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:runId:TerminateWorkflowExecution' :: Maybe Text
runId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:childPolicy:TerminateWorkflowExecution' :: Maybe ChildPolicy
childPolicy = Maybe ChildPolicy
forall a. Maybe a
Prelude.Nothing,
$sel:details:TerminateWorkflowExecution' :: Maybe Text
details = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domain:TerminateWorkflowExecution' :: Text
domain = Text
pDomain_,
$sel:workflowId:TerminateWorkflowExecution' :: Text
workflowId = Text
pWorkflowId_
}
terminateWorkflowExecution_reason :: Lens.Lens' TerminateWorkflowExecution (Prelude.Maybe Prelude.Text)
terminateWorkflowExecution_reason :: (Maybe Text -> f (Maybe Text))
-> TerminateWorkflowExecution -> f TerminateWorkflowExecution
terminateWorkflowExecution_reason = (TerminateWorkflowExecution -> Maybe Text)
-> (TerminateWorkflowExecution
-> Maybe Text -> TerminateWorkflowExecution)
-> Lens
TerminateWorkflowExecution
TerminateWorkflowExecution
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateWorkflowExecution' {Maybe Text
reason :: Maybe Text
$sel:reason:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Maybe Text
reason} -> Maybe Text
reason) (\s :: TerminateWorkflowExecution
s@TerminateWorkflowExecution' {} Maybe Text
a -> TerminateWorkflowExecution
s {$sel:reason:TerminateWorkflowExecution' :: Maybe Text
reason = Maybe Text
a} :: TerminateWorkflowExecution)
terminateWorkflowExecution_runId :: Lens.Lens' TerminateWorkflowExecution (Prelude.Maybe Prelude.Text)
terminateWorkflowExecution_runId :: (Maybe Text -> f (Maybe Text))
-> TerminateWorkflowExecution -> f TerminateWorkflowExecution
terminateWorkflowExecution_runId = (TerminateWorkflowExecution -> Maybe Text)
-> (TerminateWorkflowExecution
-> Maybe Text -> TerminateWorkflowExecution)
-> Lens
TerminateWorkflowExecution
TerminateWorkflowExecution
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateWorkflowExecution' {Maybe Text
runId :: Maybe Text
$sel:runId:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Maybe Text
runId} -> Maybe Text
runId) (\s :: TerminateWorkflowExecution
s@TerminateWorkflowExecution' {} Maybe Text
a -> TerminateWorkflowExecution
s {$sel:runId:TerminateWorkflowExecution' :: Maybe Text
runId = Maybe Text
a} :: TerminateWorkflowExecution)
terminateWorkflowExecution_childPolicy :: Lens.Lens' TerminateWorkflowExecution (Prelude.Maybe ChildPolicy)
terminateWorkflowExecution_childPolicy :: (Maybe ChildPolicy -> f (Maybe ChildPolicy))
-> TerminateWorkflowExecution -> f TerminateWorkflowExecution
terminateWorkflowExecution_childPolicy = (TerminateWorkflowExecution -> Maybe ChildPolicy)
-> (TerminateWorkflowExecution
-> Maybe ChildPolicy -> TerminateWorkflowExecution)
-> Lens
TerminateWorkflowExecution
TerminateWorkflowExecution
(Maybe ChildPolicy)
(Maybe ChildPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateWorkflowExecution' {Maybe ChildPolicy
childPolicy :: Maybe ChildPolicy
$sel:childPolicy:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Maybe ChildPolicy
childPolicy} -> Maybe ChildPolicy
childPolicy) (\s :: TerminateWorkflowExecution
s@TerminateWorkflowExecution' {} Maybe ChildPolicy
a -> TerminateWorkflowExecution
s {$sel:childPolicy:TerminateWorkflowExecution' :: Maybe ChildPolicy
childPolicy = Maybe ChildPolicy
a} :: TerminateWorkflowExecution)
terminateWorkflowExecution_details :: Lens.Lens' TerminateWorkflowExecution (Prelude.Maybe Prelude.Text)
terminateWorkflowExecution_details :: (Maybe Text -> f (Maybe Text))
-> TerminateWorkflowExecution -> f TerminateWorkflowExecution
terminateWorkflowExecution_details = (TerminateWorkflowExecution -> Maybe Text)
-> (TerminateWorkflowExecution
-> Maybe Text -> TerminateWorkflowExecution)
-> Lens
TerminateWorkflowExecution
TerminateWorkflowExecution
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateWorkflowExecution' {Maybe Text
details :: Maybe Text
$sel:details:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Maybe Text
details} -> Maybe Text
details) (\s :: TerminateWorkflowExecution
s@TerminateWorkflowExecution' {} Maybe Text
a -> TerminateWorkflowExecution
s {$sel:details:TerminateWorkflowExecution' :: Maybe Text
details = Maybe Text
a} :: TerminateWorkflowExecution)
terminateWorkflowExecution_domain :: Lens.Lens' TerminateWorkflowExecution Prelude.Text
terminateWorkflowExecution_domain :: (Text -> f Text)
-> TerminateWorkflowExecution -> f TerminateWorkflowExecution
terminateWorkflowExecution_domain = (TerminateWorkflowExecution -> Text)
-> (TerminateWorkflowExecution
-> Text -> TerminateWorkflowExecution)
-> Lens
TerminateWorkflowExecution TerminateWorkflowExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateWorkflowExecution' {Text
domain :: Text
$sel:domain:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Text
domain} -> Text
domain) (\s :: TerminateWorkflowExecution
s@TerminateWorkflowExecution' {} Text
a -> TerminateWorkflowExecution
s {$sel:domain:TerminateWorkflowExecution' :: Text
domain = Text
a} :: TerminateWorkflowExecution)
terminateWorkflowExecution_workflowId :: Lens.Lens' TerminateWorkflowExecution Prelude.Text
terminateWorkflowExecution_workflowId :: (Text -> f Text)
-> TerminateWorkflowExecution -> f TerminateWorkflowExecution
terminateWorkflowExecution_workflowId = (TerminateWorkflowExecution -> Text)
-> (TerminateWorkflowExecution
-> Text -> TerminateWorkflowExecution)
-> Lens
TerminateWorkflowExecution TerminateWorkflowExecution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateWorkflowExecution' {Text
workflowId :: Text
$sel:workflowId:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Text
workflowId} -> Text
workflowId) (\s :: TerminateWorkflowExecution
s@TerminateWorkflowExecution' {} Text
a -> TerminateWorkflowExecution
s {$sel:workflowId:TerminateWorkflowExecution' :: Text
workflowId = Text
a} :: TerminateWorkflowExecution)
instance Core.AWSRequest TerminateWorkflowExecution where
type
AWSResponse TerminateWorkflowExecution =
TerminateWorkflowExecutionResponse
request :: TerminateWorkflowExecution -> Request TerminateWorkflowExecution
request = Service
-> TerminateWorkflowExecution -> Request TerminateWorkflowExecution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy TerminateWorkflowExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse TerminateWorkflowExecution)))
response =
AWSResponse TerminateWorkflowExecution
-> Logger
-> Service
-> Proxy TerminateWorkflowExecution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse TerminateWorkflowExecution)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse TerminateWorkflowExecution
TerminateWorkflowExecutionResponse
TerminateWorkflowExecutionResponse'
instance Prelude.Hashable TerminateWorkflowExecution
instance Prelude.NFData TerminateWorkflowExecution
instance Core.ToHeaders TerminateWorkflowExecution where
toHeaders :: TerminateWorkflowExecution -> [Header]
toHeaders =
[Header] -> TerminateWorkflowExecution -> [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.TerminateWorkflowExecution" ::
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 TerminateWorkflowExecution where
toJSON :: TerminateWorkflowExecution -> Value
toJSON TerminateWorkflowExecution' {Maybe Text
Maybe ChildPolicy
Text
workflowId :: Text
domain :: Text
details :: Maybe Text
childPolicy :: Maybe ChildPolicy
runId :: Maybe Text
reason :: Maybe Text
$sel:workflowId:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Text
$sel:domain:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Text
$sel:details:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Maybe Text
$sel:childPolicy:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Maybe ChildPolicy
$sel:runId:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> Maybe Text
$sel:reason:TerminateWorkflowExecution' :: TerminateWorkflowExecution -> 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
"runId" 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
runId,
(Text
"childPolicy" Text -> ChildPolicy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ChildPolicy -> Pair) -> Maybe ChildPolicy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChildPolicy
childPolicy,
(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
"domain" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domain),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"workflowId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workflowId)
]
)
instance Core.ToPath TerminateWorkflowExecution where
toPath :: TerminateWorkflowExecution -> ByteString
toPath = ByteString -> TerminateWorkflowExecution -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery TerminateWorkflowExecution where
toQuery :: TerminateWorkflowExecution -> QueryString
toQuery = QueryString -> TerminateWorkflowExecution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data TerminateWorkflowExecutionResponse = TerminateWorkflowExecutionResponse'
{
}
deriving (TerminateWorkflowExecutionResponse
-> TerminateWorkflowExecutionResponse -> Bool
(TerminateWorkflowExecutionResponse
-> TerminateWorkflowExecutionResponse -> Bool)
-> (TerminateWorkflowExecutionResponse
-> TerminateWorkflowExecutionResponse -> Bool)
-> Eq TerminateWorkflowExecutionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TerminateWorkflowExecutionResponse
-> TerminateWorkflowExecutionResponse -> Bool
$c/= :: TerminateWorkflowExecutionResponse
-> TerminateWorkflowExecutionResponse -> Bool
== :: TerminateWorkflowExecutionResponse
-> TerminateWorkflowExecutionResponse -> Bool
$c== :: TerminateWorkflowExecutionResponse
-> TerminateWorkflowExecutionResponse -> Bool
Prelude.Eq, ReadPrec [TerminateWorkflowExecutionResponse]
ReadPrec TerminateWorkflowExecutionResponse
Int -> ReadS TerminateWorkflowExecutionResponse
ReadS [TerminateWorkflowExecutionResponse]
(Int -> ReadS TerminateWorkflowExecutionResponse)
-> ReadS [TerminateWorkflowExecutionResponse]
-> ReadPrec TerminateWorkflowExecutionResponse
-> ReadPrec [TerminateWorkflowExecutionResponse]
-> Read TerminateWorkflowExecutionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TerminateWorkflowExecutionResponse]
$creadListPrec :: ReadPrec [TerminateWorkflowExecutionResponse]
readPrec :: ReadPrec TerminateWorkflowExecutionResponse
$creadPrec :: ReadPrec TerminateWorkflowExecutionResponse
readList :: ReadS [TerminateWorkflowExecutionResponse]
$creadList :: ReadS [TerminateWorkflowExecutionResponse]
readsPrec :: Int -> ReadS TerminateWorkflowExecutionResponse
$creadsPrec :: Int -> ReadS TerminateWorkflowExecutionResponse
Prelude.Read, Int -> TerminateWorkflowExecutionResponse -> ShowS
[TerminateWorkflowExecutionResponse] -> ShowS
TerminateWorkflowExecutionResponse -> String
(Int -> TerminateWorkflowExecutionResponse -> ShowS)
-> (TerminateWorkflowExecutionResponse -> String)
-> ([TerminateWorkflowExecutionResponse] -> ShowS)
-> Show TerminateWorkflowExecutionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TerminateWorkflowExecutionResponse] -> ShowS
$cshowList :: [TerminateWorkflowExecutionResponse] -> ShowS
show :: TerminateWorkflowExecutionResponse -> String
$cshow :: TerminateWorkflowExecutionResponse -> String
showsPrec :: Int -> TerminateWorkflowExecutionResponse -> ShowS
$cshowsPrec :: Int -> TerminateWorkflowExecutionResponse -> ShowS
Prelude.Show, (forall x.
TerminateWorkflowExecutionResponse
-> Rep TerminateWorkflowExecutionResponse x)
-> (forall x.
Rep TerminateWorkflowExecutionResponse x
-> TerminateWorkflowExecutionResponse)
-> Generic TerminateWorkflowExecutionResponse
forall x.
Rep TerminateWorkflowExecutionResponse x
-> TerminateWorkflowExecutionResponse
forall x.
TerminateWorkflowExecutionResponse
-> Rep TerminateWorkflowExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TerminateWorkflowExecutionResponse x
-> TerminateWorkflowExecutionResponse
$cfrom :: forall x.
TerminateWorkflowExecutionResponse
-> Rep TerminateWorkflowExecutionResponse x
Prelude.Generic)
newTerminateWorkflowExecutionResponse ::
TerminateWorkflowExecutionResponse
newTerminateWorkflowExecutionResponse :: TerminateWorkflowExecutionResponse
newTerminateWorkflowExecutionResponse =
TerminateWorkflowExecutionResponse
TerminateWorkflowExecutionResponse'
instance
Prelude.NFData
TerminateWorkflowExecutionResponse