{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:runId:RequestCancelWorkflowExecution' :: Maybe Text
runId =
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 :: Lens' RequestCancelWorkflowExecution (Maybe Text)
requestCancelWorkflowExecution_runId = 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 :: Lens' RequestCancelWorkflowExecution Text
requestCancelWorkflowExecution_domain = 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 :: Lens' RequestCancelWorkflowExecution Text
requestCancelWorkflowExecution_workflowId = 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 :: (Service -> Service)
-> RequestCancelWorkflowExecution
-> Request RequestCancelWorkflowExecution
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy RequestCancelWorkflowExecution
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse RequestCancelWorkflowExecution)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
RequestCancelWorkflowExecutionResponse
RequestCancelWorkflowExecutionResponse'
instance
Prelude.Hashable
RequestCancelWorkflowExecution
where
hashWithSalt :: Int -> RequestCancelWorkflowExecution -> Int
hashWithSalt
Int
_salt
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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
runId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domain
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
workflowId
instance
Prelude.NFData
RequestCancelWorkflowExecution
where
rnf :: RequestCancelWorkflowExecution -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
runId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
domain
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
workflowId
instance
Data.ToHeaders
RequestCancelWorkflowExecution
where
toHeaders :: RequestCancelWorkflowExecution -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"SimpleWorkflowService.RequestCancelWorkflowExecution" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"runId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
runId,
forall a. a -> Maybe a
Prelude.Just (Key
"domain" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
domain),
forall a. a -> Maybe a
Prelude.Just (Key
"workflowId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
workflowId)
]
)
instance Data.ToPath RequestCancelWorkflowExecution where
toPath :: RequestCancelWorkflowExecution -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery RequestCancelWorkflowExecution where
toQuery :: RequestCancelWorkflowExecution -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data RequestCancelWorkflowExecutionResponse = RequestCancelWorkflowExecutionResponse'
{
}
deriving (RequestCancelWorkflowExecutionResponse
-> RequestCancelWorkflowExecutionResponse -> Bool
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]
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
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.
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
where
rnf :: RequestCancelWorkflowExecutionResponse -> ()
rnf RequestCancelWorkflowExecutionResponse
_ = ()