{-# 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.DataPipeline.ReportTaskRunnerHeartbeat
-- 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)
--
-- Task runners call @ReportTaskRunnerHeartbeat@ every 15 minutes to
-- indicate that they are operational. If the AWS Data Pipeline Task Runner
-- is launched on a resource managed by AWS Data Pipeline, the web service
-- can use this call to detect when the task runner application has failed
-- and restart a new instance.
module Amazonka.DataPipeline.ReportTaskRunnerHeartbeat
  ( -- * Creating a Request
    ReportTaskRunnerHeartbeat (..),
    newReportTaskRunnerHeartbeat,

    -- * Request Lenses
    reportTaskRunnerHeartbeat_hostname,
    reportTaskRunnerHeartbeat_workerGroup,
    reportTaskRunnerHeartbeat_taskrunnerId,

    -- * Destructuring the Response
    ReportTaskRunnerHeartbeatResponse (..),
    newReportTaskRunnerHeartbeatResponse,

    -- * Response Lenses
    reportTaskRunnerHeartbeatResponse_httpStatus,
    reportTaskRunnerHeartbeatResponse_terminate,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DataPipeline.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Contains the parameters for ReportTaskRunnerHeartbeat.
--
-- /See:/ 'newReportTaskRunnerHeartbeat' smart constructor.
data ReportTaskRunnerHeartbeat = ReportTaskRunnerHeartbeat'
  { -- | The public DNS name of the task runner.
    ReportTaskRunnerHeartbeat -> Maybe Text
hostname :: Prelude.Maybe Prelude.Text,
    -- | The type of task the task runner is configured to accept and process.
    -- The worker group is set as a field on objects in the pipeline when they
    -- are created. You can only specify a single value for @workerGroup@.
    -- There are no wildcard values permitted in @workerGroup@; the string must
    -- be an exact, case-sensitive, match.
    ReportTaskRunnerHeartbeat -> Maybe Text
workerGroup :: Prelude.Maybe Prelude.Text,
    -- | The ID of the task runner. This value should be unique across your AWS
    -- account. In the case of AWS Data Pipeline Task Runner launched on a
    -- resource managed by AWS Data Pipeline, the web service provides a unique
    -- identifier when it launches the application. If you have written a
    -- custom task runner, you should assign a unique identifier for the task
    -- runner.
    ReportTaskRunnerHeartbeat -> Text
taskrunnerId :: Prelude.Text
  }
  deriving (ReportTaskRunnerHeartbeat -> ReportTaskRunnerHeartbeat -> Bool
(ReportTaskRunnerHeartbeat -> ReportTaskRunnerHeartbeat -> Bool)
-> (ReportTaskRunnerHeartbeat -> ReportTaskRunnerHeartbeat -> Bool)
-> Eq ReportTaskRunnerHeartbeat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReportTaskRunnerHeartbeat -> ReportTaskRunnerHeartbeat -> Bool
$c/= :: ReportTaskRunnerHeartbeat -> ReportTaskRunnerHeartbeat -> Bool
== :: ReportTaskRunnerHeartbeat -> ReportTaskRunnerHeartbeat -> Bool
$c== :: ReportTaskRunnerHeartbeat -> ReportTaskRunnerHeartbeat -> Bool
Prelude.Eq, ReadPrec [ReportTaskRunnerHeartbeat]
ReadPrec ReportTaskRunnerHeartbeat
Int -> ReadS ReportTaskRunnerHeartbeat
ReadS [ReportTaskRunnerHeartbeat]
(Int -> ReadS ReportTaskRunnerHeartbeat)
-> ReadS [ReportTaskRunnerHeartbeat]
-> ReadPrec ReportTaskRunnerHeartbeat
-> ReadPrec [ReportTaskRunnerHeartbeat]
-> Read ReportTaskRunnerHeartbeat
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReportTaskRunnerHeartbeat]
$creadListPrec :: ReadPrec [ReportTaskRunnerHeartbeat]
readPrec :: ReadPrec ReportTaskRunnerHeartbeat
$creadPrec :: ReadPrec ReportTaskRunnerHeartbeat
readList :: ReadS [ReportTaskRunnerHeartbeat]
$creadList :: ReadS [ReportTaskRunnerHeartbeat]
readsPrec :: Int -> ReadS ReportTaskRunnerHeartbeat
$creadsPrec :: Int -> ReadS ReportTaskRunnerHeartbeat
Prelude.Read, Int -> ReportTaskRunnerHeartbeat -> ShowS
[ReportTaskRunnerHeartbeat] -> ShowS
ReportTaskRunnerHeartbeat -> String
(Int -> ReportTaskRunnerHeartbeat -> ShowS)
-> (ReportTaskRunnerHeartbeat -> String)
-> ([ReportTaskRunnerHeartbeat] -> ShowS)
-> Show ReportTaskRunnerHeartbeat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReportTaskRunnerHeartbeat] -> ShowS
$cshowList :: [ReportTaskRunnerHeartbeat] -> ShowS
show :: ReportTaskRunnerHeartbeat -> String
$cshow :: ReportTaskRunnerHeartbeat -> String
showsPrec :: Int -> ReportTaskRunnerHeartbeat -> ShowS
$cshowsPrec :: Int -> ReportTaskRunnerHeartbeat -> ShowS
Prelude.Show, (forall x.
 ReportTaskRunnerHeartbeat -> Rep ReportTaskRunnerHeartbeat x)
