{-# 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.Cloud9.UpdateEnvironmentMembership
(
UpdateEnvironmentMembership (..),
newUpdateEnvironmentMembership,
updateEnvironmentMembership_environmentId,
updateEnvironmentMembership_userArn,
updateEnvironmentMembership_permissions,
UpdateEnvironmentMembershipResponse (..),
newUpdateEnvironmentMembershipResponse,
updateEnvironmentMembershipResponse_membership,
updateEnvironmentMembershipResponse_httpStatus,
)
where
import Amazonka.Cloud9.Types
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
data UpdateEnvironmentMembership = UpdateEnvironmentMembership'
{
UpdateEnvironmentMembership -> Text
environmentId :: Prelude.Text,
UpdateEnvironmentMembership -> Text
userArn :: Prelude.Text,
UpdateEnvironmentMembership -> MemberPermissions
permissions :: MemberPermissions
}
deriving (UpdateEnvironmentMembership -> UpdateEnvironmentMembership -> Bool
(UpdateEnvironmentMembership
-> UpdateEnvironmentMembership -> Bool)
-> (UpdateEnvironmentMembership
-> UpdateEnvironmentMembership -> Bool)
-> Eq UpdateEnvironmentMembership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEnvironmentMembership -> UpdateEnvironmentMembership -> Bool
$c/= :: UpdateEnvironmentMembership -> UpdateEnvironmentMembership -> Bool
== :: UpdateEnvironmentMembership -> UpdateEnvironmentMembership -> Bool
$c== :: UpdateEnvironmentMembership -> UpdateEnvironmentMembership -> Bool
Prelude.Eq, ReadPrec [UpdateEnvironmentMembership]
ReadPrec UpdateEnvironmentMembership
Int -> ReadS UpdateEnvironmentMembership
ReadS [UpdateEnvironmentMembership]
(Int -> ReadS UpdateEnvironmentMembership)
-> ReadS [UpdateEnvironmentMembership]
-> ReadPrec UpdateEnvironmentMembership
-> ReadPrec [UpdateEnvironmentMembership]
-> Read UpdateEnvironmentMembership
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEnvironmentMembership]
$creadListPrec :: ReadPrec [UpdateEnvironmentMembership]
readPrec :: ReadPrec UpdateEnvironmentMembership
$creadPrec :: ReadPrec UpdateEnvironmentMembership
readList :: ReadS [UpdateEnvironmentMembership]
$creadList :: ReadS [UpdateEnvironmentMembership]
readsPrec :: Int -> ReadS UpdateEnvironmentMembership
$creadsPrec :: Int -> ReadS UpdateEnvironmentMembership
Prelude.Read, Int -> UpdateEnvironmentMembership -> ShowS
[UpdateEnvironmentMembership] -> ShowS
UpdateEnvironmentMembership -> String
(Int -> UpdateEnvironmentMembership -> ShowS)
-> (UpdateEnvironmentMembership -> String)
-> ([UpdateEnvironmentMembership] -> ShowS)
-> Show UpdateEnvironmentMembership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEnvironmentMembership] -> ShowS
$cshowList :: [UpdateEnvironmentMembership] -> ShowS
show :: UpdateEnvironmentMembership -> String
$cshow :: UpdateEnvironmentMembership -> String
showsPrec :: Int -> UpdateEnvironmentMembership -> ShowS
$cshowsPrec :: Int -> UpdateEnvironmentMembership -> ShowS
Prelude.Show, (forall x.
UpdateEnvironmentMembership -> Rep UpdateEnvironmentMembership x)
-> (forall x.
Rep UpdateEnvironmentMembership x -> UpdateEnvironmentMembership)
-> Generic UpdateEnvironmentMembership
forall x.
Rep UpdateEnvironmentMembership x -> UpdateEnvironmentMembership
forall x.
UpdateEnvironmentMembership -> Rep UpdateEnvironmentMembership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEnvironmentMembership x -> UpdateEnvironmentMembership
$cfrom :: forall x.
UpdateEnvironmentMembership -> Rep UpdateEnvironmentMembership x
Prelude.Generic)
newUpdateEnvironmentMembership ::
Prelude.Text ->
Prelude.Text ->
MemberPermissions ->
UpdateEnvironmentMembership
newUpdateEnvironmentMembership :: Text -> Text -> MemberPermissions -> UpdateEnvironmentMembership
newUpdateEnvironmentMembership
Text
pEnvironmentId_
Text
pUserArn_
MemberPermissions
pPermissions_ =
UpdateEnvironmentMembership' :: Text -> Text -> MemberPermissions -> UpdateEnvironmentMembership
UpdateEnvironmentMembership'
{ $sel:environmentId:UpdateEnvironmentMembership' :: Text
environmentId =
Text
pEnvironmentId_,
$sel:userArn:UpdateEnvironmentMembership' :: Text
userArn = Text
pUserArn_,
$sel:permissions:UpdateEnvironmentMembership' :: MemberPermissions
permissions = MemberPermissions
pPermissions_
}
updateEnvironmentMembership_environmentId :: Lens.Lens' UpdateEnvironmentMembership Prelude.Text
updateEnvironmentMembership_environmentId :: (Text -> f Text)
-> UpdateEnvironmentMembership -> f UpdateEnvironmentMembership
updateEnvironmentMembership_environmentId = (UpdateEnvironmentMembership -> Text)
-> (UpdateEnvironmentMembership
-> Text -> UpdateEnvironmentMembership)
-> Lens
UpdateEnvironmentMembership UpdateEnvironmentMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironmentMembership' {Text
environmentId :: Text
$sel:environmentId:UpdateEnvironmentMembership' :: UpdateEnvironmentMembership -> Text
environmentId} -> Text
environmentId) (\s :: UpdateEnvironmentMembership
s@UpdateEnvironmentMembership' {} Text
a -> UpdateEnvironmentMembership
s {$sel:environmentId:UpdateEnvironmentMembership' :: Text
environmentId = Text
a} :: UpdateEnvironmentMembership)
updateEnvironmentMembership_userArn :: Lens.Lens' UpdateEnvironmentMembership Prelude.Text
updateEnvironmentMembership_userArn :: (Text -> f Text)
-> UpdateEnvironmentMembership -> f UpdateEnvironmentMembership
updateEnvironmentMembership_userArn = (UpdateEnvironmentMembership -> Text)
-> (UpdateEnvironmentMembership
-> Text -> UpdateEnvironmentMembership)
-> Lens
UpdateEnvironmentMembership UpdateEnvironmentMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironmentMembership' {Text
userArn :: Text
$sel:userArn:UpdateEnvironmentMembership' :: UpdateEnvironmentMembership -> Text
userArn} -> Text
userArn) (\s :: UpdateEnvironmentMembership
s@UpdateEnvironmentMembership' {} Text
a -> UpdateEnvironmentMembership
s {$sel:userArn:UpdateEnvironmentMembership' :: Text
userArn = Text
a} :: UpdateEnvironmentMembership)
updateEnvironmentMembership_permissions :: Lens.Lens' UpdateEnvironmentMembership MemberPermissions
updateEnvironmentMembership_permissions :: (MemberPermissions -> f MemberPermissions)
-> UpdateEnvironmentMembership -> f UpdateEnvironmentMembership
updateEnvironmentMembership_permissions = (UpdateEnvironmentMembership -> MemberPermissions)
-> (UpdateEnvironmentMembership
-> MemberPermissions -> UpdateEnvironmentMembership)
-> Lens
UpdateEnvironmentMembership
UpdateEnvironmentMembership
MemberPermissions
MemberPermissions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironmentMembership' {MemberPermissions
permissions :: MemberPermissions
$sel:permissions:UpdateEnvironmentMembership' :: UpdateEnvironmentMembership -> MemberPermissions
permissions} -> MemberPermissions
permissions) (\s :: UpdateEnvironmentMembership
s@UpdateEnvironmentMembership' {} MemberPermissions
a -> UpdateEnvironmentMembership
s {$sel:permissions:UpdateEnvironmentMembership' :: MemberPermissions
permissions = MemberPermissions
a} :: UpdateEnvironmentMembership)
instance Core.AWSRequest UpdateEnvironmentMembership where
type
AWSResponse UpdateEnvironmentMembership =
UpdateEnvironmentMembershipResponse
request :: UpdateEnvironmentMembership -> Request UpdateEnvironmentMembership
request = Service
-> UpdateEnvironmentMembership
-> Request UpdateEnvironmentMembership
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateEnvironmentMembership
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateEnvironmentMembership)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateEnvironmentMembership))
-> Logger
-> Service
-> Proxy UpdateEnvironmentMembership
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateEnvironmentMembership)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe EnvironmentMember
-> Int -> UpdateEnvironmentMembershipResponse
UpdateEnvironmentMembershipResponse'
(Maybe EnvironmentMember
-> Int -> UpdateEnvironmentMembershipResponse)
-> Either String (Maybe EnvironmentMember)
-> Either String (Int -> UpdateEnvironmentMembershipResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe EnvironmentMember)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"membership")
Either String (Int -> UpdateEnvironmentMembershipResponse)
-> Either String Int
-> Either String UpdateEnvironmentMembershipResponse
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 UpdateEnvironmentMembership
instance Prelude.NFData UpdateEnvironmentMembership
instance Core.ToHeaders UpdateEnvironmentMembership where
toHeaders :: UpdateEnvironmentMembership -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateEnvironmentMembership -> 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
"AWSCloud9WorkspaceManagementService.UpdateEnvironmentMembership" ::
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 UpdateEnvironmentMembership where
toJSON :: UpdateEnvironmentMembership -> Value
toJSON UpdateEnvironmentMembership' {Text
MemberPermissions
permissions :: MemberPermissions
userArn :: Text
environmentId :: Text
$sel:permissions:UpdateEnvironmentMembership' :: UpdateEnvironmentMembership -> MemberPermissions
$sel:userArn:UpdateEnvironmentMembership' :: UpdateEnvironmentMembership -> Text
$sel:environmentId:UpdateEnvironmentMembership' :: UpdateEnvironmentMembership -> 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
"environmentId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
environmentId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"userArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"permissions" Text -> MemberPermissions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MemberPermissions
permissions)
]
)
instance Core.ToPath UpdateEnvironmentMembership where
toPath :: UpdateEnvironmentMembership -> ByteString
toPath = ByteString -> UpdateEnvironmentMembership -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateEnvironmentMembership where
toQuery :: UpdateEnvironmentMembership -> QueryString
toQuery = QueryString -> UpdateEnvironmentMembership -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateEnvironmentMembershipResponse = UpdateEnvironmentMembershipResponse'
{
UpdateEnvironmentMembershipResponse -> Maybe EnvironmentMember
membership :: Prelude.Maybe EnvironmentMember,
UpdateEnvironmentMembershipResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateEnvironmentMembershipResponse
-> UpdateEnvironmentMembershipResponse -> Bool
(UpdateEnvironmentMembershipResponse
-> UpdateEnvironmentMembershipResponse -> Bool)
-> (UpdateEnvironmentMembershipResponse
-> UpdateEnvironmentMembershipResponse -> Bool)
-> Eq UpdateEnvironmentMembershipResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEnvironmentMembershipResponse
-> UpdateEnvironmentMembershipResponse -> Bool
$c/= :: UpdateEnvironmentMembershipResponse
-> UpdateEnvironmentMembershipResponse -> Bool
== :: UpdateEnvironmentMembershipResponse
-> UpdateEnvironmentMembershipResponse -> Bool
$c== :: UpdateEnvironmentMembershipResponse
-> UpdateEnvironmentMembershipResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEnvironmentMembershipResponse]
ReadPrec UpdateEnvironmentMembershipResponse
Int -> ReadS UpdateEnvironmentMembershipResponse
ReadS [UpdateEnvironmentMembershipResponse]
(Int -> ReadS UpdateEnvironmentMembershipResponse)
-> ReadS [UpdateEnvironmentMembershipResponse]
-> ReadPrec UpdateEnvironmentMembershipResponse
-> ReadPrec [UpdateEnvironmentMembershipResponse]
-> Read UpdateEnvironmentMembershipResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEnvironmentMembershipResponse]
$creadListPrec :: ReadPrec [UpdateEnvironmentMembershipResponse]
readPrec :: ReadPrec UpdateEnvironmentMembershipResponse
$creadPrec :: ReadPrec UpdateEnvironmentMembershipResponse
readList :: ReadS [UpdateEnvironmentMembershipResponse]
$creadList :: ReadS [UpdateEnvironmentMembershipResponse]
readsPrec :: Int -> ReadS UpdateEnvironmentMembershipResponse
$creadsPrec :: Int -> ReadS UpdateEnvironmentMembershipResponse
Prelude.Read, Int -> UpdateEnvironmentMembershipResponse -> ShowS
[UpdateEnvironmentMembershipResponse] -> ShowS
UpdateEnvironmentMembershipResponse -> String
(Int -> UpdateEnvironmentMembershipResponse -> ShowS)
-> (UpdateEnvironmentMembershipResponse -> String)
-> ([UpdateEnvironmentMembershipResponse] -> ShowS)
-> Show UpdateEnvironmentMembershipResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEnvironmentMembershipResponse] -> ShowS
$cshowList :: [UpdateEnvironmentMembershipResponse] -> ShowS
show :: UpdateEnvironmentMembershipResponse -> String
$cshow :: UpdateEnvironmentMembershipResponse -> String
showsPrec :: Int -> UpdateEnvironmentMembershipResponse -> ShowS
$cshowsPrec :: Int -> UpdateEnvironmentMembershipResponse -> ShowS
Prelude.Show, (forall x.
UpdateEnvironmentMembershipResponse
-> Rep UpdateEnvironmentMembershipResponse x)
-> (forall x.
Rep UpdateEnvironmentMembershipResponse x
-> UpdateEnvironmentMembershipResponse)
-> Generic UpdateEnvironmentMembershipResponse
forall x.
Rep UpdateEnvironmentMembershipResponse x
-> UpdateEnvironmentMembershipResponse
forall x.
UpdateEnvironmentMembershipResponse
-> Rep UpdateEnvironmentMembershipResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEnvironmentMembershipResponse x
-> UpdateEnvironmentMembershipResponse
$cfrom :: forall x.
UpdateEnvironmentMembershipResponse
-> Rep UpdateEnvironmentMembershipResponse x
Prelude.Generic)
newUpdateEnvironmentMembershipResponse ::
Prelude.Int ->
UpdateEnvironmentMembershipResponse
newUpdateEnvironmentMembershipResponse :: Int -> UpdateEnvironmentMembershipResponse
newUpdateEnvironmentMembershipResponse Int
pHttpStatus_ =
UpdateEnvironmentMembershipResponse' :: Maybe EnvironmentMember
-> Int -> UpdateEnvironmentMembershipResponse
UpdateEnvironmentMembershipResponse'
{ $sel:membership:UpdateEnvironmentMembershipResponse' :: Maybe EnvironmentMember
membership =
Maybe EnvironmentMember
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateEnvironmentMembershipResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateEnvironmentMembershipResponse_membership :: Lens.Lens' UpdateEnvironmentMembershipResponse (Prelude.Maybe EnvironmentMember)
updateEnvironmentMembershipResponse_membership :: (Maybe EnvironmentMember -> f (Maybe EnvironmentMember))
-> UpdateEnvironmentMembershipResponse
-> f UpdateEnvironmentMembershipResponse
updateEnvironmentMembershipResponse_membership = (UpdateEnvironmentMembershipResponse -> Maybe EnvironmentMember)
-> (UpdateEnvironmentMembershipResponse
-> Maybe EnvironmentMember -> UpdateEnvironmentMembershipResponse)
-> Lens
UpdateEnvironmentMembershipResponse
UpdateEnvironmentMembershipResponse
(Maybe EnvironmentMember)
(Maybe EnvironmentMember)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironmentMembershipResponse' {Maybe EnvironmentMember
membership :: Maybe EnvironmentMember
$sel:membership:UpdateEnvironmentMembershipResponse' :: UpdateEnvironmentMembershipResponse -> Maybe EnvironmentMember
membership} -> Maybe EnvironmentMember
membership) (\s :: UpdateEnvironmentMembershipResponse
s@UpdateEnvironmentMembershipResponse' {} Maybe EnvironmentMember
a -> UpdateEnvironmentMembershipResponse
s {$sel:membership:UpdateEnvironmentMembershipResponse' :: Maybe EnvironmentMember
membership = Maybe EnvironmentMember
a} :: UpdateEnvironmentMembershipResponse)
updateEnvironmentMembershipResponse_httpStatus :: Lens.Lens' UpdateEnvironmentMembershipResponse Prelude.Int
updateEnvironmentMembershipResponse_httpStatus :: (Int -> f Int)
-> UpdateEnvironmentMembershipResponse
-> f UpdateEnvironmentMembershipResponse
updateEnvironmentMembershipResponse_httpStatus = (UpdateEnvironmentMembershipResponse -> Int)
-> (UpdateEnvironmentMembershipResponse
-> Int -> UpdateEnvironmentMembershipResponse)
-> Lens
UpdateEnvironmentMembershipResponse
UpdateEnvironmentMembershipResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnvironmentMembershipResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateEnvironmentMembershipResponse' :: UpdateEnvironmentMembershipResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateEnvironmentMembershipResponse
s@UpdateEnvironmentMembershipResponse' {} Int
a -> UpdateEnvironmentMembershipResponse
s {$sel:httpStatus:UpdateEnvironmentMembershipResponse' :: Int
httpStatus = Int
a} :: UpdateEnvironmentMembershipResponse)
instance
Prelude.NFData
UpdateEnvironmentMembershipResponse