{-# 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.DeleteLoginProfile
-- 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 password for the specified IAM user, For more information,
-- see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_admin-change-user.html Managing passwords for IAM users>.
--
-- You can use the CLI, the Amazon Web Services API, or the __Users__ page
-- in the IAM console to delete a password for any IAM user. You can use
-- ChangePassword to update, but not delete, your own password in the __My
-- Security Credentials__ page in the Amazon Web Services Management
-- Console.
--
-- Deleting a user\'s password does not prevent a user from accessing
-- Amazon Web Services through the command line interface or the API. To
-- prevent all user access, you must also either make any access keys
-- inactive or delete them. For more information about making keys inactive
-- or deleting them, see UpdateAccessKey and DeleteAccessKey.
module Amazonka.IAM.DeleteLoginProfile
  ( -- * Creating a Request
    DeleteLoginProfile (..),
    newDeleteLoginProfile,

    -- * Request Lenses
    deleteLoginProfile_userName,

    -- * Destructuring the Response
    DeleteLoginProfileResponse (..),
    newDeleteLoginProfileResponse,
  )
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:/ 'newDeleteLoginProfile' smart constructor.
data DeleteLoginProfile = DeleteLoginProfile'
  { -- | The name of the user whose password you want to delete.
    --
    -- This parameter allows (through its
    -- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
    -- consisting of upper and lowercase alphanumeric characters with no
    -- spaces. You can also include any of the following characters: _+=,.\@-
    DeleteLoginProfile -> Text
userName :: Prelude.Text
  }
  deriving (DeleteLoginProfile -> DeleteLoginProfile -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteLoginProfile -> DeleteLoginProfile -> Bool
$c/= :: DeleteLoginProfile -> DeleteLoginProfile -> Bool
== :: DeleteLoginProfile -> DeleteLoginProfile -> Bool
$c== :: DeleteLoginProfile -> DeleteLoginProfile -> Bool
Prelude.Eq, ReadPrec [DeleteLoginProfile]
ReadPrec DeleteLoginProfile
Int -> ReadS DeleteLoginProfile
ReadS [DeleteLoginProfile]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteLoginProfile]
$creadListPrec :: ReadPrec [DeleteLoginProfile]
readPrec :: ReadPrec DeleteLoginProfile
$creadPrec :: ReadPrec DeleteLoginProfile
readList :: ReadS [DeleteLoginProfile]
$creadList :: ReadS [DeleteLoginProfile]
readsPrec :: Int -> ReadS DeleteLoginProfile
$creadsPrec :: Int -> ReadS DeleteLoginProfile
Prelude.Read, Int -> DeleteLoginProfile -> ShowS
[DeleteLoginProfile] -> ShowS
DeleteLoginProfile -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteLoginProfile] -> ShowS
$cshowList :: [DeleteLoginProfile] -> ShowS
show :: DeleteLoginProfile -> String
$cshow :: DeleteLoginProfile -> String
showsPrec :: Int -> DeleteLoginProfile -> ShowS
$cshowsPrec :: Int -> DeleteLoginProfile -> ShowS
Prelude.Show, forall x. Rep DeleteLoginProfile x -> DeleteLoginProfile
forall x. DeleteLoginProfile -> Rep DeleteLoginProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteLoginProfile x -> DeleteLoginProfile
$cfrom :: forall x. DeleteLoginProfile -> Rep DeleteLoginProfile x
Prelude.Generic)

-- |
-- Create a value of 'DeleteLoginProfile' 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', 'deleteLoginProfile_userName' - The name of the user whose password you want to delete.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
newDeleteLoginProfile ::
  -- | 'userName'
  Prelude.Text ->
  DeleteLoginProfile
newDeleteLoginProfile :: Text -> DeleteLoginProfile
newDeleteLoginProfile Text
pUserName_ =
  DeleteLoginProfile' {$sel:userName:DeleteLoginProfile' :: Text
userName = Text
pUserName_}

-- | The name of the user whose password you want to delete.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
deleteLoginProfile_userName :: Lens.Lens' DeleteLoginProfile Prelude.Text
deleteLoginProfile_userName :: Lens' DeleteLoginProfile Text
deleteLoginProfile_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteLoginProfile' {Text
userName :: Text
$sel:userName:DeleteLoginProfile' :: DeleteLoginProfile -> Text
userName} -> Text
userName) (\s :: DeleteLoginProfile
s@DeleteLoginProfile' {} Text
a -> DeleteLoginProfile
s {$sel:userName:DeleteLoginProfile' :: Text
userName = Text
a} :: DeleteLoginProfile)

instance Core.AWSRequest DeleteLoginProfile where
  type
    AWSResponse DeleteLoginProfile =
      DeleteLoginProfileResponse
  request :: (Service -> Service)
-> DeleteLoginProfile -> Request DeleteLoginProfile
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 DeleteLoginProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteLoginProfile)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteLoginProfileResponse
DeleteLoginProfileResponse'

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

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

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

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

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

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

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

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