{-# 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.CreateProfilingGroup
-- 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)
--
-- Creates a profiling group.
module Amazonka.CodeGuruProfiler.CreateProfilingGroup
  ( -- * Creating a Request
    CreateProfilingGroup (..),
    newCreateProfilingGroup,

    -- * Request Lenses
    createProfilingGroup_computePlatform,
    createProfilingGroup_agentOrchestrationConfig,
    createProfilingGroup_tags,
    createProfilingGroup_clientToken,
    createProfilingGroup_profilingGroupName,

    -- * Destructuring the Response
    CreateProfilingGroupResponse (..),
    newCreateProfilingGroupResponse,

    -- * Response Lenses
    createProfilingGroupResponse_httpStatus,
    createProfilingGroupResponse_profilingGroup,
  )
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 createProfiliingGroupRequest.
--
-- /See:/ 'newCreateProfilingGroup' smart constructor.
data CreateProfilingGroup = CreateProfilingGroup'
  { -- | The compute platform of the profiling group. Use @AWSLambda@ if your
    -- application runs on AWS Lambda. Use @Default@ if your application runs
    -- on a compute platform that is not AWS Lambda, such an Amazon EC2
    -- instance, an on-premises server, or a different platform. If not
    -- specified, @Default@ is used.
    CreateProfilingGroup -> Maybe ComputePlatform
computePlatform :: Prelude.Maybe ComputePlatform,
    -- | Specifies whether profiling is enabled or disabled for the created
    -- profiling group.
    CreateProfilingGroup -> Maybe AgentOrchestrationConfig
agentOrchestrationConfig :: Prelude.Maybe AgentOrchestrationConfig,
    -- | A list of tags to add to the created profiling group.
    CreateProfilingGroup -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | Amazon CodeGuru Profiler uses this universally unique identifier (UUID)
    -- to prevent the accidental creation of duplicate profiling groups if
    -- there are failures and retries.
    CreateProfilingGroup -> Text
clientToken :: Prelude.Text,
    -- | The name of the profiling group to create.
    CreateProfilingGroup -> Text
profilingGroupName :: Prelude.Text
  }
  deriving (CreateProfilingGroup -> CreateProfilingGroup -> Bool
(CreateProfilingGroup -> CreateProfilingGroup -> Bool)
-> (CreateProfilingGroup -> CreateProfilingGroup -> Bool)
-> Eq CreateProfilingGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProfilingGroup -> CreateProfilingGroup -> Bool
$c/= :: CreateProfilingGroup -> CreateProfilingGroup -> Bool
== :: CreateProfilingGroup -> CreateProfilingGroup -> Bool
$c== :: CreateProfilingGroup -> CreateProfilingGroup -> Bool
Prelude.Eq, ReadPrec [CreateProfilingGroup]
ReadPrec CreateProfilingGroup
Int -> ReadS CreateProfilingGroup
ReadS [CreateProfilingGroup]
(Int -> ReadS CreateProfilingGroup)
-> ReadS [CreateProfilingGroup]
-> ReadPrec CreateProfilingGroup
-> ReadPrec [CreateProfilingGroup]
-> Read CreateProfilingGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProfilingGroup]
$creadListPrec :: ReadPrec [CreateProfilingGroup]
readPrec :: ReadPrec CreateProfilingGroup
$creadPrec :: ReadPrec CreateProfilingGroup
readList :: ReadS [CreateProfilingGroup]
$creadList :: ReadS [CreateProfilingGroup]
readsPrec :: Int -> ReadS CreateProfilingGroup
$creadsPrec :: Int -> ReadS CreateProfilingGroup
Prelude.Read, Int -> CreateProfilingGroup -> ShowS
[CreateProfilingGroup] -> ShowS
CreateProfilingGroup -> String
(Int -> CreateProfilingGroup -> ShowS)
-> (CreateProfilingGroup -> String)
-> ([CreateProfilingGroup] -> ShowS)
-> Show CreateProfilingGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProfilingGroup] -> ShowS
$cshowList :: [CreateProfilingGroup] -> ShowS
show :: CreateProfilingGroup -> String
$cshow :: CreateProfilingGroup -> String
showsPrec :: Int -> CreateProfilingGroup -> ShowS
$cshowsPrec :: Int -> CreateProfilingGroup -> ShowS
Prelude.Show, (forall x. CreateProfilingGroup -> Rep CreateProfilingGroup x)
-> (forall x. Rep CreateProfilingGroup x -> CreateProfilingGroup)
-> Generic CreateProfilingGroup
forall x. Rep CreateProfilingGroup x -> CreateProfilingGroup
forall x. CreateProfilingGroup -> Rep CreateProfilingGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProfilingGroup x -> CreateProfilingGroup
$cfrom :: forall x. CreateProfilingGroup -> Rep CreateProfilingGroup x
Prelude.Generic)

