{-# 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.IAM.DeleteRolePermissionsBoundary
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the permissions boundary for the specified IAM role.
--
-- Deleting the permissions boundary for a role might increase its
-- permissions. For example, it might allow anyone who assumes the role to
-- perform all the actions granted in its permissions policies.
module Amazonka.IAM.DeleteRolePermissionsBoundary
  ( -- * Creating a Request
    DeleteRolePermissionsBoundary (..),
    newDeleteRolePermissionsBoundary,

    -- * Request Lenses
    deleteRolePermissionsBoundary_roleName,

    -- * Destructuring the Response
    DeleteRolePermissionsBoundaryResponse (..),
    newDeleteRolePermissionsBoundaryResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IAM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDeleteRolePermissionsBoundary' smart constructor.
data DeleteRolePermissionsBoundary = DeleteRolePermissionsBoundary'
  { -- | The name (friendly name, not ARN) of the IAM role from which you want to
    -- remove the permissions boundary.
    DeleteRolePermissionsBoundary -> Text
roleName :: Prelude.Text
  }
  deriving (DeleteRolePermissionsBoundary
-> DeleteRolePermissionsBoundary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRolePermissionsBoundary
-> DeleteRolePermissionsBoundary -> Bool
$c/= :: DeleteRolePermissionsBoundary
-> DeleteRolePermissionsBoundary -> Bool
== :: DeleteRolePermissionsBoundary
-> DeleteRolePermissionsBoundary -> Bool
$c== :: DeleteRolePermissionsBoundary
-> DeleteRolePermissionsBoundary -> Bool
Prelude.Eq, ReadPrec [DeleteRolePermissionsBoundary]
ReadPrec DeleteRolePermissionsBoundary
Int -> ReadS DeleteRolePermissionsBoundary
ReadS [DeleteRolePermissionsBoundary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRolePermissionsBoundary]
$creadListPrec :: ReadPrec [DeleteRolePermissionsBoundary]
readPrec :: ReadPrec DeleteRolePermissionsBoundary
$creadPrec :: ReadPrec DeleteRolePermissionsBoundary
readList :: ReadS [DeleteRolePermissionsBoundary]
$creadList :: ReadS [DeleteRolePermissionsBoundary]
readsPrec :: Int -> ReadS DeleteRolePermissionsBoundary
$creadsPrec :: Int -> ReadS DeleteRolePermissionsBoundary
Prelude.Read, Int -> DeleteRolePermissionsBoundary -> ShowS
[DeleteRolePermissionsBoundary] -> ShowS
DeleteRolePermissionsBoundary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRolePermissionsBoundary] -> ShowS
$cshowList :: [DeleteRolePermissionsBoundary] -> ShowS
show :: DeleteRolePermissionsBoundary -> String
$cshow :: DeleteRolePermissionsBoundary -> String
showsPrec :: Int -> DeleteRolePermissionsBoundary -> ShowS
$cshowsPrec :: Int -> DeleteRolePermissionsBoundary -> ShowS
Prelude.Show, forall x.
Rep DeleteRolePermissionsBoundary x
-> DeleteRolePermissionsBoundary
forall x.
DeleteRolePermissionsBoundary
-> Rep DeleteRolePermissionsBoundary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRolePermissionsBoundary x
-> DeleteRolePermissionsBoundary
$cfrom :: forall x.
DeleteRolePermissionsBoundary
-> Rep DeleteRolePermissionsBoundary x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRolePermissionsBoundary' 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:
--
-- 'roleName', 'deleteRolePermissionsBoundary_roleName' - The name (friendly name, not ARN) of the IAM role from which you want to
-- remove the permissions boundary.
newDeleteRolePermissionsBoundary ::
  -- | 'roleName'
  Prelude.Text ->
  DeleteRolePermissionsBoundary
newDeleteRolePermissionsBoundary :: Text -> DeleteRolePermissionsBoundary
newDeleteRolePermissionsBoundary Text
pRoleName_ =
  DeleteRolePermissionsBoundary'
    { $sel:roleName:DeleteRolePermissionsBoundary' :: Text
roleName =
        Text
pRoleName_
    }

-- | The name (friendly name, not ARN) of the IAM role from which you want to
-- remove the permissions boundary.
deleteRolePermissionsBoundary_roleName :: Lens.Lens' DeleteRolePermissionsBoundary Prelude.Text
deleteRolePermissionsBoundary_roleName :: Lens' DeleteRolePermissionsBoundary Text
deleteRolePermissionsBoundary_roleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRolePermissionsBoundary' {Text
roleName :: Text
$sel:roleName:DeleteRolePermissionsBoundary' :: DeleteRolePermissionsBoundary -> Text
roleName} -> Text
roleName) (\s :: DeleteRolePermissionsBoundary
s@DeleteRolePermissionsBoundary' {} Text
a -> DeleteRolePermissionsBoundary
s {$sel:roleName:DeleteRolePermissionsBoundary' :: Text
roleName = Text
a} :: DeleteRolePermissionsBoundary)

instance
  Core.AWSRequest
    DeleteRolePermissionsBoundary
  where
  type
    AWSResponse DeleteRolePermissionsBoundary =
      DeleteRolePermissionsBoundaryResponse
  request :: (Service -> Service)
