{-# 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.RemoveClientIDFromOpenIDConnectProvider
-- 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)
--
-- Removes the specified client ID (also known as audience) from the list
-- of client IDs registered for the specified IAM OpenID Connect (OIDC)
-- provider resource object.
--
-- This operation is idempotent; it does not fail or return an error if you
-- try to remove a client ID that does not exist.
module Amazonka.IAM.RemoveClientIDFromOpenIDConnectProvider
  ( -- * Creating a Request
    RemoveClientIDFromOpenIDConnectProvider (..),
    newRemoveClientIDFromOpenIDConnectProvider,

    -- * Request Lenses
    removeClientIDFromOpenIDConnectProvider_openIDConnectProviderArn,
    removeClientIDFromOpenIDConnectProvider_clientID,

    -- * Destructuring the Response
    RemoveClientIDFromOpenIDConnectProviderResponse (..),
    newRemoveClientIDFromOpenIDConnectProviderResponse,
  )
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:/ 'newRemoveClientIDFromOpenIDConnectProvider' smart constructor.
data RemoveClientIDFromOpenIDConnectProvider = RemoveClientIDFromOpenIDConnectProvider'
  { -- | The Amazon Resource Name (ARN) of the IAM OIDC provider resource to
    -- remove the client ID from. You can get a list of OIDC provider ARNs by
    -- using the ListOpenIDConnectProviders operation.
    --
    -- For more information about ARNs, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
    -- in the /Amazon Web Services General Reference/.
    RemoveClientIDFromOpenIDConnectProvider -> Text
openIDConnectProviderArn :: Prelude.Text,
    -- | The client ID (also known as audience) to remove from the IAM OIDC
    -- provider resource. For more information about client IDs, see
    -- CreateOpenIDConnectProvider.
    RemoveClientIDFromOpenIDConnectProvider -> Text
clientID :: Prelude.Text
  }
  deriving (RemoveClientIDFromOpenIDConnectProvider
-> RemoveClientIDFromOpenIDConnectProvider -> Bool
(RemoveClientIDFromOpenIDConnectProvider
 -> RemoveClientIDFromOpenIDConnectProvider -> Bool)
-> (RemoveClientIDFromOpenIDConnectProvider
    -> RemoveClientIDFromOpenIDConnectProvider -> Bool)
-> Eq RemoveClientIDFromOpenIDConnectProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveClientIDFromOpenIDConnectProvider
-> RemoveClientIDFromOpenIDConnectProvider -> Bool
$c/= :: RemoveClientIDFromOpenIDConnectProvider
-> RemoveClientIDFromOpenIDConnectProvider -> Bool
== :: RemoveClientIDFromOpenIDConnectProvider
-> RemoveClientIDFromOpenIDConnectProvider -> Bool
$c== :: RemoveClientIDFromOpenIDConnectProvider
-> RemoveClientIDFromOpenIDConnectProvider -> Bool
Prelude.Eq, ReadPrec [RemoveClientIDFromOpenIDConnectProvider]
ReadPrec RemoveClientIDFromOpenIDConnectProvider
Int -> ReadS RemoveClientIDFromOpenIDConnectProvider
ReadS [RemoveClientIDFromOpenIDConnectProvider]
(Int -> ReadS RemoveClientIDFromOpenIDConnectProvider)
-> ReadS [RemoveClientIDFromOpenIDConnectProvider]
-> ReadPrec RemoveClientIDFromOpenIDConnectProvider
-> ReadPrec [RemoveClientIDFromOpenIDConnectProvider]
-> Read RemoveClientIDFromOpenIDConnectProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveClientIDFromOpenIDConnectProvider]
$creadListPrec :: ReadPrec [RemoveClientIDFromOpenIDConnectProvider]
readPrec :: ReadPrec RemoveClientIDFromOpenIDConnectProvider
$creadPrec :: ReadPrec RemoveClientIDFromOpenIDConnectProvider
readList :: ReadS [RemoveClientIDFromOpenIDConnectProvider]
$creadList :: ReadS [RemoveClientIDFromOpenIDConnectProvider]
readsPrec :: Int -> ReadS RemoveClientIDFromOpenIDConnectProvider
$creadsPrec :: Int -> ReadS RemoveClientIDFromOpenIDConnectProvider
Prelude.Read, Int -> RemoveClientIDFromOpenIDConnectProvider -> ShowS
[RemoveClientIDFromOpenIDConnectProvider] -> ShowS
RemoveClientIDFromOpenIDConnectProvider -> String
(Int -> RemoveClientIDFromOpenIDConnectProvider -> ShowS)
-> (RemoveClientIDFromOpenIDConnectProvider -> String)
-> ([RemoveClientIDFromOpenIDConnectProvider] -> ShowS)
-> Show RemoveClientIDFromOpenIDConnectProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveClientIDFromOpenIDConnectProvider] -> ShowS
$cshowList :: [RemoveClientIDFromOpenIDConnectProvider] -> ShowS
show :: RemoveClientIDFromOpenIDConnectProvider -> String
$cshow :: RemoveClientIDFromOpenIDConnectProvider -> String
showsPrec :: Int -> RemoveClientIDFromOpenIDConnectProvider -> ShowS
$cshowsPrec :: Int -> RemoveClientIDFromOpenIDConnectProvider -> ShowS
Prelude.Show, (forall x.
 RemoveClientIDFromOpenIDConnectProvider
 -> Rep RemoveClientIDFromOpenIDConnectProvider x)