-- |
-- Create a value of 'CreateProfilingGroup' 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:
--
-- 'computePlatform', 'createProfilingGroup_computePlatform' - The compute platform of the profiling group. Use @AWSLambda@ if your
-- application runs on AWS Lambda. Use @Default@ if your application runs
-- on a compute platform that is not AWS Lambda, such an Amazon EC2
-- instance, an on-premises server, or a different platform. If not
-- specified, @Default@ is used.
--
-- 'agentOrchestrationConfig', 'createProfilingGroup_agentOrchestrationConfig' - Specifies whether profiling is enabled or disabled for the created
-- profiling group.
--
-- 'tags', 'createProfilingGroup_tags' - A list of tags to add to the created profiling group.
--
-- 'clientToken', 'createProfilingGroup_clientToken' - Amazon CodeGuru Profiler uses this universally unique identifier (UUID)
-- to prevent the accidental creation of duplicate profiling groups if
-- there are failures and retries.
--
-- 'profilingGroupName', 'createProfilingGroup_profilingGroupName' - The name of the profiling group to create.
newCreateProfilingGroup ::
  -- | 'clientToken'
  Prelude.Text ->
  -- | 'profilingGroupName'
  Prelude.Text ->
  CreateProfilingGroup
newCreateProfilingGroup :: Text -> Text -> CreateProfilingGroup
newCreateProfilingGroup
  Text
pClientToken_
  Text
pProfilingGroupName_ =
    CreateProfilingGroup' :: Maybe ComputePlatform
-> Maybe AgentOrchestrationConfig
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> CreateProfilingGroup
CreateProfilingGroup'
      { $sel:computePlatform:CreateProfilingGroup' :: Maybe ComputePlatform
computePlatform =
          Maybe ComputePlatform
forall a. Maybe a
Prelude.Nothing,
        $sel:agentOrchestrationConfig:CreateProfilingGroup' :: Maybe AgentOrchestrationConfig
agentOrchestrationConfig = Maybe AgentOrchestrationConfig
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateProfilingGroup' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:clientToken:CreateProfilingGroup' :: Text
clientToken = Text
pClientToken_,
        $sel:profilingGroupName:CreateProfilingGroup' :: Text
profilingGroupName = Text
pProfilingGroupName_
      }

-- | The compute platform of the profiling group. Use @AWSLambda@ if your
-- application runs on AWS Lambda. Use @Default@ if your application runs
-- on a compute platform that is not AWS Lambda, such an Amazon EC2
-- instance, an on-premises server, or a different platform. If not
-- specified, @Default@ is used.
createProfilingGroup_computePlatform :: Lens.Lens' CreateProfilingGroup (Prelude.Maybe ComputePlatform)
createProfilingGroup_computePlatform :: (Maybe ComputePlatform -> f (Maybe ComputePlatform))
-> CreateProfilingGroup -> f CreateProfilingGroup
createProfilingGroup_computePlatform = (CreateProfilingGroup -> Maybe ComputePlatform)
-> (CreateProfilingGroup
    -> Maybe ComputePlatform -> CreateProfilingGroup)
