{-# 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.WorkSpaces.ModifySelfservicePermissions
(
ModifySelfservicePermissions (..),
newModifySelfservicePermissions,
modifySelfservicePermissions_resourceId,
modifySelfservicePermissions_selfservicePermissions,
ModifySelfservicePermissionsResponse (..),
newModifySelfservicePermissionsResponse,
modifySelfservicePermissionsResponse_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.WorkSpaces.Types
data ModifySelfservicePermissions = ModifySelfservicePermissions'
{
ModifySelfservicePermissions -> Text
resourceId :: Prelude.Text,
ModifySelfservicePermissions -> SelfservicePermissions
selfservicePermissions :: SelfservicePermissions
}
deriving (ModifySelfservicePermissions
-> ModifySelfservicePermissions -> Bool
(ModifySelfservicePermissions
-> ModifySelfservicePermissions -> Bool)
-> (ModifySelfservicePermissions
-> ModifySelfservicePermissions -> Bool)
-> Eq ModifySelfservicePermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifySelfservicePermissions
-> ModifySelfservicePermissions -> Bool
$c/= :: ModifySelfservicePermissions
-> ModifySelfservicePermissions -> Bool
== :: ModifySelfservicePermissions
-> ModifySelfservicePermissions -> Bool
$c== :: ModifySelfservicePermissions
-> ModifySelfservicePermissions -> Bool
Prelude.Eq, ReadPrec [ModifySelfservicePermissions]
ReadPrec ModifySelfservicePermissions
Int -> ReadS ModifySelfservicePermissions
ReadS [ModifySelfservicePermissions]
(Int -> ReadS ModifySelfservicePermissions)
-> ReadS [ModifySelfservicePermissions]
-> ReadPrec ModifySelfservicePermissions
-> ReadPrec [ModifySelfservicePermissions]
-> Read ModifySelfservicePermissions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifySelfservicePermissions]
$creadListPrec :: ReadPrec [ModifySelfservicePermissions]
readPrec :: ReadPrec ModifySelfservicePermissions
$creadPrec :: ReadPrec ModifySelfservicePermissions
readList :: ReadS [ModifySelfservicePermissions]
$creadList :: ReadS [ModifySelfservicePermissions]
readsPrec :: Int -> ReadS ModifySelfservicePermissions
$creadsPrec :: Int -> ReadS ModifySelfservicePermissions
Prelude.Read, Int -> ModifySelfservicePermissions -> ShowS
[ModifySelfservicePermissions] -> ShowS
ModifySelfservicePermissions -> String
(Int -> ModifySelfservicePermissions -> ShowS)
-> (ModifySelfservicePermissions -> String)
-> ([ModifySelfservicePermissions] -> ShowS)
-> Show ModifySelfservicePermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifySelfservicePermissions] -> ShowS
$cshowList :: [ModifySelfservicePermissions] -> ShowS
show :: ModifySelfservicePermissions -> String
$cshow :: ModifySelfservicePermissions -> String
showsPrec :: Int -> ModifySelfservicePermissions -> ShowS
$cshowsPrec :: Int -> ModifySelfservicePermissions -> ShowS
Prelude.Show, (forall x.
ModifySelfservicePermissions -> Rep ModifySelfservicePermissions x)
-> (forall x.
Rep ModifySelfservicePermissions x -> ModifySelfservicePermissions)
-> Generic ModifySelfservicePermissions
forall x.
Rep ModifySelfservicePermissions x -> ModifySelfservicePermissions
forall x.
ModifySelfservicePermissions -> Rep ModifySelfservicePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifySelfservicePermissions x -> ModifySelfservicePermissions
$cfrom :: forall x.
ModifySelfservicePermissions -> Rep ModifySelfservicePermissions x
Prelude.Generic)
newModifySelfservicePermissions ::
Prelude.Text ->
SelfservicePermissions ->
ModifySelfservicePermissions
newModifySelfservicePermissions :: Text -> SelfservicePermissions -> ModifySelfservicePermissions
newModifySelfservicePermissions
Text
pResourceId_
SelfservicePermissions
pSelfservicePermissions_ =
ModifySelfservicePermissions' :: Text -> SelfservicePermissions -> ModifySelfservicePermissions
ModifySelfservicePermissions'
{ $sel:resourceId:ModifySelfservicePermissions' :: Text
resourceId =
Text
pResourceId_,
$sel:selfservicePermissions:ModifySelfservicePermissions' :: SelfservicePermissions
selfservicePermissions =
SelfservicePermissions
pSelfservicePermissions_
}
modifySelfservicePermissions_resourceId :: Lens.Lens' ModifySelfservicePermissions Prelude.Text
modifySelfservicePermissions_resourceId :: (Text -> f Text)
-> ModifySelfservicePermissions -> f ModifySelfservicePermissions
modifySelfservicePermissions_resourceId = (ModifySelfservicePermissions -> Text)
-> (ModifySelfservicePermissions
-> Text -> ModifySelfservicePermissions)
-> Lens
ModifySelfservicePermissions ModifySelfservicePermissions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifySelfservicePermissions' {Text
resourceId :: Text
$sel:resourceId:ModifySelfservicePermissions' :: ModifySelfservicePermissions -> Text
resourceId} -> Text
resourceId) (\s :: ModifySelfservicePermissions
s@ModifySelfservicePermissions' {} Text
a -> ModifySelfservicePermissions
s {$sel:resourceId:ModifySelfservicePermissions' :: Text
resourceId = Text
a} :: ModifySelfservicePermissions)
modifySelfservicePermissions_selfservicePermissions :: Lens.Lens' ModifySelfservicePermissions SelfservicePermissions
modifySelfservicePermissions_selfservicePermissions :: (SelfservicePermissions -> f SelfservicePermissions)
-> ModifySelfservicePermissions -> f ModifySelfservicePermissions
modifySelfservicePermissions_selfservicePermissions = (ModifySelfservicePermissions -> SelfservicePermissions)
-> (ModifySelfservicePermissions
-> SelfservicePermissions -> ModifySelfservicePermissions)
-> Lens
ModifySelfservicePermissions
ModifySelfservicePermissions
SelfservicePermissions
SelfservicePermissions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifySelfservicePermissions' {SelfservicePermissions
selfservicePermissions :: SelfservicePermissions
$sel:selfservicePermissions:ModifySelfservicePermissions' :: ModifySelfservicePermissions -> SelfservicePermissions
selfservicePermissions} -> SelfservicePermissions
selfservicePermissions) (\s :: ModifySelfservicePermissions
s@ModifySelfservicePermissions' {} SelfservicePermissions
a -> ModifySelfservicePermissions
s {$sel:selfservicePermissions:ModifySelfservicePermissions' :: SelfservicePermissions
selfservicePermissions = SelfservicePermissions
a} :: ModifySelfservicePermissions)
instance Core.AWSRequest ModifySelfservicePermissions where
type
AWSResponse ModifySelfservicePermissions =
ModifySelfservicePermissionsResponse
request :: ModifySelfservicePermissions
-> Request ModifySelfservicePermissions
request = Service
-> ModifySelfservicePermissions
-> Request ModifySelfservicePermissions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ModifySelfservicePermissions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifySelfservicePermissions)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse ModifySelfservicePermissions))
-> Logger
-> Service
-> Proxy ModifySelfservicePermissions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifySelfservicePermissions)))
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 -> ModifySelfservicePermissionsResponse
ModifySelfservicePermissionsResponse'
(Int -> ModifySelfservicePermissionsResponse)
-> Either String Int
-> Either String ModifySelfservicePermissionsResponse
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
ModifySelfservicePermissions
instance Prelude.NFData ModifySelfservicePermissions
instance Core.ToHeaders ModifySelfservicePermissions where
toHeaders :: ModifySelfservicePermissions -> ResponseHeaders
toHeaders =
ResponseHeaders -> ModifySelfservicePermissions -> 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
"WorkspacesService.ModifySelfservicePermissions" ::
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 ModifySelfservicePermissions where
toJSON :: ModifySelfservicePermissions -> Value
toJSON ModifySelfservicePermissions' {Text
SelfservicePermissions
selfservicePermissions :: SelfservicePermissions
resourceId :: Text
$sel:selfservicePermissions:ModifySelfservicePermissions' :: ModifySelfservicePermissions -> SelfservicePermissions
$sel:resourceId:ModifySelfservicePermissions' :: ModifySelfservicePermissions -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"SelfservicePermissions"
Text -> SelfservicePermissions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SelfservicePermissions
selfservicePermissions
)
]
)
instance Core.ToPath ModifySelfservicePermissions where
toPath :: ModifySelfservicePermissions -> ByteString
toPath = ByteString -> ModifySelfservicePermissions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ModifySelfservicePermissions where
toQuery :: ModifySelfservicePermissions -> QueryString
toQuery = QueryString -> ModifySelfservicePermissions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ModifySelfservicePermissionsResponse = ModifySelfservicePermissionsResponse'
{
ModifySelfservicePermissionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifySelfservicePermissionsResponse
-> ModifySelfservicePermissionsResponse -> Bool
(ModifySelfservicePermissionsResponse
-> ModifySelfservicePermissionsResponse -> Bool)
-> (ModifySelfservicePermissionsResponse
-> ModifySelfservicePermissionsResponse -> Bool)
-> Eq ModifySelfservicePermissionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifySelfservicePermissionsResponse
-> ModifySelfservicePermissionsResponse -> Bool
$c/= :: ModifySelfservicePermissionsResponse
-> ModifySelfservicePermissionsResponse -> Bool
== :: ModifySelfservicePermissionsResponse
-> ModifySelfservicePermissionsResponse -> Bool
$c== :: ModifySelfservicePermissionsResponse
-> ModifySelfservicePermissionsResponse -> Bool
Prelude.Eq, ReadPrec [ModifySelfservicePermissionsResponse]
ReadPrec ModifySelfservicePermissionsResponse
Int -> ReadS ModifySelfservicePermissionsResponse
ReadS [ModifySelfservicePermissionsResponse]
(Int -> ReadS ModifySelfservicePermissionsResponse)
-> ReadS [ModifySelfservicePermissionsResponse]
-> ReadPrec ModifySelfservicePermissionsResponse
-> ReadPrec [ModifySelfservicePermissionsResponse]
-> Read ModifySelfservicePermissionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifySelfservicePermissionsResponse]
$creadListPrec :: ReadPrec [ModifySelfservicePermissionsResponse]
readPrec :: ReadPrec ModifySelfservicePermissionsResponse
$creadPrec :: ReadPrec ModifySelfservicePermissionsResponse
readList :: ReadS [ModifySelfservicePermissionsResponse]
$creadList :: ReadS [ModifySelfservicePermissionsResponse]
readsPrec :: Int -> ReadS ModifySelfservicePermissionsResponse
$creadsPrec :: Int -> ReadS ModifySelfservicePermissionsResponse
Prelude.Read, Int -> ModifySelfservicePermissionsResponse -> ShowS
[ModifySelfservicePermissionsResponse] -> ShowS
ModifySelfservicePermissionsResponse -> String
(Int -> ModifySelfservicePermissionsResponse -> ShowS)
-> (ModifySelfservicePermissionsResponse -> String)
-> ([ModifySelfservicePermissionsResponse] -> ShowS)
-> Show ModifySelfservicePermissionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifySelfservicePermissionsResponse] -> ShowS
$cshowList :: [ModifySelfservicePermissionsResponse] -> ShowS
show :: ModifySelfservicePermissionsResponse -> String
$cshow :: ModifySelfservicePermissionsResponse -> String
showsPrec :: Int -> ModifySelfservicePermissionsResponse -> ShowS
$cshowsPrec :: Int -> ModifySelfservicePermissionsResponse -> ShowS
Prelude.Show, (forall x.
ModifySelfservicePermissionsResponse
-> Rep ModifySelfservicePermissionsResponse x)
-> (forall x.
Rep ModifySelfservicePermissionsResponse x
-> ModifySelfservicePermissionsResponse)
-> Generic ModifySelfservicePermissionsResponse
forall x.
Rep ModifySelfservicePermissionsResponse x
-> ModifySelfservicePermissionsResponse
forall x.
ModifySelfservicePermissionsResponse
-> Rep ModifySelfservicePermissionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifySelfservicePermissionsResponse x
-> ModifySelfservicePermissionsResponse
$cfrom :: forall x.
ModifySelfservicePermissionsResponse
-> Rep ModifySelfservicePermissionsResponse x
Prelude.Generic)
newModifySelfservicePermissionsResponse ::
Prelude.Int ->
ModifySelfservicePermissionsResponse
newModifySelfservicePermissionsResponse :: Int -> ModifySelfservicePermissionsResponse
newModifySelfservicePermissionsResponse Int
pHttpStatus_ =
ModifySelfservicePermissionsResponse' :: Int -> ModifySelfservicePermissionsResponse
ModifySelfservicePermissionsResponse'
{ $sel:httpStatus:ModifySelfservicePermissionsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
modifySelfservicePermissionsResponse_httpStatus :: Lens.Lens' ModifySelfservicePermissionsResponse Prelude.Int
modifySelfservicePermissionsResponse_httpStatus :: (Int -> f Int)
-> ModifySelfservicePermissionsResponse
-> f ModifySelfservicePermissionsResponse
modifySelfservicePermissionsResponse_httpStatus = (ModifySelfservicePermissionsResponse -> Int)
-> (ModifySelfservicePermissionsResponse
-> Int -> ModifySelfservicePermissionsResponse)
-> Lens
ModifySelfservicePermissionsResponse
ModifySelfservicePermissionsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifySelfservicePermissionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifySelfservicePermissionsResponse' :: ModifySelfservicePermissionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifySelfservicePermissionsResponse
s@ModifySelfservicePermissionsResponse' {} Int
a -> ModifySelfservicePermissionsResponse
s {$sel:httpStatus:ModifySelfservicePermissionsResponse' :: Int
httpStatus = Int
a} :: ModifySelfservicePermissionsResponse)
instance
Prelude.NFData
ModifySelfservicePermissionsResponse