{-# 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.UpdateSAMLProvider -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Updates the metadata document for an existing SAML provider resource -- object. -- -- This operation requires -- . module Amazonka.IAM.UpdateSAMLProvider ( -- * Creating a Request UpdateSAMLProvider (..), newUpdateSAMLProvider, -- * Request Lenses updateSAMLProvider_sAMLMetadataDocument, updateSAMLProvider_sAMLProviderArn, -- * Destructuring the Response UpdateSAMLProviderResponse (..), newUpdateSAMLProviderResponse, -- * Response Lenses updateSAMLProviderResponse_sAMLProviderArn, updateSAMLProviderResponse_httpStatus, ) where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.IAM.Types import qualified Amazonka.Prelude as Prelude import qualified Amazonka.Request as Request import qualified Amazonka.Response as Response -- | /See:/ 'newUpdateSAMLProvider' smart constructor. data UpdateSAMLProvider = UpdateSAMLProvider' { -- | 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. sAMLMetadataDocument :: Prelude.Text, -- | The Amazon Resource Name (ARN) of the SAML provider to update. -- -- For more information about ARNs, see -- -- in the /Amazon Web Services General Reference/. sAMLProviderArn :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'UpdateSAMLProvider' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'sAMLMetadataDocument', 'updateSAMLProvider_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. -- -- 'sAMLProviderArn', 'updateSAMLProvider_sAMLProviderArn' - The Amazon Resource Name (ARN) of the SAML provider to update. -- -- For more information about ARNs, see -- -- in the /Amazon Web Services General Reference/. newUpdateSAMLProvider :: -- | 'sAMLMetadataDocument' Prelude.Text -> -- | 'sAMLProviderArn' Prelude.Text -> UpdateSAMLProvider newUpdateSAMLProvider pSAMLMetadataDocument_ pSAMLProviderArn_ = UpdateSAMLProvider' { sAMLMetadataDocument = pSAMLMetadataDocument_, sAMLProviderArn = pSAMLProviderArn_ } -- | 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. updateSAMLProvider_sAMLMetadataDocument :: Lens.Lens' UpdateSAMLProvider Prelude.Text updateSAMLProvider_sAMLMetadataDocument = Lens.lens (\UpdateSAMLProvider' {sAMLMetadataDocument} -> sAMLMetadataDocument) (\s@UpdateSAMLProvider' {} a -> s {sAMLMetadataDocument = a} :: UpdateSAMLProvider) -- | The Amazon Resource Name (ARN) of the SAML provider to update. -- -- For more information about ARNs, see -- -- in the /Amazon Web Services General Reference/. updateSAMLProvider_sAMLProviderArn :: Lens.Lens' UpdateSAMLProvider Prelude.Text updateSAMLProvider_sAMLProviderArn = Lens.lens (\UpdateSAMLProvider' {sAMLProviderArn} -> sAMLProviderArn) (\s@UpdateSAMLProvider' {} a -> s {sAMLProviderArn = a} :: UpdateSAMLProvider) instance Core.AWSRequest UpdateSAMLProvider where type AWSResponse UpdateSAMLProvider = UpdateSAMLProviderResponse request overrides = Request.postQuery (overrides defaultService) response = Response.receiveXMLWrapper "UpdateSAMLProviderResult" ( \s h x -> UpdateSAMLProviderResponse' Prelude.<$> (x Data..@? "SAMLProviderArn") Prelude.<*> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable UpdateSAMLProvider where hashWithSalt _salt UpdateSAMLProvider' {..} = _salt `Prelude.hashWithSalt` sAMLMetadataDocument `Prelude.hashWithSalt` sAMLProviderArn instance Prelude.NFData UpdateSAMLProvider where rnf UpdateSAMLProvider' {..} = Prelude.rnf sAMLMetadataDocument `Prelude.seq` Prelude.rnf sAMLProviderArn instance Data.ToHeaders UpdateSAMLProvider where toHeaders = Prelude.const Prelude.mempty instance Data.ToPath UpdateSAMLProvider where toPath = Prelude.const "/" instance Data.ToQuery UpdateSAMLProvider where toQuery UpdateSAMLProvider' {..} = Prelude.mconcat [ "Action" Data.=: ("UpdateSAMLProvider" :: Prelude.ByteString), "Version" Data.=: ("2010-05-08" :: Prelude.ByteString), "SAMLMetadataDocument" Data.=: sAMLMetadataDocument, "SAMLProviderArn" Data.=: sAMLProviderArn ] -- | Contains the response to a successful UpdateSAMLProvider request. -- -- /See:/ 'newUpdateSAMLProviderResponse' smart constructor. data UpdateSAMLProviderResponse = UpdateSAMLProviderResponse' { -- | The Amazon Resource Name (ARN) of the SAML provider that was updated. sAMLProviderArn :: Prelude.Maybe Prelude.Text, -- | The response's http status code. httpStatus :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'UpdateSAMLProviderResponse' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'sAMLProviderArn', 'updateSAMLProviderResponse_sAMLProviderArn' - The Amazon Resource Name (ARN) of the SAML provider that was updated. -- -- 'httpStatus', 'updateSAMLProviderResponse_httpStatus' - The response's http status code. newUpdateSAMLProviderResponse :: -- | 'httpStatus' Prelude.Int -> UpdateSAMLProviderResponse newUpdateSAMLProviderResponse pHttpStatus_ = UpdateSAMLProviderResponse' { sAMLProviderArn = Prelude.Nothing, httpStatus = pHttpStatus_ } -- | The Amazon Resource Name (ARN) of the SAML provider that was updated. updateSAMLProviderResponse_sAMLProviderArn :: Lens.Lens' UpdateSAMLProviderResponse (Prelude.Maybe Prelude.Text) updateSAMLProviderResponse_sAMLProviderArn = Lens.lens (\UpdateSAMLProviderResponse' {sAMLProviderArn} -> sAMLProviderArn) (\s@UpdateSAMLProviderResponse' {} a -> s {sAMLProviderArn = a} :: UpdateSAMLProviderResponse) -- | The response's http status code. updateSAMLProviderResponse_httpStatus :: Lens.Lens' UpdateSAMLProviderResponse Prelude.Int updateSAMLProviderResponse_httpStatus = Lens.lens (\UpdateSAMLProviderResponse' {httpStatus} -> httpStatus) (\s@UpdateSAMLProviderResponse' {} a -> s {httpStatus = a} :: UpdateSAMLProviderResponse) instance Prelude.NFData UpdateSAMLProviderResponse where rnf UpdateSAMLProviderResponse' {..} = Prelude.rnf sAMLProviderArn `Prelude.seq` Prelude.rnf httpStatus