-> Lens
     CreateProfilingGroup
     CreateProfilingGroup
     (Maybe ComputePlatform)
     (Maybe ComputePlatform)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfilingGroup' {Maybe ComputePlatform
computePlatform :: Maybe ComputePlatform
$sel:computePlatform:CreateProfilingGroup' :: CreateProfilingGroup -> Maybe ComputePlatform
computePlatform} -> Maybe ComputePlatform
computePlatform) (\s :: CreateProfilingGroup
s@CreateProfilingGroup' {} Maybe ComputePlatform
a -> CreateProfilingGroup
s {$sel:computePlatform:CreateProfilingGroup' :: Maybe ComputePlatform
computePlatform = Maybe ComputePlatform
a} :: CreateProfilingGroup)

-- | Specifies whether profiling is enabled or disabled for the created
-- profiling group.
createProfilingGroup_agentOrchestrationConfig :: Lens.Lens' CreateProfilingGroup (Prelude.Maybe AgentOrchestrationConfig)
createProfilingGroup_agentOrchestrationConfig :: (Maybe AgentOrchestrationConfig
 -> f (Maybe AgentOrchestrationConfig))
-> CreateProfilingGroup -> f CreateProfilingGroup
createProfilingGroup_agentOrchestrationConfig = (CreateProfilingGroup -> Maybe AgentOrchestrationConfig)
-> (CreateProfilingGroup
    -> Maybe AgentOrchestrationConfig -> CreateProfilingGroup)
-> Lens
     CreateProfilingGroup
     CreateProfilingGroup
     (Maybe AgentOrchestrationConfig)
     (Maybe AgentOrchestrationConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfilingGroup' {Maybe AgentOrchestrationConfig
agentOrchestrationConfig :: Maybe AgentOrchestrationConfig
$sel:agentOrchestrationConfig:CreateProfilingGroup' :: CreateProfilingGroup -> Maybe AgentOrchestrationConfig
agentOrchestrationConfig} -> Maybe AgentOrchestrationConfig
agentOrchestrationConfig) (\s :: CreateProfilingGroup
s@CreateProfilingGroup' {} Maybe AgentOrchestrationConfig
a -> CreateProfilingGroup
s {$sel:agentOrchestrationConfig:CreateProfilingGroup' :: Maybe AgentOrchestrationConfig
agentOrchestrationConfig = Maybe AgentOrchestrationConfig
a} :: CreateProfilingGroup)

-- | A list of tags to add to the created profiling group.
createProfilingGroup_tags :: Lens.Lens' CreateProfilingGroup (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createProfilingGroup_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateProfilingGroup -> f CreateProfilingGroup
createProfilingGroup_tags = (CreateProfilingGroup -> Maybe (HashMap Text Text))
-> (CreateProfilingGroup
    -> Maybe (HashMap Text Text) -> CreateProfilingGroup)
-> Lens
     CreateProfilingGroup
     CreateProfilingGroup
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfilingGroup' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateProfilingGroup' :: CreateProfilingGroup -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateProfilingGroup
s@CreateProfilingGroup' {} Maybe (HashMap Text Text)
a -> CreateProfilingGroup
s {$sel:tags:CreateProfilingGroup' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateProfilingGroup) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateProfilingGroup -> f CreateProfilingGroup)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateProfilingGroup
-> f CreateProfilingGroup
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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 Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Amazon CodeGuru Profiler uses this universally unique identifier (UUID)
-- to prevent the accidental creation of duplicate profiling groups if
-- there are failures and retries.
createProfilingGroup_clientToken :: Lens.Lens' CreateProfilingGroup Prelude.Text
createProfilingGroup_clientToken :: (Text -> f Text) -> CreateProfilingGroup -> f CreateProfilingGroup
createProfilingGroup_clientToken = (CreateProfilingGroup -> Text)
-> (CreateProfilingGroup -> Text -> CreateProfilingGroup)
-> Lens CreateProfilingGroup CreateProfilingGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfilingGroup' {Text
clientToken :: Text
$sel:clientToken:CreateProfilingGroup' :: CreateProfilingGroup -> Text
clientToken} -> Text
clientToken) (\s :: CreateProfilingGroup
s@CreateProfilingGroup' {} Text
a -> CreateProfilingGroup
s {$sel:clientToken:CreateProfilingGroup' :: Text
clientToken = Text
a} :: CreateProfilingGroup)

