{-# 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.DeleteServiceSpecificCredential
-- 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 specified service-specific credential.
module Amazonka.IAM.DeleteServiceSpecificCredential
  ( -- * Creating a Request
    DeleteServiceSpecificCredential (..),
    newDeleteServiceSpecificCredential,

    -- * Request Lenses
    deleteServiceSpecificCredential_userName,
    deleteServiceSpecificCredential_serviceSpecificCredentialId,

    -- * Destructuring the Response
    DeleteServiceSpecificCredentialResponse (..),
    newDeleteServiceSpecificCredentialResponse,
  )
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:/ 'newDeleteServiceSpecificCredential' smart constructor.
data DeleteServiceSpecificCredential = DeleteServiceSpecificCredential'
  { -- | The name of the IAM user associated with the service-specific
    -- credential. If this value is not specified, then the operation assumes
    -- the user whose credentials are used to call the operation.
    --
    -- 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: _+=,.\@-
    DeleteServiceSpecificCredential -> Maybe Text
userName :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the service-specific credential. You can get
    -- this value by calling ListServiceSpecificCredentials.
    --
    -- This parameter allows (through its
    -- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
    -- that can consist of any upper or lowercased letter or digit.
    DeleteServiceSpecificCredential -> Text
serviceSpecificCredentialId :: Prelude.Text
  }
  deriving (DeleteServiceSpecificCredential
-> DeleteServiceSpecificCredential -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteServiceSpecificCredential
-> DeleteServiceSpecificCredential -> Bool
$c/= :: DeleteServiceSpecificCredential
-> DeleteServiceSpecificCredential -> Bool
== :: DeleteServiceSpecificCredential
-> DeleteServiceSpecificCredential -> Bool
$c== :: DeleteServiceSpecificCredential
-> DeleteServiceSpecificCredential -> Bool
Prelude.Eq, ReadPrec [DeleteServiceSpecificCredential]
ReadPrec DeleteServiceSpecificCredential
Int -> ReadS DeleteServiceSpecificCredential
ReadS [DeleteServiceSpecificCredential]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteServiceSpecificCredential]
$creadListPrec :: ReadPrec [DeleteServiceSpecificCredential]
readPrec :: ReadPrec DeleteServiceSpecificCredential
$creadPrec :: ReadPrec DeleteServiceSpecificCredential
readList :: ReadS [DeleteServiceSpecificCredential]
$creadList :: ReadS [DeleteServiceSpecificCredential]
readsPrec :: Int -> ReadS DeleteServiceSpecificCredential
$creadsPrec :: Int -> ReadS DeleteServiceSpecificCredential
Prelude.Read, Int -> DeleteServiceSpecificCredential -> ShowS
[DeleteServiceSpecificCredential] -> ShowS
DeleteServiceSpecificCredential -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteServiceSpecificCredential] -> ShowS
$cshowList :: [DeleteServiceSpecificCredential] -> ShowS
show :: DeleteServiceSpecificCredential -> String
$cshow :: DeleteServiceSpecificCredential -> String
showsPrec :: Int -> DeleteServiceSpecificCredential -> ShowS
$cshowsPrec :: Int -> DeleteServiceSpecificCredential -> ShowS
Prelude.Show, forall x.
Rep DeleteServiceSpecificCredential x
-> DeleteServiceSpecificCredential
forall x.
DeleteServiceSpecificCredential
-> Rep DeleteServiceSpecificCredential x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteServiceSpecificCredential x
-> DeleteServiceSpecificCredential
$cfrom :: forall x.
DeleteServiceSpecificCredential
-> Rep DeleteServiceSpecificCredential x
Prelude.Generic)

-- |
-- Create a value of 'DeleteServiceSpecificCredential' 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', 'deleteServiceSpecificCredential_userName' - The name of the IAM user associated with the service-specific
-- credential. If this value is not specified, then the operation assumes
-- the user whose credentials are used to call the operation.
--
-- 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: _+=,.\@-
--
-- 'serviceSpecificCredentialId', 'deleteServiceSpecificCredential_serviceSpecificCredentialId' - The unique identifier of the service-specific credential. You can get
-- this value by calling ListServiceSpecificCredentials.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- that can consist of any upper or lowercased letter or digit.
newDeleteServiceSpecificCredential ::
  -- | 'serviceSpecificCredentialId'
  Prelude.Text ->
  DeleteServiceSpecificCredential