-> (forall x.
    Rep ReportTaskRunnerHeartbeat x -> ReportTaskRunnerHeartbeat)
-> Generic ReportTaskRunnerHeartbeat
forall x.
Rep ReportTaskRunnerHeartbeat x -> ReportTaskRunnerHeartbeat
forall x.
ReportTaskRunnerHeartbeat -> Rep ReportTaskRunnerHeartbeat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReportTaskRunnerHeartbeat x -> ReportTaskRunnerHeartbeat
$cfrom :: forall x.
ReportTaskRunnerHeartbeat -> Rep ReportTaskRunnerHeartbeat x
Prelude.Generic)

-- |
-- Create a value of 'ReportTaskRunnerHeartbeat' 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:
--
-- 'hostname', 'reportTaskRunnerHeartbeat_hostname' - The public DNS name of the task runner.
--
-- 'workerGroup', 'reportTaskRunnerHeartbeat_workerGroup' - The type of task the task runner is configured to accept and process.
-- The worker group is set as a field on objects in the pipeline when they
-- are created. You can only specify a single value for @workerGroup@.
-- There are no wildcard values permitted in @workerGroup@; the string must
-- be an exact, case-sensitive, match.
--
-- 'taskrunnerId', 'reportTaskRunnerHeartbeat_taskrunnerId' - The ID of the task runner. This value should be unique across your AWS
-- account. In the case of AWS Data Pipeline Task Runner launched on a
-- resource managed by AWS Data Pipeline, the web service provides a unique
-- identifier when it launches the application. If you have written a
-- custom task runner, you should assign a unique identifier for the task
-- runner.
newReportTaskRunnerHeartbeat ::
  -- | 'taskrunnerId'
  Prelude.Text ->
  ReportTaskRunnerHeartbeat
newReportTaskRunnerHeartbeat :: Text -> ReportTaskRunnerHeartbeat
newReportTaskRunnerHeartbeat Text
pTaskrunnerId_ =
  ReportTaskRunnerHeartbeat' :: Maybe Text -> Maybe Text -> Text -> ReportTaskRunnerHeartbeat
ReportTaskRunnerHeartbeat'
    { $sel:hostname:ReportTaskRunnerHeartbeat' :: Maybe Text
hostname =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workerGroup:ReportTaskRunnerHeartbeat' :: Maybe Text
workerGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:taskrunnerId:ReportTaskRunnerHeartbeat' :: Text
taskrunnerId = Text
pTaskrunnerId_
    }

