{-# 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.CodeGuruProfiler.ConfigureAgent
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Used by profiler agents to report their current state and to receive
-- remote configuration updates. For example, @ConfigureAgent@ can be used
-- to tell an agent whether to profile or not and for how long to return
-- profiling data.
module Amazonka.CodeGuruProfiler.ConfigureAgent
  ( -- * Creating a Request
    ConfigureAgent (..),
    newConfigureAgent,

    -- * Request Lenses
    configureAgent_fleetInstanceId,
    configureAgent_metadata,
    configureAgent_profilingGroupName,

    -- * Destructuring the Response
    ConfigureAgentResponse (..),
    newConfigureAgentResponse,

    -- * Response Lenses
    configureAgentResponse_httpStatus,
    configureAgentResponse_configuration,
  )
where

import Amazonka.CodeGuruProfiler.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The structure representing the configureAgentRequest.
--
-- /See:/ 'newConfigureAgent' smart constructor.
data ConfigureAgent = ConfigureAgent'
  { -- | A universally unique identifier (UUID) for a profiling instance. For
    -- example, if the profiling instance is an Amazon EC2 instance, it is the
    -- instance ID. If it is an AWS Fargate container, it is the container\'s
    -- task ID.
    ConfigureAgent -> Maybe Text
fleetInstanceId :: Prelude.Maybe Prelude.Text,
    -- | Metadata captured about the compute platform the agent is running on. It
    -- includes information about sampling and reporting. The valid fields are:
    --
    -- -   @COMPUTE_PLATFORM@ - The compute platform on which the agent is
    --     running
    --
    -- -   @AGENT_ID@ - The ID for an agent instance.
    --
    -- -   @AWS_REQUEST_ID@ - The AWS request ID of a Lambda invocation.
    --
    -- -   @EXECUTION_ENVIRONMENT@ - The execution environment a Lambda
    --     function is running on.
    --
    -- -   @LAMBDA_FUNCTION_ARN@ - The Amazon Resource Name (ARN) that is used
    --     to invoke a Lambda function.
    --
    -- -   @LAMBDA_MEMORY_LIMIT_IN_MB@ - The memory allocated to a Lambda
    --     function.
    --
    -- -   @LAMBDA_REMAINING_TIME_IN_MILLISECONDS@ - The time in milliseconds
    --     before execution of a Lambda function times out.
    --
    -- -   @LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS@ - The time in
    --     milliseconds between two invocations of a Lambda function.
    --
    -- -   @LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS@ - The time in
    --     milliseconds for the previous Lambda invocation.
    ConfigureAgent -> Maybe (HashMap MetadataField Text)
metadata :: Prelude.Maybe (Prelude.HashMap MetadataField Prelude.Text),
    -- | The name of the profiling group for which the configured agent is
    -- collecting profiling data.
    ConfigureAgent -> Text
profilingGroupName :: Prelude.Text
  }
  deriving (ConfigureAgent -> ConfigureAgent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigureAgent -> ConfigureAgent -> Bool
$c/= :: ConfigureAgent -> ConfigureAgent -> Bool
== :: ConfigureAgent -> ConfigureAgent -> Bool
$c== :: ConfigureAgent -> ConfigureAgent -> Bool
Prelude.Eq, ReadPrec [ConfigureAgent]
ReadPrec ConfigureAgent
Int -> ReadS ConfigureAgent
ReadS [ConfigureAgent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigureAgent]
$creadListPrec :: ReadPrec [ConfigureAgent]
readPrec :: ReadPrec ConfigureAgent
$creadPrec :: ReadPrec ConfigureAgent
readList :: ReadS [ConfigureAgent]
$creadList :: ReadS [ConfigureAgent]
readsPrec :: Int -> ReadS ConfigureAgent
$creadsPrec :: Int -> ReadS ConfigureAgent
Prelude.Read, Int -> ConfigureAgent -> ShowS
[ConfigureAgent] -> ShowS
ConfigureAgent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigureAgent] -> ShowS
$cshowList :: [ConfigureAgent] -> ShowS
show :: ConfigureAgent -> String
$cshow :: ConfigureAgent -> String
showsPrec :: Int -> ConfigureAgent -> ShowS
$cshowsPrec :: Int -> ConfigureAgent -> ShowS
Prelude.Show, forall x. Rep ConfigureAgent x -> ConfigureAgent
forall x. ConfigureAgent -> Rep ConfigureAgent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfigureAgent x -> ConfigureAgent
$cfrom :: forall x. ConfigureAgent -> Rep ConfigureAgent x
Prelude.Generic)

