{-# 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.StepFunctions.StopExecution
(
StopExecution (..),
newStopExecution,
stopExecution_cause,
stopExecution_error,
stopExecution_executionArn,
StopExecutionResponse (..),
newStopExecutionResponse,
stopExecutionResponse_httpStatus,
stopExecutionResponse_stopDate,
)
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.StepFunctions.Types
data StopExecution = StopExecution'
{
StopExecution -> Maybe (Sensitive Text)
cause :: Prelude.Maybe (Data.Sensitive Prelude.Text),
StopExecution -> Maybe (Sensitive Text)
error :: Prelude.Maybe (Data.Sensitive Prelude.Text),
StopExecution -> Text
executionArn :: Prelude.Text
}
deriving (StopExecution -> StopExecution -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopExecution -> StopExecution -> Bool
$c/= :: StopExecution -> StopExecution -> Bool
== :: StopExecution -> StopExecution -> Bool
$c== :: StopExecution -> StopExecution -> Bool
Prelude.Eq, Int -> StopExecution -> ShowS
[StopExecution] -> ShowS
StopExecution -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopExecution] -> ShowS
$cshowList :: [StopExecution] -> ShowS
show :: StopExecution -> String
$cshow :: StopExecution -> String
showsPrec :: Int -> StopExecution -> ShowS
$cshowsPrec :: Int -> StopExecution -> ShowS
Prelude.Show, forall x. Rep StopExecution x -> StopExecution
forall x. StopExecution -> Rep StopExecution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopExecution x -> StopExecution
$cfrom :: forall x. StopExecution -> Rep StopExecution x
Prelude.Generic)
newStopExecution ::
Prelude.Text ->
StopExecution
newStopExecution :: Text -> StopExecution
newStopExecution Text
pExecutionArn_ =
StopExecution'
{ $sel:cause:StopExecution' :: Maybe (Sensitive Text)
cause = forall a. Maybe a
Prelude.Nothing,
$sel:error:StopExecution' :: Maybe (Sensitive Text)
error = forall a. Maybe a
Prelude.Nothing,
$sel:executionArn:StopExecution' :: Text
executionArn = Text
pExecutionArn_
}
stopExecution_cause :: Lens.Lens' StopExecution (Prelude.Maybe Prelude.Text)
stopExecution_cause :: Lens' StopExecution (Maybe Text)
stopExecution_cause = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopExecution' {Maybe (Sensitive Text)
cause :: Maybe (Sensitive Text)
$sel:cause:StopExecution' :: StopExecution -> Maybe (Sensitive Text)
cause} -> Maybe (Sensitive Text)
cause) (\s :: StopExecution
s@StopExecution' {} Maybe (Sensitive Text)
a -> StopExecution
s {$sel:cause:StopExecution' :: Maybe (Sensitive Text)
cause = Maybe (Sensitive Text)
a} :: StopExecution) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
stopExecution_error :: Lens.Lens' StopExecution (Prelude.Maybe Prelude.Text)
stopExecution_error :: Lens' StopExecution (Maybe Text)
stopExecution_error = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopExecution' {Maybe (Sensitive Text)
error :: Maybe (Sensitive Text)
$sel:error:StopExecution' :: StopExecution -> Maybe (Sensitive Text)
error} -> Maybe (Sensitive Text)
error) (\s :: StopExecution
s@StopExecution' {} Maybe (Sensitive Text)
a -> StopExecution
s {$sel:error:StopExecution' :: Maybe (Sensitive Text)
error = Maybe (Sensitive Text)
a} :: StopExecution) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
stopExecution_executionArn :: Lens.Lens' StopExecution Prelude.Text
stopExecution_executionArn :: Lens' StopExecution Text
stopExecution_executionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopExecution' {Text
executionArn :: Text
$sel:executionArn:StopExecution' :: StopExecution -> Text
executionArn} -> Text
executionArn) (\s :: StopExecution
s@StopExecution' {} Text
a -> StopExecution
s {$sel:executionArn:StopExecution' :: Text
executionArn = Text
a} :: StopExecution)
instance Core.AWSRequest StopExecution where
type
AWSResponse StopExecution =
StopExecutionResponse
request :: (Service -> Service) -> StopExecution -> Request StopExecution
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 StopExecution
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StopExecution)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> POSIX -> StopExecutionResponse
StopExecutionResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"stopDate")
)
instance Prelude.Hashable StopExecution where
hashWithSalt :: Int -> StopExecution -> Int
hashWithSalt Int
_salt StopExecution' {Maybe (Sensitive Text)
Text
executionArn :: Text
error :: Maybe (Sensitive Text)
cause :: Maybe (Sensitive Text)
$sel:executionArn:StopExecution' :: StopExecution -> Text
$sel:error:StopExecution' :: StopExecution -> Maybe (Sensitive Text)
$sel:cause:StopExecution' :: StopExecution -> Maybe (Sensitive Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
cause
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
error
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
executionArn
instance Prelude.NFData StopExecution where
rnf :: StopExecution -> ()
rnf StopExecution' {Maybe (Sensitive Text)
Text
executionArn :: Text
error :: Maybe (Sensitive Text)
cause :: Maybe (Sensitive Text)
$sel:executionArn:StopExecution' :: StopExecution -> Text
$sel:error:StopExecution' :: StopExecution -> Maybe (Sensitive Text)
$sel:cause:StopExecution' :: StopExecution -> Maybe (Sensitive Text)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
cause
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
error
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
executionArn
instance Data.ToHeaders StopExecution where
toHeaders :: StopExecution -> ResponseHeaders
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 -> ResponseHeaders
Data.=# ( ByteString
"AWSStepFunctions.StopExecution" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StopExecution where
toJSON :: StopExecution -> Value
toJSON StopExecution' {Maybe (Sensitive Text)
Text
executionArn :: Text
error :: Maybe (Sensitive Text)
cause :: Maybe (Sensitive Text)
$sel:executionArn:StopExecution' :: StopExecution -> Text
$sel:error:StopExecution' :: StopExecution -> Maybe (Sensitive Text)
$sel:cause:StopExecution' :: StopExecution -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"cause" 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 (Sensitive Text)
cause,
(Key
"error" 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 (Sensitive Text)
error,
forall a. a -> Maybe a
Prelude.Just (Key
"executionArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
executionArn)
]
)
instance Data.ToPath StopExecution where
toPath :: StopExecution -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StopExecution where
toQuery :: StopExecution -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopExecutionResponse = StopExecutionResponse'
{
StopExecutionResponse -> Int
httpStatus :: Prelude.Int,
StopExecutionResponse -> POSIX
stopDate :: Data.POSIX
}
deriving (StopExecutionResponse -> StopExecutionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopExecutionResponse -> StopExecutionResponse -> Bool
$c/= :: StopExecutionResponse -> StopExecutionResponse -> Bool
== :: StopExecutionResponse -> StopExecutionResponse -> Bool
$c== :: StopExecutionResponse -> StopExecutionResponse -> Bool
Prelude.Eq, ReadPrec [StopExecutionResponse]
ReadPrec StopExecutionResponse
Int -> ReadS StopExecutionResponse
ReadS [StopExecutionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopExecutionResponse]
$creadListPrec :: ReadPrec [StopExecutionResponse]
readPrec :: ReadPrec StopExecutionResponse
$creadPrec :: ReadPrec StopExecutionResponse
readList :: ReadS [StopExecutionResponse]
$creadList :: ReadS [StopExecutionResponse]
readsPrec :: Int -> ReadS StopExecutionResponse
$creadsPrec :: Int -> ReadS StopExecutionResponse
Prelude.Read, Int -> StopExecutionResponse -> ShowS
[StopExecutionResponse] -> ShowS
StopExecutionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopExecutionResponse] -> ShowS
$cshowList :: [StopExecutionResponse] -> ShowS
show :: StopExecutionResponse -> String
$cshow :: StopExecutionResponse -> String
showsPrec :: Int -> StopExecutionResponse -> ShowS
$cshowsPrec :: Int -> StopExecutionResponse -> ShowS
Prelude.Show, forall x. Rep StopExecutionResponse x -> StopExecutionResponse
forall x. StopExecutionResponse -> Rep StopExecutionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopExecutionResponse x -> StopExecutionResponse
$cfrom :: forall x. StopExecutionResponse -> Rep StopExecutionResponse x
Prelude.Generic)
newStopExecutionResponse ::
Prelude.Int ->
Prelude.UTCTime ->
StopExecutionResponse
newStopExecutionResponse :: Int -> UTCTime -> StopExecutionResponse
newStopExecutionResponse Int
pHttpStatus_ UTCTime
pStopDate_ =
StopExecutionResponse'
{ $sel:httpStatus:StopExecutionResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:stopDate:StopExecutionResponse' :: POSIX
stopDate = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStopDate_
}
stopExecutionResponse_httpStatus :: Lens.Lens' StopExecutionResponse Prelude.Int
stopExecutionResponse_httpStatus :: Lens' StopExecutionResponse Int
stopExecutionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopExecutionResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopExecutionResponse' :: StopExecutionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopExecutionResponse
s@StopExecutionResponse' {} Int
a -> StopExecutionResponse
s {$sel:httpStatus:StopExecutionResponse' :: Int
httpStatus = Int
a} :: StopExecutionResponse)
stopExecutionResponse_stopDate :: Lens.Lens' StopExecutionResponse Prelude.UTCTime
stopExecutionResponse_stopDate :: Lens' StopExecutionResponse UTCTime
stopExecutionResponse_stopDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopExecutionResponse' {POSIX
stopDate :: POSIX
$sel:stopDate:StopExecutionResponse' :: StopExecutionResponse -> POSIX
stopDate} -> POSIX
stopDate) (\s :: StopExecutionResponse
s@StopExecutionResponse' {} POSIX
a -> StopExecutionResponse
s {$sel:stopDate:StopExecutionResponse' :: POSIX
stopDate = POSIX
a} :: StopExecutionResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Prelude.NFData StopExecutionResponse where
rnf :: StopExecutionResponse -> ()
rnf StopExecutionResponse' {Int
POSIX
stopDate :: POSIX
httpStatus :: Int
$sel:stopDate:StopExecutionResponse' :: StopExecutionResponse -> POSIX
$sel:httpStatus:StopExecutionResponse' :: StopExecutionResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
stopDate