-- | The public DNS name of the task runner.
reportTaskRunnerHeartbeat_hostname :: Lens.Lens' ReportTaskRunnerHeartbeat (Prelude.Maybe Prelude.Text)
reportTaskRunnerHeartbeat_hostname :: (Maybe Text -> f (Maybe Text))
-> ReportTaskRunnerHeartbeat -> f ReportTaskRunnerHeartbeat
reportTaskRunnerHeartbeat_hostname = (ReportTaskRunnerHeartbeat -> Maybe Text)
-> (ReportTaskRunnerHeartbeat
    -> Maybe Text -> ReportTaskRunnerHeartbeat)
-> Lens
     ReportTaskRunnerHeartbeat
     ReportTaskRunnerHeartbeat
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportTaskRunnerHeartbeat' {Maybe Text
hostname :: Maybe Text
$sel:hostname:ReportTaskRunnerHeartbeat' :: ReportTaskRunnerHeartbeat -> Maybe Text
hostname} -> Maybe Text
hostname) (\s :: ReportTaskRunnerHeartbeat
s@ReportTaskRunnerHeartbeat' {} Maybe Text
a -> ReportTaskRunnerHeartbeat
s {$sel:hostname:ReportTaskRunnerHeartbeat' :: Maybe Text
hostname = Maybe Text
a} :: ReportTaskRunnerHeartbeat)

-- | The type of task the task runner is configured to accept and process.
-- The worker group is set as a field on objects in the pipeline when they
-- are created. You can only specify a single value for @workerGroup@.
-- There are no wildcard values permitted in @workerGroup@; the string must
-- be an exact, case-sensitive, match.
reportTaskRunnerHeartbeat_workerGroup :: Lens.Lens' ReportTaskRunnerHeartbeat (Prelude.Maybe Prelude.Text)
reportTaskRunnerHeartbeat_workerGroup :: (Maybe Text -> f (Maybe Text))
-> ReportTaskRunnerHeartbeat -> f ReportTaskRunnerHeartbeat
reportTaskRunnerHeartbeat_workerGroup = (ReportTaskRunnerHeartbeat -> Maybe Text)
-> (ReportTaskRunnerHeartbeat
    -> Maybe Text -> ReportTaskRunnerHeartbeat)
-> Lens
     ReportTaskRunnerHeartbeat
     ReportTaskRunnerHeartbeat
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportTaskRunnerHeartbeat' {Maybe Text
workerGroup :: Maybe Text
$sel:workerGroup:ReportTaskRunnerHeartbeat' :: ReportTaskRunnerHeartbeat -> Maybe Text
workerGroup} -> Maybe Text
workerGroup) (\s :: ReportTaskRunnerHeartbeat
s@ReportTaskRunnerHeartbeat' {} Maybe Text
a -> ReportTaskRunnerHeartbeat
s {$sel:workerGroup:ReportTaskRunnerHeartbeat' :: Maybe Text
workerGroup = Maybe Text
a} :: ReportTaskRunnerHeartbeat)

-- | The ID of the task runner. This value should be unique across your AWS
-- account. In the case of AWS Data Pipeline Task Runner launched on a
-- resource managed by AWS Data Pipeline, the web service provides a unique
-- identifier when it launches the application. If you have written a
-- custom task runner, you should assign a unique identifier for the task
-- runner.
reportTaskRunnerHeartbeat_taskrunnerId :: Lens.Lens' ReportTaskRunnerHeartbeat Prelude.Text
reportTaskRunnerHeartbeat_taskrunnerId :: (Text -> f Text)
-> ReportTaskRunnerHeartbeat -> f ReportTaskRunnerHeartbeat
reportTaskRunnerHeartbeat_taskrunnerId = (ReportTaskRunnerHeartbeat -> Text)
-> (ReportTaskRunnerHeartbeat -> Text -> ReportTaskRunnerHeartbeat)
-> Lens
     ReportTaskRunnerHeartbeat ReportTaskRunnerHeartbeat Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportTaskRunnerHeartbeat' {Text
taskrunnerId :: Text
$sel:taskrunnerId:ReportTaskRunnerHeartbeat' :: ReportTaskRunnerHeartbeat -> Text
taskrunnerId} -> Text
taskrunnerId) (\s :: ReportTaskRunnerHeartbeat
s@ReportTaskRunnerHeartbeat' {} Text
a -> ReportTaskRunnerHeartbeat
s {$sel:taskrunnerId:ReportTaskRunnerHeartbeat' :: Text
taskrunnerId = Text
a} :: ReportTaskRunnerHeartbeat)

instance Core.AWSRequest ReportTaskRunnerHeartbeat where
  type
    AWSResponse ReportTaskRunnerHeartbeat =
      ReportTaskRunnerHeartbeatResponse
  request :: ReportTaskRunnerHeartbeat -> Request ReportTaskRunnerHeartbeat
request = Service
-> ReportTaskRunnerHeartbeat -> Request ReportTaskRunnerHeartbeat
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ReportTaskRunnerHeartbeat
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ReportTaskRunnerHeartbeat)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ReportTaskRunnerHeartbeat))
-> Logger
-> Service
-> Proxy ReportTaskRunnerHeartbeat
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ReportTaskRunnerHeartbeat)))
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 -> ReportTaskRunnerHeartbeatResponse
ReportTaskRunnerHeartbeatResponse'
            (Int -> Bool -> ReportTaskRunnerHeartbeatResponse)
-> Either String Int
-> Either String (Bool -> ReportTaskRunnerHeartbeatResponse)
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 -> ReportTaskRunnerHeartbeatResponse)
-> Either String Bool
-> Either String ReportTaskRunnerHeartbeatResponse
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
"terminate")
      )

instance Prelude.Hashable ReportTaskRunnerHeartbeat

instance Prelude.NFData ReportTaskRunnerHeartbeat

instance Core.ToHeaders ReportTaskRunnerHeartbeat where
  toHeaders :: ReportTaskRunnerHeartbeat -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ReportTaskRunnerHeartbeat -> 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
"DataPipeline.ReportTaskRunnerHeartbeat" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ReportTaskRunnerHeartbeat where
  toJSON :: ReportTaskRunnerHeartbeat -> Value
toJSON ReportTaskRunnerHeartbeat' {Maybe Text
Text
taskrunnerId :: Text
workerGroup :: Maybe Text
hostname :: Maybe Text
$sel:taskrunnerId:ReportTaskRunnerHeartbeat' :: ReportTaskRunnerHeartbeat -> Text
$sel:workerGroup:ReportTaskRunnerHeartbeat' :: ReportTaskRunnerHeartbeat -> Maybe Text
$sel:hostname:ReportTaskRunnerHeartbeat' :: ReportTaskRunnerHeartbeat -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"hostname" 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
hostname,
            (Text
"workerGroup" 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
workerGroup,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"taskrunnerId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskrunnerId)
          ]
      )

instance Core.ToPath ReportTaskRunnerHeartbeat where
  toPath :: ReportTaskRunnerHeartbeat -> ByteString
toPath = ByteString -> ReportTaskRunnerHeartbeat -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ReportTaskRunnerHeartbeat where
  toQuery :: ReportTaskRunnerHeartbeat -> QueryString