-- |
-- Create a value of 'ConfigureAgent' 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:
--
-- 'fleetInstanceId', 'configureAgent_fleetInstanceId' - A universally unique identifier (UUID) for a profiling instance. For
-- example, if the profiling instance is an Amazon EC2 instance, it is the
-- instance ID. If it is an AWS Fargate container, it is the container\'s
-- task ID.
--
-- 'metadata', 'configureAgent_metadata' - Metadata captured about the compute platform the agent is running on. It
-- includes information about sampling and reporting. The valid fields are:
--
-- -   @COMPUTE_PLATFORM@ - The compute platform on which the agent is
--     running
--
-- -   @AGENT_ID@ - The ID for an agent instance.
--
-- -   @AWS_REQUEST_ID@ - The AWS request ID of a Lambda invocation.
--
-- -   @EXECUTION_ENVIRONMENT@ - The execution environment a Lambda
--     function is running on.
--
-- -   @LAMBDA_FUNCTION_ARN@ - The Amazon Resource Name (ARN) that is used
--     to invoke a Lambda function.
--
-- -   @LAMBDA_MEMORY_LIMIT_IN_MB@ - The memory allocated to a Lambda
--     function.
--
-- -   @LAMBDA_REMAINING_TIME_IN_MILLISECONDS@ - The time in milliseconds
--     before execution of a Lambda function times out.
--
-- -   @LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS@ - The time in
--     milliseconds between two invocations of a Lambda function.
--
-- -   @LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS@ - The time in
--     milliseconds for the previous Lambda invocation.
--
-- 'profilingGroupName', 'configureAgent_profilingGroupName' - The name of the profiling group for which the configured agent is
-- collecting profiling data.
newConfigureAgent ::
  -- | 'profilingGroupName'
  Prelude.Text ->
  ConfigureAgent
newConfigureAgent :: Text -> ConfigureAgent
newConfigureAgent Text
pProfilingGroupName_ =
  ConfigureAgent'
    { $sel:fleetInstanceId:ConfigureAgent' :: Maybe Text
fleetInstanceId = forall a. Maybe a
Prelude.Nothing,
      $sel:metadata:ConfigureAgent' :: Maybe (HashMap MetadataField Text)
metadata = forall a. Maybe a
Prelude.Nothing,
      $sel:profilingGroupName:ConfigureAgent' :: Text
profilingGroupName = Text
pProfilingGroupName_
    }

-- | A universally unique identifier (UUID) for a profiling instance. For
-- example, if the profiling instance is an Amazon EC2 instance, it is the
-- instance ID. If it is an AWS Fargate container, it is the container\'s
-- task ID.
configureAgent_fleetInstanceId :: Lens.Lens' ConfigureAgent (Prelude.Maybe Prelude.Text)
configureAgent_fleetInstanceId :: Lens' ConfigureAgent (Maybe Text)
configureAgent_fleetInstanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigureAgent' {Maybe Text
fleetInstanceId :: Maybe Text
$sel:fleetInstanceId:ConfigureAgent' :: ConfigureAgent -> Maybe Text
fleetInstanceId} -> Maybe Text
fleetInstanceId) (\s :: ConfigureAgent
s@ConfigureAgent' {} Maybe Text
a -> ConfigureAgent
s {$sel:fleetInstanceId:ConfigureAgent' :: Maybe Text
fleetInstanceId = Maybe Text
a} :: ConfigureAgent)

-- | Metadata captured about the compute platform the agent is running on. It
-- includes information about sampling and reporting. The valid fields are:
--
-- -   @COMPUTE_PLATFORM@ - The compute platform on which the agent is
--     running
--
-- -   @AGENT_ID@ - The ID for an agent instance.
--
-- -   @AWS_REQUEST_ID@ - The AWS request ID of a Lambda invocation.
--
-- -   @EXECUTION_ENVIRONMENT@ - The execution environment a Lambda
--     function is running on.
--
-- -   @LAMBDA_FUNCTION_ARN@ - The Amazon Resource Name (ARN) that is used
--     to invoke a Lambda function.
--
-- -   @LAMBDA_MEMORY_LIMIT_IN_MB@ - The memory allocated to a Lambda
--     function.
--
-- -   @LAMBDA_REMAINING_TIME_IN_MILLISECONDS@ - The time in milliseconds
--     before execution of a Lambda function times out.
--
-- -   @LAMBDA_TIME_GAP_BETWEEN_INVOKES_IN_MILLISECONDS@ - The time in
--     milliseconds between two invocations of a Lambda function.
--
-- -   @LAMBDA_PREVIOUS_EXECUTION_TIME_IN_MILLISECONDS@ - The time in
--     milliseconds for the previous Lambda invocation.
configureAgent_metadata :: Lens.Lens' ConfigureAgent (Prelude.Maybe (Prelude.HashMap MetadataField Prelude.Text))
configureAgent_metadata :: Lens' ConfigureAgent (Maybe (HashMap MetadataField Text))
configureAgent_metadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigureAgent' {Maybe (HashMap MetadataField Text)
metadata :: Maybe (HashMap MetadataField Text)
$sel:metadata:ConfigureAgent' :: ConfigureAgent -> Maybe (HashMap MetadataField Text)
metadata} -> Maybe (HashMap MetadataField Text)
metadata) (\s :: ConfigureAgent
s@ConfigureAgent' {} Maybe (HashMap MetadataField Text)
a -> ConfigureAgent
s {$sel:metadata:ConfigureAgent' :: Maybe (HashMap MetadataField Text)
metadata = Maybe (HashMap MetadataField Text)
a} :: ConfigureAgent) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the profiling group for which the configured agent is
-- collecting profiling data.
configureAgent_profilingGroupName :: Lens.Lens' ConfigureAgent Prelude.Text
configureAgent_profilingGroupName :: Lens' ConfigureAgent Text
configureAgent_profilingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigureAgent' {Text
profilingGroupName :: Text
$sel:profilingGroupName:ConfigureAgent' :: ConfigureAgent -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: ConfigureAgent
s@ConfigureAgent' {} Text
a -> ConfigureAgent
s {$sel:profilingGroupName:ConfigureAgent' :: Text
profilingGroupName = Text
a} :: ConfigureAgent)

