{-# 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.CreateSAMLProvider
-- 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)
--
-- Creates an IAM resource that describes an identity provider (IdP) that
-- supports SAML 2.0.
--
-- The SAML provider resource that you create with this operation can be
-- used as a principal in an IAM role\'s trust policy. Such a policy can
-- enable federated users who sign in using the SAML IdP to assume the
-- role. You can create an IAM role that supports Web-based single sign-on
-- (SSO) to the Amazon Web Services Management Console or one that supports
-- API access to Amazon Web Services.
--
-- When you create the SAML provider resource, you upload a SAML metadata
-- document that you get from your IdP. That document includes the
-- issuer\'s name, expiration information, and keys that can be used to
-- validate the SAML authentication response (assertions) that the IdP
-- sends. You must generate the metadata document using the identity
-- management software that is used as your organization\'s IdP.
--
-- This operation requires
-- <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html Signature Version 4>.
--
-- For more information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html Enabling SAML 2.0 federated users to access the Amazon Web Services Management Console>
-- and
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html About SAML 2.0-based federation>
-- in the /IAM User Guide/.
module Amazonka.IAM.CreateSAMLProvider
  ( -- * Creating a Request
    CreateSAMLProvider (..),
    newCreateSAMLProvider,

    -- * Request Lenses
    createSAMLProvider_tags,
    createSAMLProvider_sAMLMetadataDocument,
    createSAMLProvider_name,

    -- * Destructuring the Response
    CreateSAMLProviderResponse (..),
    newCreateSAMLProviderResponse,

    -- * Response Lenses
    createSAMLProviderResponse_sAMLProviderArn,
    createSAMLProviderResponse_tags,
    createSAMLProviderResponse_httpStatus,
  )
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:/ 'newCreateSAMLProvider' smart constructor.
data CreateSAMLProvider = CreateSAMLProvider'
  { -- | A list of tags that you want to attach to the new IAM SAML provider.
    -- Each tag consists of a key name and an associated value. 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/.
    --
    -- If any one of the tags is invalid or if you exceed the allowed maximum
    -- number of tags, then the entire request fails and the resource is not
    -- created.
    CreateSAMLProvider -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | An XML document generated by an identity provider (IdP) that supports
    -- SAML 2.0. The document includes the issuer\'s name, expiration
    -- information, and keys that can be used to validate the SAML
    -- authentication response (assertions) that are received from the IdP. You
    -- must generate the metadata document using the identity management
    -- software that is used as your organization\'s IdP.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html About SAML 2.0-based federation>
    -- in the /IAM User Guide/
    CreateSAMLProvider -> Text
sAMLMetadataDocument :: Prelude.Text,
    -- | The name of the provider to create.
    --
    -- 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: _+=,.\@-
    CreateSAMLProvider -> Text
name :: Prelude.Text
  }
  deriving (CreateSAMLProvider -> CreateSAMLProvider -> Bool
(CreateSAMLProvider -> CreateSAMLProvider -> Bool)
-> (CreateSAMLProvider -> CreateSAMLProvider -> Bool)
-> Eq CreateSAMLProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSAMLProvider -> CreateSAMLProvider -> Bool
$c/= :: CreateSAMLProvider -> CreateSAMLProvider -> Bool
== :: CreateSAMLProvider -> CreateSAMLProvider -> Bool
$c== :: CreateSAMLProvider -> CreateSAMLProvider -> Bool
Prelude.Eq, ReadPrec [CreateSAMLProvider]
ReadPrec CreateSAMLProvider
Int -> ReadS CreateSAMLProvider
ReadS [CreateSAMLProvider]
(Int -> ReadS CreateSAMLProvider)
-> ReadS [CreateSAMLProvider]
-> ReadPrec CreateSAMLProvider
-> ReadPrec [CreateSAMLProvider]
-> Read CreateSAMLProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSAMLProvider]
$creadListPrec :: ReadPrec [CreateSAMLProvider]
readPrec :: ReadPrec CreateSAMLProvider
$creadPrec :: ReadPrec CreateSAMLProvider
readList :: ReadS [CreateSAMLProvider]
$creadList :: ReadS [CreateSAMLProvider]
readsPrec :: Int -> ReadS CreateSAMLProvider
$creadsPrec :: Int -> ReadS CreateSAMLProvider
Prelude.Read, Int -> CreateSAMLProvider -> ShowS
[CreateSAMLProvider] -> ShowS
CreateSAMLProvider -> String
(Int -> CreateSAMLProvider -> ShowS)
-> (CreateSAMLProvider -> String)
-> ([CreateSAMLProvider] -> ShowS)
-> Show CreateSAMLProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSAMLProvider] -> ShowS
$cshowList :: [CreateSAMLProvider] -> ShowS
show :: CreateSAMLProvider -> String
$cshow :: CreateSAMLProvider -> String
showsPrec :: Int -> CreateSAMLProvider -> ShowS
$cshowsPrec :: Int -> CreateSAMLProvider -> ShowS
Prelude.Show, (forall x. CreateSAMLProvider -> Rep CreateSAMLProvider x)
-> (forall x. Rep CreateSAMLProvider x -> CreateSAMLProvider)
-> Generic CreateSAMLProvider
forall x. Rep CreateSAMLProvider x -> CreateSAMLProvider
forall x. CreateSAMLProvider -> Rep CreateSAMLProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateSAMLProvider x -> CreateSAMLProvider
$cfrom :: forall x. CreateSAMLProvider -> Rep CreateSAMLProvider x
Prelude.Generic)

