{-# 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.PostAgentProfile
(
PostAgentProfile (..),
newPostAgentProfile,
postAgentProfile_profileToken,
postAgentProfile_agentProfile,
postAgentProfile_contentType,
postAgentProfile_profilingGroupName,
PostAgentProfileResponse (..),
newPostAgentProfileResponse,
postAgentProfileResponse_httpStatus,
)
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
data PostAgentProfile = PostAgentProfile'
{
PostAgentProfile -> Maybe Text
profileToken :: Prelude.Maybe Prelude.Text,
PostAgentProfile -> ByteString
agentProfile :: Prelude.ByteString,
PostAgentProfile -> Text
contentType :: Prelude.Text,
PostAgentProfile -> Text
profilingGroupName :: Prelude.Text
}
deriving (PostAgentProfile -> PostAgentProfile -> Bool
(PostAgentProfile -> PostAgentProfile -> Bool)
-> (PostAgentProfile -> PostAgentProfile -> Bool)
-> Eq PostAgentProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostAgentProfile -> PostAgentProfile -> Bool
$c/= :: PostAgentProfile -> PostAgentProfile -> Bool
== :: PostAgentProfile -> PostAgentProfile -> Bool
$c== :: PostAgentProfile -> PostAgentProfile -> Bool
Prelude.Eq, ReadPrec [PostAgentProfile]
ReadPrec PostAgentProfile
Int -> ReadS PostAgentProfile
ReadS [PostAgentProfile]
(Int -> ReadS PostAgentProfile)
-> ReadS [PostAgentProfile]
-> ReadPrec PostAgentProfile
-> ReadPrec [PostAgentProfile]
-> Read PostAgentProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PostAgentProfile]
$creadListPrec :: ReadPrec [PostAgentProfile]
readPrec :: ReadPrec PostAgentProfile
$creadPrec :: ReadPrec PostAgentProfile
readList :: ReadS [PostAgentProfile]
$creadList :: ReadS [PostAgentProfile]
readsPrec :: Int -> ReadS PostAgentProfile
$creadsPrec :: Int -> ReadS PostAgentProfile
Prelude.Read, Int -> PostAgentProfile -> ShowS
[PostAgentProfile] -> ShowS
PostAgentProfile -> String
(Int -> PostAgentProfile -> ShowS)
-> (PostAgentProfile -> String)
-> ([PostAgentProfile] -> ShowS)
-> Show PostAgentProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostAgentProfile] -> ShowS
$cshowList :: [PostAgentProfile] -> ShowS
show :: PostAgentProfile -> String
$cshow :: PostAgentProfile -> String
showsPrec :: Int -> PostAgentProfile -> ShowS
$cshowsPrec :: Int -> PostAgentProfile -> ShowS
Prelude.Show, (forall x. PostAgentProfile -> Rep PostAgentProfile x)
-> (forall x. Rep PostAgentProfile x -> PostAgentProfile)
-> Generic PostAgentProfile
forall x. Rep PostAgentProfile x -> PostAgentProfile
forall x. PostAgentProfile -> Rep PostAgentProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PostAgentProfile x -> PostAgentProfile
$cfrom :: forall x. PostAgentProfile -> Rep PostAgentProfile x
Prelude.Generic)
newPostAgentProfile ::
Prelude.ByteString ->
Prelude.Text ->
Prelude.Text ->
PostAgentProfile
newPostAgentProfile :: ByteString -> Text -> Text -> PostAgentProfile
newPostAgentProfile
ByteString
pAgentProfile_
Text
pContentType_
Text
pProfilingGroupName_ =
PostAgentProfile' :: Maybe Text -> ByteString -> Text -> Text -> PostAgentProfile
PostAgentProfile'
{ $sel:profileToken:PostAgentProfile' :: Maybe Text
profileToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:agentProfile:PostAgentProfile' :: ByteString
agentProfile = ByteString
pAgentProfile_,
$sel:contentType:PostAgentProfile' :: Text
contentType = Text
pContentType_,
$sel:profilingGroupName:PostAgentProfile' :: Text
profilingGroupName = Text
pProfilingGroupName_
}
postAgentProfile_profileToken :: Lens.Lens' PostAgentProfile (Prelude.Maybe Prelude.Text)
postAgentProfile_profileToken :: (Maybe Text -> f (Maybe Text))
-> PostAgentProfile -> f PostAgentProfile
postAgentProfile_profileToken = (PostAgentProfile -> Maybe Text)
-> (PostAgentProfile -> Maybe Text -> PostAgentProfile)
-> Lens PostAgentProfile PostAgentProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostAgentProfile' {Maybe Text
profileToken :: Maybe Text
$sel:profileToken:PostAgentProfile' :: PostAgentProfile -> Maybe Text
profileToken} -> Maybe Text
profileToken) (\s :: PostAgentProfile
s@PostAgentProfile' {} Maybe Text
a -> PostAgentProfile
s {$sel:profileToken:PostAgentProfile' :: Maybe Text
profileToken = Maybe Text
a} :: PostAgentProfile)
postAgentProfile_agentProfile :: Lens.Lens' PostAgentProfile Prelude.ByteString
postAgentProfile_agentProfile :: (ByteString -> f ByteString)
-> PostAgentProfile -> f PostAgentProfile
postAgentProfile_agentProfile = (PostAgentProfile -> ByteString)
-> (PostAgentProfile -> ByteString -> PostAgentProfile)
-> Lens PostAgentProfile PostAgentProfile ByteString ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostAgentProfile' {ByteString
agentProfile :: ByteString
$sel:agentProfile:PostAgentProfile' :: PostAgentProfile -> ByteString
agentProfile} -> ByteString
agentProfile) (\s :: PostAgentProfile
s@PostAgentProfile' {} ByteString
a -> PostAgentProfile
s {$sel:agentProfile:PostAgentProfile' :: ByteString
agentProfile = ByteString
a} :: PostAgentProfile)
postAgentProfile_contentType :: Lens.Lens' PostAgentProfile Prelude.Text
postAgentProfile_contentType :: (Text -> f Text) -> PostAgentProfile -> f PostAgentProfile
postAgentProfile_contentType = (PostAgentProfile -> Text)
-> (PostAgentProfile -> Text -> PostAgentProfile)
-> Lens PostAgentProfile PostAgentProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostAgentProfile' {Text
contentType :: Text
$sel:contentType:PostAgentProfile' :: PostAgentProfile -> Text
contentType} -> Text
contentType) (\s :: PostAgentProfile
s@PostAgentProfile' {} Text
a -> PostAgentProfile
s {$sel:contentType:PostAgentProfile' :: Text
contentType = Text
a} :: PostAgentProfile)
postAgentProfile_profilingGroupName :: Lens.Lens' PostAgentProfile Prelude.Text
postAgentProfile_profilingGroupName :: (Text -> f Text) -> PostAgentProfile -> f PostAgentProfile
postAgentProfile_profilingGroupName = (PostAgentProfile -> Text)
-> (PostAgentProfile -> Text -> PostAgentProfile)
-> Lens PostAgentProfile PostAgentProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostAgentProfile' {Text
profilingGroupName :: Text
$sel:profilingGroupName:PostAgentProfile' :: PostAgentProfile -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: PostAgentProfile
s@PostAgentProfile' {} Text
a -> PostAgentProfile
s {$sel:profilingGroupName:PostAgentProfile' :: Text
profilingGroupName = Text
a} :: PostAgentProfile)
instance Core.AWSRequest PostAgentProfile where
type
AWSResponse PostAgentProfile =
PostAgentProfileResponse
request :: PostAgentProfile -> Request PostAgentProfile
request = Service -> PostAgentProfile -> Request PostAgentProfile
forall a. (ToRequest a, ToBody a) => Service -> a -> Request a
Request.postBody Service
defaultService
response :: Logger
-> Service
-> Proxy PostAgentProfile
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PostAgentProfile)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PostAgentProfile))
-> Logger
-> Service
-> Proxy PostAgentProfile
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PostAgentProfile)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PostAgentProfileResponse
PostAgentProfileResponse'
(Int -> PostAgentProfileResponse)
-> Either String Int -> Either String PostAgentProfileResponse
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))
)
instance Prelude.Hashable PostAgentProfile
instance Prelude.NFData PostAgentProfile
instance Core.ToBody PostAgentProfile where
toBody :: PostAgentProfile -> RequestBody
toBody PostAgentProfile' {Maybe Text
ByteString
Text
profilingGroupName :: Text
contentType :: Text
agentProfile :: ByteString
profileToken :: Maybe Text
$sel:profilingGroupName:PostAgentProfile' :: PostAgentProfile -> Text
$sel:contentType:PostAgentProfile' :: PostAgentProfile -> Text
$sel:agentProfile:PostAgentProfile' :: PostAgentProfile -> ByteString
$sel:profileToken:PostAgentProfile' :: PostAgentProfile -> Maybe Text
..} =
ByteString -> RequestBody
forall a. ToBody a => a -> RequestBody
Core.toBody ByteString
agentProfile
instance Core.ToHeaders PostAgentProfile where
toHeaders :: PostAgentProfile -> ResponseHeaders
toHeaders PostAgentProfile' {Maybe Text
ByteString
Text
profilingGroupName :: Text
contentType :: Text
agentProfile :: ByteString
profileToken :: Maybe Text
$sel:profilingGroupName:PostAgentProfile' :: PostAgentProfile -> Text
$sel:contentType:PostAgentProfile' :: PostAgentProfile -> Text
$sel:agentProfile:PostAgentProfile' :: PostAgentProfile -> ByteString
$sel:profileToken:PostAgentProfile' :: PostAgentProfile -> Maybe Text
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[HeaderName
"Content-Type" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
contentType]
instance Core.ToPath PostAgentProfile where
toPath :: PostAgentProfile -> ByteString
toPath PostAgentProfile' {Maybe Text
ByteString
Text
profilingGroupName :: Text
contentType :: Text
agentProfile :: ByteString
profileToken :: Maybe Text
$sel:profilingGroupName:PostAgentProfile' :: PostAgentProfile -> Text
$sel:contentType:PostAgentProfile' :: PostAgentProfile -> Text
$sel:agentProfile:PostAgentProfile' :: PostAgentProfile -> ByteString
$sel:profileToken:PostAgentProfile' :: PostAgentProfile -> 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
"/agentProfile"
]
instance Core.ToQuery PostAgentProfile where
toQuery :: PostAgentProfile -> QueryString
toQuery PostAgentProfile' {Maybe Text
ByteString
Text
profilingGroupName :: Text
contentType :: Text
agentProfile :: ByteString
profileToken :: Maybe Text
$sel:profilingGroupName:PostAgentProfile' :: PostAgentProfile -> Text
$sel:contentType:PostAgentProfile' :: PostAgentProfile -> Text
$sel:agentProfile:PostAgentProfile' :: PostAgentProfile -> ByteString
$sel:profileToken:PostAgentProfile' :: PostAgentProfile -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"profileToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
profileToken]
data PostAgentProfileResponse = PostAgentProfileResponse'
{
PostAgentProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PostAgentProfileResponse -> PostAgentProfileResponse -> Bool
(PostAgentProfileResponse -> PostAgentProfileResponse -> Bool)
-> (PostAgentProfileResponse -> PostAgentProfileResponse -> Bool)
-> Eq PostAgentProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostAgentProfileResponse -> PostAgentProfileResponse -> Bool
$c/= :: PostAgentProfileResponse -> PostAgentProfileResponse -> Bool
== :: PostAgentProfileResponse -> PostAgentProfileResponse -> Bool
$c== :: PostAgentProfileResponse -> PostAgentProfileResponse -> Bool
Prelude.Eq, ReadPrec [PostAgentProfileResponse]
ReadPrec PostAgentProfileResponse
Int -> ReadS PostAgentProfileResponse
ReadS [PostAgentProfileResponse]
(Int -> ReadS PostAgentProfileResponse)
-> ReadS [PostAgentProfileResponse]
-> ReadPrec PostAgentProfileResponse
-> ReadPrec [PostAgentProfileResponse]
-> Read PostAgentProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PostAgentProfileResponse]
$creadListPrec :: ReadPrec [PostAgentProfileResponse]
readPrec :: ReadPrec PostAgentProfileResponse
$creadPrec :: ReadPrec PostAgentProfileResponse
readList :: ReadS [PostAgentProfileResponse]
$creadList :: ReadS [PostAgentProfileResponse]
readsPrec :: Int -> ReadS PostAgentProfileResponse
$creadsPrec :: Int -> ReadS PostAgentProfileResponse
Prelude.Read, Int -> PostAgentProfileResponse -> ShowS
[PostAgentProfileResponse] -> ShowS
PostAgentProfileResponse -> String
(Int -> PostAgentProfileResponse -> ShowS)
-> (PostAgentProfileResponse -> String)
-> ([PostAgentProfileResponse] -> ShowS)
-> Show PostAgentProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostAgentProfileResponse] -> ShowS
$cshowList :: [PostAgentProfileResponse] -> ShowS
show :: PostAgentProfileResponse -> String
$cshow :: PostAgentProfileResponse -> String
showsPrec :: Int -> PostAgentProfileResponse -> ShowS
$cshowsPrec :: Int -> PostAgentProfileResponse -> ShowS
Prelude.Show, (forall x.
PostAgentProfileResponse -> Rep PostAgentProfileResponse x)
-> (forall x.
Rep PostAgentProfileResponse x -> PostAgentProfileResponse)
-> Generic PostAgentProfileResponse
forall x.
Rep PostAgentProfileResponse x -> PostAgentProfileResponse
forall x.
PostAgentProfileResponse -> Rep PostAgentProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PostAgentProfileResponse x -> PostAgentProfileResponse
$cfrom :: forall x.
PostAgentProfileResponse -> Rep PostAgentProfileResponse x
Prelude.Generic)
newPostAgentProfileResponse ::
Prelude.Int ->
PostAgentProfileResponse
newPostAgentProfileResponse :: Int -> PostAgentProfileResponse
newPostAgentProfileResponse Int
pHttpStatus_ =
PostAgentProfileResponse' :: Int -> PostAgentProfileResponse
PostAgentProfileResponse'
{ $sel:httpStatus:PostAgentProfileResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
postAgentProfileResponse_httpStatus :: Lens.Lens' PostAgentProfileResponse Prelude.Int
postAgentProfileResponse_httpStatus :: (Int -> f Int)
-> PostAgentProfileResponse -> f PostAgentProfileResponse
postAgentProfileResponse_httpStatus = (PostAgentProfileResponse -> Int)
-> (PostAgentProfileResponse -> Int -> PostAgentProfileResponse)
-> Lens PostAgentProfileResponse PostAgentProfileResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostAgentProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:PostAgentProfileResponse' :: PostAgentProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PostAgentProfileResponse
s@PostAgentProfileResponse' {} Int
a -> PostAgentProfileResponse
s {$sel:httpStatus:PostAgentProfileResponse' :: Int
httpStatus = Int
a} :: PostAgentProfileResponse)
instance Prelude.NFData PostAgentProfileResponse