{-# 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 #-}
module Amazonka.CodeGuruProfiler.UpdateProfilingGroup
(
UpdateProfilingGroup (..),
newUpdateProfilingGroup,
updateProfilingGroup_agentOrchestrationConfig,
updateProfilingGroup_profilingGroupName,
UpdateProfilingGroupResponse (..),
newUpdateProfilingGroupResponse,
updateProfilingGroupResponse_httpStatus,
updateProfilingGroupResponse_profilingGroup,
)
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
data UpdateProfilingGroup = UpdateProfilingGroup'
{
UpdateProfilingGroup -> AgentOrchestrationConfig
agentOrchestrationConfig :: AgentOrchestrationConfig,
UpdateProfilingGroup -> Text
profilingGroupName :: Prelude.Text
}
deriving (UpdateProfilingGroup -> UpdateProfilingGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateProfilingGroup -> UpdateProfilingGroup -> Bool
$c/= :: UpdateProfilingGroup -> UpdateProfilingGroup -> Bool
== :: UpdateProfilingGroup -> UpdateProfilingGroup -> Bool
$c== :: UpdateProfilingGroup -> UpdateProfilingGroup -> Bool
Prelude.Eq, ReadPrec [UpdateProfilingGroup]
ReadPrec UpdateProfilingGroup
Int -> ReadS UpdateProfilingGroup
ReadS [UpdateProfilingGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateProfilingGroup]
$creadListPrec :: ReadPrec [UpdateProfilingGroup]
readPrec :: ReadPrec UpdateProfilingGroup
$creadPrec :: ReadPrec UpdateProfilingGroup
readList :: ReadS [UpdateProfilingGroup]
$creadList :: ReadS [UpdateProfilingGroup]
readsPrec :: Int -> ReadS UpdateProfilingGroup
$creadsPrec :: Int -> ReadS UpdateProfilingGroup
Prelude.Read, Int -> UpdateProfilingGroup -> ShowS
[UpdateProfilingGroup] -> ShowS
UpdateProfilingGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateProfilingGroup] -> ShowS
$cshowList :: [UpdateProfilingGroup] -> ShowS
show :: UpdateProfilingGroup -> String
$cshow :: UpdateProfilingGroup -> String
showsPrec :: Int -> UpdateProfilingGroup -> ShowS
$cshowsPrec :: Int -> UpdateProfilingGroup -> ShowS
Prelude.Show, forall x. Rep UpdateProfilingGroup x -> UpdateProfilingGroup
forall x. UpdateProfilingGroup -> Rep UpdateProfilingGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateProfilingGroup x -> UpdateProfilingGroup
$cfrom :: forall x. UpdateProfilingGroup -> Rep UpdateProfilingGroup x
Prelude.Generic)
newUpdateProfilingGroup ::
AgentOrchestrationConfig ->
Prelude.Text ->
UpdateProfilingGroup
newUpdateProfilingGroup :: AgentOrchestrationConfig -> Text -> UpdateProfilingGroup
newUpdateProfilingGroup
AgentOrchestrationConfig
pAgentOrchestrationConfig_
Text
pProfilingGroupName_ =
UpdateProfilingGroup'
{ $sel:agentOrchestrationConfig:UpdateProfilingGroup' :: AgentOrchestrationConfig
agentOrchestrationConfig =
AgentOrchestrationConfig
pAgentOrchestrationConfig_,
$sel:profilingGroupName:UpdateProfilingGroup' :: Text
profilingGroupName = Text
pProfilingGroupName_
}
updateProfilingGroup_agentOrchestrationConfig :: Lens.Lens' UpdateProfilingGroup AgentOrchestrationConfig
updateProfilingGroup_agentOrchestrationConfig :: Lens' UpdateProfilingGroup AgentOrchestrationConfig
updateProfilingGroup_agentOrchestrationConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProfilingGroup' {AgentOrchestrationConfig
agentOrchestrationConfig :: AgentOrchestrationConfig
$sel:agentOrchestrationConfig:UpdateProfilingGroup' :: UpdateProfilingGroup -> AgentOrchestrationConfig
agentOrchestrationConfig} -> AgentOrchestrationConfig
agentOrchestrationConfig) (\s :: UpdateProfilingGroup
s@UpdateProfilingGroup' {} AgentOrchestrationConfig
a -> UpdateProfilingGroup
s {$sel:agentOrchestrationConfig:UpdateProfilingGroup' :: AgentOrchestrationConfig
agentOrchestrationConfig = AgentOrchestrationConfig
a} :: UpdateProfilingGroup)
updateProfilingGroup_profilingGroupName :: Lens.Lens' UpdateProfilingGroup Prelude.Text
updateProfilingGroup_profilingGroupName :: Lens' UpdateProfilingGroup Text
updateProfilingGroup_profilingGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProfilingGroup' {Text
profilingGroupName :: Text
$sel:profilingGroupName:UpdateProfilingGroup' :: UpdateProfilingGroup -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: UpdateProfilingGroup
s@UpdateProfilingGroup' {} Text
a -> UpdateProfilingGroup
s {$sel:profilingGroupName:UpdateProfilingGroup' :: Text
profilingGroupName = Text
a} :: UpdateProfilingGroup)
instance Core.AWSRequest UpdateProfilingGroup where
type
AWSResponse UpdateProfilingGroup =
UpdateProfilingGroupResponse
request :: (Service -> Service)
-> UpdateProfilingGroup -> Request UpdateProfilingGroup
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateProfilingGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateProfilingGroup)))
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 -> ProfilingGroupDescription -> UpdateProfilingGroupResponse
UpdateProfilingGroupResponse'
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 UpdateProfilingGroup where
hashWithSalt :: Int -> UpdateProfilingGroup -> Int
hashWithSalt Int
_salt UpdateProfilingGroup' {Text
AgentOrchestrationConfig
profilingGroupName :: Text
agentOrchestrationConfig :: AgentOrchestrationConfig
$sel:profilingGroupName:UpdateProfilingGroup' :: UpdateProfilingGroup -> Text
$sel:agentOrchestrationConfig:UpdateProfilingGroup' :: UpdateProfilingGroup -> AgentOrchestrationConfig
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AgentOrchestrationConfig
agentOrchestrationConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
profilingGroupName
instance Prelude.NFData UpdateProfilingGroup where
rnf :: UpdateProfilingGroup -> ()
rnf UpdateProfilingGroup' {Text
AgentOrchestrationConfig
profilingGroupName :: Text
agentOrchestrationConfig :: AgentOrchestrationConfig
$sel:profilingGroupName:UpdateProfilingGroup' :: UpdateProfilingGroup -> Text
$sel:agentOrchestrationConfig:UpdateProfilingGroup' :: UpdateProfilingGroup -> AgentOrchestrationConfig
..} =
forall a. NFData a => a -> ()
Prelude.rnf AgentOrchestrationConfig
agentOrchestrationConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
profilingGroupName
instance Data.ToHeaders UpdateProfilingGroup where
toHeaders :: UpdateProfilingGroup -> 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 UpdateProfilingGroup where
toJSON :: UpdateProfilingGroup -> Value
toJSON UpdateProfilingGroup' {Text
AgentOrchestrationConfig
profilingGroupName :: Text
agentOrchestrationConfig :: AgentOrchestrationConfig
$sel:profilingGroupName:UpdateProfilingGroup' :: UpdateProfilingGroup -> Text
$sel:agentOrchestrationConfig:UpdateProfilingGroup' :: UpdateProfilingGroup -> AgentOrchestrationConfig
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"agentOrchestrationConfig"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AgentOrchestrationConfig
agentOrchestrationConfig
)
]
)
instance Data.ToPath UpdateProfilingGroup where
toPath :: UpdateProfilingGroup -> ByteString
toPath UpdateProfilingGroup' {Text
AgentOrchestrationConfig
profilingGroupName :: Text
agentOrchestrationConfig :: AgentOrchestrationConfig
$sel:profilingGroupName:UpdateProfilingGroup' :: UpdateProfilingGroup -> Text
$sel:agentOrchestrationConfig:UpdateProfilingGroup' :: UpdateProfilingGroup -> AgentOrchestrationConfig
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/profilingGroups/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
profilingGroupName]
instance Data.ToQuery UpdateProfilingGroup where
toQuery :: UpdateProfilingGroup -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateProfilingGroupResponse = UpdateProfilingGroupResponse'
{
UpdateProfilingGroupResponse -> Int
httpStatus :: Prelude.Int,
UpdateProfilingGroupResponse -> ProfilingGroupDescription
profilingGroup :: ProfilingGroupDescription
}
deriving (UpdateProfilingGroupResponse
-> UpdateProfilingGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateProfilingGroupResponse
-> UpdateProfilingGroupResponse -> Bool
$c/= :: UpdateProfilingGroupResponse
-> UpdateProfilingGroupResponse -> Bool
== :: UpdateProfilingGroupResponse
-> UpdateProfilingGroupResponse -> Bool
$c== :: UpdateProfilingGroupResponse
-> UpdateProfilingGroupResponse -> Bool
Prelude.Eq, ReadPrec [UpdateProfilingGroupResponse]
ReadPrec UpdateProfilingGroupResponse
Int -> ReadS UpdateProfilingGroupResponse
ReadS [UpdateProfilingGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateProfilingGroupResponse]
$creadListPrec :: ReadPrec [UpdateProfilingGroupResponse]
readPrec :: ReadPrec UpdateProfilingGroupResponse
$creadPrec :: ReadPrec UpdateProfilingGroupResponse
readList :: ReadS [UpdateProfilingGroupResponse]
$creadList :: ReadS [UpdateProfilingGroupResponse]
readsPrec :: Int -> ReadS UpdateProfilingGroupResponse
$creadsPrec :: Int -> ReadS UpdateProfilingGroupResponse
Prelude.Read, Int -> UpdateProfilingGroupResponse -> ShowS
[UpdateProfilingGroupResponse] -> ShowS
UpdateProfilingGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateProfilingGroupResponse] -> ShowS
$cshowList :: [UpdateProfilingGroupResponse] -> ShowS
show :: UpdateProfilingGroupResponse -> String
$cshow :: UpdateProfilingGroupResponse -> String
showsPrec :: Int -> UpdateProfilingGroupResponse -> ShowS
$cshowsPrec :: Int -> UpdateProfilingGroupResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateProfilingGroupResponse x -> UpdateProfilingGroupResponse
forall x.
UpdateProfilingGroupResponse -> Rep UpdateProfilingGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateProfilingGroupResponse x -> UpdateProfilingGroupResponse
$cfrom :: forall x.
UpdateProfilingGroupResponse -> Rep UpdateProfilingGroupResponse x
Prelude.Generic)
newUpdateProfilingGroupResponse ::
Prelude.Int ->
ProfilingGroupDescription ->
UpdateProfilingGroupResponse
newUpdateProfilingGroupResponse :: Int -> ProfilingGroupDescription -> UpdateProfilingGroupResponse
newUpdateProfilingGroupResponse
Int
pHttpStatus_
ProfilingGroupDescription
pProfilingGroup_ =
UpdateProfilingGroupResponse'
{ $sel:httpStatus:UpdateProfilingGroupResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:profilingGroup:UpdateProfilingGroupResponse' :: ProfilingGroupDescription
profilingGroup = ProfilingGroupDescription
pProfilingGroup_
}
updateProfilingGroupResponse_httpStatus :: Lens.Lens' UpdateProfilingGroupResponse Prelude.Int
updateProfilingGroupResponse_httpStatus :: Lens' UpdateProfilingGroupResponse Int
updateProfilingGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProfilingGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateProfilingGroupResponse' :: UpdateProfilingGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateProfilingGroupResponse
s@UpdateProfilingGroupResponse' {} Int
a -> UpdateProfilingGroupResponse
s {$sel:httpStatus:UpdateProfilingGroupResponse' :: Int
httpStatus = Int
a} :: UpdateProfilingGroupResponse)
updateProfilingGroupResponse_profilingGroup :: Lens.Lens' UpdateProfilingGroupResponse ProfilingGroupDescription
updateProfilingGroupResponse_profilingGroup :: Lens' UpdateProfilingGroupResponse ProfilingGroupDescription
updateProfilingGroupResponse_profilingGroup = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateProfilingGroupResponse' {ProfilingGroupDescription
profilingGroup :: ProfilingGroupDescription
$sel:profilingGroup:UpdateProfilingGroupResponse' :: UpdateProfilingGroupResponse -> ProfilingGroupDescription
profilingGroup} -> ProfilingGroupDescription
profilingGroup) (\s :: UpdateProfilingGroupResponse
s@UpdateProfilingGroupResponse' {} ProfilingGroupDescription
a -> UpdateProfilingGroupResponse
s {$sel:profilingGroup:UpdateProfilingGroupResponse' :: ProfilingGroupDescription
profilingGroup = ProfilingGroupDescription
a} :: UpdateProfilingGroupResponse)
instance Prelude.NFData UpdateProfilingGroupResponse where
rnf :: UpdateProfilingGroupResponse -> ()
rnf UpdateProfilingGroupResponse' {Int
ProfilingGroupDescription
profilingGroup :: ProfilingGroupDescription
httpStatus :: Int
$sel:profilingGroup:UpdateProfilingGroupResponse' :: UpdateProfilingGroupResponse -> ProfilingGroupDescription
$sel:httpStatus:UpdateProfilingGroupResponse' :: UpdateProfilingGroupResponse -> 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 ProfilingGroupDescription
profilingGroup