-- |
-- Create a value of 'CreateSAMLProvider' 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:
--
-- 'tags', 'createSAMLProvider_tags' - A list of tags that you want to attach to the new IAM SAML provider.
-- Each tag consists of a key name and an associated value. 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/.
--
-- If any one of the tags is invalid or if you exceed the allowed maximum
-- number of tags, then the entire request fails and the resource is not
-- created.
--
-- 'sAMLMetadataDocument', 'createSAMLProvider_sAMLMetadataDocument' - An XML document generated by an identity provider (IdP) that supports
-- SAML 2.0. The document includes the issuer\'s name, expiration
-- information, and keys that can be used to validate the SAML
-- authentication response (assertions) that are received from the IdP. You
-- must generate the metadata document using the identity management
-- software that is used as your organization\'s IdP.
--
-- For more information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html About SAML 2.0-based federation>
-- in the /IAM User Guide/
--
-- 'name', 'createSAMLProvider_name' - The name of the provider to create.
--
-- 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: _+=,.\@-
newCreateSAMLProvider ::
  -- | 'sAMLMetadataDocument'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  CreateSAMLProvider
newCreateSAMLProvider :: Text -> Text -> CreateSAMLProvider
newCreateSAMLProvider Text
pSAMLMetadataDocument_ Text
pName_ =
  CreateSAMLProvider' :: Maybe [Tag] -> Text -> Text -> CreateSAMLProvider
CreateSAMLProvider'
    { $sel:tags:CreateSAMLProvider' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:sAMLMetadataDocument:CreateSAMLProvider' :: Text
sAMLMetadataDocument = Text
pSAMLMetadataDocument_,
      $sel:name:CreateSAMLProvider' :: Text
name = Text
pName_
    }