toQuery = QueryString -> ReportTaskRunnerHeartbeat -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | Contains the output of ReportTaskRunnerHeartbeat.
--
-- /See:/ 'newReportTaskRunnerHeartbeatResponse' smart constructor.
data ReportTaskRunnerHeartbeatResponse = ReportTaskRunnerHeartbeatResponse'
  { -- | The response's http status code.
    ReportTaskRunnerHeartbeatResponse -> Int
httpStatus :: Prelude.Int,
    -- | Indicates whether the calling task runner should terminate.
    ReportTaskRunnerHeartbeatResponse -> Bool
terminate :: Prelude.Bool
  }
  deriving (ReportTaskRunnerHeartbeatResponse
-> ReportTaskRunnerHeartbeatResponse -> Bool
(ReportTaskRunnerHeartbeatResponse
 -> ReportTaskRunnerHeartbeatResponse -> Bool)
-> (ReportTaskRunnerHeartbeatResponse
    -> ReportTaskRunnerHeartbeatResponse -> Bool)
-> Eq ReportTaskRunnerHeartbeatResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReportTaskRunnerHeartbeatResponse
-> ReportTaskRunnerHeartbeatResponse -> Bool
$c/= :: ReportTaskRunnerHeartbeatResponse
-> ReportTaskRunnerHeartbeatResponse -> Bool
== :: ReportTaskRunnerHeartbeatResponse
-> ReportTaskRunnerHeartbeatResponse -> Bool
$c== :: ReportTaskRunnerHeartbeatResponse
-> ReportTaskRunnerHeartbeatResponse -> Bool
Prelude.Eq, ReadPrec [ReportTaskRunnerHeartbeatResponse]
ReadPrec ReportTaskRunnerHeartbeatResponse
Int -> ReadS ReportTaskRunnerHeartbeatResponse
ReadS [ReportTaskRunnerHeartbeatResponse]
(Int -> ReadS ReportTaskRunnerHeartbeatResponse)
-> ReadS [ReportTaskRunnerHeartbeatResponse]
-> ReadPrec ReportTaskRunnerHeartbeatResponse
-> ReadPrec [ReportTaskRunnerHeartbeatResponse]
-> Read ReportTaskRunnerHeartbeatResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReportTaskRunnerHeartbeatResponse]
$creadListPrec :: ReadPrec [ReportTaskRunnerHeartbeatResponse]
readPrec :: ReadPrec ReportTaskRunnerHeartbeatResponse
$creadPrec :: ReadPrec ReportTaskRunnerHeartbeatResponse
readList :: ReadS [ReportTaskRunnerHeartbeatResponse]
$creadList :: ReadS [ReportTaskRunnerHeartbeatResponse]
readsPrec :: Int -> ReadS ReportTaskRunnerHeartbeatResponse
$creadsPrec :: Int -> ReadS ReportTaskRunnerHeartbeatResponse
Prelude.Read, Int -> ReportTaskRunnerHeartbeatResponse -> ShowS
[ReportTaskRunnerHeartbeatResponse] -> ShowS
ReportTaskRunnerHeartbeatResponse -> String
(Int -> ReportTaskRunnerHeartbeatResponse -> ShowS)
-> (ReportTaskRunnerHeartbeatResponse -> String)
-> ([ReportTaskRunnerHeartbeatResponse] -> ShowS)
-> Show ReportTaskRunnerHeartbeatResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReportTaskRunnerHeartbeatResponse] -> ShowS
$cshowList :: [ReportTaskRunnerHeartbeatResponse] -> ShowS
show :: ReportTaskRunnerHeartbeatResponse -> String
$cshow :: ReportTaskRunnerHeartbeatResponse -> String
showsPrec :: Int -> ReportTaskRunnerHeartbeatResponse -> ShowS
$cshowsPrec :: Int -> ReportTaskRunnerHeartbeatResponse -> ShowS
Prelude.Show, (forall x.
 ReportTaskRunnerHeartbeatResponse
 -> Rep ReportTaskRunnerHeartbeatResponse x)
-> (forall x.
    Rep ReportTaskRunnerHeartbeatResponse x
    -> ReportTaskRunnerHeartbeatResponse)
-> Generic ReportTaskRunnerHeartbeatResponse
forall x.
Rep ReportTaskRunnerHeartbeatResponse x
-> ReportTaskRunnerHeartbeatResponse
forall x.
ReportTaskRunnerHeartbeatResponse
-> Rep ReportTaskRunnerHeartbeatResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReportTaskRunnerHeartbeatResponse x
-> ReportTaskRunnerHeartbeatResponse
$cfrom :: forall x.
ReportTaskRunnerHeartbeatResponse
-> Rep ReportTaskRunnerHeartbeatResponse x
Prelude.Generic)