-> DeleteRolePermissionsBoundary
-> Request DeleteRolePermissionsBoundary
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteRolePermissionsBoundary
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteRolePermissionsBoundary)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      DeleteRolePermissionsBoundaryResponse
DeleteRolePermissionsBoundaryResponse'

instance
  Prelude.Hashable
    DeleteRolePermissionsBoundary
  where
  hashWithSalt :: Int -> DeleteRolePermissionsBoundary -> Int
hashWithSalt Int
_salt DeleteRolePermissionsBoundary' {Text
roleName :: Text
$sel:roleName:DeleteRolePermissionsBoundary' :: DeleteRolePermissionsBoundary -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleName

instance Prelude.NFData DeleteRolePermissionsBoundary where
  rnf :: DeleteRolePermissionsBoundary -> ()
rnf DeleteRolePermissionsBoundary' {Text
roleName :: Text
$sel:roleName:DeleteRolePermissionsBoundary' :: DeleteRolePermissionsBoundary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
roleName

instance Data.ToHeaders DeleteRolePermissionsBoundary where
  toHeaders :: DeleteRolePermissionsBoundary -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToPath DeleteRolePermissionsBoundary where
  toPath :: DeleteRolePermissionsBoundary -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DeleteRolePermissionsBoundary where
  toQuery :: DeleteRolePermissionsBoundary -> QueryString
toQuery DeleteRolePermissionsBoundary' {Text
roleName :: Text
$sel:roleName:DeleteRolePermissionsBoundary' :: DeleteRolePermissionsBoundary -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DeleteRolePermissionsBoundary" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"RoleName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
roleName
      ]

-- | /See:/ 'newDeleteRolePermissionsBoundaryResponse' smart constructor.
data DeleteRolePermissionsBoundaryResponse = DeleteRolePermissionsBoundaryResponse'
  {
  }
  deriving (DeleteRolePermissionsBoundaryResponse
-> DeleteRolePermissionsBoundaryResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRolePermissionsBoundaryResponse
-> DeleteRolePermissionsBoundaryResponse -> Bool
$c/= :: DeleteRolePermissionsBoundaryResponse
-> DeleteRolePermissionsBoundaryResponse -> Bool
== :: DeleteRolePermissionsBoundaryResponse
-> DeleteRolePermissionsBoundaryResponse -> Bool
$c== :: DeleteRolePermissionsBoundaryResponse
-> DeleteRolePermissionsBoundaryResponse -> Bool
Prelude.Eq, ReadPrec [DeleteRolePermissionsBoundaryResponse]
ReadPrec DeleteRolePermissionsBoundaryResponse
Int -> ReadS DeleteRolePermissionsBoundaryResponse
ReadS [DeleteRolePermissionsBoundaryResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRolePermissionsBoundaryResponse]
$creadListPrec :: ReadPrec [DeleteRolePermissionsBoundaryResponse]
readPrec :: ReadPrec DeleteRolePermissionsBoundaryResponse
$creadPrec :: ReadPrec DeleteRolePermissionsBoundaryResponse
readList :: ReadS [DeleteRolePermissionsBoundaryResponse]
$creadList :: ReadS [DeleteRolePermissionsBoundaryResponse]
readsPrec :: Int -> ReadS DeleteRolePermissionsBoundaryResponse
$creadsPrec :: Int -> ReadS DeleteRolePermissionsBoundaryResponse
Prelude.Read, Int -> DeleteRolePermissionsBoundaryResponse -> ShowS
[DeleteRolePermissionsBoundaryResponse] -> ShowS
DeleteRolePermissionsBoundaryResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRolePermissionsBoundaryResponse] -> ShowS
$cshowList :: [DeleteRolePermissionsBoundaryResponse] -> ShowS
show :: DeleteRolePermissionsBoundaryResponse -> String
$cshow :: DeleteRolePermissionsBoundaryResponse -> String
showsPrec :: Int -> DeleteRolePermissionsBoundaryResponse -> ShowS
$cshowsPrec :: Int -> DeleteRolePermissionsBoundaryResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteRolePermissionsBoundaryResponse x
-> DeleteRolePermissionsBoundaryResponse
forall x.
DeleteRolePermissionsBoundaryResponse
-> Rep DeleteRolePermissionsBoundaryResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRolePermissionsBoundaryResponse x
-> DeleteRolePermissionsBoundaryResponse
$cfrom :: forall x.
DeleteRolePermissionsBoundaryResponse
-> Rep DeleteRolePermissionsBoundaryResponse x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRolePermissionsBoundaryResponse' 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.
newDeleteRolePermissionsBoundaryResponse ::
  DeleteRolePermissionsBoundaryResponse
newDeleteRolePermissionsBoundaryResponse :: DeleteRolePermissionsBoundaryResponse
newDeleteRolePermissionsBoundaryResponse =
  DeleteRolePermissionsBoundaryResponse
DeleteRolePermissionsBoundaryResponse'

instance
  Prelude.NFData
    DeleteRolePermissionsBoundaryResponse
  where
  rnf :: DeleteRolePermissionsBoundaryResponse -> ()
rnf DeleteRolePermissionsBoundaryResponse
_ = ()