{-# 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-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 password for the specified IAM user, which terminates the
-- user\'s ability to access Amazon Web Services services through the
-- Amazon Web Services Management Console.
--
-- 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 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:/ '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
(DeleteLoginProfile -> DeleteLoginProfile -> Bool)
-> (DeleteLoginProfile -> DeleteLoginProfile -> Bool)
-> Eq DeleteLoginProfile
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]
(Int -> ReadS DeleteLoginProfile)
-> ReadS [DeleteLoginProfile]
-> ReadPrec DeleteLoginProfile
-> ReadPrec [DeleteLoginProfile]
-> Read 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
(Int -> DeleteLoginProfile -> ShowS)
-> (DeleteLoginProfile -> String)
-> ([DeleteLoginProfile] -> ShowS)
-> Show DeleteLoginProfile
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. DeleteLoginProfile -> Rep DeleteLoginProfile x)
-> (forall x. Rep DeleteLoginProfile x -> DeleteLoginProfile)
-> Generic DeleteLoginProfile
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' :: Text -> DeleteLoginProfile
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 :: (Text -> f Text) -> DeleteLoginProfile -> f DeleteLoginProfile
deleteLoginProfile_userName = (DeleteLoginProfile -> Text)
-> (DeleteLoginProfile -> Text -> DeleteLoginProfile)
-> Lens DeleteLoginProfile DeleteLoginProfile Text Text
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 :: DeleteLoginProfile -> Request DeleteLoginProfile
request = Service -> DeleteLoginProfile -> Request DeleteLoginProfile
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteLoginProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteLoginProfile)))
response =
    AWSResponse DeleteLoginProfile
-> Logger
-> Service
-> Proxy DeleteLoginProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteLoginProfile)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteLoginProfile
DeleteLoginProfileResponse
DeleteLoginProfileResponse'

instance Prelude.Hashable DeleteLoginProfile

instance Prelude.NFData DeleteLoginProfile

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

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

instance Core.ToQuery DeleteLoginProfile where
  toQuery :: DeleteLoginProfile -> QueryString
toQuery DeleteLoginProfile' {Text
userName :: Text
$sel:userName:DeleteLoginProfile' :: DeleteLoginProfile -> 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
"DeleteLoginProfile" :: 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:/ 'newDeleteLoginProfileResponse' smart constructor.
data DeleteLoginProfileResponse = DeleteLoginProfileResponse'
  {
  }
  deriving (DeleteLoginProfileResponse -> DeleteLoginProfileResponse -> Bool
(DeleteLoginProfileResponse -> DeleteLoginProfileResponse -> Bool)
-> (DeleteLoginProfileResponse
    -> DeleteLoginProfileResponse -> Bool)
-> Eq DeleteLoginProfileResponse
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]
(Int -> ReadS DeleteLoginProfileResponse)
-> ReadS [DeleteLoginProfileResponse]
-> ReadPrec DeleteLoginProfileResponse
-> ReadPrec [DeleteLoginProfileResponse]
-> Read 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
(Int -> DeleteLoginProfileResponse -> ShowS)
-> (DeleteLoginProfileResponse -> String)
-> ([DeleteLoginProfileResponse] -> ShowS)
-> Show DeleteLoginProfileResponse
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.
 DeleteLoginProfileResponse -> Rep DeleteLoginProfileResponse x)
-> (forall x.
    Rep DeleteLoginProfileResponse x -> DeleteLoginProfileResponse)
-> Generic DeleteLoginProfileResponse
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