-> (forall x.
    Rep RemoveClientIDFromOpenIDConnectProvider x
    -> RemoveClientIDFromOpenIDConnectProvider)
-> Generic RemoveClientIDFromOpenIDConnectProvider
forall x.
Rep RemoveClientIDFromOpenIDConnectProvider x
-> RemoveClientIDFromOpenIDConnectProvider
forall x.
RemoveClientIDFromOpenIDConnectProvider
-> Rep RemoveClientIDFromOpenIDConnectProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemoveClientIDFromOpenIDConnectProvider x
-> RemoveClientIDFromOpenIDConnectProvider
$cfrom :: forall x.
RemoveClientIDFromOpenIDConnectProvider
-> Rep RemoveClientIDFromOpenIDConnectProvider x
Prelude.Generic)

-- |
-- Create a value of 'RemoveClientIDFromOpenIDConnectProvider' 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', 'removeClientIDFromOpenIDConnectProvider_openIDConnectProviderArn' - The Amazon Resource Name (ARN) of the IAM OIDC provider resource to
-- remove the client ID from. You can get a list of OIDC provider ARNs by
-- using the ListOpenIDConnectProviders operation.
--
-- For more information about ARNs, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /Amazon Web Services General Reference/.
--
-- 'clientID', 'removeClientIDFromOpenIDConnectProvider_clientID' - The client ID (also known as audience) to remove from the IAM OIDC
-- provider resource. For more information about client IDs, see
-- CreateOpenIDConnectProvider.
newRemoveClientIDFromOpenIDConnectProvider ::
  -- | 'openIDConnectProviderArn'
  Prelude.Text ->
  -- | 'clientID'
  Prelude.Text ->
  RemoveClientIDFromOpenIDConnectProvider
newRemoveClientIDFromOpenIDConnectProvider :: Text -> Text -> RemoveClientIDFromOpenIDConnectProvider
newRemoveClientIDFromOpenIDConnectProvider
  Text
pOpenIDConnectProviderArn_
  Text
pClientID_ =
    RemoveClientIDFromOpenIDConnectProvider' :: Text -> Text -> RemoveClientIDFromOpenIDConnectProvider
RemoveClientIDFromOpenIDConnectProvider'
      { $sel:openIDConnectProviderArn:RemoveClientIDFromOpenIDConnectProvider' :: Text
openIDConnectProviderArn =
          Text
pOpenIDConnectProviderArn_,
        $sel:clientID:RemoveClientIDFromOpenIDConnectProvider' :: Text
clientID = Text
pClientID_
      }

