{-# 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.SendTaskHeartbeat
(
SendTaskHeartbeat (..),
newSendTaskHeartbeat,
sendTaskHeartbeat_taskToken,
SendTaskHeartbeatResponse (..),
newSendTaskHeartbeatResponse,
sendTaskHeartbeatResponse_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 SendTaskHeartbeat = SendTaskHeartbeat'
{
SendTaskHeartbeat -> Text
taskToken :: Prelude.Text
}
deriving (SendTaskHeartbeat -> SendTaskHeartbeat -> Bool
(SendTaskHeartbeat -> SendTaskHeartbeat -> Bool)
-> (SendTaskHeartbeat -> SendTaskHeartbeat -> Bool)
-> Eq SendTaskHeartbeat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendTaskHeartbeat -> SendTaskHeartbeat -> Bool
$c/= :: SendTaskHeartbeat -> SendTaskHeartbeat -> Bool
== :: SendTaskHeartbeat -> SendTaskHeartbeat -> Bool
$c== :: SendTaskHeartbeat -> SendTaskHeartbeat -> Bool
Prelude.Eq, ReadPrec [SendTaskHeartbeat]
ReadPrec SendTaskHeartbeat
Int -> ReadS SendTaskHeartbeat
ReadS [SendTaskHeartbeat]
(Int -> ReadS SendTaskHeartbeat)
-> ReadS [SendTaskHeartbeat]
-> ReadPrec SendTaskHeartbeat
-> ReadPrec [SendTaskHeartbeat]
-> Read SendTaskHeartbeat
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendTaskHeartbeat]
$creadListPrec :: ReadPrec [SendTaskHeartbeat]
readPrec :: ReadPrec SendTaskHeartbeat
$creadPrec :: ReadPrec SendTaskHeartbeat
readList :: ReadS [SendTaskHeartbeat]
$creadList :: ReadS [SendTaskHeartbeat]
readsPrec :: Int -> ReadS SendTaskHeartbeat
$creadsPrec :: Int -> ReadS SendTaskHeartbeat
Prelude.Read, Int -> SendTaskHeartbeat -> ShowS
[SendTaskHeartbeat] -> ShowS
SendTaskHeartbeat -> String
(Int -> SendTaskHeartbeat -> ShowS)
-> (SendTaskHeartbeat -> String)
-> ([SendTaskHeartbeat] -> ShowS)
-> Show SendTaskHeartbeat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendTaskHeartbeat] -> ShowS
$cshowList :: [SendTaskHeartbeat] -> ShowS
show :: SendTaskHeartbeat -> String
$cshow :: SendTaskHeartbeat -> String
showsPrec :: Int -> SendTaskHeartbeat -> ShowS
$cshowsPrec :: Int -> SendTaskHeartbeat -> ShowS
Prelude.Show, (forall x. SendTaskHeartbeat -> Rep SendTaskHeartbeat x)
-> (forall x. Rep SendTaskHeartbeat x -> SendTaskHeartbeat)
-> Generic SendTaskHeartbeat
forall x. Rep SendTaskHeartbeat x -> SendTaskHeartbeat
forall x. SendTaskHeartbeat -> Rep SendTaskHeartbeat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendTaskHeartbeat x -> SendTaskHeartbeat
$cfrom :: forall x. SendTaskHeartbeat -> Rep SendTaskHeartbeat x
Prelude.Generic)
newSendTaskHeartbeat ::
Prelude.Text ->
SendTaskHeartbeat
newSendTaskHeartbeat :: Text -> SendTaskHeartbeat
newSendTaskHeartbeat Text
pTaskToken_ =
SendTaskHeartbeat' :: Text -> SendTaskHeartbeat
SendTaskHeartbeat' {$sel:taskToken:SendTaskHeartbeat' :: Text
taskToken = Text
pTaskToken_}
sendTaskHeartbeat_taskToken :: Lens.Lens' SendTaskHeartbeat Prelude.Text
sendTaskHeartbeat_taskToken :: (Text -> f Text) -> SendTaskHeartbeat -> f SendTaskHeartbeat
sendTaskHeartbeat_taskToken = (SendTaskHeartbeat -> Text)
-> (SendTaskHeartbeat -> Text -> SendTaskHeartbeat)
-> Lens SendTaskHeartbeat SendTaskHeartbeat Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTaskHeartbeat' {Text
taskToken :: Text
$sel:taskToken:SendTaskHeartbeat' :: SendTaskHeartbeat -> Text
taskToken} -> Text
taskToken) (\s :: SendTaskHeartbeat
s@SendTaskHeartbeat' {} Text
a -> SendTaskHeartbeat
s {$sel:taskToken:SendTaskHeartbeat' :: Text
taskToken = Text
a} :: SendTaskHeartbeat)
instance Core.AWSRequest SendTaskHeartbeat where
type
AWSResponse SendTaskHeartbeat =
SendTaskHeartbeatResponse
request :: SendTaskHeartbeat -> Request SendTaskHeartbeat
request = Service -> SendTaskHeartbeat -> Request SendTaskHeartbeat
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SendTaskHeartbeat
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendTaskHeartbeat)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse SendTaskHeartbeat))
-> Logger
-> Service
-> Proxy SendTaskHeartbeat
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SendTaskHeartbeat)))
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 -> SendTaskHeartbeatResponse
SendTaskHeartbeatResponse'
(Int -> SendTaskHeartbeatResponse)
-> Either String Int -> Either String SendTaskHeartbeatResponse
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 SendTaskHeartbeat
instance Prelude.NFData SendTaskHeartbeat
instance Core.ToHeaders SendTaskHeartbeat where
toHeaders :: SendTaskHeartbeat -> ResponseHeaders
toHeaders =
ResponseHeaders -> SendTaskHeartbeat -> 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.SendTaskHeartbeat" ::
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 SendTaskHeartbeat where
toJSON :: SendTaskHeartbeat -> Value
toJSON SendTaskHeartbeat' {Text
taskToken :: Text
$sel:taskToken:SendTaskHeartbeat' :: SendTaskHeartbeat -> 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)]
)
instance Core.ToPath SendTaskHeartbeat where
toPath :: SendTaskHeartbeat -> ByteString
toPath = ByteString -> SendTaskHeartbeat -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SendTaskHeartbeat where
toQuery :: SendTaskHeartbeat -> QueryString
toQuery = QueryString -> SendTaskHeartbeat -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SendTaskHeartbeatResponse = SendTaskHeartbeatResponse'
{
SendTaskHeartbeatResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SendTaskHeartbeatResponse -> SendTaskHeartbeatResponse -> Bool
(SendTaskHeartbeatResponse -> SendTaskHeartbeatResponse -> Bool)
-> (SendTaskHeartbeatResponse -> SendTaskHeartbeatResponse -> Bool)
-> Eq SendTaskHeartbeatResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendTaskHeartbeatResponse -> SendTaskHeartbeatResponse -> Bool
$c/= :: SendTaskHeartbeatResponse -> SendTaskHeartbeatResponse -> Bool
== :: SendTaskHeartbeatResponse -> SendTaskHeartbeatResponse -> Bool
$c== :: SendTaskHeartbeatResponse -> SendTaskHeartbeatResponse -> Bool
Prelude.Eq, ReadPrec [SendTaskHeartbeatResponse]
ReadPrec SendTaskHeartbeatResponse
Int -> ReadS SendTaskHeartbeatResponse
ReadS [SendTaskHeartbeatResponse]
(Int -> ReadS SendTaskHeartbeatResponse)
-> ReadS [SendTaskHeartbeatResponse]
-> ReadPrec SendTaskHeartbeatResponse
-> ReadPrec [SendTaskHeartbeatResponse]
-> Read SendTaskHeartbeatResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SendTaskHeartbeatResponse]
$creadListPrec :: ReadPrec [SendTaskHeartbeatResponse]
readPrec :: ReadPrec SendTaskHeartbeatResponse
$creadPrec :: ReadPrec SendTaskHeartbeatResponse
readList :: ReadS [SendTaskHeartbeatResponse]
$creadList :: ReadS [SendTaskHeartbeatResponse]
readsPrec :: Int -> ReadS SendTaskHeartbeatResponse
$creadsPrec :: Int -> ReadS SendTaskHeartbeatResponse
Prelude.Read, Int -> SendTaskHeartbeatResponse -> ShowS
[SendTaskHeartbeatResponse] -> ShowS
SendTaskHeartbeatResponse -> String
(Int -> SendTaskHeartbeatResponse -> ShowS)
-> (SendTaskHeartbeatResponse -> String)
-> ([SendTaskHeartbeatResponse] -> ShowS)
-> Show SendTaskHeartbeatResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendTaskHeartbeatResponse] -> ShowS
$cshowList :: [SendTaskHeartbeatResponse] -> ShowS
show :: SendTaskHeartbeatResponse -> String
$cshow :: SendTaskHeartbeatResponse -> String
showsPrec :: Int -> SendTaskHeartbeatResponse -> ShowS
$cshowsPrec :: Int -> SendTaskHeartbeatResponse -> ShowS
Prelude.Show, (forall x.
SendTaskHeartbeatResponse -> Rep SendTaskHeartbeatResponse x)
-> (forall x.
Rep SendTaskHeartbeatResponse x -> SendTaskHeartbeatResponse)
-> Generic SendTaskHeartbeatResponse
forall x.
Rep SendTaskHeartbeatResponse x -> SendTaskHeartbeatResponse
forall x.
SendTaskHeartbeatResponse -> Rep SendTaskHeartbeatResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SendTaskHeartbeatResponse x -> SendTaskHeartbeatResponse
$cfrom :: forall x.
SendTaskHeartbeatResponse -> Rep SendTaskHeartbeatResponse x
Prelude.Generic)
newSendTaskHeartbeatResponse ::
Prelude.Int ->
SendTaskHeartbeatResponse
newSendTaskHeartbeatResponse :: Int -> SendTaskHeartbeatResponse
newSendTaskHeartbeatResponse Int
pHttpStatus_ =
SendTaskHeartbeatResponse' :: Int -> SendTaskHeartbeatResponse
SendTaskHeartbeatResponse'
{ $sel:httpStatus:SendTaskHeartbeatResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
sendTaskHeartbeatResponse_httpStatus :: Lens.Lens' SendTaskHeartbeatResponse Prelude.Int
sendTaskHeartbeatResponse_httpStatus :: (Int -> f Int)
-> SendTaskHeartbeatResponse -> f SendTaskHeartbeatResponse
sendTaskHeartbeatResponse_httpStatus = (SendTaskHeartbeatResponse -> Int)
-> (SendTaskHeartbeatResponse -> Int -> SendTaskHeartbeatResponse)
-> Lens SendTaskHeartbeatResponse SendTaskHeartbeatResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendTaskHeartbeatResponse' {Int
httpStatus :: Int
$sel:httpStatus:SendTaskHeartbeatResponse' :: SendTaskHeartbeatResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SendTaskHeartbeatResponse
s@SendTaskHeartbeatResponse' {} Int
a -> SendTaskHeartbeatResponse
s {$sel:httpStatus:SendTaskHeartbeatResponse' :: Int
httpStatus = Int
a} :: SendTaskHeartbeatResponse)
instance Prelude.NFData SendTaskHeartbeatResponse