{-# 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.SSOAdmin.UpdatePermissionSet
(
UpdatePermissionSet (..),
newUpdatePermissionSet,
updatePermissionSet_relayState,
updatePermissionSet_sessionDuration,
updatePermissionSet_description,
updatePermissionSet_instanceArn,
updatePermissionSet_permissionSetArn,
UpdatePermissionSetResponse (..),
newUpdatePermissionSetResponse,
updatePermissionSetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSOAdmin.Types
data UpdatePermissionSet = UpdatePermissionSet'
{
UpdatePermissionSet -> Maybe Text
relayState :: Prelude.Maybe Prelude.Text,
UpdatePermissionSet -> Maybe Text
sessionDuration :: Prelude.Maybe Prelude.Text,
UpdatePermissionSet -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdatePermissionSet -> Text
instanceArn :: Prelude.Text,
UpdatePermissionSet -> Text
permissionSetArn :: Prelude.Text
}
deriving (UpdatePermissionSet -> UpdatePermissionSet -> Bool
(UpdatePermissionSet -> UpdatePermissionSet -> Bool)
-> (UpdatePermissionSet -> UpdatePermissionSet -> Bool)
-> Eq UpdatePermissionSet
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePermissionSet -> UpdatePermissionSet -> Bool
$c/= :: UpdatePermissionSet -> UpdatePermissionSet -> Bool
== :: UpdatePermissionSet -> UpdatePermissionSet -> Bool
$c== :: UpdatePermissionSet -> UpdatePermissionSet -> Bool
Prelude.Eq, ReadPrec [UpdatePermissionSet]
ReadPrec UpdatePermissionSet
Int -> ReadS UpdatePermissionSet
ReadS [UpdatePermissionSet]
(Int -> ReadS UpdatePermissionSet)
-> ReadS [UpdatePermissionSet]
-> ReadPrec UpdatePermissionSet
-> ReadPrec [UpdatePermissionSet]
-> Read UpdatePermissionSet
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePermissionSet]
$creadListPrec :: ReadPrec [UpdatePermissionSet]
readPrec :: ReadPrec UpdatePermissionSet
$creadPrec :: ReadPrec UpdatePermissionSet
readList :: ReadS [UpdatePermissionSet]
$creadList :: ReadS [UpdatePermissionSet]
readsPrec :: Int -> ReadS UpdatePermissionSet
$creadsPrec :: Int -> ReadS UpdatePermissionSet
Prelude.Read, Int -> UpdatePermissionSet -> ShowS
[UpdatePermissionSet] -> ShowS
UpdatePermissionSet -> String
(Int -> UpdatePermissionSet -> ShowS)
-> (UpdatePermissionSet -> String)
-> ([UpdatePermissionSet] -> ShowS)
-> Show UpdatePermissionSet
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePermissionSet] -> ShowS
$cshowList :: [UpdatePermissionSet] -> ShowS
show :: UpdatePermissionSet -> String
$cshow :: UpdatePermissionSet -> String
showsPrec :: Int -> UpdatePermissionSet -> ShowS
$cshowsPrec :: Int -> UpdatePermissionSet -> ShowS
Prelude.Show, (forall x. UpdatePermissionSet -> Rep UpdatePermissionSet x)
-> (forall x. Rep UpdatePermissionSet x -> UpdatePermissionSet)
-> Generic UpdatePermissionSet
forall x. Rep UpdatePermissionSet x -> UpdatePermissionSet
forall x. UpdatePermissionSet -> Rep UpdatePermissionSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdatePermissionSet x -> UpdatePermissionSet
$cfrom :: forall x. UpdatePermissionSet -> Rep UpdatePermissionSet x
Prelude.Generic)
newUpdatePermissionSet ::
Prelude.Text ->
Prelude.Text ->
UpdatePermissionSet
newUpdatePermissionSet :: Text -> Text -> UpdatePermissionSet
newUpdatePermissionSet
Text
pInstanceArn_
Text
pPermissionSetArn_ =
UpdatePermissionSet' :: Maybe Text
-> Maybe Text -> Maybe Text -> Text -> Text -> UpdatePermissionSet
UpdatePermissionSet'
{ $sel:relayState:UpdatePermissionSet' :: Maybe Text
relayState = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sessionDuration:UpdatePermissionSet' :: Maybe Text
sessionDuration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdatePermissionSet' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceArn:UpdatePermissionSet' :: Text
instanceArn = Text
pInstanceArn_,
$sel:permissionSetArn:UpdatePermissionSet' :: Text
permissionSetArn = Text
pPermissionSetArn_
}
updatePermissionSet_relayState :: Lens.Lens' UpdatePermissionSet (Prelude.Maybe Prelude.Text)
updatePermissionSet_relayState :: (Maybe Text -> f (Maybe Text))
-> UpdatePermissionSet -> f UpdatePermissionSet
updatePermissionSet_relayState = (UpdatePermissionSet -> Maybe Text)
-> (UpdatePermissionSet -> Maybe Text -> UpdatePermissionSet)
-> Lens
UpdatePermissionSet UpdatePermissionSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePermissionSet' {Maybe Text
relayState :: Maybe Text
$sel:relayState:UpdatePermissionSet' :: UpdatePermissionSet -> Maybe Text
relayState} -> Maybe Text
relayState) (\s :: UpdatePermissionSet
s@UpdatePermissionSet' {} Maybe Text
a -> UpdatePermissionSet
s {$sel:relayState:UpdatePermissionSet' :: Maybe Text
relayState = Maybe Text
a} :: UpdatePermissionSet)
updatePermissionSet_sessionDuration :: Lens.Lens' UpdatePermissionSet (Prelude.Maybe Prelude.Text)
updatePermissionSet_sessionDuration :: (Maybe Text -> f (Maybe Text))
-> UpdatePermissionSet -> f UpdatePermissionSet
updatePermissionSet_sessionDuration = (UpdatePermissionSet -> Maybe Text)
-> (UpdatePermissionSet -> Maybe Text -> UpdatePermissionSet)
-> Lens
UpdatePermissionSet UpdatePermissionSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePermissionSet' {Maybe Text
sessionDuration :: Maybe Text
$sel:sessionDuration:UpdatePermissionSet' :: UpdatePermissionSet -> Maybe Text
sessionDuration} -> Maybe Text
sessionDuration) (\s :: UpdatePermissionSet
s@UpdatePermissionSet' {} Maybe Text
a -> UpdatePermissionSet
s {$sel:sessionDuration:UpdatePermissionSet' :: Maybe Text
sessionDuration = Maybe Text
a} :: UpdatePermissionSet)
updatePermissionSet_description :: Lens.Lens' UpdatePermissionSet (Prelude.Maybe Prelude.Text)
updatePermissionSet_description :: (Maybe Text -> f (Maybe Text))
-> UpdatePermissionSet -> f UpdatePermissionSet
updatePermissionSet_description = (UpdatePermissionSet -> Maybe Text)
-> (UpdatePermissionSet -> Maybe Text -> UpdatePermissionSet)
-> Lens
UpdatePermissionSet UpdatePermissionSet (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePermissionSet' {Maybe Text
description :: Maybe Text
$sel:description:UpdatePermissionSet' :: UpdatePermissionSet -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdatePermissionSet
s@UpdatePermissionSet' {} Maybe Text
a -> UpdatePermissionSet
s {$sel:description:UpdatePermissionSet' :: Maybe Text
description = Maybe Text
a} :: UpdatePermissionSet)
updatePermissionSet_instanceArn :: Lens.Lens' UpdatePermissionSet Prelude.Text
updatePermissionSet_instanceArn :: (Text -> f Text) -> UpdatePermissionSet -> f UpdatePermissionSet
updatePermissionSet_instanceArn = (UpdatePermissionSet -> Text)
-> (UpdatePermissionSet -> Text -> UpdatePermissionSet)
-> Lens UpdatePermissionSet UpdatePermissionSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePermissionSet' {Text
instanceArn :: Text
$sel:instanceArn:UpdatePermissionSet' :: UpdatePermissionSet -> Text
instanceArn} -> Text
instanceArn) (\s :: UpdatePermissionSet
s@UpdatePermissionSet' {} Text
a -> UpdatePermissionSet
s {$sel:instanceArn:UpdatePermissionSet' :: Text
instanceArn = Text
a} :: UpdatePermissionSet)
updatePermissionSet_permissionSetArn :: Lens.Lens' UpdatePermissionSet Prelude.Text
updatePermissionSet_permissionSetArn :: (Text -> f Text) -> UpdatePermissionSet -> f UpdatePermissionSet
updatePermissionSet_permissionSetArn = (UpdatePermissionSet -> Text)
-> (UpdatePermissionSet -> Text -> UpdatePermissionSet)
-> Lens UpdatePermissionSet UpdatePermissionSet Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePermissionSet' {Text
permissionSetArn :: Text
$sel:permissionSetArn:UpdatePermissionSet' :: UpdatePermissionSet -> Text
permissionSetArn} -> Text
permissionSetArn) (\s :: UpdatePermissionSet
s@UpdatePermissionSet' {} Text
a -> UpdatePermissionSet
s {$sel:permissionSetArn:UpdatePermissionSet' :: Text
permissionSetArn = Text
a} :: UpdatePermissionSet)
instance Core.AWSRequest UpdatePermissionSet where
type
AWSResponse UpdatePermissionSet =
UpdatePermissionSetResponse
request :: UpdatePermissionSet -> Request UpdatePermissionSet
request = Service -> UpdatePermissionSet -> Request UpdatePermissionSet
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdatePermissionSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePermissionSet)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdatePermissionSet))
-> Logger
-> Service
-> Proxy UpdatePermissionSet
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePermissionSet)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdatePermissionSetResponse
UpdatePermissionSetResponse'
(Int -> UpdatePermissionSetResponse)
-> Either String Int -> Either String UpdatePermissionSetResponse
forall (f :: * -> *) a b. Functor 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 UpdatePermissionSet
instance Prelude.NFData UpdatePermissionSet
instance Core.ToHeaders UpdatePermissionSet where
toHeaders :: UpdatePermissionSet -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdatePermissionSet -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SWBExternalService.UpdatePermissionSet" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdatePermissionSet where
toJSON :: UpdatePermissionSet -> Value
toJSON UpdatePermissionSet' {Maybe Text
Text
permissionSetArn :: Text
instanceArn :: Text
description :: Maybe Text
sessionDuration :: Maybe Text
relayState :: Maybe Text
$sel:permissionSetArn:UpdatePermissionSet' :: UpdatePermissionSet -> Text
$sel:instanceArn:UpdatePermissionSet' :: UpdatePermissionSet -> Text
$sel:description:UpdatePermissionSet' :: UpdatePermissionSet -> Maybe Text
$sel:sessionDuration:UpdatePermissionSet' :: UpdatePermissionSet -> Maybe Text
$sel:relayState:UpdatePermissionSet' :: UpdatePermissionSet -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"RelayState" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
relayState,
(Text
"SessionDuration" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sessionDuration,
(Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InstanceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"PermissionSetArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
permissionSetArn)
]
)
instance Core.ToPath UpdatePermissionSet where
toPath :: UpdatePermissionSet -> ByteString
toPath = ByteString -> UpdatePermissionSet -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdatePermissionSet where
toQuery :: UpdatePermissionSet -> QueryString
toQuery = QueryString -> UpdatePermissionSet -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdatePermissionSetResponse = UpdatePermissionSetResponse'
{
UpdatePermissionSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdatePermissionSetResponse -> UpdatePermissionSetResponse -> Bool
(UpdatePermissionSetResponse
-> UpdatePermissionSetResponse -> Bool)
-> (UpdatePermissionSetResponse
-> UpdatePermissionSetResponse -> Bool)
-> Eq UpdatePermissionSetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePermissionSetResponse -> UpdatePermissionSetResponse -> Bool
$c/= :: UpdatePermissionSetResponse -> UpdatePermissionSetResponse -> Bool
== :: UpdatePermissionSetResponse -> UpdatePermissionSetResponse -> Bool
$c== :: UpdatePermissionSetResponse -> UpdatePermissionSetResponse -> Bool
Prelude.Eq, ReadPrec [UpdatePermissionSetResponse]
ReadPrec UpdatePermissionSetResponse
Int -> ReadS UpdatePermissionSetResponse
ReadS [UpdatePermissionSetResponse]
(Int -> ReadS UpdatePermissionSetResponse)
-> ReadS [UpdatePermissionSetResponse]
-> ReadPrec UpdatePermissionSetResponse
-> ReadPrec [UpdatePermissionSetResponse]
-> Read UpdatePermissionSetResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePermissionSetResponse]
$creadListPrec :: ReadPrec [UpdatePermissionSetResponse]
readPrec :: ReadPrec UpdatePermissionSetResponse
$creadPrec :: ReadPrec UpdatePermissionSetResponse
readList :: ReadS [UpdatePermissionSetResponse]
$creadList :: ReadS [UpdatePermissionSetResponse]
readsPrec :: Int -> ReadS UpdatePermissionSetResponse
$creadsPrec :: Int -> ReadS UpdatePermissionSetResponse
Prelude.Read, Int -> UpdatePermissionSetResponse -> ShowS
[UpdatePermissionSetResponse] -> ShowS
UpdatePermissionSetResponse -> String
(Int -> UpdatePermissionSetResponse -> ShowS)
-> (UpdatePermissionSetResponse -> String)
-> ([UpdatePermissionSetResponse] -> ShowS)
-> Show UpdatePermissionSetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePermissionSetResponse] -> ShowS
$cshowList :: [UpdatePermissionSetResponse] -> ShowS
show :: UpdatePermissionSetResponse -> String
$cshow :: UpdatePermissionSetResponse -> String
showsPrec :: Int -> UpdatePermissionSetResponse -> ShowS
$cshowsPrec :: Int -> UpdatePermissionSetResponse -> ShowS
Prelude.Show, (forall x.
UpdatePermissionSetResponse -> Rep UpdatePermissionSetResponse x)
-> (forall x.
Rep UpdatePermissionSetResponse x -> UpdatePermissionSetResponse)
-> Generic UpdatePermissionSetResponse
forall x.
Rep UpdatePermissionSetResponse x -> UpdatePermissionSetResponse
forall x.
UpdatePermissionSetResponse -> Rep UpdatePermissionSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdatePermissionSetResponse x -> UpdatePermissionSetResponse
$cfrom :: forall x.
UpdatePermissionSetResponse -> Rep UpdatePermissionSetResponse x
Prelude.Generic)
newUpdatePermissionSetResponse ::
Prelude.Int ->
UpdatePermissionSetResponse
newUpdatePermissionSetResponse :: Int -> UpdatePermissionSetResponse
newUpdatePermissionSetResponse Int
pHttpStatus_ =
UpdatePermissionSetResponse' :: Int -> UpdatePermissionSetResponse
UpdatePermissionSetResponse'
{ $sel:httpStatus:UpdatePermissionSetResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updatePermissionSetResponse_httpStatus :: Lens.Lens' UpdatePermissionSetResponse Prelude.Int
updatePermissionSetResponse_httpStatus :: (Int -> f Int)
-> UpdatePermissionSetResponse -> f UpdatePermissionSetResponse
updatePermissionSetResponse_httpStatus = (UpdatePermissionSetResponse -> Int)
-> (UpdatePermissionSetResponse
-> Int -> UpdatePermissionSetResponse)
-> Lens
UpdatePermissionSetResponse UpdatePermissionSetResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePermissionSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdatePermissionSetResponse' :: UpdatePermissionSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdatePermissionSetResponse
s@UpdatePermissionSetResponse' {} Int
a -> UpdatePermissionSetResponse
s {$sel:httpStatus:UpdatePermissionSetResponse' :: Int
httpStatus = Int
a} :: UpdatePermissionSetResponse)
instance Prelude.NFData UpdatePermissionSetResponse