-- | The Amazon Resource Name (ARN) of the IAM OIDC provider resource to
-- remove the client ID from. You can get a list of OIDC provider ARNs by
-- using the ListOpenIDConnectProviders operation.
--
-- For more information about ARNs, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /Amazon Web Services General Reference/.
removeClientIDFromOpenIDConnectProvider_openIDConnectProviderArn :: Lens.Lens' RemoveClientIDFromOpenIDConnectProvider Prelude.Text
removeClientIDFromOpenIDConnectProvider_openIDConnectProviderArn :: (Text -> f Text)
-> RemoveClientIDFromOpenIDConnectProvider
-> f RemoveClientIDFromOpenIDConnectProvider
removeClientIDFromOpenIDConnectProvider_openIDConnectProviderArn = (RemoveClientIDFromOpenIDConnectProvider -> Text)
-> (RemoveClientIDFromOpenIDConnectProvider
    -> Text -> RemoveClientIDFromOpenIDConnectProvider)
-> Lens
     RemoveClientIDFromOpenIDConnectProvider
     RemoveClientIDFromOpenIDConnectProvider
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveClientIDFromOpenIDConnectProvider' {Text
openIDConnectProviderArn :: Text
$sel:openIDConnectProviderArn:RemoveClientIDFromOpenIDConnectProvider' :: RemoveClientIDFromOpenIDConnectProvider -> Text
openIDConnectProviderArn} -> Text
openIDConnectProviderArn) (\s :: RemoveClientIDFromOpenIDConnectProvider
s@RemoveClientIDFromOpenIDConnectProvider' {} Text
a -> RemoveClientIDFromOpenIDConnectProvider
s {$sel:openIDConnectProviderArn:RemoveClientIDFromOpenIDConnectProvider' :: Text
openIDConnectProviderArn = Text
a} :: RemoveClientIDFromOpenIDConnectProvider)

-- | The client ID (also known as audience) to remove from the IAM OIDC
-- provider resource. For more information about client IDs, see
-- CreateOpenIDConnectProvider.
removeClientIDFromOpenIDConnectProvider_clientID :: Lens.Lens' RemoveClientIDFromOpenIDConnectProvider Prelude.Text
removeClientIDFromOpenIDConnectProvider_clientID :: (Text -> f Text)
-> RemoveClientIDFromOpenIDConnectProvider
-> f RemoveClientIDFromOpenIDConnectProvider
removeClientIDFromOpenIDConnectProvider_clientID = (RemoveClientIDFromOpenIDConnectProvider -> Text)
-> (RemoveClientIDFromOpenIDConnectProvider
    -> Text -> RemoveClientIDFromOpenIDConnectProvider)
-> Lens
     RemoveClientIDFromOpenIDConnectProvider
     RemoveClientIDFromOpenIDConnectProvider
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveClientIDFromOpenIDConnectProvider' {Text
clientID :: Text
$sel:clientID:RemoveClientIDFromOpenIDConnectProvider' :: RemoveClientIDFromOpenIDConnectProvider -> Text
clientID} -> Text
clientID) (\s :: RemoveClientIDFromOpenIDConnectProvider
s@RemoveClientIDFromOpenIDConnectProvider' {} Text
a -> RemoveClientIDFromOpenIDConnectProvider
s {$sel:clientID:RemoveClientIDFromOpenIDConnectProvider' :: Text
clientID = Text
a} :: RemoveClientIDFromOpenIDConnectProvider)

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

instance
  Prelude.Hashable
    RemoveClientIDFromOpenIDConnectProvider

instance
  Prelude.NFData
    RemoveClientIDFromOpenIDConnectProvider

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

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

instance
  Core.ToQuery
    RemoveClientIDFromOpenIDConnectProvider
  where
  toQuery :: RemoveClientIDFromOpenIDConnectProvider -> QueryString
toQuery RemoveClientIDFromOpenIDConnectProvider' {Text
clientID :: Text
openIDConnectProviderArn :: Text
$sel:clientID:RemoveClientIDFromOpenIDConnectProvider' :: RemoveClientIDFromOpenIDConnectProvider -> Text
$sel:openIDConnectProviderArn:RemoveClientIDFromOpenIDConnectProvider' :: RemoveClientIDFromOpenIDConnectProvider -> 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
"RemoveClientIDFromOpenIDConnectProvider" ::
                      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,
        ByteString
"ClientID" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clientID
      ]

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

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

instance
  Prelude.NFData
    RemoveClientIDFromOpenIDConnectProviderResponse