-- | A list of tags that you want to attach to the new IAM SAML provider.
-- Each tag consists of a key name and an associated value. 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/.
--
-- If any one of the tags is invalid or if you exceed the allowed maximum
-- number of tags, then the entire request fails and the resource is not
-- created.
createSAMLProvider_tags :: Lens.Lens' CreateSAMLProvider (Prelude.Maybe [Tag])
createSAMLProvider_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSAMLProvider -> f CreateSAMLProvider
createSAMLProvider_tags = (CreateSAMLProvider -> Maybe [Tag])
-> (CreateSAMLProvider -> Maybe [Tag] -> CreateSAMLProvider)
-> Lens
     CreateSAMLProvider CreateSAMLProvider (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSAMLProvider' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateSAMLProvider' :: CreateSAMLProvider -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateSAMLProvider
s@CreateSAMLProvider' {} Maybe [Tag]
a -> CreateSAMLProvider
s {$sel:tags:CreateSAMLProvider' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateSAMLProvider) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateSAMLProvider -> f CreateSAMLProvider)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSAMLProvider
-> f CreateSAMLProvider
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An XML document generated by an identity provider (IdP) that supports
-- SAML 2.0. The document includes the issuer\'s name, expiration
-- information, and keys that can be used to validate the SAML
-- authentication response (assertions) that are received from the IdP. You
-- must generate the metadata document using the identity management
-- software that is used as your organization\'s IdP.
--
-- For more information, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html About SAML 2.0-based federation>
-- in the /IAM User Guide/
createSAMLProvider_sAMLMetadataDocument :: Lens.Lens' CreateSAMLProvider Prelude.Text
createSAMLProvider_sAMLMetadataDocument :: (Text -> f Text) -> CreateSAMLProvider -> f CreateSAMLProvider
createSAMLProvider_sAMLMetadataDocument = (CreateSAMLProvider -> Text)
-> (CreateSAMLProvider -> Text -> CreateSAMLProvider)
-> Lens CreateSAMLProvider CreateSAMLProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSAMLProvider' {Text
sAMLMetadataDocument :: Text
$sel:sAMLMetadataDocument:CreateSAMLProvider' :: CreateSAMLProvider -> Text
sAMLMetadataDocument} -> Text
sAMLMetadataDocument) (\s :: CreateSAMLProvider
s@CreateSAMLProvider' {} Text
a -> CreateSAMLProvider
s {$sel:sAMLMetadataDocument:CreateSAMLProvider' :: Text
sAMLMetadataDocument = Text
a} :: CreateSAMLProvider)

-- | The name of the provider to create.
--
-- 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: _+=,.\@-
createSAMLProvider_name :: Lens.Lens' CreateSAMLProvider Prelude.Text
createSAMLProvider_name :: (Text -> f Text) -> CreateSAMLProvider -> f CreateSAMLProvider
createSAMLProvider_name = (CreateSAMLProvider -> Text)
-> (CreateSAMLProvider -> Text -> CreateSAMLProvider)
-> Lens CreateSAMLProvider CreateSAMLProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSAMLProvider' {Text
name :: Text
$sel:name:CreateSAMLProvider' :: CreateSAMLProvider -> Text
name} -> Text
name) (\s :: CreateSAMLProvider
s@CreateSAMLProvider' {} Text
a -> CreateSAMLProvider
s {$sel:name:CreateSAMLProvider' :: Text
name = Text
a} :: CreateSAMLProvider)

instance Core.AWSRequest CreateSAMLProvider where
  type
    AWSResponse CreateSAMLProvider =
      CreateSAMLProviderResponse
  request :: CreateSAMLProvider -> Request CreateSAMLProvider
request = Service -> CreateSAMLProvider -> Request CreateSAMLProvider
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateSAMLProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateSAMLProvider)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse CreateSAMLProvider))
-> Logger
-> Service
-> Proxy CreateSAMLProvider
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateSAMLProvider)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"CreateSAMLProviderResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Maybe [Tag] -> Int -> CreateSAMLProviderResponse
CreateSAMLProviderResponse'
            (Maybe Text -> Maybe [Tag] -> Int -> CreateSAMLProviderResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Tag] -> Int -> CreateSAMLProviderResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SAMLProviderArn")
            Either String (Maybe [Tag] -> Int -> CreateSAMLProviderResponse)
-> Either String (Maybe [Tag])
-> Either String (Int -> CreateSAMLProviderResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Tags" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [Tag]))
-> Either String (Maybe [Tag])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Tag])
-> [Node] -> Either String (Maybe [Tag])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Tag]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> CreateSAMLProviderResponse)
-> Either String Int -> Either String CreateSAMLProviderResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateSAMLProvider

instance Prelude.NFData CreateSAMLProvider

instance Core.ToHeaders CreateSAMLProvider where
  toHeaders :: CreateSAMLProvider -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateSAMLProvider -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery CreateSAMLProvider where
  toQuery :: CreateSAMLProvider -> QueryString
toQuery CreateSAMLProvider' {Maybe [Tag]
Text
name :: Text
sAMLMetadataDocument :: Text
tags :: Maybe [Tag]
$sel:name:CreateSAMLProvider' :: CreateSAMLProvider -> Text
$sel:sAMLMetadataDocument:CreateSAMLProvider' :: CreateSAMLProvider -> Text
$sel:tags:CreateSAMLProvider' :: CreateSAMLProvider -> Maybe [Tag]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateSAMLProvider" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"SAMLMetadataDocument" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sAMLMetadataDocument,
        ByteString
