{-# 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.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 RemovePermission = RemovePermission'
{
RemovePermission -> ActionGroup
actionGroup :: ActionGroup,
RemovePermission -> Text
profilingGroupName :: Prelude.Text,
RemovePermission -> Text
revisionId :: Prelude.Text
}
deriving (RemovePermission -> RemovePermission -> Bool
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]
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
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. 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'
{ $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 :: Lens' RemovePermission ActionGroup
removePermission_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 :: Lens' RemovePermission Text
removePermission_profilingGroupName = 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 :: Lens' RemovePermission Text
removePermission_revisionId = 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 :: (Service -> Service)
-> RemovePermission -> Request RemovePermission
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy RemovePermission
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RemovePermission)))
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 -> Text -> Text -> RemovePermissionResponse
RemovePermissionResponse'
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.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"policy")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"revisionId")
)
instance Prelude.Hashable RemovePermission where
hashWithSalt :: Int -> RemovePermission -> Int
hashWithSalt Int
_salt RemovePermission' {Text
ActionGroup
revisionId :: Text
profilingGroupName :: Text
actionGroup :: ActionGroup
$sel:revisionId:RemovePermission' :: RemovePermission -> Text
$sel:profilingGroupName:RemovePermission' :: RemovePermission -> Text
$sel:actionGroup:RemovePermission' :: RemovePermission -> ActionGroup
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ActionGroup
actionGroup
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
profilingGroupName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
revisionId
instance Prelude.NFData RemovePermission where
rnf :: RemovePermission -> ()
rnf RemovePermission' {Text
ActionGroup
revisionId :: Text
profilingGroupName :: Text
actionGroup :: ActionGroup
$sel:revisionId:RemovePermission' :: RemovePermission -> Text
$sel:profilingGroupName:RemovePermission' :: RemovePermission -> Text
$sel:actionGroup:RemovePermission' :: RemovePermission -> ActionGroup
..} =
forall a. NFData a => a -> ()
Prelude.rnf ActionGroup
actionGroup
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
profilingGroupName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
revisionId
instance Data.ToHeaders RemovePermission where
toHeaders :: RemovePermission -> 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.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/profilingGroups/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
profilingGroupName,
ByteString
"/policy/",
forall a. ToByteString a => a -> ByteString
Data.toBS ActionGroup
actionGroup
]
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"revisionId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
revisionId]
data RemovePermissionResponse = RemovePermissionResponse'
{
RemovePermissionResponse -> Int
httpStatus :: Prelude.Int,
RemovePermissionResponse -> Text
policy :: Prelude.Text,
RemovePermissionResponse -> Text
revisionId :: Prelude.Text
}
deriving (RemovePermissionResponse -> RemovePermissionResponse -> Bool
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]
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
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.
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'
{ $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 :: Lens' RemovePermissionResponse Int
removePermissionResponse_httpStatus = 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 :: Lens' RemovePermissionResponse Text
removePermissionResponse_policy = 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 :: Lens' RemovePermissionResponse Text
removePermissionResponse_revisionId = 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 where
rnf :: RemovePermissionResponse -> ()
rnf RemovePermissionResponse' {Int
Text
revisionId :: Text
policy :: Text
httpStatus :: Int
$sel:revisionId:RemovePermissionResponse' :: RemovePermissionResponse -> Text
$sel:policy:RemovePermissionResponse' :: RemovePermissionResponse -> Text
$sel:httpStatus:RemovePermissionResponse' :: RemovePermissionResponse -> 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 Text
policy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
revisionId