instance Core.AWSRequest ConfigureAgent where
  type
    AWSResponse ConfigureAgent =
      ConfigureAgentResponse
  request :: (Service -> Service) -> ConfigureAgent -> Request ConfigureAgent
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ConfigureAgent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ConfigureAgent)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> AgentConfiguration -> ConfigureAgentResponse
ConfigureAgentResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
      )

instance Prelude.Hashable ConfigureAgent where
  hashWithSalt :: Int -> ConfigureAgent -> Int
hashWithSalt Int
_salt ConfigureAgent' {Maybe Text
Maybe (HashMap MetadataField Text)
Text
profilingGroupName :: Text
metadata :: Maybe (HashMap MetadataField Text)
fleetInstanceId :: Maybe Text
$sel:profilingGroupName:ConfigureAgent' :: ConfigureAgent -> Text
$sel:metadata:ConfigureAgent' :: ConfigureAgent -> Maybe (HashMap MetadataField Text)
$sel:fleetInstanceId:ConfigureAgent' :: ConfigureAgent -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fleetInstanceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap MetadataField Text)
metadata
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
profilingGroupName

instance Prelude.NFData ConfigureAgent where
  rnf :: ConfigureAgent -> ()
rnf ConfigureAgent' {Maybe Text
Maybe (HashMap MetadataField Text)
Text
profilingGroupName :: Text
metadata :: Maybe (HashMap MetadataField Text)
fleetInstanceId :: Maybe Text
$sel:profilingGroupName:ConfigureAgent' :: ConfigureAgent -> Text
$sel:metadata:ConfigureAgent' :: ConfigureAgent -> Maybe (HashMap MetadataField Text)
$sel:fleetInstanceId:ConfigureAgent' :: ConfigureAgent -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fleetInstanceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap MetadataField Text)
metadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
profilingGroupName

instance Data.ToHeaders ConfigureAgent where
  toHeaders :: ConfigureAgent -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ConfigureAgent where
  toJSON :: ConfigureAgent -> Value
toJSON ConfigureAgent' {Maybe Text
Maybe (HashMap MetadataField Text)
Text
profilingGroupName :: Text
metadata :: Maybe (HashMap MetadataField Text)
fleetInstanceId :: Maybe Text
$sel:profilingGroupName:ConfigureAgent' :: ConfigureAgent -> Text
$sel:metadata:ConfigureAgent' :: ConfigureAgent -> Maybe (HashMap MetadataField Text)
$sel:fleetInstanceId:ConfigureAgent' :: ConfigureAgent -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"fleetInstanceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
fleetInstanceId,
            (Key
"metadata" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap MetadataField Text)
metadata
          ]
      )

instance Data.ToPath ConfigureAgent where
  toPath :: ConfigureAgent -> ByteString
toPath ConfigureAgent' {Maybe Text
Maybe (HashMap MetadataField Text)
Text
profilingGroupName :: Text
metadata :: Maybe (HashMap MetadataField Text)
fleetInstanceId :: Maybe Text
$sel:profilingGroupName:ConfigureAgent' :: ConfigureAgent -> Text
$sel:metadata:ConfigureAgent' :: ConfigureAgent -> Maybe (HashMap MetadataField Text)
$sel:fleetInstanceId:ConfigureAgent' :: ConfigureAgent -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/profilingGroups/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
profilingGroupName,
        ByteString
"/configureAgent"
      ]

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

