{-# 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-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 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.Lens as Lens
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
(ConfigureAgent -> ConfigureAgent -> Bool)
-> (ConfigureAgent -> ConfigureAgent -> Bool) -> Eq ConfigureAgent
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]
(Int -> ReadS ConfigureAgent)
-> ReadS [ConfigureAgent]
-> ReadPrec ConfigureAgent
-> ReadPrec [ConfigureAgent]
-> Read 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
(Int -> ConfigureAgent -> ShowS)
-> (ConfigureAgent -> String)
-> ([ConfigureAgent] -> ShowS)
-> Show ConfigureAgent
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. ConfigureAgent -> Rep ConfigureAgent x)
-> (forall x. Rep ConfigureAgent x -> ConfigureAgent)
-> Generic ConfigureAgent
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' :: Maybe Text
-> Maybe (HashMap MetadataField Text) -> Text -> ConfigureAgent
ConfigureAgent'
    { $sel:fleetInstanceId:ConfigureAgent' :: Maybe Text
fleetInstanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:metadata:ConfigureAgent' :: Maybe (HashMap MetadataField Text)
metadata = Maybe (HashMap MetadataField Text)
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 :: (Maybe Text -> f (Maybe Text))
-> ConfigureAgent -> f ConfigureAgent
configureAgent_fleetInstanceId = (ConfigureAgent -> Maybe Text)
-> (ConfigureAgent -> Maybe Text -> ConfigureAgent)
-> Lens ConfigureAgent ConfigureAgent (Maybe Text) (Maybe Text)
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 :: (Maybe (HashMap MetadataField Text)
 -> f (Maybe (HashMap MetadataField Text)))
-> ConfigureAgent -> f ConfigureAgent
configureAgent_metadata = (ConfigureAgent -> Maybe (HashMap MetadataField Text))
-> (ConfigureAgent
    -> Maybe (HashMap MetadataField Text) -> ConfigureAgent)
-> Lens
     ConfigureAgent
     ConfigureAgent
     (Maybe (HashMap MetadataField Text))
     (Maybe (HashMap MetadataField Text))
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) ((Maybe (HashMap MetadataField Text)
  -> f (Maybe (HashMap MetadataField Text)))
 -> ConfigureAgent -> f ConfigureAgent)
-> ((Maybe (HashMap MetadataField Text)
     -> f (Maybe (HashMap MetadataField Text)))
    -> Maybe (HashMap MetadataField Text)
    -> f (Maybe (HashMap MetadataField Text)))
-> (Maybe (HashMap MetadataField Text)
    -> f (Maybe (HashMap MetadataField Text)))
-> ConfigureAgent
-> f ConfigureAgent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap MetadataField Text)
  (HashMap MetadataField Text)
  (HashMap MetadataField Text)
  (HashMap MetadataField Text)
-> Iso
     (Maybe (HashMap MetadataField Text))
     (Maybe (HashMap MetadataField Text))
     (Maybe (HashMap MetadataField Text))
     (Maybe (HashMap MetadataField Text))
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 AnIso
  (HashMap MetadataField Text)
  (HashMap MetadataField Text)
  (HashMap MetadataField Text)
  (HashMap MetadataField Text)
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 :: (Text -> f Text) -> ConfigureAgent -> f ConfigureAgent
configureAgent_profilingGroupName = (ConfigureAgent -> Text)
-> (ConfigureAgent -> Text -> ConfigureAgent)
-> Lens ConfigureAgent ConfigureAgent Text Text
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 :: ConfigureAgent -> Request ConfigureAgent
request = Service -> ConfigureAgent -> Request ConfigureAgent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ConfigureAgent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ConfigureAgent)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ConfigureAgent))
-> Logger
-> Service
-> Proxy ConfigureAgent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ConfigureAgent)))
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 -> AgentConfiguration -> ConfigureAgentResponse
ConfigureAgentResponse'
            (Int -> AgentConfiguration -> ConfigureAgentResponse)
-> Either String Int
-> Either String (AgentConfiguration -> ConfigureAgentResponse)
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 (AgentConfiguration -> ConfigureAgentResponse)
-> Either String AgentConfiguration
-> Either String ConfigureAgentResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String AgentConfiguration
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
      )

instance Prelude.Hashable ConfigureAgent

instance Prelude.NFData ConfigureAgent

instance Core.ToHeaders ConfigureAgent where
  toHeaders :: ConfigureAgent -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ConfigureAgent -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"fleetInstanceId" 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
fleetInstanceId,
            (Text
"metadata" Text -> HashMap MetadataField Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap MetadataField Text -> Pair)
-> Maybe (HashMap MetadataField Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap MetadataField Text)
metadata
          ]
      )

instance Core.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
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/profilingGroups/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
profilingGroupName,
        ByteString
"/configureAgent"
      ]

instance Core.ToQuery ConfigureAgent where
  toQuery :: ConfigureAgent -> QueryString
toQuery = QueryString -> ConfigureAgent -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(ConfigureAgentResponse -> ConfigureAgentResponse -> Bool)
-> (ConfigureAgentResponse -> ConfigureAgentResponse -> Bool)
-> Eq ConfigureAgentResponse
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]
(Int -> ReadS ConfigureAgentResponse)
-> ReadS [ConfigureAgentResponse]
-> ReadPrec ConfigureAgentResponse
-> ReadPrec [ConfigureAgentResponse]
-> Read 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
(Int -> ConfigureAgentResponse -> ShowS)
-> (ConfigureAgentResponse -> String)
-> ([ConfigureAgentResponse] -> ShowS)
-> Show ConfigureAgentResponse
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. ConfigureAgentResponse -> Rep ConfigureAgentResponse x)
-> (forall x.
    Rep ConfigureAgentResponse x -> ConfigureAgentResponse)
-> Generic ConfigureAgentResponse
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' :: Int -> AgentConfiguration -> ConfigureAgentResponse
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 :: (Int -> f Int)
-> ConfigureAgentResponse -> f ConfigureAgentResponse
configureAgentResponse_httpStatus = (ConfigureAgentResponse -> Int)
-> (ConfigureAgentResponse -> Int -> ConfigureAgentResponse)
-> Lens ConfigureAgentResponse ConfigureAgentResponse Int Int
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 :: (AgentConfiguration -> f AgentConfiguration)
-> ConfigureAgentResponse -> f ConfigureAgentResponse
configureAgentResponse_configuration = (ConfigureAgentResponse -> AgentConfiguration)
-> (ConfigureAgentResponse
    -> AgentConfiguration -> ConfigureAgentResponse)
-> Lens
     ConfigureAgentResponse
     ConfigureAgentResponse
     AgentConfiguration
     AgentConfiguration
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