{-# 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.DeleteVirtualMFADevice
-- 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 a virtual MFA device.
--
-- You must deactivate a user\'s virtual MFA device before you can delete
-- it. For information about deactivating MFA devices, see
-- DeactivateMFADevice.
module Amazonka.IAM.DeleteVirtualMFADevice
  ( -- * Creating a Request
    DeleteVirtualMFADevice (..),
    newDeleteVirtualMFADevice,

    -- * Request Lenses
    deleteVirtualMFADevice_serialNumber,

    -- * Destructuring the Response
    DeleteVirtualMFADeviceResponse (..),
    newDeleteVirtualMFADeviceResponse,
  )
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:/ 'newDeleteVirtualMFADevice' smart constructor.
data DeleteVirtualMFADevice = DeleteVirtualMFADevice'
  { -- | The serial number that uniquely identifies the MFA device. For virtual
    -- MFA devices, the serial number is the same as the ARN.
    --
    -- 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: =,.\@:\/-
    DeleteVirtualMFADevice -> Text
serialNumber :: Prelude.Text
  }
  deriving (DeleteVirtualMFADevice -> DeleteVirtualMFADevice -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteVirtualMFADevice -> DeleteVirtualMFADevice -> Bool
$c/= :: DeleteVirtualMFADevice -> DeleteVirtualMFADevice -> Bool
== :: DeleteVirtualMFADevice -> DeleteVirtualMFADevice -> Bool
$c== :: DeleteVirtualMFADevice -> DeleteVirtualMFADevice -> Bool
Prelude.Eq, ReadPrec [DeleteVirtualMFADevice]
ReadPrec DeleteVirtualMFADevice
Int -> ReadS DeleteVirtualMFADevice
ReadS [DeleteVirtualMFADevice]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteVirtualMFADevice]
$creadListPrec :: ReadPrec [DeleteVirtualMFADevice]
readPrec :: ReadPrec DeleteVirtualMFADevice
$creadPrec :: ReadPrec DeleteVirtualMFADevice
readList :: ReadS [DeleteVirtualMFADevice]
$creadList :: ReadS [DeleteVirtualMFADevice]
readsPrec :: Int -> ReadS DeleteVirtualMFADevice
$creadsPrec :: Int -> ReadS DeleteVirtualMFADevice
Prelude.Read, Int -> DeleteVirtualMFADevice -> ShowS
[DeleteVirtualMFADevice] -> ShowS
DeleteVirtualMFADevice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteVirtualMFADevice] -> ShowS
$cshowList :: [DeleteVirtualMFADevice] -> ShowS
show :: DeleteVirtualMFADevice -> String
$cshow :: DeleteVirtualMFADevice -> String
showsPrec :: Int -> DeleteVirtualMFADevice -> ShowS
$cshowsPrec :: Int -> DeleteVirtualMFADevice -> ShowS
Prelude.Show, forall x. Rep DeleteVirtualMFADevice x -> DeleteVirtualMFADevice
forall x. DeleteVirtualMFADevice -> Rep DeleteVirtualMFADevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteVirtualMFADevice x -> DeleteVirtualMFADevice
$cfrom :: forall x. DeleteVirtualMFADevice -> Rep DeleteVirtualMFADevice x
Prelude.Generic)

-- |
-- Create a value of 'DeleteVirtualMFADevice' 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:
--
-- 'serialNumber', 'deleteVirtualMFADevice_serialNumber' - The serial number that uniquely identifies the MFA device. For virtual
-- MFA devices, the serial number is the same as the ARN.
--
-- 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: =,.\@:\/-
newDeleteVirtualMFADevice ::
  -- | 'serialNumber'
  Prelude.Text ->
  DeleteVirtualMFADevice
newDeleteVirtualMFADevice :: Text -> DeleteVirtualMFADevice
newDeleteVirtualMFADevice Text
pSerialNumber_ =
  DeleteVirtualMFADevice'
    { $sel:serialNumber:DeleteVirtualMFADevice' :: Text
serialNumber =
        Text
pSerialNumber_
    }

-- | The serial number that uniquely identifies the MFA device. For virtual
-- MFA devices, the serial number is the same as the ARN.
--
-- 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: =,.\@:\/-
deleteVirtualMFADevice_serialNumber :: Lens.Lens' DeleteVirtualMFADevice Prelude.Text
deleteVirtualMFADevice_serialNumber :: Lens' DeleteVirtualMFADevice Text
deleteVirtualMFADevice_serialNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteVirtualMFADevice' {Text
serialNumber :: Text
$sel:serialNumber:DeleteVirtualMFADevice' :: DeleteVirtualMFADevice -> Text
serialNumber} -> Text
serialNumber) (\s :: DeleteVirtualMFADevice
s@DeleteVirtualMFADevice' {} Text
a -> DeleteVirtualMFADevice
s {$sel:serialNumber:DeleteVirtualMFADevice' :: Text
serialNumber = Text
a} :: DeleteVirtualMFADevice)

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

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

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

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

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

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

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

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

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