-- | The structure representing the configureAgentResponse.
--
-- /See:/ 'newConfigureAgentResponse' smart constructor.
data ConfigureAgentResponse = ConfigureAgentResponse'
  { -- | The response's http status code.
    ConfigureAgentResponse -> Int
httpStatus :: Prelude.Int,
    -- | An
    -- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AgentConfiguration.html AgentConfiguration>
    -- object that specifies if an agent profiles or not and for how long to
    -- return profiling data.
    ConfigureAgentResponse -> AgentConfiguration
configuration :: AgentConfiguration
  }
  deriving (ConfigureAgentResponse -> ConfigureAgentResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigureAgentResponse -> ConfigureAgentResponse -> Bool
$c/= :: ConfigureAgentResponse -> ConfigureAgentResponse -> Bool
== :: ConfigureAgentResponse -> ConfigureAgentResponse -> Bool
$c== :: ConfigureAgentResponse -> ConfigureAgentResponse -> Bool
Prelude.Eq, ReadPrec [ConfigureAgentResponse]
ReadPrec ConfigureAgentResponse
Int -> ReadS ConfigureAgentResponse
ReadS [ConfigureAgentResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigureAgentResponse]
$creadListPrec :: ReadPrec [ConfigureAgentResponse]
readPrec :: ReadPrec ConfigureAgentResponse
$creadPrec :: ReadPrec ConfigureAgentResponse
readList :: ReadS [ConfigureAgentResponse]
$creadList :: ReadS [ConfigureAgentResponse]
readsPrec :: Int -> ReadS ConfigureAgentResponse
$creadsPrec :: Int -> ReadS ConfigureAgentResponse
Prelude.Read, Int -> ConfigureAgentResponse -> ShowS
[ConfigureAgentResponse] -> ShowS
ConfigureAgentResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigureAgentResponse] -> ShowS
$cshowList :: [ConfigureAgentResponse] -> ShowS
show :: ConfigureAgentResponse -> String
$cshow :: ConfigureAgentResponse -> String
showsPrec :: Int -> ConfigureAgentResponse -> ShowS
$cshowsPrec :: Int -> ConfigureAgentResponse -> ShowS
Prelude.Show, forall x. Rep ConfigureAgentResponse x -> ConfigureAgentResponse
forall x. ConfigureAgentResponse -> Rep ConfigureAgentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfigureAgentResponse x -> ConfigureAgentResponse
$cfrom :: forall x. ConfigureAgentResponse -> Rep ConfigureAgentResponse x
Prelude.Generic)

-- |
-- Create a value of 'ConfigureAgentResponse' 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', 'configureAgentResponse_httpStatus' - The response's http status code.
--
-- 'configuration', 'configureAgentResponse_configuration' - An
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AgentConfiguration.html AgentConfiguration>
-- object that specifies if an agent profiles or not and for how long to
-- return profiling data.
newConfigureAgentResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'configuration'
  AgentConfiguration ->
  ConfigureAgentResponse
newConfigureAgentResponse :: Int -> AgentConfiguration -> ConfigureAgentResponse
newConfigureAgentResponse
  Int
pHttpStatus_
  AgentConfiguration
pConfiguration_ =
    ConfigureAgentResponse'
      { $sel:httpStatus:ConfigureAgentResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:configuration:ConfigureAgentResponse' :: AgentConfiguration
configuration = AgentConfiguration
pConfiguration_
      }

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

-- | An
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AgentConfiguration.html AgentConfiguration>
-- object that specifies if an agent profiles or not and for how long to
-- return profiling data.
configureAgentResponse_configuration :: Lens.Lens' ConfigureAgentResponse AgentConfiguration
configureAgentResponse_configuration :: Lens' ConfigureAgentResponse AgentConfiguration
configureAgentResponse_configuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigureAgentResponse' {AgentConfiguration
configuration :: AgentConfiguration
$sel:configuration:ConfigureAgentResponse' :: ConfigureAgentResponse -> AgentConfiguration
configuration} -> AgentConfiguration
configuration) (\s :: ConfigureAgentResponse
s@ConfigureAgentResponse' {} AgentConfiguration
a -> ConfigureAgentResponse
s {$sel:configuration:ConfigureAgentResponse' :: AgentConfiguration
configuration = AgentConfiguration
a} :: ConfigureAgentResponse)

instance Prelude.NFData ConfigureAgentResponse where
  rnf :: ConfigureAgentResponse -> ()
rnf ConfigureAgentResponse' {Int
AgentConfiguration
configuration :: AgentConfiguration
httpStatus :: Int
$sel:configuration:ConfigureAgentResponse' :: ConfigureAgentResponse -> AgentConfiguration
$sel:httpStatus:ConfigureAgentResponse' :: ConfigureAgentResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AgentConfiguration
configuration