{-# 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.RemovePermission
(
RemovePermission (..),
newRemovePermission,
removePermission_actionGroup,
removePermission_profilingGroupName,
removePermission_revisionId,
RemovePermissionResponse (..),
newRemovePermissionResponse,
removePermissionResponse_httpStatus,
removePermissionResponse_policy,
removePermissionResponse_revisionId,
)
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 RemovePermission = RemovePermission'
{
RemovePermission -> ActionGroup
actionGroup :: ActionGroup,
RemovePermission -> Text
profilingGroupName :: Prelude.Text,
RemovePermission -> Text
revisionId :: Prelude.Text
}
deriving (RemovePermission -> RemovePermission -> Bool
(RemovePermission -> RemovePermission -> Bool)
-> (RemovePermission -> RemovePermission -> Bool)
-> Eq RemovePermission
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemovePermission -> RemovePermission -> Bool
$c/= :: RemovePermission -> RemovePermission -> Bool
== :: RemovePermission -> RemovePermission -> Bool
$c== :: RemovePermission -> RemovePermission -> Bool
Prelude.Eq, ReadPrec [RemovePermission]
ReadPrec RemovePermission
Int -> ReadS RemovePermission
ReadS [RemovePermission]
(Int -> ReadS RemovePermission)
-> ReadS [RemovePermission]
-> ReadPrec RemovePermission
-> ReadPrec [RemovePermission]
-> Read RemovePermission
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemovePermission]
$creadListPrec :: ReadPrec [RemovePermission]
readPrec :: ReadPrec RemovePermission
$creadPrec :: ReadPrec RemovePermission
readList :: ReadS [RemovePermission]
$creadList :: ReadS [RemovePermission]
readsPrec :: Int -> ReadS RemovePermission
$creadsPrec :: Int -> ReadS RemovePermission
Prelude.Read, Int -> RemovePermission -> ShowS
[RemovePermission] -> ShowS
RemovePermission -> String
(Int -> RemovePermission -> ShowS)
-> (RemovePermission -> String)
-> ([RemovePermission] -> ShowS)
-> Show RemovePermission
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemovePermission] -> ShowS
$cshowList :: [RemovePermission] -> ShowS
show :: RemovePermission -> String
$cshow :: RemovePermission -> String
showsPrec :: Int -> RemovePermission -> ShowS
$cshowsPrec :: Int -> RemovePermission -> ShowS
Prelude.Show, (forall x. RemovePermission -> Rep RemovePermission x)
-> (forall x. Rep RemovePermission x -> RemovePermission)
-> Generic RemovePermission
forall x. Rep RemovePermission x -> RemovePermission
forall x. RemovePermission -> Rep RemovePermission x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemovePermission x -> RemovePermission
$cfrom :: forall x. RemovePermission -> Rep RemovePermission x
Prelude.Generic)
newRemovePermission ::
ActionGroup ->
Prelude.Text ->
Prelude.Text ->
RemovePermission
newRemovePermission :: ActionGroup -> Text -> Text -> RemovePermission
newRemovePermission
ActionGroup
pActionGroup_
Text
pProfilingGroupName_
Text
pRevisionId_ =
RemovePermission' :: ActionGroup -> Text -> Text -> RemovePermission
RemovePermission'
{ $sel:actionGroup:RemovePermission' :: ActionGroup
actionGroup = ActionGroup
pActionGroup_,
$sel:profilingGroupName:RemovePermission' :: Text
profilingGroupName = Text
pProfilingGroupName_,
$sel:revisionId:RemovePermission' :: Text
revisionId = Text
pRevisionId_
}
removePermission_actionGroup :: Lens.Lens' RemovePermission ActionGroup
removePermission_actionGroup :: (ActionGroup -> f ActionGroup)
-> RemovePermission -> f RemovePermission
removePermission_actionGroup = (RemovePermission -> ActionGroup)
-> (RemovePermission -> ActionGroup -> RemovePermission)
-> Lens RemovePermission RemovePermission ActionGroup ActionGroup
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemovePermission' {ActionGroup
actionGroup :: ActionGroup
$sel:actionGroup:RemovePermission' :: RemovePermission -> ActionGroup
actionGroup} -> ActionGroup
actionGroup) (\s :: RemovePermission
s@RemovePermission' {} ActionGroup
a -> RemovePermission
s {$sel:actionGroup:RemovePermission' :: ActionGroup
actionGroup = ActionGroup
a} :: RemovePermission)
removePermission_profilingGroupName :: Lens.Lens' RemovePermission Prelude.Text
removePermission_profilingGroupName :: (Text -> f Text) -> RemovePermission -> f RemovePermission
removePermission_profilingGroupName = (RemovePermission -> Text)
-> (RemovePermission -> Text -> RemovePermission)
-> Lens RemovePermission RemovePermission Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemovePermission' {Text
profilingGroupName :: Text
$sel:profilingGroupName:RemovePermission' :: RemovePermission -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: RemovePermission
s@RemovePermission' {} Text
a -> RemovePermission
s {$sel:profilingGroupName:RemovePermission' :: Text
profilingGroupName = Text
a} :: RemovePermission)
removePermission_revisionId :: Lens.Lens' RemovePermission Prelude.Text
removePermission_revisionId :: (Text -> f Text) -> RemovePermission -> f RemovePermission
removePermission_revisionId = (RemovePermission -> Text)
-> (RemovePermission -> Text -> RemovePermission)
-> Lens RemovePermission RemovePermission Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemovePermission' {Text
revisionId :: Text
$sel:revisionId:RemovePermission' :: RemovePermission -> Text
revisionId} -> Text
revisionId) (\s :: RemovePermission
s@RemovePermission' {} Text
a -> RemovePermission
s {$sel:revisionId:RemovePermission' :: Text
revisionId = Text
a} :: RemovePermission)
instance Core.AWSRequest RemovePermission where
type
AWSResponse RemovePermission =
RemovePermissionResponse
request :: RemovePermission -> Request RemovePermission
request = Service -> RemovePermission -> Request RemovePermission
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy RemovePermission
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RemovePermission)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RemovePermission))
-> Logger
-> Service
-> Proxy RemovePermission
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RemovePermission)))
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 -> Text -> Text -> RemovePermissionResponse
RemovePermissionResponse'
(Int -> Text -> Text -> RemovePermissionResponse)
-> Either String Int
-> Either String (Text -> Text -> RemovePermissionResponse)
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 (Text -> Text -> RemovePermissionResponse)
-> Either String Text
-> Either String (Text -> RemovePermissionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"policy")
Either String (Text -> RemovePermissionResponse)
-> Either String Text -> Either String RemovePermissionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"revisionId")
)
instance Prelude.Hashable RemovePermission
instance Prelude.NFData RemovePermission
instance Core.ToHeaders RemovePermission where
toHeaders :: RemovePermission -> ResponseHeaders
toHeaders =
ResponseHeaders -> RemovePermission -> 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.ToPath RemovePermission where
toPath :: RemovePermission -> ByteString
toPath RemovePermission' {Text
ActionGroup
revisionId :: Text
profilingGroupName :: Text
actionGroup :: ActionGroup
$sel:revisionId:RemovePermission' :: RemovePermission -> Text
$sel:profilingGroupName:RemovePermission' :: RemovePermission -> Text
$sel:actionGroup:RemovePermission' :: RemovePermission -> ActionGroup
..} =
[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
"/policy/",
ActionGroup -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ActionGroup
actionGroup
]
instance Core.ToQuery RemovePermission where
toQuery :: RemovePermission -> QueryString
toQuery RemovePermission' {Text
ActionGroup
revisionId :: Text
profilingGroupName :: Text
actionGroup :: ActionGroup
$sel:revisionId:RemovePermission' :: RemovePermission -> Text
$sel:profilingGroupName:RemovePermission' :: RemovePermission -> Text
$sel:actionGroup:RemovePermission' :: RemovePermission -> ActionGroup
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"revisionId" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
revisionId]
data RemovePermissionResponse = RemovePermissionResponse'
{
RemovePermissionResponse -> Int
httpStatus :: Prelude.Int,
RemovePermissionResponse -> Text
policy :: Prelude.Text,
RemovePermissionResponse -> Text
revisionId :: Prelude.Text
}
deriving (RemovePermissionResponse -> RemovePermissionResponse -> Bool
(RemovePermissionResponse -> RemovePermissionResponse -> Bool)
-> (RemovePermissionResponse -> RemovePermissionResponse -> Bool)
-> Eq RemovePermissionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemovePermissionResponse -> RemovePermissionResponse -> Bool
$c/= :: RemovePermissionResponse -> RemovePermissionResponse -> Bool
== :: RemovePermissionResponse -> RemovePermissionResponse -> Bool
$c== :: RemovePermissionResponse -> RemovePermissionResponse -> Bool
Prelude.Eq, ReadPrec [RemovePermissionResponse]
ReadPrec RemovePermissionResponse
Int -> ReadS RemovePermissionResponse
ReadS [RemovePermissionResponse]
(Int -> ReadS RemovePermissionResponse)
-> ReadS [RemovePermissionResponse]
-> ReadPrec RemovePermissionResponse
-> ReadPrec [RemovePermissionResponse]
-> Read RemovePermissionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemovePermissionResponse]
$creadListPrec :: ReadPrec [RemovePermissionResponse]
readPrec :: ReadPrec RemovePermissionResponse
$creadPrec :: ReadPrec RemovePermissionResponse
readList :: ReadS [RemovePermissionResponse]
$creadList :: ReadS [RemovePermissionResponse]
readsPrec :: Int -> ReadS RemovePermissionResponse
$creadsPrec :: Int -> ReadS RemovePermissionResponse
Prelude.Read, Int -> RemovePermissionResponse -> ShowS
[RemovePermissionResponse] -> ShowS
RemovePermissionResponse -> String
(Int -> RemovePermissionResponse -> ShowS)
-> (RemovePermissionResponse -> String)
-> ([RemovePermissionResponse] -> ShowS)
-> Show RemovePermissionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemovePermissionResponse] -> ShowS
$cshowList :: [RemovePermissionResponse] -> ShowS
show :: RemovePermissionResponse -> String
$cshow :: RemovePermissionResponse -> String
showsPrec :: Int -> RemovePermissionResponse -> ShowS
$cshowsPrec :: Int -> RemovePermissionResponse -> ShowS
Prelude.Show, (forall x.
RemovePermissionResponse -> Rep RemovePermissionResponse x)
-> (forall x.
Rep RemovePermissionResponse x -> RemovePermissionResponse)
-> Generic RemovePermissionResponse
forall x.
Rep RemovePermissionResponse x -> RemovePermissionResponse
forall x.
RemovePermissionResponse -> Rep RemovePermissionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemovePermissionResponse x -> RemovePermissionResponse
$cfrom :: forall x.
RemovePermissionResponse -> Rep RemovePermissionResponse x
Prelude.Generic)
newRemovePermissionResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
RemovePermissionResponse
newRemovePermissionResponse :: Int -> Text -> Text -> RemovePermissionResponse
newRemovePermissionResponse
Int
pHttpStatus_
Text
pPolicy_
Text
pRevisionId_ =
RemovePermissionResponse' :: Int -> Text -> Text -> RemovePermissionResponse
RemovePermissionResponse'
{ $sel:httpStatus:RemovePermissionResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:policy:RemovePermissionResponse' :: Text
policy = Text
pPolicy_,
$sel:revisionId:RemovePermissionResponse' :: Text
revisionId = Text
pRevisionId_
}
removePermissionResponse_httpStatus :: Lens.Lens' RemovePermissionResponse Prelude.Int
removePermissionResponse_httpStatus :: (Int -> f Int)
-> RemovePermissionResponse -> f RemovePermissionResponse
removePermissionResponse_httpStatus = (RemovePermissionResponse -> Int)
-> (RemovePermissionResponse -> Int -> RemovePermissionResponse)
-> Lens RemovePermissionResponse RemovePermissionResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemovePermissionResponse' {Int
httpStatus :: Int
$sel:httpStatus:RemovePermissionResponse' :: RemovePermissionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RemovePermissionResponse
s@RemovePermissionResponse' {} Int
a -> RemovePermissionResponse
s {$sel:httpStatus:RemovePermissionResponse' :: Int
httpStatus = Int
a} :: RemovePermissionResponse)
removePermissionResponse_policy :: Lens.Lens' RemovePermissionResponse Prelude.Text
removePermissionResponse_policy :: (Text -> f Text)
-> RemovePermissionResponse -> f RemovePermissionResponse
removePermissionResponse_policy = (RemovePermissionResponse -> Text)
-> (RemovePermissionResponse -> Text -> RemovePermissionResponse)
-> Lens RemovePermissionResponse RemovePermissionResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemovePermissionResponse' {Text
policy :: Text
$sel:policy:RemovePermissionResponse' :: RemovePermissionResponse -> Text
policy} -> Text
policy) (\s :: RemovePermissionResponse
s@RemovePermissionResponse' {} Text
a -> RemovePermissionResponse
s {$sel:policy:RemovePermissionResponse' :: Text
policy = Text
a} :: RemovePermissionResponse)
removePermissionResponse_revisionId :: Lens.Lens' RemovePermissionResponse Prelude.Text
removePermissionResponse_revisionId :: (Text -> f Text)
-> RemovePermissionResponse -> f RemovePermissionResponse
removePermissionResponse_revisionId = (RemovePermissionResponse -> Text)
-> (RemovePermissionResponse -> Text -> RemovePermissionResponse)
-> Lens RemovePermissionResponse RemovePermissionResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemovePermissionResponse' {Text
revisionId :: Text
$sel:revisionId:RemovePermissionResponse' :: RemovePermissionResponse -> Text
revisionId} -> Text
revisionId) (\s :: RemovePermissionResponse
s@RemovePermissionResponse' {} Text
a -> RemovePermissionResponse
s {$sel:revisionId:RemovePermissionResponse' :: Text
revisionId = Text
a} :: RemovePermissionResponse)
instance Prelude.NFData RemovePermissionResponse