-- | The name of the profiling group to create.
createProfilingGroup_profilingGroupName :: Lens.Lens' CreateProfilingGroup Prelude.Text
createProfilingGroup_profilingGroupName :: (Text -> f Text) -> CreateProfilingGroup -> f CreateProfilingGroup
createProfilingGroup_profilingGroupName = (CreateProfilingGroup -> Text)
-> (CreateProfilingGroup -> Text -> CreateProfilingGroup)
-> Lens CreateProfilingGroup CreateProfilingGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfilingGroup' {Text
profilingGroupName :: Text
$sel:profilingGroupName:CreateProfilingGroup' :: CreateProfilingGroup -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: CreateProfilingGroup
s@CreateProfilingGroup' {} Text
a -> CreateProfilingGroup
s {$sel:profilingGroupName:CreateProfilingGroup' :: Text
profilingGroupName = Text
a} :: CreateProfilingGroup)

instance Core.AWSRequest CreateProfilingGroup where
  type
    AWSResponse CreateProfilingGroup =
      CreateProfilingGroupResponse
  request :: CreateProfilingGroup -> Request CreateProfilingGroup
request = Service -> CreateProfilingGroup -> Request CreateProfilingGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateProfilingGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateProfilingGroup)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateProfilingGroup))
-> Logger
-> Service
-> Proxy CreateProfilingGroup
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateProfilingGroup)))
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 -> ProfilingGroupDescription -> CreateProfilingGroupResponse
CreateProfilingGroupResponse'
            (Int -> ProfilingGroupDescription -> CreateProfilingGroupResponse)
-> Either String Int
-> Either
     String (ProfilingGroupDescription -> CreateProfilingGroupResponse)
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 (ProfilingGroupDescription -> CreateProfilingGroupResponse)
-> Either String ProfilingGroupDescription
-> Either String CreateProfilingGroupResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object -> Either String ProfilingGroupDescription
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
      )

instance Prelude.Hashable CreateProfilingGroup

instance Prelude.NFData CreateProfilingGroup

instance Core.ToHeaders CreateProfilingGroup where
  toHeaders :: CreateProfilingGroup -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateProfilingGroup -> 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 CreateProfilingGroup where
  toJSON :: CreateProfilingGroup -> Value
toJSON CreateProfilingGroup' {Maybe (HashMap Text Text)
Maybe AgentOrchestrationConfig
Maybe ComputePlatform
Text
profilingGroupName :: Text
clientToken :: Text
tags :: Maybe (HashMap Text Text)
agentOrchestrationConfig :: Maybe AgentOrchestrationConfig
computePlatform :: Maybe ComputePlatform
$sel:profilingGroupName:CreateProfilingGroup' :: CreateProfilingGroup -> Text
$sel:clientToken:CreateProfilingGroup' :: CreateProfilingGroup -> Text
$sel:tags:CreateProfilingGroup' :: CreateProfilingGroup -> Maybe (HashMap Text Text)
$sel:agentOrchestrationConfig:CreateProfilingGroup' :: CreateProfilingGroup -> Maybe AgentOrchestrationConfig
$sel:computePlatform:CreateProfilingGroup' :: CreateProfilingGroup -> Maybe ComputePlatform
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"computePlatform" Text -> ComputePlatform -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ComputePlatform -> Pair) -> Maybe ComputePlatform -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ComputePlatform
computePlatform,
            (Text
"agentOrchestrationConfig" Text -> AgentOrchestrationConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AgentOrchestrationConfig -> Pair)
-> Maybe AgentOrchestrationConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AgentOrchestrationConfig
agentOrchestrationConfig,
            (Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"profilingGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
profilingGroupName)
          ]
      )

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

