{-# 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.RequestCancelWorkflowExecution
(
RequestCancelWorkflowExecution (..),
newRequestCancelWorkflowExecution,
requestCancelWorkflowExecution_runId,
requestCancelWorkflowExecution_domain,
requestCancelWorkflowExecution_workflowId,
RequestCancelWorkflowExecutionResponse (..),
newRequestCancelWorkflowExecutionResponse,
)
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 RequestCancelWorkflowExecution = RequestCancelWorkflowExecution'
{
RequestCancelWorkflowExecution -> Maybe Text
runId :: Prelude.Maybe Prelude.Text,
RequestCancelWorkflowExecution -> Text
domain :: Prelude.Text,
RequestCancelWorkflowExecution -> Text
workflowId :: Prelude.Text
}
deriving (RequestCancelWorkflowExecution
-> RequestCancelWorkflowExecution -> Bool
(RequestCancelWorkflowExecution
-> RequestCancelWorkflowExecution -> Bool)
-> (RequestCancelWorkflowExecution
-> RequestCancelWorkflowExecution -> Bool)
-> Eq RequestCancelWorkflowExecution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RequestCancelWorkflowExecution
-> RequestCancelWorkflowExecution -> Bool
$c/= :: RequestCancelWorkflowExecution
-> RequestCancelWorkflowExecution -> Bool
== :: RequestCancelWorkflowExecution
-> RequestCancelWorkflowExecution -> Bool
$c== :: RequestCancelWorkflowExecution
-> RequestCancelWorkflowExecution -> Bool
Prelude.Eq, ReadPrec [RequestCancelWorkflowExecution]
ReadPrec RequestCancelWorkflowExecution
Int -> ReadS RequestCancelWorkflowExecution
ReadS [RequestCancelWorkflowExecution]
(Int -> ReadS RequestCancelWorkflowExecution)
-> ReadS [RequestCancelWorkflowExecution]
-> ReadPrec RequestCancelWorkflowExecution
-> ReadPrec [RequestCancelWorkflowExecution]
-> Read RequestCancelWorkflowExecution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RequestCancelWorkflowExecution]
$creadListPrec :: ReadPrec [RequestCancelWorkflowExecution]
readPrec :: ReadPrec RequestCancelWorkflowExecution
$creadPrec :: ReadPrec RequestCancelWorkflowExecution
readList :: ReadS [RequestCancelWorkflowExecution]
$creadList :: ReadS [RequestCancelWorkflowExecution]
readsPrec :: Int -> ReadS RequestCancelWorkflowExecution
$creadsPrec :: Int -> ReadS RequestCancelWorkflowExecution
Prelude.Read, Int -> RequestCancelWorkflowExecution -> ShowS
[RequestCancelWorkflowExecution] -> ShowS
RequestCancelWorkflowExecution -> String
(Int -> RequestCancelWorkflowExecution -> ShowS)
-> (RequestCancelWorkflowExecution -> String)
-> ([RequestCancelWorkflowExecution] -> ShowS)
-> Show RequestCancelWorkflowExecution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RequestCancelWorkflowExecution] -> ShowS
$cshowList :: [RequestCancelWorkflowExecution] -> ShowS
show :: RequestCancelWorkflowExecution -> String
$cshow :: RequestCancelWorkflowExecution -> String
showsPrec :: Int -> RequestCancelWorkflowExecution -> ShowS
$cshowsPrec :: Int -> RequestCancelWorkflowExecution -> ShowS
Prelude.Show, (forall x.
RequestCancelWorkflowExecution
-> Rep RequestCancelWorkflowExecution x)
-> (forall x.
Rep RequestCancelWorkflowExecution x
-> RequestCancelWorkflowExecution)
-> Generic RequestCancelWorkflowExecution
forall x.
Rep RequestCancelWorkflowExecution x
-> RequestCancelWorkflowExecution
forall x.
RequestCancelWorkflowExecution
-> Rep RequestCancelWorkflowExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RequestCancelWorkflowExecution x
-> RequestCancelWorkflowExecution
$cfrom :: forall x.
RequestCancelWorkflowExecution
-> Rep RequestCancelWorkflowExecution x
Prelude.Generic)
newRequestCancelWorkflowExecution ::
Prelude.Text ->
Prelude.Text ->
RequestCancelWorkflowExecution
newRequestCancelWorkflowExecution :: Text -> Text -> RequestCancelWorkflowExecution
newRequestCancelWorkflowExecution
Text
pDomain_
Text
pWorkflowId_ =
RequestCancelWorkflowExecution' :: Maybe Text -> Text -> Text -> RequestCancelWorkflowExecution
RequestCancelWorkflowExecution'
{ $sel:runId:RequestCancelWorkflowExecution' :: Maybe Text
runId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:domain:RequestCancelWorkflowExecution' :: Text
domain = Text
pDomain_,
$sel:workflowId:RequestCancelWorkflowExecution' :: Text
workflowId = Text
pWorkflowId_
}
requestCancelWorkflowExecution_runId :: Lens.Lens' RequestCancelWorkflowExecution (Prelude.Maybe Prelude.Text)
requestCancelWorkflowExecution_runId :: (Maybe Text -> f (Maybe Text))
-> RequestCancelWorkflowExecution
-> f RequestCancelWorkflowExecution
requestCancelWorkflowExecution_runId = (RequestCancelWorkflowExecution -> Maybe Text)
-> (RequestCancelWorkflowExecution
-> Maybe Text -> RequestCancelWorkflowExecution)
-> Lens
RequestCancelWorkflowExecution
RequestCancelWorkflowExecution
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelWorkflowExecution' {Maybe Text
runId :: Maybe Text
$sel:runId:RequestCancelWorkflowExecution' :: RequestCancelWorkflowExecution -> Maybe Text
runId} -> Maybe Text
runId) (\s :: RequestCancelWorkflowExecution
s@RequestCancelWorkflowExecution' {} Maybe Text
a -> RequestCancelWorkflowExecution
s {$sel:runId:RequestCancelWorkflowExecution' :: Maybe Text
runId = Maybe Text
a} :: RequestCancelWorkflowExecution)
requestCancelWorkflowExecution_domain :: Lens.Lens' RequestCancelWorkflowExecution Prelude.Text
requestCancelWorkflowExecution_domain :: (Text -> f Text)
-> RequestCancelWorkflowExecution
-> f RequestCancelWorkflowExecution
requestCancelWorkflowExecution_domain = (RequestCancelWorkflowExecution -> Text)
-> (RequestCancelWorkflowExecution
-> Text -> RequestCancelWorkflowExecution)
-> Lens
RequestCancelWorkflowExecution
RequestCancelWorkflowExecution
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelWorkflowExecution' {Text
domain :: Text
$sel:domain:RequestCancelWorkflowExecution' :: RequestCancelWorkflowExecution -> Text
domain} -> Text
domain) (\s :: RequestCancelWorkflowExecution
s@RequestCancelWorkflowExecution' {} Text
a -> RequestCancelWorkflowExecution
s {$sel:domain:RequestCancelWorkflowExecution' :: Text
domain = Text
a} :: RequestCancelWorkflowExecution)
requestCancelWorkflowExecution_workflowId :: Lens.Lens' RequestCancelWorkflowExecution Prelude.Text
requestCancelWorkflowExecution_workflowId :: (Text -> f Text)
-> RequestCancelWorkflowExecution
-> f RequestCancelWorkflowExecution
requestCancelWorkflowExecution_workflowId = (RequestCancelWorkflowExecution -> Text)
-> (RequestCancelWorkflowExecution
-> Text -> RequestCancelWorkflowExecution)
-> Lens
RequestCancelWorkflowExecution
RequestCancelWorkflowExecution
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RequestCancelWorkflowExecution' {Text
workflowId :: Text
$sel:workflowId:RequestCancelWorkflowExecution' :: RequestCancelWorkflowExecution -> Text
workflowId} -> Text
workflowId) (\s :: RequestCancelWorkflowExecution
s@RequestCancelWorkflowExecution' {} Text
a -> RequestCancelWorkflowExecution
s {$sel:workflowId:RequestCancelWorkflowExecution' :: Text
workflowId = Text
a} :: RequestCancelWorkflowExecution)
instance
Core.AWSRequest
RequestCancelWorkflowExecution
where
type
AWSResponse RequestCancelWorkflowExecution =
RequestCancelWorkflowExecutionResponse
request :: RequestCancelWorkflowExecution
-> Request RequestCancelWorkflowExecution
request = Service
-> RequestCancelWorkflowExecution
-> Request RequestCancelWorkflowExecution
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RequestCancelWorkflowExecution
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse RequestCancelWorkflowExecution)))
response =
AWSResponse RequestCancelWorkflowExecution
-> Logger
-> Service
-> Proxy RequestCancelWorkflowExecution
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse RequestCancelWorkflowExecution)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse RequestCancelWorkflowExecution
RequestCancelWorkflowExecutionResponse
RequestCancelWorkflowExecutionResponse'
instance
Prelude.Hashable
RequestCancelWorkflowExecution
instance
Prelude.NFData
RequestCancelWorkflowExecution
instance
Core.ToHeaders
RequestCancelWorkflowExecution
where
toHeaders :: RequestCancelWorkflowExecution -> [Header]
toHeaders =
[Header] -> RequestCancelWorkflowExecution -> [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.RequestCancelWorkflowExecution" ::
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 RequestCancelWorkflowExecution where
toJSON :: RequestCancelWorkflowExecution -> Value
toJSON RequestCancelWorkflowExecution' {Maybe Text
Text
workflowId :: Text
domain :: Text
runId :: Maybe Text
$sel:workflowId:RequestCancelWorkflowExecution' :: RequestCancelWorkflowExecution -> Text
$sel:domain:RequestCancelWorkflowExecution' :: RequestCancelWorkflowExecution -> Text
$sel:runId:RequestCancelWorkflowExecution' :: RequestCancelWorkflowExecution -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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,
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 RequestCancelWorkflowExecution where
toPath :: RequestCancelWorkflowExecution -> ByteString
toPath = ByteString -> RequestCancelWorkflowExecution -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RequestCancelWorkflowExecution where
toQuery :: RequestCancelWorkflowExecution -> QueryString
toQuery = QueryString -> RequestCancelWorkflowExecution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RequestCancelWorkflowExecutionResponse = RequestCancelWorkflowExecutionResponse'
{
}
deriving (RequestCancelWorkflowExecutionResponse
-> RequestCancelWorkflowExecutionResponse -> Bool
(RequestCancelWorkflowExecutionResponse
-> RequestCancelWorkflowExecutionResponse -> Bool)
-> (RequestCancelWorkflowExecutionResponse
-> RequestCancelWorkflowExecutionResponse -> Bool)
-> Eq RequestCancelWorkflowExecutionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RequestCancelWorkflowExecutionResponse
-> RequestCancelWorkflowExecutionResponse -> Bool
$c/= :: RequestCancelWorkflowExecutionResponse
-> RequestCancelWorkflowExecutionResponse -> Bool
== :: RequestCancelWorkflowExecutionResponse
-> RequestCancelWorkflowExecutionResponse -> Bool
$c== :: RequestCancelWorkflowExecutionResponse
-> RequestCancelWorkflowExecutionResponse -> Bool
Prelude.Eq, ReadPrec [RequestCancelWorkflowExecutionResponse]
ReadPrec RequestCancelWorkflowExecutionResponse
Int -> ReadS RequestCancelWorkflowExecutionResponse
ReadS [RequestCancelWorkflowExecutionResponse]
(Int -> ReadS RequestCancelWorkflowExecutionResponse)
-> ReadS [RequestCancelWorkflowExecutionResponse]
-> ReadPrec RequestCancelWorkflowExecutionResponse
-> ReadPrec [RequestCancelWorkflowExecutionResponse]
-> Read RequestCancelWorkflowExecutionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RequestCancelWorkflowExecutionResponse]
$creadListPrec :: ReadPrec [RequestCancelWorkflowExecutionResponse]
readPrec :: ReadPrec RequestCancelWorkflowExecutionResponse
$creadPrec :: ReadPrec RequestCancelWorkflowExecutionResponse
readList :: ReadS [RequestCancelWorkflowExecutionResponse]
$creadList :: ReadS [RequestCancelWorkflowExecutionResponse]
readsPrec :: Int -> ReadS RequestCancelWorkflowExecutionResponse
$creadsPrec :: Int -> ReadS RequestCancelWorkflowExecutionResponse
Prelude.Read, Int -> RequestCancelWorkflowExecutionResponse -> ShowS
[RequestCancelWorkflowExecutionResponse] -> ShowS
RequestCancelWorkflowExecutionResponse -> String
(Int -> RequestCancelWorkflowExecutionResponse -> ShowS)
-> (RequestCancelWorkflowExecutionResponse -> String)
-> ([RequestCancelWorkflowExecutionResponse] -> ShowS)
-> Show RequestCancelWorkflowExecutionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RequestCancelWorkflowExecutionResponse] -> ShowS
$cshowList :: [RequestCancelWorkflowExecutionResponse] -> ShowS
show :: RequestCancelWorkflowExecutionResponse -> String
$cshow :: RequestCancelWorkflowExecutionResponse -> String
showsPrec :: Int -> RequestCancelWorkflowExecutionResponse -> ShowS
$cshowsPrec :: Int -> RequestCancelWorkflowExecutionResponse -> ShowS
Prelude.Show, (forall x.
RequestCancelWorkflowExecutionResponse
-> Rep RequestCancelWorkflowExecutionResponse x)
-> (forall x.
Rep RequestCancelWorkflowExecutionResponse x
-> RequestCancelWorkflowExecutionResponse)
-> Generic RequestCancelWorkflowExecutionResponse
forall x.
Rep RequestCancelWorkflowExecutionResponse x
-> RequestCancelWorkflowExecutionResponse
forall x.
RequestCancelWorkflowExecutionResponse
-> Rep RequestCancelWorkflowExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RequestCancelWorkflowExecutionResponse x
-> RequestCancelWorkflowExecutionResponse
$cfrom :: forall x.
RequestCancelWorkflowExecutionResponse
-> Rep RequestCancelWorkflowExecutionResponse x
Prelude.Generic)
newRequestCancelWorkflowExecutionResponse ::
RequestCancelWorkflowExecutionResponse
newRequestCancelWorkflowExecutionResponse :: RequestCancelWorkflowExecutionResponse
newRequestCancelWorkflowExecutionResponse =
RequestCancelWorkflowExecutionResponse
RequestCancelWorkflowExecutionResponse'
instance
Prelude.NFData
RequestCancelWorkflowExecutionResponse