newDeleteServiceSpecificCredential :: Text -> DeleteServiceSpecificCredential
newDeleteServiceSpecificCredential
  Text
pServiceSpecificCredentialId_ =
    DeleteServiceSpecificCredential'
      { $sel:userName:DeleteServiceSpecificCredential' :: Maybe Text
userName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:serviceSpecificCredentialId:DeleteServiceSpecificCredential' :: Text
serviceSpecificCredentialId =
          Text
pServiceSpecificCredentialId_
      }

-- | The name of the IAM user associated with the service-specific
-- credential. If this value is not specified, then the operation assumes
-- the user whose credentials are used to call the operation.
--
-- 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: _+=,.\@-
deleteServiceSpecificCredential_userName :: Lens.Lens' DeleteServiceSpecificCredential (Prelude.Maybe Prelude.Text)
deleteServiceSpecificCredential_userName :: Lens' DeleteServiceSpecificCredential (Maybe Text)
deleteServiceSpecificCredential_userName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceSpecificCredential' {Maybe Text
userName :: Maybe Text
$sel:userName:DeleteServiceSpecificCredential' :: DeleteServiceSpecificCredential -> Maybe Text
userName} -> Maybe Text
userName) (\s :: DeleteServiceSpecificCredential
s@DeleteServiceSpecificCredential' {} Maybe Text
a -> DeleteServiceSpecificCredential
s {$sel:userName:DeleteServiceSpecificCredential' :: Maybe Text
userName = Maybe Text
a} :: DeleteServiceSpecificCredential)

-- | The unique identifier of the service-specific credential. You can get
-- this value by calling ListServiceSpecificCredentials.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- that can consist of any upper or lowercased letter or digit.
deleteServiceSpecificCredential_serviceSpecificCredentialId :: Lens.Lens' DeleteServiceSpecificCredential Prelude.Text
deleteServiceSpecificCredential_serviceSpecificCredentialId :: Lens' DeleteServiceSpecificCredential Text
deleteServiceSpecificCredential_serviceSpecificCredentialId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteServiceSpecificCredential' {Text
serviceSpecificCredentialId :: Text
$sel:serviceSpecificCredentialId:DeleteServiceSpecificCredential' :: DeleteServiceSpecificCredential -> Text
serviceSpecificCredentialId} -> Text
serviceSpecificCredentialId) (\s :: DeleteServiceSpecificCredential
s@DeleteServiceSpecificCredential' {} Text
a -> DeleteServiceSpecificCredential
s {$sel:serviceSpecificCredentialId:DeleteServiceSpecificCredential' :: Text
serviceSpecificCredentialId = Text
a} :: DeleteServiceSpecificCredential)

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

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

instance
  Prelude.NFData
    DeleteServiceSpecificCredential
  where
  rnf :: DeleteServiceSpecificCredential -> ()
rnf DeleteServiceSpecificCredential' {Maybe Text
Text
serviceSpecificCredentialId :: Text
userName :: Maybe Text
$sel:serviceSpecificCredentialId:DeleteServiceSpecificCredential' :: DeleteServiceSpecificCredential -> Text
$sel:userName:DeleteServiceSpecificCredential' :: DeleteServiceSpecificCredential -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceSpecificCredentialId

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

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

instance Data.ToQuery DeleteServiceSpecificCredential where
  toQuery :: DeleteServiceSpecificCredential -> QueryString
toQuery DeleteServiceSpecificCredential' {Maybe Text
Text
serviceSpecificCredentialId :: Text
userName :: Maybe Text
$sel:serviceSpecificCredentialId:DeleteServiceSpecificCredential' :: DeleteServiceSpecificCredential -> Text
$sel:userName:DeleteServiceSpecificCredential' :: DeleteServiceSpecificCredential -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"DeleteServiceSpecificCredential" ::
                      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.=: Maybe Text
userName,
        ByteString
"ServiceSpecificCredentialId"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
serviceSpecificCredentialId
      ]

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

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

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