{-# 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.SendTaskSuccess
(
SendTaskSuccess (..),
newSendTaskSuccess,
sendTaskSuccess_taskToken,
sendTaskSuccess_output,
SendTaskSuccessResponse (..),
newSendTaskSuccessResponse,
sendTaskSuccessResponse_httpStatus,
)
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.StepFunctions.Types
data SendTaskSuccess = SendTaskSuccess'
{
SendTaskSuccess -> Text
taskToken :: Prelude.Text,
SendTaskSuccess -> Sensitive Text
output :: Core.Sensitive Prelude.Text
}
deriving (SendTaskSuccess -> SendTaskSuccess -> Bool
(SendTaskSuccess -> SendTaskSuccess -> Bool)
-> (SendTaskSuccess -> SendTaskSuccess -> Bool)
-> Eq SendTaskSuccess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendTaskSuccess -> SendTaskSuccess -> Bool
$c/= :: SendTaskSuccess -> SendTaskSuccess -> Bool
== :: SendTaskSuccess -> SendTaskSuccess -> Bool
$c== :: SendTaskSuccess -> SendTaskSuccess -> Bool
Prelude.Eq, Int -> SendTaskSuccess -> ShowS
[SendTaskSuccess] -> ShowS
SendTaskSuccess -> String
(Int -> SendTaskSuccess -> ShowS)
-> (SendTaskSuccess -> String)
-> ([SendTaskSuccess] -> ShowS)
-> Show SendTaskSuccess
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendTaskSuccess] -> ShowS
$cshowList :: [SendTaskSuccess] -> ShowS
show :: SendTaskSuccess -> String
$cshow :: SendTaskSuccess -> String
showsPrec :: Int -> SendTaskSuccess -> ShowS
$cshowsPrec :: Int -> SendTaskSuccess -> ShowS
Prelude.Show, (forall x. SendTaskSuccess -> Rep SendTaskSuccess x)
-> (forall x. Rep SendTaskSuccess x -> SendTaskSuccess)
-> Generic SendTaskSuccess
forall x. Rep SendTaskSuccess x -> SendTaskSuccess
forall x. SendTaskSuccess -> Rep SendTaskSuccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendTaskSuccess x -> SendTaskSuccess
$cfrom :: forall x. SendTaskSuccess -> Rep SendTaskSuccess x
Prelude.Generic)
newSendTaskSuccess ::
Prelude.Text ->
Prelude.Text ->
SendTaskSuccess
newSendTaskSuccess :: Text -> Text -> SendTaskSuccess
newSendTaskSuccess Text
pTaskToken_ Text
pOutput_ =
SendTaskSuccess' :: Text -> Sensitive Text -> SendTaskSuccess
SendTaskSuccess'
{ $sel:taskToken:SendTaskSuccess' :: Text
taskToken = Text
pTaskToken_,
$sel:output:SendTaskSuccess' :: Sensitive Text
output = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pOutput_
}
sendTaskSuccess_taskToken :: Lens.Lens' SendTaskSuccess Prelude.Text
sendTaskSuccess_taskToken :: (Text -> f Text) -> SendTaskSuccess -> f SendTaskSuccess
sendTaskSuccess_taskToken = (SendTaskSuccess -> Text)
-> (SendTaskSuccess -> Text -> SendTaskSuccess)
-> Lens SendTaskSuccess SendTaskSuccess Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTaskSuccess' {Text
taskToken :: Text
$sel:taskToken:SendTaskSuccess' :: SendTaskSuccess -> Text
taskToken} -> Text
taskToken) (\s :: SendTaskSuccess
s@SendTaskSuccess' {} Text
a -> SendTaskSuccess
s {$sel:taskToken:SendTaskSuccess' :: Text
taskToken = Text
a} :: SendTaskSuccess)
sendTaskSuccess_output :: Lens.Lens' SendTaskSuccess Prelude.Text
sendTaskSuccess_output :: (Text -> f Text) -> SendTaskSuccess -> f SendTaskSuccess
sendTaskSuccess_output = (SendTaskSuccess -> Sensitive Text)
-> (SendTaskSuccess -> Sensitive Text -> SendTaskSuccess)
-> Lens
SendTaskSuccess SendTaskSuccess (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTaskSuccess' {Sensitive Text
output :: Sensitive Text
$sel:output:SendTaskSuccess' :: SendTaskSuccess -> Sensitive Text
output} -> Sensitive Text
output) (\s :: SendTaskSuccess
s@SendTaskSuccess' {} Sensitive Text
a -> SendTaskSuccess
s {$sel:output:SendTaskSuccess' :: Sensitive Text
output = Sensitive Text
a} :: SendTaskSuccess) ((Sensitive Text -> f (Sensitive Text))
-> SendTaskSuccess -> f SendTaskSuccess)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> SendTaskSuccess
-> f SendTaskSuccess
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Core.AWSRequest SendTaskSuccess where
type
AWSResponse SendTaskSuccess =
SendTaskSuccessResponse
request :: SendTaskSuccess -> Request SendTaskSuccess
request = Service -> SendTaskSuccess -> Request SendTaskSuccess
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendTaskSuccess
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendTaskSuccess)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse SendTaskSuccess))
-> Logger
-> Service
-> Proxy SendTaskSuccess
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendTaskSuccess)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> SendTaskSuccessResponse
SendTaskSuccessResponse'
(Int -> SendTaskSuccessResponse)
-> Either String Int -> Either String SendTaskSuccessResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable SendTaskSuccess
instance Prelude.NFData SendTaskSuccess
instance Core.ToHeaders SendTaskSuccess where
toHeaders :: SendTaskSuccess -> ResponseHeaders
toHeaders =
ResponseHeaders -> SendTaskSuccess -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSStepFunctions.SendTaskSuccess" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON SendTaskSuccess where
toJSON :: SendTaskSuccess -> Value
toJSON SendTaskSuccess' {Text
Sensitive Text
output :: Sensitive Text
taskToken :: Text
$sel:output:SendTaskSuccess' :: SendTaskSuccess -> Sensitive Text
$sel:taskToken:SendTaskSuccess' :: SendTaskSuccess -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"output" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
output)
]
)
instance Core.ToPath SendTaskSuccess where
toPath :: SendTaskSuccess -> ByteString
toPath = ByteString -> SendTaskSuccess -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SendTaskSuccess where
toQuery :: SendTaskSuccess -> QueryString
toQuery = QueryString -> SendTaskSuccess -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendTaskSuccessResponse = SendTaskSuccessResponse'
{
SendTaskSuccessResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendTaskSuccessResponse -> SendTaskSuccessResponse -> Bool
(SendTaskSuccessResponse -> SendTaskSuccessResponse -> Bool)
-> (SendTaskSuccessResponse -> SendTaskSuccessResponse -> Bool)
-> Eq SendTaskSuccessResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendTaskSuccessResponse -> SendTaskSuccessResponse -> Bool
$c/= :: SendTaskSuccessResponse -> SendTaskSuccessResponse -> Bool
== :: SendTaskSuccessResponse -> SendTaskSuccessResponse -> Bool
$c== :: SendTaskSuccessResponse -> SendTaskSuccessResponse -> Bool
Prelude.Eq, ReadPrec [SendTaskSuccessResponse]
ReadPrec SendTaskSuccessResponse
Int -> ReadS SendTaskSuccessResponse
ReadS [SendTaskSuccessResponse]
(Int -> ReadS SendTaskSuccessResponse)
-> ReadS [SendTaskSuccessResponse]
-> ReadPrec SendTaskSuccessResponse
-> ReadPrec [SendTaskSuccessResponse]
-> Read SendTaskSuccessResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendTaskSuccessResponse]
$creadListPrec :: ReadPrec [SendTaskSuccessResponse]
readPrec :: ReadPrec SendTaskSuccessResponse
$creadPrec :: ReadPrec SendTaskSuccessResponse
readList :: ReadS [SendTaskSuccessResponse]
$creadList :: ReadS [SendTaskSuccessResponse]
readsPrec :: Int -> ReadS SendTaskSuccessResponse
$creadsPrec :: Int -> ReadS SendTaskSuccessResponse
Prelude.Read, Int -> SendTaskSuccessResponse -> ShowS
[SendTaskSuccessResponse] -> ShowS
SendTaskSuccessResponse -> String
(Int -> SendTaskSuccessResponse -> ShowS)
-> (SendTaskSuccessResponse -> String)
-> ([SendTaskSuccessResponse] -> ShowS)
-> Show SendTaskSuccessResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendTaskSuccessResponse] -> ShowS
$cshowList :: [SendTaskSuccessResponse] -> ShowS
show :: SendTaskSuccessResponse -> String
$cshow :: SendTaskSuccessResponse -> String
showsPrec :: Int -> SendTaskSuccessResponse -> ShowS
$cshowsPrec :: Int -> SendTaskSuccessResponse -> ShowS
Prelude.Show, (forall x.
SendTaskSuccessResponse -> Rep SendTaskSuccessResponse x)
-> (forall x.
Rep SendTaskSuccessResponse x -> SendTaskSuccessResponse)
-> Generic SendTaskSuccessResponse
forall x. Rep SendTaskSuccessResponse x -> SendTaskSuccessResponse
forall x. SendTaskSuccessResponse -> Rep SendTaskSuccessResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendTaskSuccessResponse x -> SendTaskSuccessResponse
$cfrom :: forall x. SendTaskSuccessResponse -> Rep SendTaskSuccessResponse x
Prelude.Generic)
newSendTaskSuccessResponse ::
Prelude.Int ->
SendTaskSuccessResponse
newSendTaskSuccessResponse :: Int -> SendTaskSuccessResponse
newSendTaskSuccessResponse Int
pHttpStatus_ =
SendTaskSuccessResponse' :: Int -> SendTaskSuccessResponse
SendTaskSuccessResponse' {$sel:httpStatus:SendTaskSuccessResponse' :: Int
httpStatus = Int
pHttpStatus_}
sendTaskSuccessResponse_httpStatus :: Lens.Lens' SendTaskSuccessResponse Prelude.Int
sendTaskSuccessResponse_httpStatus :: (Int -> f Int)
-> SendTaskSuccessResponse -> f SendTaskSuccessResponse
sendTaskSuccessResponse_httpStatus = (SendTaskSuccessResponse -> Int)
-> (SendTaskSuccessResponse -> Int -> SendTaskSuccessResponse)
-> Lens SendTaskSuccessResponse SendTaskSuccessResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTaskSuccessResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendTaskSuccessResponse' :: SendTaskSuccessResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendTaskSuccessResponse
s@SendTaskSuccessResponse' {} Int
a -> SendTaskSuccessResponse
s {$sel:httpStatus:SendTaskSuccessResponse' :: Int
httpStatus = Int
a} :: SendTaskSuccessResponse)
instance Prelude.NFData SendTaskSuccessResponse