{-# 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.DeleteUserPermissionsBoundary
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Deletes the permissions boundary for the specified IAM user.
--
-- Deleting the permissions boundary for a user might increase its
-- permissions by allowing the user to perform all the actions granted in
-- its permissions policies.
module Amazonka.IAM.DeleteUserPermissionsBoundary
  ( -- * Creating a Request
    DeleteUserPermissionsBoundary (..),
    newDeleteUserPermissionsBoundary,

    -- * Request Lenses
    deleteUserPermissionsBoundary_userName,

    -- * Destructuring the Response
    DeleteUserPermissionsBoundaryResponse (..),
    newDeleteUserPermissionsBoundaryResponse,
  )
where

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

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

-- |
-- Create a value of 'DeleteUserPermissionsBoundary' 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:
--
-- 'userName', 'deleteUserPermissionsBoundary_userName' - The name (friendly name, not ARN) of the IAM user from which you want to
-- remove the permissions boundary.
newDeleteUserPermissionsBoundary ::
  -- | 'userName'
  Prelude.Text ->
  DeleteUserPermissionsBoundary
newDeleteUserPermissionsBoundary :: Text -> DeleteUserPermissionsBoundary
newDeleteUserPermissionsBoundary Text
pUserName_ =
  DeleteUserPermissionsBoundary' :: Text -> DeleteUserPermissionsBoundary
DeleteUserPermissionsBoundary'
    { $sel:userName:DeleteUserPermissionsBoundary' :: Text
userName =
        Text
pUserName_
    }

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

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

instance
  Prelude.Hashable
    DeleteUserPermissionsBoundary

instance Prelude.NFData DeleteUserPermissionsBoundary

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

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

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

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

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

instance
  Prelude.NFData
    DeleteUserPermissionsBoundaryResponse