{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SWF.RecordActivityTaskHeartbeat
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Used by activity workers to report to the service that the ActivityTask
-- represented by the specified @taskToken@ is still making progress. The
-- worker can also specify details of the progress, for example percent
-- complete, using the @details@ parameter. This action can also be used by
-- the worker as a mechanism to check if cancellation is being requested
-- for the activity task. If a cancellation is being attempted for the
-- specified task, then the boolean @cancelRequested@ flag returned by the
-- service is set to @true@.
--
-- This action resets the @taskHeartbeatTimeout@ clock. The
-- @taskHeartbeatTimeout@ is specified in RegisterActivityType.
--
-- This action doesn\'t in itself create an event in the workflow execution
-- history. However, if the task times out, the workflow execution history
-- contains a @ActivityTaskTimedOut@ event that contains the information
-- from the last heartbeat generated by the activity worker.
--
-- The @taskStartToCloseTimeout@ of an activity type is the maximum
-- duration of an activity task, regardless of the number of
-- RecordActivityTaskHeartbeat requests received. The
-- @taskStartToCloseTimeout@ is also specified in RegisterActivityType.
--
-- This operation is only useful for long-lived activities to report
-- liveliness of the task and to determine if a cancellation is being
-- attempted.
--
-- If the @cancelRequested@ flag returns @true@, a cancellation is being
-- attempted. If the worker can cancel the activity, it should respond with
-- RespondActivityTaskCanceled. Otherwise, it should ignore the
-- cancellation request.
--
-- __Access Control__
--
-- You can use IAM policies to control this action\'s access to Amazon SWF
-- resources as follows:
--
-- -   Use a @Resource@ element with the domain name to limit the action to
--     only specified domains.
--
-- -   Use an @Action@ element to allow or deny permission to call this
--     action.
--
-- -   You cannot use an IAM policy to constrain this action\'s parameters.
--
-- If the caller doesn\'t have sufficient permissions to invoke the action,
-- or the parameter values fall outside the specified constraints, the
-- action fails. The associated event attribute\'s @cause@ parameter is set
-- to @OPERATION_NOT_PERMITTED@. For details and example IAM policies, see
-- <https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html Using IAM to Manage Access to Amazon SWF Workflows>
-- in the /Amazon SWF Developer Guide/.
module Amazonka.SWF.RecordActivityTaskHeartbeat
  ( -- * Creating a Request
    RecordActivityTaskHeartbeat (..),
    newRecordActivityTaskHeartbeat,

    -- * Request Lenses
    recordActivityTaskHeartbeat_details,
    recordActivityTaskHeartbeat_taskToken,

    -- * Destructuring the Response
    RecordActivityTaskHeartbeatResponse (..),
    newRecordActivityTaskHeartbeatResponse,

    -- * Response Lenses
    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

-- | /See:/ 'newRecordActivityTaskHeartbeat' smart constructor.
data RecordActivityTaskHeartbeat = RecordActivityTaskHeartbeat'
  { -- | If specified, contains details about the progress of the task.
    RecordActivityTaskHeartbeat -> Maybe Text
details :: Prelude.Maybe Prelude.Text,
    -- | The @taskToken@ of the ActivityTask.
    --
    -- @taskToken@ is generated by the service and should be treated as an
    -- opaque value. If the task is passed to another process, its @taskToken@
    -- must also be passed. This enables it to provide its progress and respond
    -- with results.
    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)

-- |
-- Create a value of 'RecordActivityTaskHeartbeat' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'details', 'recordActivityTaskHeartbeat_details' - If specified, contains details about the progress of the task.
--
-- 'taskToken', 'recordActivityTaskHeartbeat_taskToken' - The @taskToken@ of the ActivityTask.
--
-- @taskToken@ is generated by the service and should be treated as an
-- opaque value. If the task is passed to another process, its @taskToken@
-- must also be passed. This enables it to provide its progress and respond
-- with results.
newRecordActivityTaskHeartbeat ::
  -- | 'taskToken'
  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_
    }

-- | If specified, contains details about the progress of the task.
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)

-- | The @taskToken@ of the ActivityTask.
--
-- @taskToken@ is generated by the service and should be treated as an
-- opaque value. If the task is passed to another process, its @taskToken@
-- must also be passed. This enables it to provide its progress and respond
-- with results.
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

-- | Status information about an activity task.
--
-- /See:/ 'newRecordActivityTaskHeartbeatResponse' smart constructor.
data RecordActivityTaskHeartbeatResponse = RecordActivityTaskHeartbeatResponse'
  { -- | The response's http status code.
    RecordActivityTaskHeartbeatResponse -> Int
httpStatus :: Prelude.Int,
    -- | Set to @true@ if cancellation of the task is requested.
    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)

-- |
-- Create a value of 'RecordActivityTaskHeartbeatResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'recordActivityTaskHeartbeatResponse_httpStatus' - The response's http status code.
--
-- 'cancelRequested', 'recordActivityTaskHeartbeatResponse_cancelRequested' - Set to @true@ if cancellation of the task is requested.
newRecordActivityTaskHeartbeatResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'cancelRequested'
  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_
      }

-- | The response's http status code.
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)

-- | Set to @true@ if cancellation of the task is requested.
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