{-# 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 #-}
module Amazonka.IAM.UpdateSAMLProvider
(
UpdateSAMLProvider (..),
newUpdateSAMLProvider,
updateSAMLProvider_sAMLMetadataDocument,
updateSAMLProvider_sAMLProviderArn,
UpdateSAMLProviderResponse (..),
newUpdateSAMLProviderResponse,
updateSAMLProviderResponse_sAMLProviderArn,
updateSAMLProviderResponse_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
data UpdateSAMLProvider = UpdateSAMLProvider'
{
UpdateSAMLProvider -> Text
sAMLMetadataDocument :: Prelude.Text,
UpdateSAMLProvider -> Text
sAMLProviderArn :: Prelude.Text
}
deriving (UpdateSAMLProvider -> UpdateSAMLProvider -> Bool
(UpdateSAMLProvider -> UpdateSAMLProvider -> Bool)
-> (UpdateSAMLProvider -> UpdateSAMLProvider -> Bool)
-> Eq UpdateSAMLProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSAMLProvider -> UpdateSAMLProvider -> Bool
$c/= :: UpdateSAMLProvider -> UpdateSAMLProvider -> Bool
== :: UpdateSAMLProvider -> UpdateSAMLProvider -> Bool
$c== :: UpdateSAMLProvider -> UpdateSAMLProvider -> Bool
Prelude.Eq, ReadPrec [UpdateSAMLProvider]
ReadPrec UpdateSAMLProvider
Int -> ReadS UpdateSAMLProvider
ReadS [UpdateSAMLProvider]
(Int -> ReadS UpdateSAMLProvider)
-> ReadS [UpdateSAMLProvider]
-> ReadPrec UpdateSAMLProvider
-> ReadPrec [UpdateSAMLProvider]
-> Read UpdateSAMLProvider
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSAMLProvider]
$creadListPrec :: ReadPrec [UpdateSAMLProvider]
readPrec :: ReadPrec UpdateSAMLProvider
$creadPrec :: ReadPrec UpdateSAMLProvider
readList :: ReadS [UpdateSAMLProvider]
$creadList :: ReadS [UpdateSAMLProvider]
readsPrec :: Int -> ReadS UpdateSAMLProvider
$creadsPrec :: Int -> ReadS UpdateSAMLProvider
Prelude.Read, Int -> UpdateSAMLProvider -> ShowS
[UpdateSAMLProvider] -> ShowS
UpdateSAMLProvider -> String
(Int -> UpdateSAMLProvider -> ShowS)
-> (UpdateSAMLProvider -> String)
-> ([UpdateSAMLProvider] -> ShowS)
-> Show UpdateSAMLProvider
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSAMLProvider] -> ShowS
$cshowList :: [UpdateSAMLProvider] -> ShowS
show :: UpdateSAMLProvider -> String
$cshow :: UpdateSAMLProvider -> String
showsPrec :: Int -> UpdateSAMLProvider -> ShowS
$cshowsPrec :: Int -> UpdateSAMLProvider -> ShowS
Prelude.Show, (forall x. UpdateSAMLProvider -> Rep UpdateSAMLProvider x)
-> (forall x. Rep UpdateSAMLProvider x -> UpdateSAMLProvider)
-> Generic UpdateSAMLProvider
forall x. Rep UpdateSAMLProvider x -> UpdateSAMLProvider
forall x. UpdateSAMLProvider -> Rep UpdateSAMLProvider x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSAMLProvider x -> UpdateSAMLProvider
$cfrom :: forall x. UpdateSAMLProvider -> Rep UpdateSAMLProvider x
Prelude.Generic)
newUpdateSAMLProvider ::
Prelude.Text ->
Prelude.Text ->
UpdateSAMLProvider
newUpdateSAMLProvider :: Text -> Text -> UpdateSAMLProvider
newUpdateSAMLProvider
Text
pSAMLMetadataDocument_
Text
pSAMLProviderArn_ =
UpdateSAMLProvider' :: Text -> Text -> UpdateSAMLProvider
UpdateSAMLProvider'
{ $sel:sAMLMetadataDocument:UpdateSAMLProvider' :: Text
sAMLMetadataDocument =
Text
pSAMLMetadataDocument_,
$sel:sAMLProviderArn:UpdateSAMLProvider' :: Text
sAMLProviderArn = Text
pSAMLProviderArn_
}
updateSAMLProvider_sAMLMetadataDocument :: Lens.Lens' UpdateSAMLProvider Prelude.Text
updateSAMLProvider_sAMLMetadataDocument :: (Text -> f Text) -> UpdateSAMLProvider -> f UpdateSAMLProvider
updateSAMLProvider_sAMLMetadataDocument = (UpdateSAMLProvider -> Text)
-> (UpdateSAMLProvider -> Text -> UpdateSAMLProvider)
-> Lens UpdateSAMLProvider UpdateSAMLProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSAMLProvider' {Text
sAMLMetadataDocument :: Text
$sel:sAMLMetadataDocument:UpdateSAMLProvider' :: UpdateSAMLProvider -> Text
sAMLMetadataDocument} -> Text
sAMLMetadataDocument) (\s :: UpdateSAMLProvider
s@UpdateSAMLProvider' {} Text
a -> UpdateSAMLProvider
s {$sel:sAMLMetadataDocument:UpdateSAMLProvider' :: Text
sAMLMetadataDocument = Text
a} :: UpdateSAMLProvider)
updateSAMLProvider_sAMLProviderArn :: Lens.Lens' UpdateSAMLProvider Prelude.Text
updateSAMLProvider_sAMLProviderArn :: (Text -> f Text) -> UpdateSAMLProvider -> f UpdateSAMLProvider
updateSAMLProvider_sAMLProviderArn = (UpdateSAMLProvider -> Text)
-> (UpdateSAMLProvider -> Text -> UpdateSAMLProvider)
-> Lens UpdateSAMLProvider UpdateSAMLProvider Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSAMLProvider' {Text
sAMLProviderArn :: Text
$sel:sAMLProviderArn:UpdateSAMLProvider' :: UpdateSAMLProvider -> Text
sAMLProviderArn} -> Text
sAMLProviderArn) (\s :: UpdateSAMLProvider
s@UpdateSAMLProvider' {} Text
a -> UpdateSAMLProvider
s {$sel:sAMLProviderArn:UpdateSAMLProvider' :: Text
sAMLProviderArn = Text
a} :: UpdateSAMLProvider)
instance Core.AWSRequest UpdateSAMLProvider where
type
AWSResponse UpdateSAMLProvider =
UpdateSAMLProviderResponse
request :: UpdateSAMLProvider -> Request UpdateSAMLProvider
request = Service -> UpdateSAMLProvider -> Request UpdateSAMLProvider
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateSAMLProvider
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateSAMLProvider)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse UpdateSAMLProvider))
-> Logger
-> Service
-> Proxy UpdateSAMLProvider
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateSAMLProvider)))
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
"UpdateSAMLProviderResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text -> Int -> UpdateSAMLProviderResponse
UpdateSAMLProviderResponse'
(Maybe Text -> Int -> UpdateSAMLProviderResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateSAMLProviderResponse)
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 (Int -> UpdateSAMLProviderResponse)
-> Either String Int -> Either String UpdateSAMLProviderResponse
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 UpdateSAMLProvider
instance Prelude.NFData UpdateSAMLProvider
instance Core.ToHeaders UpdateSAMLProvider where
toHeaders :: UpdateSAMLProvider -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateSAMLProvider -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath UpdateSAMLProvider where
toPath :: UpdateSAMLProvider -> ByteString
toPath = ByteString -> UpdateSAMLProvider -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateSAMLProvider where
toQuery :: UpdateSAMLProvider -> QueryString
toQuery UpdateSAMLProvider' {Text
sAMLProviderArn :: Text
sAMLMetadataDocument :: Text
$sel:sAMLProviderArn:UpdateSAMLProvider' :: UpdateSAMLProvider -> Text
$sel:sAMLMetadataDocument:UpdateSAMLProvider' :: UpdateSAMLProvider -> 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
"UpdateSAMLProvider" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
ByteString
"SAMLMetadataDocument" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sAMLMetadataDocument,
ByteString
"SAMLProviderArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sAMLProviderArn
]
data UpdateSAMLProviderResponse = UpdateSAMLProviderResponse'
{
UpdateSAMLProviderResponse -> Maybe Text
sAMLProviderArn :: Prelude.Maybe Prelude.Text,
UpdateSAMLProviderResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateSAMLProviderResponse -> UpdateSAMLProviderResponse -> Bool
(UpdateSAMLProviderResponse -> UpdateSAMLProviderResponse -> Bool)
-> (UpdateSAMLProviderResponse
-> UpdateSAMLProviderResponse -> Bool)
-> Eq UpdateSAMLProviderResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSAMLProviderResponse -> UpdateSAMLProviderResponse -> Bool
$c/= :: UpdateSAMLProviderResponse -> UpdateSAMLProviderResponse -> Bool
== :: UpdateSAMLProviderResponse -> UpdateSAMLProviderResponse -> Bool
$c== :: UpdateSAMLProviderResponse -> UpdateSAMLProviderResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSAMLProviderResponse]
ReadPrec UpdateSAMLProviderResponse
Int -> ReadS UpdateSAMLProviderResponse
ReadS [UpdateSAMLProviderResponse]
(Int -> ReadS UpdateSAMLProviderResponse)
-> ReadS [UpdateSAMLProviderResponse]
-> ReadPrec UpdateSAMLProviderResponse
-> ReadPrec [UpdateSAMLProviderResponse]
-> Read UpdateSAMLProviderResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSAMLProviderResponse]
$creadListPrec :: ReadPrec [UpdateSAMLProviderResponse]
readPrec :: ReadPrec UpdateSAMLProviderResponse
$creadPrec :: ReadPrec UpdateSAMLProviderResponse
readList :: ReadS [UpdateSAMLProviderResponse]
$creadList :: ReadS [UpdateSAMLProviderResponse]
readsPrec :: Int -> ReadS UpdateSAMLProviderResponse
$creadsPrec :: Int -> ReadS UpdateSAMLProviderResponse
Prelude.Read, Int -> UpdateSAMLProviderResponse -> ShowS
[UpdateSAMLProviderResponse] -> ShowS
UpdateSAMLProviderResponse -> String
(Int -> UpdateSAMLProviderResponse -> ShowS)
-> (UpdateSAMLProviderResponse -> String)
-> ([UpdateSAMLProviderResponse] -> ShowS)
-> Show UpdateSAMLProviderResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSAMLProviderResponse] -> ShowS
$cshowList :: [UpdateSAMLProviderResponse] -> ShowS
show :: UpdateSAMLProviderResponse -> String
$cshow :: UpdateSAMLProviderResponse -> String
showsPrec :: Int -> UpdateSAMLProviderResponse -> ShowS
$cshowsPrec :: Int -> UpdateSAMLProviderResponse -> ShowS
Prelude.Show, (forall x.
UpdateSAMLProviderResponse -> Rep UpdateSAMLProviderResponse x)
-> (forall x.
Rep UpdateSAMLProviderResponse x -> UpdateSAMLProviderResponse)
-> Generic UpdateSAMLProviderResponse
forall x.
Rep UpdateSAMLProviderResponse x -> UpdateSAMLProviderResponse
forall x.
UpdateSAMLProviderResponse -> Rep UpdateSAMLProviderResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSAMLProviderResponse x -> UpdateSAMLProviderResponse
$cfrom :: forall x.
UpdateSAMLProviderResponse -> Rep UpdateSAMLProviderResponse x
Prelude.Generic)
newUpdateSAMLProviderResponse ::
Prelude.Int ->
UpdateSAMLProviderResponse
newUpdateSAMLProviderResponse :: Int -> UpdateSAMLProviderResponse
newUpdateSAMLProviderResponse Int
pHttpStatus_ =
UpdateSAMLProviderResponse' :: Maybe Text -> Int -> UpdateSAMLProviderResponse
UpdateSAMLProviderResponse'
{ $sel:sAMLProviderArn:UpdateSAMLProviderResponse' :: Maybe Text
sAMLProviderArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateSAMLProviderResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateSAMLProviderResponse_sAMLProviderArn :: Lens.Lens' UpdateSAMLProviderResponse (Prelude.Maybe Prelude.Text)
updateSAMLProviderResponse_sAMLProviderArn :: (Maybe Text -> f (Maybe Text))
-> UpdateSAMLProviderResponse -> f UpdateSAMLProviderResponse
updateSAMLProviderResponse_sAMLProviderArn = (UpdateSAMLProviderResponse -> Maybe Text)
-> (UpdateSAMLProviderResponse
-> Maybe Text -> UpdateSAMLProviderResponse)
-> Lens
UpdateSAMLProviderResponse
UpdateSAMLProviderResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSAMLProviderResponse' {Maybe Text
sAMLProviderArn :: Maybe Text
$sel:sAMLProviderArn:UpdateSAMLProviderResponse' :: UpdateSAMLProviderResponse -> Maybe Text
sAMLProviderArn} -> Maybe Text
sAMLProviderArn) (\s :: UpdateSAMLProviderResponse
s@UpdateSAMLProviderResponse' {} Maybe Text
a -> UpdateSAMLProviderResponse
s {$sel:sAMLProviderArn:UpdateSAMLProviderResponse' :: Maybe Text
sAMLProviderArn = Maybe Text
a} :: UpdateSAMLProviderResponse)
updateSAMLProviderResponse_httpStatus :: Lens.Lens' UpdateSAMLProviderResponse Prelude.Int
updateSAMLProviderResponse_httpStatus :: (Int -> f Int)
-> UpdateSAMLProviderResponse -> f UpdateSAMLProviderResponse
updateSAMLProviderResponse_httpStatus = (UpdateSAMLProviderResponse -> Int)
-> (UpdateSAMLProviderResponse
-> Int -> UpdateSAMLProviderResponse)
-> Lens
UpdateSAMLProviderResponse UpdateSAMLProviderResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSAMLProviderResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateSAMLProviderResponse' :: UpdateSAMLProviderResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateSAMLProviderResponse
s@UpdateSAMLProviderResponse' {} Int
a -> UpdateSAMLProviderResponse
s {$sel:httpStatus:UpdateSAMLProviderResponse' :: Int
httpStatus = Int
a} :: UpdateSAMLProviderResponse)
instance Prelude.NFData UpdateSAMLProviderResponse