instance Core.ToQuery CreateProfilingGroup where
  toQuery :: CreateProfilingGroup -> QueryString
toQuery CreateProfilingGroup' {Maybe (HashMap Text Text)
Maybe AgentOrchestrationConfig
Maybe ComputePlatform
Text
profilingGroupName :: Text
clientToken :: Text
tags :: Maybe (HashMap Text Text)
agentOrchestrationConfig :: Maybe AgentOrchestrationConfig
computePlatform :: Maybe ComputePlatform
$sel:profilingGroupName:CreateProfilingGroup' :: CreateProfilingGroup -> Text
$sel:clientToken:CreateProfilingGroup' :: CreateProfilingGroup -> Text
$sel:tags:CreateProfilingGroup' :: CreateProfilingGroup -> Maybe (HashMap Text Text)
$sel:agentOrchestrationConfig:CreateProfilingGroup' :: CreateProfilingGroup -> Maybe AgentOrchestrationConfig
$sel:computePlatform:CreateProfilingGroup' :: CreateProfilingGroup -> Maybe ComputePlatform
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"clientToken" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clientToken]

-- | The structure representing the createProfilingGroupResponse.
--
-- /See:/ 'newCreateProfilingGroupResponse' smart constructor.
data CreateProfilingGroupResponse = CreateProfilingGroupResponse'
  { -- | The response's http status code.
    CreateProfilingGroupResponse -> Int
httpStatus :: Prelude.Int,
    -- | The returned
    -- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
    -- object that contains information about the created profiling group.
    CreateProfilingGroupResponse -> ProfilingGroupDescription
profilingGroup :: ProfilingGroupDescription
  }
  deriving (CreateProfilingGroupResponse
-> CreateProfilingGroupResponse -> Bool
(CreateProfilingGroupResponse
 -> CreateProfilingGroupResponse -> Bool)
-> (CreateProfilingGroupResponse
    -> CreateProfilingGroupResponse -> Bool)
-> Eq CreateProfilingGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProfilingGroupResponse
-> CreateProfilingGroupResponse -> Bool
$c/= :: CreateProfilingGroupResponse
-> CreateProfilingGroupResponse -> Bool
== :: CreateProfilingGroupResponse
-> CreateProfilingGroupResponse -> Bool
$c== :: CreateProfilingGroupResponse
-> CreateProfilingGroupResponse -> Bool
Prelude.Eq, ReadPrec [CreateProfilingGroupResponse]
ReadPrec CreateProfilingGroupResponse
Int -> ReadS CreateProfilingGroupResponse
ReadS [CreateProfilingGroupResponse]
(Int -> ReadS CreateProfilingGroupResponse)
-> ReadS [CreateProfilingGroupResponse]
-> ReadPrec CreateProfilingGroupResponse
-> ReadPrec [CreateProfilingGroupResponse]
-> Read CreateProfilingGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProfilingGroupResponse]
$creadListPrec :: ReadPrec [CreateProfilingGroupResponse]
readPrec :: ReadPrec CreateProfilingGroupResponse
$creadPrec :: ReadPrec CreateProfilingGroupResponse
readList :: ReadS [CreateProfilingGroupResponse]
$creadList :: ReadS [CreateProfilingGroupResponse]
readsPrec :: Int -> ReadS CreateProfilingGroupResponse
$creadsPrec :: Int -> ReadS CreateProfilingGroupResponse
Prelude.Read, Int -> CreateProfilingGroupResponse -> ShowS
[CreateProfilingGroupResponse] -> ShowS
CreateProfilingGroupResponse -> String
(Int -> CreateProfilingGroupResponse -> ShowS)
-> (CreateProfilingGroupResponse -> String)
-> ([CreateProfilingGroupResponse] -> ShowS)
-> Show CreateProfilingGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProfilingGroupResponse] -> ShowS
$cshowList :: [CreateProfilingGroupResponse] -> ShowS
show :: CreateProfilingGroupResponse -> String
$cshow :: CreateProfilingGroupResponse -> String
showsPrec :: Int -> CreateProfilingGroupResponse -> ShowS
$cshowsPrec :: Int -> CreateProfilingGroupResponse -> ShowS
Prelude.Show, (forall x.
 CreateProfilingGroupResponse -> Rep CreateProfilingGroupResponse x)
