{-# 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-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 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 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:/ '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
(DeleteServiceSpecificCredential
 -> DeleteServiceSpecificCredential -> Bool)
-> (DeleteServiceSpecificCredential
    -> DeleteServiceSpecificCredential -> Bool)
-> Eq DeleteServiceSpecificCredential
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]
(Int -> ReadS DeleteServiceSpecificCredential)
-> ReadS [DeleteServiceSpecificCredential]
-> ReadPrec DeleteServiceSpecificCredential
-> ReadPrec [DeleteServiceSpecificCredential]
-> Read 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
(Int -> DeleteServiceSpecificCredential -> ShowS)
-> (DeleteServiceSpecificCredential -> String)
-> ([DeleteServiceSpecificCredential] -> ShowS)
-> Show DeleteServiceSpecificCredential
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.
 DeleteServiceSpecificCredential
 -> Rep DeleteServiceSpecificCredential x)
-> (forall x.
    Rep DeleteServiceSpecificCredential x
    -> DeleteServiceSpecificCredential)
-> Generic DeleteServiceSpecificCredential
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' :: Maybe Text -> Text -> DeleteServiceSpecificCredential
DeleteServiceSpecificCredential'
      { $sel:userName:DeleteServiceSpecificCredential' :: Maybe Text
userName =
          Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> DeleteServiceSpecificCredential
-> f DeleteServiceSpecificCredential
deleteServiceSpecificCredential_userName = (DeleteServiceSpecificCredential -> Maybe Text)
-> (DeleteServiceSpecificCredential
    -> Maybe Text -> DeleteServiceSpecificCredential)
-> Lens
     DeleteServiceSpecificCredential
     DeleteServiceSpecificCredential
     (Maybe Text)
     (Maybe Text)
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 :: (Text -> f Text)
-> DeleteServiceSpecificCredential
-> f DeleteServiceSpecificCredential
deleteServiceSpecificCredential_serviceSpecificCredentialId = (DeleteServiceSpecificCredential -> Text)
-> (DeleteServiceSpecificCredential
    -> Text -> DeleteServiceSpecificCredential)
-> Lens
     DeleteServiceSpecificCredential
     DeleteServiceSpecificCredential
     Text
     Text
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 :: DeleteServiceSpecificCredential
-> Request DeleteServiceSpecificCredential
request = Service
-> DeleteServiceSpecificCredential
-> Request DeleteServiceSpecificCredential
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteServiceSpecificCredential
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteServiceSpecificCredential)))
response =
    AWSResponse DeleteServiceSpecificCredential
-> Logger
-> Service
-> Proxy DeleteServiceSpecificCredential
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DeleteServiceSpecificCredential)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteServiceSpecificCredential
DeleteServiceSpecificCredentialResponse
DeleteServiceSpecificCredentialResponse'

instance
  Prelude.Hashable
    DeleteServiceSpecificCredential

instance
  Prelude.NFData
    DeleteServiceSpecificCredential

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

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

instance Core.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
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"DeleteServiceSpecificCredential" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"UserName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userName,
        ByteString
"ServiceSpecificCredentialId"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
serviceSpecificCredentialId
      ]

-- | /See:/ 'newDeleteServiceSpecificCredentialResponse' smart constructor.
data DeleteServiceSpecificCredentialResponse = DeleteServiceSpecificCredentialResponse'
  {
  }
  deriving (DeleteServiceSpecificCredentialResponse
-> DeleteServiceSpecificCredentialResponse -> Bool
(DeleteServiceSpecificCredentialResponse
 -> DeleteServiceSpecificCredentialResponse -> Bool)
-> (DeleteServiceSpecificCredentialResponse
    -> DeleteServiceSpecificCredentialResponse -> Bool)
-> Eq DeleteServiceSpecificCredentialResponse
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]
(Int -> ReadS DeleteServiceSpecificCredentialResponse)
-> ReadS [DeleteServiceSpecificCredentialResponse]
-> ReadPrec DeleteServiceSpecificCredentialResponse
-> ReadPrec [DeleteServiceSpecificCredentialResponse]
-> Read 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
(Int -> DeleteServiceSpecificCredentialResponse -> ShowS)
-> (DeleteServiceSpecificCredentialResponse -> String)
-> ([DeleteServiceSpecificCredentialResponse] -> ShowS)
-> Show DeleteServiceSpecificCredentialResponse
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.
 DeleteServiceSpecificCredentialResponse
 -> Rep DeleteServiceSpecificCredentialResponse x)
-> (forall x.
    Rep DeleteServiceSpecificCredentialResponse x
    -> DeleteServiceSpecificCredentialResponse)
-> Generic DeleteServiceSpecificCredentialResponse
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