{-# 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.DeleteOpenIDConnectProvider
-- 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 an OpenID Connect identity provider (IdP) resource object in
-- IAM.
--
-- Deleting an IAM OIDC provider resource does not update any roles that
-- reference the provider as a principal in their trust policies. Any
-- attempt to assume a role that references a deleted provider fails.
--
-- This operation is idempotent; it does not fail or return an error if you
-- call the operation for a provider that does not exist.
module Amazonka.IAM.DeleteOpenIDConnectProvider
  ( -- * Creating a Request
    DeleteOpenIDConnectProvider (..),
    newDeleteOpenIDConnectProvider,

    -- * Request Lenses
    deleteOpenIDConnectProvider_openIDConnectProviderArn,

    -- * Destructuring the Response
    DeleteOpenIDConnectProviderResponse (..),
    newDeleteOpenIDConnectProviderResponse,
  )
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:/ 'newDeleteOpenIDConnectProvider' smart constructor.
data DeleteOpenIDConnectProvider = DeleteOpenIDConnectProvider'
  { -- | The Amazon Resource Name (ARN) of the IAM OpenID Connect provider
    -- resource object to delete. You can get a list of OpenID Connect provider
    -- resource ARNs by using the ListOpenIDConnectProviders operation.
    DeleteOpenIDConnectProvider -> Text
openIDConnectProviderArn :: Prelude.Text
  }
  deriving (DeleteOpenIDConnectProvider -> DeleteOpenIDConnectProvider -> Bool
(DeleteOpenIDConnectProvider
 -> DeleteOpenIDConnectProvider -> Bool)
-> (DeleteOpenIDConnectProvider
    -> DeleteOpenIDConnectProvider -> Bool)
-> Eq DeleteOpenIDConnectProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteOpenIDConnectProvider -> DeleteOpenIDConnectProvider -> Bool
$c/= :: DeleteOpenIDConnectProvider -> DeleteOpenIDConnectProvider -> Bool
== :: DeleteOpenIDConnectProvider -> DeleteOpenIDConnectProvider -> Bool
$c== :: DeleteOpenIDConnectProvider -> DeleteOpenIDConnectProvider -> Bool
Prelude.Eq, ReadPrec [DeleteOpenIDConnectProvider]
ReadPrec DeleteOpenIDConnectProvider
Int -> ReadS DeleteOpenIDConnectProvider
ReadS [DeleteOpenIDConnectProvider]
(Int -> ReadS DeleteOpenIDConnectProvider)
-> ReadS [DeleteOpenIDConnectProvider]
-> ReadPrec DeleteOpenIDConnectProvider
-> ReadPrec [DeleteOpenIDConnectProvider]
-> Read DeleteOpenIDConnectProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteOpenIDConnectProvider]
$creadListPrec :: ReadPrec [DeleteOpenIDConnectProvider]
readPrec :: ReadPrec DeleteOpenIDConnectProvider
$creadPrec :: ReadPrec DeleteOpenIDConnectProvider
readList :: ReadS [DeleteOpenIDConnectProvider]
$creadList :: ReadS [DeleteOpenIDConnectProvider]
readsPrec :: Int -> ReadS DeleteOpenIDConnectProvider
$creadsPrec :: Int -> ReadS DeleteOpenIDConnectProvider
Prelude.Read, Int -> DeleteOpenIDConnectProvider -> ShowS
[DeleteOpenIDConnectProvider] -> ShowS
DeleteOpenIDConnectProvider -> String
(Int -> DeleteOpenIDConnectProvider -> ShowS)
-> (DeleteOpenIDConnectProvider -> String)
-> ([DeleteOpenIDConnectProvider] -> ShowS)
-> Show DeleteOpenIDConnectProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteOpenIDConnectProvider] -> ShowS
$cshowList :: [DeleteOpenIDConnectProvider] -> ShowS
show :: DeleteOpenIDConnectProvider -> String
$cshow :: DeleteOpenIDConnectProvider -> String
showsPrec :: Int -> DeleteOpenIDConnectProvider -> ShowS
$cshowsPrec :: Int -> DeleteOpenIDConnectProvider -> ShowS
Prelude.Show, (forall x.
 DeleteOpenIDConnectProvider -> Rep DeleteOpenIDConnectProvider x)
-> (forall x.
    Rep DeleteOpenIDConnectProvider x -> DeleteOpenIDConnectProvider)
-> Generic DeleteOpenIDConnectProvider
forall x.
Rep DeleteOpenIDConnectProvider x -> DeleteOpenIDConnectProvider
forall x.
DeleteOpenIDConnectProvider -> Rep DeleteOpenIDConnectProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteOpenIDConnectProvider x -> DeleteOpenIDConnectProvider
$cfrom :: forall x.
DeleteOpenIDConnectProvider -> Rep DeleteOpenIDConnectProvider x
Prelude.Generic)

-- |
-- Create a value of 'DeleteOpenIDConnectProvider' 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:
--
-- 'openIDConnectProviderArn', 'deleteOpenIDConnectProvider_openIDConnectProviderArn' - The Amazon Resource Name (ARN) of the IAM OpenID Connect provider
-- resource object to delete. You can get a list of OpenID Connect provider
-- resource ARNs by using the ListOpenIDConnectProviders operation.
newDeleteOpenIDConnectProvider ::
  -- | 'openIDConnectProviderArn'
  Prelude.Text ->
  DeleteOpenIDConnectProvider
newDeleteOpenIDConnectProvider :: Text -> DeleteOpenIDConnectProvider
newDeleteOpenIDConnectProvider
  Text
pOpenIDConnectProviderArn_ =
    DeleteOpenIDConnectProvider' :: Text -> DeleteOpenIDConnectProvider
DeleteOpenIDConnectProvider'
      { $sel:openIDConnectProviderArn:DeleteOpenIDConnectProvider' :: Text
openIDConnectProviderArn =
          Text
pOpenIDConnectProviderArn_
      }

-- | The Amazon Resource Name (ARN) of the IAM OpenID Connect provider
-- resource object to delete. You can get a list of OpenID Connect provider
-- resource ARNs by using the ListOpenIDConnectProviders operation.
deleteOpenIDConnectProvider_openIDConnectProviderArn :: Lens.Lens' DeleteOpenIDConnectProvider Prelude.Text
deleteOpenIDConnectProvider_openIDConnectProviderArn :: (Text -> f Text)
-> DeleteOpenIDConnectProvider -> f DeleteOpenIDConnectProvider
deleteOpenIDConnectProvider_openIDConnectProviderArn = (DeleteOpenIDConnectProvider -> Text)
-> (DeleteOpenIDConnectProvider
    -> Text -> DeleteOpenIDConnectProvider)
-> Lens
     DeleteOpenIDConnectProvider DeleteOpenIDConnectProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOpenIDConnectProvider' {Text
openIDConnectProviderArn :: Text
$sel:openIDConnectProviderArn:DeleteOpenIDConnectProvider' :: DeleteOpenIDConnectProvider -> Text
openIDConnectProviderArn} -> Text
openIDConnectProviderArn) (\s :: DeleteOpenIDConnectProvider
s@DeleteOpenIDConnectProvider' {} Text
a -> DeleteOpenIDConnectProvider
s {$sel:openIDConnectProviderArn:DeleteOpenIDConnectProvider' :: Text
openIDConnectProviderArn = Text
a} :: DeleteOpenIDConnectProvider)

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

instance Prelude.Hashable DeleteOpenIDConnectProvider

instance Prelude.NFData DeleteOpenIDConnectProvider

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

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

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

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

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

instance
  Prelude.NFData
    DeleteOpenIDConnectProviderResponse