{-# 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.RecordActivityTaskHeartbeat
(
RecordActivityTaskHeartbeat (..),
newRecordActivityTaskHeartbeat,
recordActivityTaskHeartbeat_details,
recordActivityTaskHeartbeat_taskToken,
RecordActivityTaskHeartbeatResponse (..),
newRecordActivityTaskHeartbeatResponse,
recordActivityTaskHeartbeatResponse_httpStatus,
recordActivityTaskHeartbeatResponse_cancelRequested,
)
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 RecordActivityTaskHeartbeat = RecordActivityTaskHeartbeat'
{
RecordActivityTaskHeartbeat -> Maybe Text
details :: Prelude.Maybe Prelude.Text,
RecordActivityTaskHeartbeat -> Text
taskToken :: Prelude.Text
}
deriving (RecordActivityTaskHeartbeat -> RecordActivityTaskHeartbeat -> Bool
(RecordActivityTaskHeartbeat
-> RecordActivityTaskHeartbeat -> Bool)
-> (RecordActivityTaskHeartbeat
-> RecordActivityTaskHeartbeat -> Bool)
-> Eq RecordActivityTaskHeartbeat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecordActivityTaskHeartbeat -> RecordActivityTaskHeartbeat -> Bool
$c/= :: RecordActivityTaskHeartbeat -> RecordActivityTaskHeartbeat -> Bool
== :: RecordActivityTaskHeartbeat -> RecordActivityTaskHeartbeat -> Bool
$c== :: RecordActivityTaskHeartbeat -> RecordActivityTaskHeartbeat -> Bool
Prelude.Eq, ReadPrec [RecordActivityTaskHeartbeat]
ReadPrec RecordActivityTaskHeartbeat
Int -> ReadS RecordActivityTaskHeartbeat
ReadS [RecordActivityTaskHeartbeat]
(Int -> ReadS RecordActivityTaskHeartbeat)
-> ReadS [RecordActivityTaskHeartbeat]
-> ReadPrec RecordActivityTaskHeartbeat
-> ReadPrec [RecordActivityTaskHeartbeat]
-> Read RecordActivityTaskHeartbeat
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecordActivityTaskHeartbeat]
$creadListPrec :: ReadPrec [RecordActivityTaskHeartbeat]
readPrec :: ReadPrec RecordActivityTaskHeartbeat
$creadPrec :: ReadPrec RecordActivityTaskHeartbeat
readList :: ReadS [RecordActivityTaskHeartbeat]
$creadList :: ReadS [RecordActivityTaskHeartbeat]
readsPrec :: Int -> ReadS RecordActivityTaskHeartbeat
$creadsPrec :: Int -> ReadS RecordActivityTaskHeartbeat
Prelude.Read, Int -> RecordActivityTaskHeartbeat -> ShowS
[RecordActivityTaskHeartbeat] -> ShowS
RecordActivityTaskHeartbeat -> String
(Int -> RecordActivityTaskHeartbeat -> ShowS)
-> (RecordActivityTaskHeartbeat -> String)
-> ([RecordActivityTaskHeartbeat] -> ShowS)
-> Show RecordActivityTaskHeartbeat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecordActivityTaskHeartbeat] -> ShowS
$cshowList :: [RecordActivityTaskHeartbeat] -> ShowS
show :: RecordActivityTaskHeartbeat -> String
$cshow :: RecordActivityTaskHeartbeat -> String
showsPrec :: Int -> RecordActivityTaskHeartbeat -> ShowS
$cshowsPrec :: Int -> RecordActivityTaskHeartbeat -> ShowS
Prelude.Show, (forall x.
RecordActivityTaskHeartbeat -> Rep RecordActivityTaskHeartbeat x)
-> (forall x.
Rep RecordActivityTaskHeartbeat x -> RecordActivityTaskHeartbeat)
-> Generic RecordActivityTaskHeartbeat
forall x.
Rep RecordActivityTaskHeartbeat x -> RecordActivityTaskHeartbeat
forall x.
RecordActivityTaskHeartbeat -> Rep RecordActivityTaskHeartbeat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecordActivityTaskHeartbeat x -> RecordActivityTaskHeartbeat
$cfrom :: forall x.
RecordActivityTaskHeartbeat -> Rep RecordActivityTaskHeartbeat x
Prelude.Generic)
newRecordActivityTaskHeartbeat ::
Prelude.Text ->
RecordActivityTaskHeartbeat
newRecordActivityTaskHeartbeat :: Text -> RecordActivityTaskHeartbeat
newRecordActivityTaskHeartbeat Text
pTaskToken_ =
RecordActivityTaskHeartbeat' :: Maybe Text -> Text -> RecordActivityTaskHeartbeat
RecordActivityTaskHeartbeat'
{ $sel:details:RecordActivityTaskHeartbeat' :: Maybe Text
details =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:taskToken:RecordActivityTaskHeartbeat' :: Text
taskToken = Text
pTaskToken_
}
recordActivityTaskHeartbeat_details :: Lens.Lens' RecordActivityTaskHeartbeat (Prelude.Maybe Prelude.Text)
recordActivityTaskHeartbeat_details :: (Maybe Text -> f (Maybe Text))
-> RecordActivityTaskHeartbeat -> f RecordActivityTaskHeartbeat
recordActivityTaskHeartbeat_details = (RecordActivityTaskHeartbeat -> Maybe Text)
-> (RecordActivityTaskHeartbeat
-> Maybe Text -> RecordActivityTaskHeartbeat)
-> Lens
RecordActivityTaskHeartbeat
RecordActivityTaskHeartbeat
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordActivityTaskHeartbeat' {Maybe Text
details :: Maybe Text
$sel:details:RecordActivityTaskHeartbeat' :: RecordActivityTaskHeartbeat -> Maybe Text
details} -> Maybe Text
details) (\s :: RecordActivityTaskHeartbeat
s@RecordActivityTaskHeartbeat' {} Maybe Text
a -> RecordActivityTaskHeartbeat
s {$sel:details:RecordActivityTaskHeartbeat' :: Maybe Text
details = Maybe Text
a} :: RecordActivityTaskHeartbeat)
recordActivityTaskHeartbeat_taskToken :: Lens.Lens' RecordActivityTaskHeartbeat Prelude.Text
recordActivityTaskHeartbeat_taskToken :: (Text -> f Text)
-> RecordActivityTaskHeartbeat -> f RecordActivityTaskHeartbeat
recordActivityTaskHeartbeat_taskToken = (RecordActivityTaskHeartbeat -> Text)
-> (RecordActivityTaskHeartbeat
-> Text -> RecordActivityTaskHeartbeat)
-> Lens
RecordActivityTaskHeartbeat RecordActivityTaskHeartbeat Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordActivityTaskHeartbeat' {Text
taskToken :: Text
$sel:taskToken:RecordActivityTaskHeartbeat' :: RecordActivityTaskHeartbeat -> Text
taskToken} -> Text
taskToken) (\s :: RecordActivityTaskHeartbeat
s@RecordActivityTaskHeartbeat' {} Text
a -> RecordActivityTaskHeartbeat
s {$sel:taskToken:RecordActivityTaskHeartbeat' :: Text
taskToken = Text
a} :: RecordActivityTaskHeartbeat)
instance Core.AWSRequest RecordActivityTaskHeartbeat where
type
AWSResponse RecordActivityTaskHeartbeat =
RecordActivityTaskHeartbeatResponse
request :: RecordActivityTaskHeartbeat -> Request RecordActivityTaskHeartbeat
request = Service
-> RecordActivityTaskHeartbeat
-> Request RecordActivityTaskHeartbeat
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RecordActivityTaskHeartbeat
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RecordActivityTaskHeartbeat)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RecordActivityTaskHeartbeat))
-> Logger
-> Service
-> Proxy RecordActivityTaskHeartbeat
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RecordActivityTaskHeartbeat)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> Bool -> RecordActivityTaskHeartbeatResponse
RecordActivityTaskHeartbeatResponse'
(Int -> Bool -> RecordActivityTaskHeartbeatResponse)
-> Either String Int
-> Either String (Bool -> RecordActivityTaskHeartbeatResponse)
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))
Either String (Bool -> RecordActivityTaskHeartbeatResponse)
-> Either String Bool
-> Either String RecordActivityTaskHeartbeatResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Bool
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"cancelRequested")
)
instance Prelude.Hashable RecordActivityTaskHeartbeat
instance Prelude.NFData RecordActivityTaskHeartbeat
instance Core.ToHeaders RecordActivityTaskHeartbeat where
toHeaders :: RecordActivityTaskHeartbeat -> ResponseHeaders
toHeaders =
ResponseHeaders -> RecordActivityTaskHeartbeat -> 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
"SimpleWorkflowService.RecordActivityTaskHeartbeat" ::
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 RecordActivityTaskHeartbeat where
toJSON :: RecordActivityTaskHeartbeat -> Value
toJSON RecordActivityTaskHeartbeat' {Maybe Text
Text
taskToken :: Text
details :: Maybe Text
$sel:taskToken:RecordActivityTaskHeartbeat' :: RecordActivityTaskHeartbeat -> Text
$sel:details:RecordActivityTaskHeartbeat' :: RecordActivityTaskHeartbeat -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"details" 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
details,
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 RecordActivityTaskHeartbeat where
toPath :: RecordActivityTaskHeartbeat -> ByteString
toPath = ByteString -> RecordActivityTaskHeartbeat -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RecordActivityTaskHeartbeat where
toQuery :: RecordActivityTaskHeartbeat -> QueryString
toQuery = QueryString -> RecordActivityTaskHeartbeat -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RecordActivityTaskHeartbeatResponse = RecordActivityTaskHeartbeatResponse'
{
RecordActivityTaskHeartbeatResponse -> Int
httpStatus :: Prelude.Int,
RecordActivityTaskHeartbeatResponse -> Bool
cancelRequested :: Prelude.Bool
}
deriving (RecordActivityTaskHeartbeatResponse
-> RecordActivityTaskHeartbeatResponse -> Bool
(RecordActivityTaskHeartbeatResponse
-> RecordActivityTaskHeartbeatResponse -> Bool)
-> (RecordActivityTaskHeartbeatResponse
-> RecordActivityTaskHeartbeatResponse -> Bool)
-> Eq RecordActivityTaskHeartbeatResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecordActivityTaskHeartbeatResponse
-> RecordActivityTaskHeartbeatResponse -> Bool
$c/= :: RecordActivityTaskHeartbeatResponse
-> RecordActivityTaskHeartbeatResponse -> Bool
== :: RecordActivityTaskHeartbeatResponse
-> RecordActivityTaskHeartbeatResponse -> Bool
$c== :: RecordActivityTaskHeartbeatResponse
-> RecordActivityTaskHeartbeatResponse -> Bool
Prelude.Eq, ReadPrec [RecordActivityTaskHeartbeatResponse]
ReadPrec RecordActivityTaskHeartbeatResponse
Int -> ReadS RecordActivityTaskHeartbeatResponse
ReadS [RecordActivityTaskHeartbeatResponse]
(Int -> ReadS RecordActivityTaskHeartbeatResponse)
-> ReadS [RecordActivityTaskHeartbeatResponse]
-> ReadPrec RecordActivityTaskHeartbeatResponse
-> ReadPrec [RecordActivityTaskHeartbeatResponse]
-> Read RecordActivityTaskHeartbeatResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecordActivityTaskHeartbeatResponse]
$creadListPrec :: ReadPrec [RecordActivityTaskHeartbeatResponse]
readPrec :: ReadPrec RecordActivityTaskHeartbeatResponse
$creadPrec :: ReadPrec RecordActivityTaskHeartbeatResponse
readList :: ReadS [RecordActivityTaskHeartbeatResponse]
$creadList :: ReadS [RecordActivityTaskHeartbeatResponse]
readsPrec :: Int -> ReadS RecordActivityTaskHeartbeatResponse
$creadsPrec :: Int -> ReadS RecordActivityTaskHeartbeatResponse
Prelude.Read, Int -> RecordActivityTaskHeartbeatResponse -> ShowS
[RecordActivityTaskHeartbeatResponse] -> ShowS
RecordActivityTaskHeartbeatResponse -> String
(Int -> RecordActivityTaskHeartbeatResponse -> ShowS)
-> (RecordActivityTaskHeartbeatResponse -> String)
-> ([RecordActivityTaskHeartbeatResponse] -> ShowS)
-> Show RecordActivityTaskHeartbeatResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecordActivityTaskHeartbeatResponse] -> ShowS
$cshowList :: [RecordActivityTaskHeartbeatResponse] -> ShowS
show :: RecordActivityTaskHeartbeatResponse -> String
$cshow :: RecordActivityTaskHeartbeatResponse -> String
showsPrec :: Int -> RecordActivityTaskHeartbeatResponse -> ShowS
$cshowsPrec :: Int -> RecordActivityTaskHeartbeatResponse -> ShowS
Prelude.Show, (forall x.
RecordActivityTaskHeartbeatResponse
-> Rep RecordActivityTaskHeartbeatResponse x)
-> (forall x.
Rep RecordActivityTaskHeartbeatResponse x
-> RecordActivityTaskHeartbeatResponse)
-> Generic RecordActivityTaskHeartbeatResponse
forall x.
Rep RecordActivityTaskHeartbeatResponse x
-> RecordActivityTaskHeartbeatResponse
forall x.
RecordActivityTaskHeartbeatResponse
-> Rep RecordActivityTaskHeartbeatResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecordActivityTaskHeartbeatResponse x
-> RecordActivityTaskHeartbeatResponse
$cfrom :: forall x.
RecordActivityTaskHeartbeatResponse
-> Rep RecordActivityTaskHeartbeatResponse x
Prelude.Generic)
newRecordActivityTaskHeartbeatResponse ::
Prelude.Int ->
Prelude.Bool ->
RecordActivityTaskHeartbeatResponse
newRecordActivityTaskHeartbeatResponse :: Int -> Bool -> RecordActivityTaskHeartbeatResponse
newRecordActivityTaskHeartbeatResponse
Int
pHttpStatus_
Bool
pCancelRequested_ =
RecordActivityTaskHeartbeatResponse' :: Int -> Bool -> RecordActivityTaskHeartbeatResponse
RecordActivityTaskHeartbeatResponse'
{ $sel:httpStatus:RecordActivityTaskHeartbeatResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:cancelRequested:RecordActivityTaskHeartbeatResponse' :: Bool
cancelRequested = Bool
pCancelRequested_
}
recordActivityTaskHeartbeatResponse_httpStatus :: Lens.Lens' RecordActivityTaskHeartbeatResponse Prelude.Int
recordActivityTaskHeartbeatResponse_httpStatus :: (Int -> f Int)
-> RecordActivityTaskHeartbeatResponse
-> f RecordActivityTaskHeartbeatResponse
recordActivityTaskHeartbeatResponse_httpStatus = (RecordActivityTaskHeartbeatResponse -> Int)
-> (RecordActivityTaskHeartbeatResponse
-> Int -> RecordActivityTaskHeartbeatResponse)
-> Lens
RecordActivityTaskHeartbeatResponse
RecordActivityTaskHeartbeatResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordActivityTaskHeartbeatResponse' {Int
httpStatus :: Int
$sel:httpStatus:RecordActivityTaskHeartbeatResponse' :: RecordActivityTaskHeartbeatResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RecordActivityTaskHeartbeatResponse
s@RecordActivityTaskHeartbeatResponse' {} Int
a -> RecordActivityTaskHeartbeatResponse
s {$sel:httpStatus:RecordActivityTaskHeartbeatResponse' :: Int
httpStatus = Int
a} :: RecordActivityTaskHeartbeatResponse)
recordActivityTaskHeartbeatResponse_cancelRequested :: Lens.Lens' RecordActivityTaskHeartbeatResponse Prelude.Bool
recordActivityTaskHeartbeatResponse_cancelRequested :: (Bool -> f Bool)
-> RecordActivityTaskHeartbeatResponse
-> f RecordActivityTaskHeartbeatResponse
recordActivityTaskHeartbeatResponse_cancelRequested = (RecordActivityTaskHeartbeatResponse -> Bool)
-> (RecordActivityTaskHeartbeatResponse
-> Bool -> RecordActivityTaskHeartbeatResponse)
-> Lens
RecordActivityTaskHeartbeatResponse
RecordActivityTaskHeartbeatResponse
Bool
Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecordActivityTaskHeartbeatResponse' {Bool
cancelRequested :: Bool
$sel:cancelRequested:RecordActivityTaskHeartbeatResponse' :: RecordActivityTaskHeartbeatResponse -> Bool
cancelRequested} -> Bool
cancelRequested) (\s :: RecordActivityTaskHeartbeatResponse
s@RecordActivityTaskHeartbeatResponse' {} Bool
a -> RecordActivityTaskHeartbeatResponse
s {$sel:cancelRequested:RecordActivityTaskHeartbeatResponse' :: Bool
cancelRequested = Bool
a} :: RecordActivityTaskHeartbeatResponse)
instance
Prelude.NFData
RecordActivityTaskHeartbeatResponse