{-# 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.UntagSAMLProvider
-- 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 tags from the specified Security Assertion Markup
-- Language (SAML) identity provider in IAM. For more information about
-- these providers, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc.html About web identity federation>.
-- For more information about tagging, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
-- in the /IAM User Guide/.
module Amazonka.IAM.UntagSAMLProvider
  ( -- * Creating a Request
    UntagSAMLProvider (..),
    newUntagSAMLProvider,

    -- * Request Lenses
    untagSAMLProvider_sAMLProviderArn,
    untagSAMLProvider_tagKeys,

    -- * Destructuring the Response
    UntagSAMLProviderResponse (..),
    newUntagSAMLProviderResponse,
  )
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:/ 'newUntagSAMLProvider' smart constructor.
data UntagSAMLProvider = UntagSAMLProvider'
  { -- | The ARN of the SAML identity provider in IAM from which you want to
    -- remove tags.
    --
    -- 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: _+=,.\@-
    UntagSAMLProvider -> Text
sAMLProviderArn :: Prelude.Text,
    -- | A list of key names as a simple array of strings. The tags with matching
    -- keys are removed from the specified SAML identity provider.
    UntagSAMLProvider -> [Text]
tagKeys :: [Prelude.Text]
  }
  deriving (UntagSAMLProvider -> UntagSAMLProvider -> Bool
(UntagSAMLProvider -> UntagSAMLProvider -> Bool)
-> (UntagSAMLProvider -> UntagSAMLProvider -> Bool)
-> Eq UntagSAMLProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UntagSAMLProvider -> UntagSAMLProvider -> Bool
$c/= :: UntagSAMLProvider -> UntagSAMLProvider -> Bool
== :: UntagSAMLProvider -> UntagSAMLProvider -> Bool
$c== :: UntagSAMLProvider -> UntagSAMLProvider -> Bool
Prelude.Eq, ReadPrec [UntagSAMLProvider]
ReadPrec UntagSAMLProvider
Int -> ReadS UntagSAMLProvider
ReadS [UntagSAMLProvider]
(Int -> ReadS UntagSAMLProvider)
-> ReadS [UntagSAMLProvider]
-> ReadPrec UntagSAMLProvider
-> ReadPrec [UntagSAMLProvider]
-> Read UntagSAMLProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UntagSAMLProvider]
$creadListPrec :: ReadPrec [UntagSAMLProvider]
readPrec :: ReadPrec UntagSAMLProvider
$creadPrec :: ReadPrec UntagSAMLProvider
readList :: ReadS [UntagSAMLProvider]
$creadList :: ReadS [UntagSAMLProvider]
readsPrec :: Int -> ReadS UntagSAMLProvider
$creadsPrec :: Int -> ReadS UntagSAMLProvider
Prelude.Read, Int -> UntagSAMLProvider -> ShowS
[UntagSAMLProvider] -> ShowS
UntagSAMLProvider -> String
(Int -> UntagSAMLProvider -> ShowS)
-> (UntagSAMLProvider -> String)
-> ([UntagSAMLProvider] -> ShowS)
-> Show UntagSAMLProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UntagSAMLProvider] -> ShowS
$cshowList :: [UntagSAMLProvider] -> ShowS
show :: UntagSAMLProvider -> String
$cshow :: UntagSAMLProvider -> String
showsPrec :: Int -> UntagSAMLProvider -> ShowS
$cshowsPrec :: Int -> UntagSAMLProvider -> ShowS
Prelude.Show, (forall x. UntagSAMLProvider -> Rep UntagSAMLProvider x)
-> (forall x. Rep UntagSAMLProvider x -> UntagSAMLProvider)
-> Generic UntagSAMLProvider
forall x. Rep UntagSAMLProvider x -> UntagSAMLProvider
forall x. UntagSAMLProvider -> Rep UntagSAMLProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UntagSAMLProvider x -> UntagSAMLProvider
$cfrom :: forall x. UntagSAMLProvider -> Rep UntagSAMLProvider x
Prelude.Generic)