"Name" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
name
      ]

-- | Contains the response to a successful CreateSAMLProvider request.
--
-- /See:/ 'newCreateSAMLProviderResponse' smart constructor.
data CreateSAMLProviderResponse = CreateSAMLProviderResponse'
  { -- | The Amazon Resource Name (ARN) of the new SAML provider resource in IAM.
    CreateSAMLProviderResponse -> Maybe Text
sAMLProviderArn :: Prelude.Maybe Prelude.Text,
    -- | A list of tags that are attached to the new IAM SAML provider. The
    -- returned list of tags is sorted by tag key. 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/.
    CreateSAMLProviderResponse -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The response's http status code.
    CreateSAMLProviderResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateSAMLProviderResponse -> CreateSAMLProviderResponse -> Bool
(CreateSAMLProviderResponse -> CreateSAMLProviderResponse -> Bool)
-> (CreateSAMLProviderResponse
    -> CreateSAMLProviderResponse -> Bool)
-> Eq CreateSAMLProviderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSAMLProviderResponse -> CreateSAMLProviderResponse -> Bool
$c/= :: CreateSAMLProviderResponse -> CreateSAMLProviderResponse -> Bool
== :: CreateSAMLProviderResponse -> CreateSAMLProviderResponse -> Bool
$c== :: CreateSAMLProviderResponse -> CreateSAMLProviderResponse -> Bool
Prelude.Eq, ReadPrec [CreateSAMLProviderResponse]
ReadPrec CreateSAMLProviderResponse
Int -> ReadS CreateSAMLProviderResponse
ReadS [CreateSAMLProviderResponse]
(Int -> ReadS CreateSAMLProviderResponse)
-> ReadS [CreateSAMLProviderResponse]
-> ReadPrec CreateSAMLProviderResponse
-> ReadPrec [CreateSAMLProviderResponse]
-> Read CreateSAMLProviderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSAMLProviderResponse]
$creadListPrec :: ReadPrec [CreateSAMLProviderResponse]
readPrec :: ReadPrec CreateSAMLProviderResponse
$creadPrec :: ReadPrec CreateSAMLProviderResponse
readList :: ReadS [CreateSAMLProviderResponse]
$creadList :: ReadS [CreateSAMLProviderResponse]
readsPrec :: Int -> ReadS CreateSAMLProviderResponse
$creadsPrec :: Int -> ReadS CreateSAMLProviderResponse
Prelude.Read, Int -> CreateSAMLProviderResponse -> ShowS
[CreateSAMLProviderResponse] -> ShowS
CreateSAMLProviderResponse -> String
(Int -> CreateSAMLProviderResponse -> ShowS)
-> (CreateSAMLProviderResponse -> String)
-> ([CreateSAMLProviderResponse] -> ShowS)
-> Show CreateSAMLProviderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSAMLProviderResponse] -> ShowS
$cshowList :: [CreateSAMLProviderResponse] -> ShowS
show :: CreateSAMLProviderResponse -> String
$cshow :: CreateSAMLProviderResponse -> String
showsPrec :: Int -> CreateSAMLProviderResponse -> ShowS
$cshowsPrec :: Int -> CreateSAMLProviderResponse -> ShowS
Prelude.Show, (forall x.
 CreateSAMLProviderResponse -> Rep CreateSAMLProviderResponse x)
-> (forall x.
    Rep CreateSAMLProviderResponse x -> CreateSAMLProviderResponse)
-> Generic CreateSAMLProviderResponse
forall x.
Rep CreateSAMLProviderResponse x -> CreateSAMLProviderResponse
forall x.
CreateSAMLProviderResponse -> Rep CreateSAMLProviderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateSAMLProviderResponse x -> CreateSAMLProviderResponse
$cfrom :: forall x.
CreateSAMLProviderResponse -> Rep CreateSAMLProviderResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateSAMLProviderResponse' 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', 'createSAMLProviderResponse_sAMLProviderArn' - The Amazon Resource Name (ARN) of the new SAML provider resource in IAM.
--
-- 'tags', 'createSAMLProviderResponse_tags' - A list of tags that are attached to the new IAM SAML provider. The
-- returned list of tags is sorted by tag key. 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/.
--
-- 'httpStatus', 'createSAMLProviderResponse_httpStatus' - The response's http status code.
newCreateSAMLProviderResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateSAMLProviderResponse
newCreateSAMLProviderResponse :: Int -> CreateSAMLProviderResponse
newCreateSAMLProviderResponse Int
pHttpStatus_ =
  CreateSAMLProviderResponse' :: Maybe Text -> Maybe [Tag] -> Int -> CreateSAMLProviderResponse