-> (forall x.
    Rep CreateProfilingGroupResponse x -> CreateProfilingGroupResponse)
-> Generic CreateProfilingGroupResponse
forall x.
Rep CreateProfilingGroupResponse x -> CreateProfilingGroupResponse
forall x.
CreateProfilingGroupResponse -> Rep CreateProfilingGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateProfilingGroupResponse x -> CreateProfilingGroupResponse
$cfrom :: forall x.
CreateProfilingGroupResponse -> Rep CreateProfilingGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateProfilingGroupResponse' 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', 'createProfilingGroupResponse_httpStatus' - The response's http status code.
--
-- 'profilingGroup', 'createProfilingGroupResponse_profilingGroup' - The returned
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- object that contains information about the created profiling group.
newCreateProfilingGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'profilingGroup'
  ProfilingGroupDescription ->
  CreateProfilingGroupResponse
newCreateProfilingGroupResponse :: Int -> ProfilingGroupDescription -> CreateProfilingGroupResponse
newCreateProfilingGroupResponse
  Int
pHttpStatus_
  ProfilingGroupDescription
pProfilingGroup_ =
    CreateProfilingGroupResponse' :: Int -> ProfilingGroupDescription -> CreateProfilingGroupResponse
CreateProfilingGroupResponse'
      { $sel:httpStatus:CreateProfilingGroupResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:profilingGroup:CreateProfilingGroupResponse' :: ProfilingGroupDescription
profilingGroup = ProfilingGroupDescription
pProfilingGroup_
      }

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

-- | The returned
-- <https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html ProfilingGroupDescription>
-- object that contains information about the created profiling group.
createProfilingGroupResponse_profilingGroup :: Lens.Lens' CreateProfilingGroupResponse ProfilingGroupDescription
createProfilingGroupResponse_profilingGroup :: (ProfilingGroupDescription -> f ProfilingGroupDescription)
-> CreateProfilingGroupResponse -> f CreateProfilingGroupResponse
createProfilingGroupResponse_profilingGroup = (CreateProfilingGroupResponse -> ProfilingGroupDescription)
-> (CreateProfilingGroupResponse
    -> ProfilingGroupDescription -> CreateProfilingGroupResponse)
-> Lens
     CreateProfilingGroupResponse
     CreateProfilingGroupResponse
     ProfilingGroupDescription
     ProfilingGroupDescription
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProfilingGroupResponse' {ProfilingGroupDescription
profilingGroup :: ProfilingGroupDescription
$sel:profilingGroup:CreateProfilingGroupResponse' :: CreateProfilingGroupResponse -> ProfilingGroupDescription
profilingGroup} -> ProfilingGroupDescription
profilingGroup) (\s :: CreateProfilingGroupResponse
s@CreateProfilingGroupResponse' {} ProfilingGroupDescription
a -> CreateProfilingGroupResponse
s {$sel:profilingGroup:CreateProfilingGroupResponse' :: ProfilingGroupDescription
profilingGroup = ProfilingGroupDescription
a} :: CreateProfilingGroupResponse)

instance Prelude.NFData CreateProfilingGroupResponse