{-# 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.DeleteSAMLProvider
-- 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 a SAML provider resource in IAM.
--
-- Deleting the provider resource from IAM does not update any roles that
-- reference the SAML provider resource\'s ARN as a principal in their
-- trust policies. Any attempt to assume a role that references a
-- non-existent provider resource ARN fails.
--
-- This operation requires
-- <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html Signature Version 4>.
module Amazonka.IAM.DeleteSAMLProvider
  ( -- * Creating a Request
    DeleteSAMLProvider (..),
    newDeleteSAMLProvider,

    -- * Request Lenses
    deleteSAMLProvider_sAMLProviderArn,

    -- * Destructuring the Response
    DeleteSAMLProviderResponse (..),
    newDeleteSAMLProviderResponse,
  )
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:/ 'newDeleteSAMLProvider' smart constructor.
data DeleteSAMLProvider = DeleteSAMLProvider'
  { -- | The Amazon Resource Name (ARN) of the SAML provider to delete.
    DeleteSAMLProvider -> Text
sAMLProviderArn :: Prelude.Text
  }
  deriving (DeleteSAMLProvider -> DeleteSAMLProvider -> Bool
(DeleteSAMLProvider -> DeleteSAMLProvider -> Bool)
-> (DeleteSAMLProvider -> DeleteSAMLProvider -> Bool)
-> Eq DeleteSAMLProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSAMLProvider -> DeleteSAMLProvider -> Bool
$c/= :: DeleteSAMLProvider -> DeleteSAMLProvider -> Bool
== :: DeleteSAMLProvider -> DeleteSAMLProvider -> Bool
$c== :: DeleteSAMLProvider -> DeleteSAMLProvider -> Bool
Prelude.Eq, ReadPrec [DeleteSAMLProvider]
ReadPrec DeleteSAMLProvider
Int -> ReadS DeleteSAMLProvider
ReadS [DeleteSAMLProvider]
(Int -> ReadS DeleteSAMLProvider)
-> ReadS [DeleteSAMLProvider]
-> ReadPrec DeleteSAMLProvider
-> ReadPrec [DeleteSAMLProvider]
-> Read DeleteSAMLProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSAMLProvider]
$creadListPrec :: ReadPrec [DeleteSAMLProvider]
readPrec :: ReadPrec DeleteSAMLProvider
$creadPrec :: ReadPrec DeleteSAMLProvider
readList :: ReadS [DeleteSAMLProvider]
$creadList :: ReadS [DeleteSAMLProvider]
readsPrec :: Int -> ReadS DeleteSAMLProvider
$creadsPrec :: Int -> ReadS DeleteSAMLProvider
Prelude.Read, Int -> DeleteSAMLProvider -> ShowS
[DeleteSAMLProvider] -> ShowS
DeleteSAMLProvider -> String
(Int -> DeleteSAMLProvider -> ShowS)
-> (DeleteSAMLProvider -> String)
-> ([DeleteSAMLProvider] -> ShowS)
-> Show DeleteSAMLProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSAMLProvider] -> ShowS
$cshowList :: [DeleteSAMLProvider] -> ShowS
show :: DeleteSAMLProvider -> String
$cshow :: DeleteSAMLProvider -> String
showsPrec :: Int -> DeleteSAMLProvider -> ShowS
$cshowsPrec :: Int -> DeleteSAMLProvider -> ShowS
Prelude.Show, (forall x. DeleteSAMLProvider -> Rep DeleteSAMLProvider x)
-> (forall x. Rep DeleteSAMLProvider x -> DeleteSAMLProvider)
-> Generic DeleteSAMLProvider
forall x. Rep DeleteSAMLProvider x -> DeleteSAMLProvider
forall x. DeleteSAMLProvider -> Rep DeleteSAMLProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSAMLProvider x -> DeleteSAMLProvider
$cfrom :: forall x. DeleteSAMLProvider -> Rep DeleteSAMLProvider x
Prelude.Generic)

-- |
-- Create a value of 'DeleteSAMLProvider' 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:
--
-- 'sAMLProviderArn', 'deleteSAMLProvider_sAMLProviderArn' - The Amazon Resource Name (ARN) of the SAML provider to delete.
newDeleteSAMLProvider ::
  -- | 'sAMLProviderArn'
  Prelude.Text ->
  DeleteSAMLProvider
newDeleteSAMLProvider :: Text -> DeleteSAMLProvider
newDeleteSAMLProvider Text
pSAMLProviderArn_ =
  DeleteSAMLProvider' :: Text -> DeleteSAMLProvider
DeleteSAMLProvider'
    { $sel:sAMLProviderArn:DeleteSAMLProvider' :: Text
sAMLProviderArn =
        Text
pSAMLProviderArn_
    }

-- | The Amazon Resource Name (ARN) of the SAML provider to delete.
deleteSAMLProvider_sAMLProviderArn :: Lens.Lens' DeleteSAMLProvider Prelude.Text
deleteSAMLProvider_sAMLProviderArn :: (Text -> f Text) -> DeleteSAMLProvider -> f DeleteSAMLProvider
deleteSAMLProvider_sAMLProviderArn = (DeleteSAMLProvider -> Text)
-> (DeleteSAMLProvider -> Text -> DeleteSAMLProvider)
-> Lens DeleteSAMLProvider DeleteSAMLProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSAMLProvider' {Text
sAMLProviderArn :: Text
$sel:sAMLProviderArn:DeleteSAMLProvider' :: DeleteSAMLProvider -> Text
sAMLProviderArn} -> Text
sAMLProviderArn) (\s :: DeleteSAMLProvider
s@DeleteSAMLProvider' {} Text
a -> DeleteSAMLProvider
s {$sel:sAMLProviderArn:DeleteSAMLProvider' :: Text
sAMLProviderArn = Text
a} :: DeleteSAMLProvider)

instance Core.AWSRequest DeleteSAMLProvider where
  type
    AWSResponse DeleteSAMLProvider =
      DeleteSAMLProviderResponse
  request :: DeleteSAMLProvider -> Request DeleteSAMLProvider
request = Service -> DeleteSAMLProvider -> Request DeleteSAMLProvider
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteSAMLProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteSAMLProvider)))
response =
    AWSResponse DeleteSAMLProvider
-> Logger
-> Service
-> Proxy DeleteSAMLProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteSAMLProvider)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteSAMLProvider
DeleteSAMLProviderResponse
DeleteSAMLProviderResponse'

instance Prelude.Hashable DeleteSAMLProvider

instance Prelude.NFData DeleteSAMLProvider

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

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

instance Core.ToQuery DeleteSAMLProvider where
  toQuery :: DeleteSAMLProvider -> QueryString
toQuery DeleteSAMLProvider' {Text
sAMLProviderArn :: Text
$sel:sAMLProviderArn:DeleteSAMLProvider' :: DeleteSAMLProvider -> 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
"DeleteSAMLProvider" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"SAMLProviderArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sAMLProviderArn
      ]

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

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

instance Prelude.NFData DeleteSAMLProviderResponse