CreateSAMLProviderResponse'
    { $sel:sAMLProviderArn:CreateSAMLProviderResponse' :: Maybe Text
sAMLProviderArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateSAMLProviderResponse' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateSAMLProviderResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the new SAML provider resource in IAM.
createSAMLProviderResponse_sAMLProviderArn :: Lens.Lens' CreateSAMLProviderResponse (Prelude.Maybe Prelude.Text)
createSAMLProviderResponse_sAMLProviderArn :: (Maybe Text -> f (Maybe Text))
-> CreateSAMLProviderResponse -> f CreateSAMLProviderResponse
createSAMLProviderResponse_sAMLProviderArn = (CreateSAMLProviderResponse -> Maybe Text)
-> (CreateSAMLProviderResponse
    -> Maybe Text -> CreateSAMLProviderResponse)
-> Lens
     CreateSAMLProviderResponse
     CreateSAMLProviderResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSAMLProviderResponse' {Maybe Text
sAMLProviderArn :: Maybe Text
$sel:sAMLProviderArn:CreateSAMLProviderResponse' :: CreateSAMLProviderResponse -> Maybe Text
sAMLProviderArn} -> Maybe Text
sAMLProviderArn) (\s :: CreateSAMLProviderResponse
s@CreateSAMLProviderResponse' {} Maybe Text
a -> CreateSAMLProviderResponse
s {$sel:sAMLProviderArn:CreateSAMLProviderResponse' :: Maybe Text
sAMLProviderArn = Maybe Text
a} :: CreateSAMLProviderResponse)

-- | A list of tags that are attached to the new IAM SAML provider. The
-- returned list of tags is sorted by tag key. 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/.
createSAMLProviderResponse_tags :: Lens.Lens' CreateSAMLProviderResponse (Prelude.Maybe [Tag])
createSAMLProviderResponse_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSAMLProviderResponse -> f CreateSAMLProviderResponse
createSAMLProviderResponse_tags = (CreateSAMLProviderResponse -> Maybe [Tag])
-> (CreateSAMLProviderResponse
    -> Maybe [Tag] -> CreateSAMLProviderResponse)
-> Lens
     CreateSAMLProviderResponse
     CreateSAMLProviderResponse
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSAMLProviderResponse' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateSAMLProviderResponse' :: CreateSAMLProviderResponse -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateSAMLProviderResponse
s@CreateSAMLProviderResponse' {} Maybe [Tag]
a -> CreateSAMLProviderResponse
s {$sel:tags:CreateSAMLProviderResponse' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateSAMLProviderResponse) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateSAMLProviderResponse -> f CreateSAMLProviderResponse)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateSAMLProviderResponse
-> f CreateSAMLProviderResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
createSAMLProviderResponse_httpStatus :: Lens.Lens' CreateSAMLProviderResponse Prelude.Int
createSAMLProviderResponse_httpStatus :: (Int -> f Int)
-> CreateSAMLProviderResponse -> f CreateSAMLProviderResponse
createSAMLProviderResponse_httpStatus = (CreateSAMLProviderResponse -> Int)
-> (CreateSAMLProviderResponse
    -> Int -> CreateSAMLProviderResponse)
-> Lens
     CreateSAMLProviderResponse CreateSAMLProviderResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSAMLProviderResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateSAMLProviderResponse' :: CreateSAMLProviderResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateSAMLProviderResponse
s@CreateSAMLProviderResponse' {} Int
a -> CreateSAMLProviderResponse
s {$sel:httpStatus:CreateSAMLProviderResponse' :: Int
httpStatus = Int
a} :: CreateSAMLProviderResponse)

instance Prelude.NFData CreateSAMLProviderResponse