-- |
-- Create a value of 'ReportTaskRunnerHeartbeatResponse' 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', 'reportTaskRunnerHeartbeatResponse_httpStatus' - The response's http status code.
--
-- 'terminate', 'reportTaskRunnerHeartbeatResponse_terminate' - Indicates whether the calling task runner should terminate.
newReportTaskRunnerHeartbeatResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'terminate'
  Prelude.Bool ->
  ReportTaskRunnerHeartbeatResponse
newReportTaskRunnerHeartbeatResponse :: Int -> Bool -> ReportTaskRunnerHeartbeatResponse
newReportTaskRunnerHeartbeatResponse
  Int
pHttpStatus_
  Bool
pTerminate_ =
    ReportTaskRunnerHeartbeatResponse' :: Int -> Bool -> ReportTaskRunnerHeartbeatResponse
ReportTaskRunnerHeartbeatResponse'
      { $sel:httpStatus:ReportTaskRunnerHeartbeatResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:terminate:ReportTaskRunnerHeartbeatResponse' :: Bool
terminate = Bool
pTerminate_
      }

-- | The response's http status code.
reportTaskRunnerHeartbeatResponse_httpStatus :: Lens.Lens' ReportTaskRunnerHeartbeatResponse Prelude.Int
reportTaskRunnerHeartbeatResponse_httpStatus :: (Int -> f Int)
-> ReportTaskRunnerHeartbeatResponse
-> f ReportTaskRunnerHeartbeatResponse
reportTaskRunnerHeartbeatResponse_httpStatus = (ReportTaskRunnerHeartbeatResponse -> Int)
-> (ReportTaskRunnerHeartbeatResponse
    -> Int -> ReportTaskRunnerHeartbeatResponse)
-> Lens
     ReportTaskRunnerHeartbeatResponse
     ReportTaskRunnerHeartbeatResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportTaskRunnerHeartbeatResponse' {Int
httpStatus :: Int
$sel:httpStatus:ReportTaskRunnerHeartbeatResponse' :: ReportTaskRunnerHeartbeatResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ReportTaskRunnerHeartbeatResponse
s@ReportTaskRunnerHeartbeatResponse' {} Int
a -> ReportTaskRunnerHeartbeatResponse
s {$sel:httpStatus:ReportTaskRunnerHeartbeatResponse' :: Int
httpStatus = Int
a} :: ReportTaskRunnerHeartbeatResponse)

-- | Indicates whether the calling task runner should terminate.
reportTaskRunnerHeartbeatResponse_terminate :: Lens.Lens' ReportTaskRunnerHeartbeatResponse Prelude.Bool
reportTaskRunnerHeartbeatResponse_terminate :: (Bool -> f Bool)
-> ReportTaskRunnerHeartbeatResponse
-> f ReportTaskRunnerHeartbeatResponse
reportTaskRunnerHeartbeatResponse_terminate = (ReportTaskRunnerHeartbeatResponse -> Bool)
-> (ReportTaskRunnerHeartbeatResponse
    -> Bool -> ReportTaskRunnerHeartbeatResponse)
-> Lens
     ReportTaskRunnerHeartbeatResponse
     ReportTaskRunnerHeartbeatResponse
     Bool
     Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReportTaskRunnerHeartbeatResponse' {Bool
terminate :: Bool
$sel:terminate:ReportTaskRunnerHeartbeatResponse' :: ReportTaskRunnerHeartbeatResponse -> Bool
terminate} -> Bool
terminate) (\s :: ReportTaskRunnerHeartbeatResponse
s@ReportTaskRunnerHeartbeatResponse' {} Bool
a -> ReportTaskRunnerHeartbeatResponse
s {$sel:terminate:ReportTaskRunnerHeartbeatResponse' :: Bool
terminate = Bool
a} :: ReportTaskRunnerHeartbeatResponse)

instance
  Prelude.NFData
    ReportTaskRunnerHeartbeatResponse