-- |
-- Create a value of 'UntagSAMLProvider' 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', 'untagSAMLProvider_sAMLProviderArn' - The ARN of the SAML identity provider in IAM from which you want to
-- remove tags.
--
-- 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: _+=,.\@-
--
-- 'tagKeys', 'untagSAMLProvider_tagKeys' - A list of key names as a simple array of strings. The tags with matching
-- keys are removed from the specified SAML identity provider.
newUntagSAMLProvider ::
  -- | 'sAMLProviderArn'
  Prelude.Text ->
  UntagSAMLProvider
newUntagSAMLProvider :: Text -> UntagSAMLProvider
newUntagSAMLProvider Text
pSAMLProviderArn_ =
  UntagSAMLProvider' :: Text -> [Text] -> UntagSAMLProvider
UntagSAMLProvider'
    { $sel:sAMLProviderArn:UntagSAMLProvider' :: Text
sAMLProviderArn =
        Text
pSAMLProviderArn_,
      $sel:tagKeys:UntagSAMLProvider' :: [Text]
tagKeys = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The ARN of the SAML identity provider in IAM from which you want to
-- remove tags.
--
-- 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: _+=,.\@-
untagSAMLProvider_sAMLProviderArn :: Lens.Lens' UntagSAMLProvider Prelude.Text
untagSAMLProvider_sAMLProviderArn :: (Text -> f Text) -> UntagSAMLProvider -> f UntagSAMLProvider
untagSAMLProvider_sAMLProviderArn = (UntagSAMLProvider -> Text)
-> (UntagSAMLProvider -> Text -> UntagSAMLProvider)
-> Lens UntagSAMLProvider UntagSAMLProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UntagSAMLProvider' {Text
sAMLProviderArn :: Text
$sel:sAMLProviderArn:UntagSAMLProvider' :: UntagSAMLProvider -> Text
sAMLProviderArn} -> Text
sAMLProviderArn) (\s :: UntagSAMLProvider
s@UntagSAMLProvider' {} Text
a -> UntagSAMLProvider
s {$sel:sAMLProviderArn:UntagSAMLProvider' :: Text
sAMLProviderArn = Text
a} :: UntagSAMLProvider)

-- | A list of key names as a simple array of strings. The tags with matching
-- keys are removed from the specified SAML identity provider.
untagSAMLProvider_tagKeys :: Lens.Lens' UntagSAMLProvider [Prelude.Text]
untagSAMLProvider_tagKeys :: ([Text] -> f [Text]) -> UntagSAMLProvider -> f UntagSAMLProvider
untagSAMLProvider_tagKeys = (UntagSAMLProvider -> [Text])
-> (UntagSAMLProvider -> [Text] -> UntagSAMLProvider)
-> Lens UntagSAMLProvider UntagSAMLProvider [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UntagSAMLProvider' {[Text]
tagKeys :: [Text]
$sel:tagKeys:UntagSAMLProvider' :: UntagSAMLProvider -> [Text]
tagKeys} -> [Text]
tagKeys) (\s :: UntagSAMLProvider
s@UntagSAMLProvider' {} [Text]
a -> UntagSAMLProvider
s {$sel:tagKeys:UntagSAMLProvider' :: [Text]
tagKeys = [Text]
a} :: UntagSAMLProvider) (([Text] -> f [Text]) -> UntagSAMLProvider -> f UntagSAMLProvider)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> UntagSAMLProvider
-> f UntagSAMLProvider
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable UntagSAMLProvider

instance Prelude.NFData UntagSAMLProvider

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

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

instance Core.ToQuery UntagSAMLProvider where
  toQuery :: UntagSAMLProvider -> QueryString
toQuery UntagSAMLProvider' {[Text]
Text
tagKeys :: [Text]
sAMLProviderArn :: Text
$sel:tagKeys:UntagSAMLProvider' :: UntagSAMLProvider -> [Text]
$sel:sAMLProviderArn:UntagSAMLProvider' :: UntagSAMLProvider -> 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
"UntagSAMLProvider" :: 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,
        ByteString
"TagKeys" ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [Text]
tagKeys
      ]

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

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

instance Prelude.NFData UntagSAMLProviderResponse