{-# 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.DeleteEnvironmentMembership
(
DeleteEnvironmentMembership (..),
newDeleteEnvironmentMembership,
deleteEnvironmentMembership_environmentId,
deleteEnvironmentMembership_userArn,
DeleteEnvironmentMembershipResponse (..),
newDeleteEnvironmentMembershipResponse,
deleteEnvironmentMembershipResponse_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 DeleteEnvironmentMembership = DeleteEnvironmentMembership'
{
DeleteEnvironmentMembership -> Text
environmentId :: Prelude.Text,
DeleteEnvironmentMembership -> Text
userArn :: Prelude.Text
}
deriving (DeleteEnvironmentMembership -> DeleteEnvironmentMembership -> Bool
(DeleteEnvironmentMembership
-> DeleteEnvironmentMembership -> Bool)
-> (DeleteEnvironmentMembership
-> DeleteEnvironmentMembership -> Bool)
-> Eq DeleteEnvironmentMembership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEnvironmentMembership -> DeleteEnvironmentMembership -> Bool
$c/= :: DeleteEnvironmentMembership -> DeleteEnvironmentMembership -> Bool
== :: DeleteEnvironmentMembership -> DeleteEnvironmentMembership -> Bool
$c== :: DeleteEnvironmentMembership -> DeleteEnvironmentMembership -> Bool
Prelude.Eq, ReadPrec [DeleteEnvironmentMembership]
ReadPrec DeleteEnvironmentMembership
Int -> ReadS DeleteEnvironmentMembership
ReadS [DeleteEnvironmentMembership]
(Int -> ReadS DeleteEnvironmentMembership)
-> ReadS [DeleteEnvironmentMembership]
-> ReadPrec DeleteEnvironmentMembership
-> ReadPrec [DeleteEnvironmentMembership]
-> Read DeleteEnvironmentMembership
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEnvironmentMembership]
$creadListPrec :: ReadPrec [DeleteEnvironmentMembership]
readPrec :: ReadPrec DeleteEnvironmentMembership
$creadPrec :: ReadPrec DeleteEnvironmentMembership
readList :: ReadS [DeleteEnvironmentMembership]
$creadList :: ReadS [DeleteEnvironmentMembership]
readsPrec :: Int -> ReadS DeleteEnvironmentMembership
$creadsPrec :: Int -> ReadS DeleteEnvironmentMembership
Prelude.Read, Int -> DeleteEnvironmentMembership -> ShowS
[DeleteEnvironmentMembership] -> ShowS
DeleteEnvironmentMembership -> String
(Int -> DeleteEnvironmentMembership -> ShowS)
-> (DeleteEnvironmentMembership -> String)
-> ([DeleteEnvironmentMembership] -> ShowS)
-> Show DeleteEnvironmentMembership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEnvironmentMembership] -> ShowS
$cshowList :: [DeleteEnvironmentMembership] -> ShowS
show :: DeleteEnvironmentMembership -> String
$cshow :: DeleteEnvironmentMembership -> String
showsPrec :: Int -> DeleteEnvironmentMembership -> ShowS
$cshowsPrec :: Int -> DeleteEnvironmentMembership -> ShowS
Prelude.Show, (forall x.
DeleteEnvironmentMembership -> Rep DeleteEnvironmentMembership x)
-> (forall x.
Rep DeleteEnvironmentMembership x -> DeleteEnvironmentMembership)
-> Generic DeleteEnvironmentMembership
forall x.
Rep DeleteEnvironmentMembership x -> DeleteEnvironmentMembership
forall x.
DeleteEnvironmentMembership -> Rep DeleteEnvironmentMembership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteEnvironmentMembership x -> DeleteEnvironmentMembership
$cfrom :: forall x.
DeleteEnvironmentMembership -> Rep DeleteEnvironmentMembership x
Prelude.Generic)
newDeleteEnvironmentMembership ::
Prelude.Text ->
Prelude.Text ->
DeleteEnvironmentMembership
newDeleteEnvironmentMembership :: Text -> Text -> DeleteEnvironmentMembership
newDeleteEnvironmentMembership
Text
pEnvironmentId_
Text
pUserArn_ =
DeleteEnvironmentMembership' :: Text -> Text -> DeleteEnvironmentMembership
DeleteEnvironmentMembership'
{ $sel:environmentId:DeleteEnvironmentMembership' :: Text
environmentId =
Text
pEnvironmentId_,
$sel:userArn:DeleteEnvironmentMembership' :: Text
userArn = Text
pUserArn_
}
deleteEnvironmentMembership_environmentId :: Lens.Lens' DeleteEnvironmentMembership Prelude.Text
deleteEnvironmentMembership_environmentId :: (Text -> f Text)
-> DeleteEnvironmentMembership -> f DeleteEnvironmentMembership
deleteEnvironmentMembership_environmentId = (DeleteEnvironmentMembership -> Text)
-> (DeleteEnvironmentMembership
-> Text -> DeleteEnvironmentMembership)
-> Lens
DeleteEnvironmentMembership DeleteEnvironmentMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEnvironmentMembership' {Text
environmentId :: Text
$sel:environmentId:DeleteEnvironmentMembership' :: DeleteEnvironmentMembership -> Text
environmentId} -> Text
environmentId) (\s :: DeleteEnvironmentMembership
s@DeleteEnvironmentMembership' {} Text
a -> DeleteEnvironmentMembership
s {$sel:environmentId:DeleteEnvironmentMembership' :: Text
environmentId = Text
a} :: DeleteEnvironmentMembership)
deleteEnvironmentMembership_userArn :: Lens.Lens' DeleteEnvironmentMembership Prelude.Text
deleteEnvironmentMembership_userArn :: (Text -> f Text)
-> DeleteEnvironmentMembership -> f DeleteEnvironmentMembership
deleteEnvironmentMembership_userArn = (DeleteEnvironmentMembership -> Text)
-> (DeleteEnvironmentMembership
-> Text -> DeleteEnvironmentMembership)
-> Lens
DeleteEnvironmentMembership DeleteEnvironmentMembership Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEnvironmentMembership' {Text
userArn :: Text
$sel:userArn:DeleteEnvironmentMembership' :: DeleteEnvironmentMembership -> Text
userArn} -> Text
userArn) (\s :: DeleteEnvironmentMembership
s@DeleteEnvironmentMembership' {} Text
a -> DeleteEnvironmentMembership
s {$sel:userArn:DeleteEnvironmentMembership' :: Text
userArn = Text
a} :: DeleteEnvironmentMembership)
instance Core.AWSRequest DeleteEnvironmentMembership where
type
AWSResponse DeleteEnvironmentMembership =
DeleteEnvironmentMembershipResponse
request :: DeleteEnvironmentMembership -> Request DeleteEnvironmentMembership
request = Service
-> DeleteEnvironmentMembership
-> Request DeleteEnvironmentMembership
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteEnvironmentMembership
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteEnvironmentMembership)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteEnvironmentMembership))
-> Logger
-> Service
-> Proxy DeleteEnvironmentMembership
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteEnvironmentMembership)))
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 -> DeleteEnvironmentMembershipResponse
DeleteEnvironmentMembershipResponse'
(Int -> DeleteEnvironmentMembershipResponse)
-> Either String Int
-> Either String DeleteEnvironmentMembershipResponse
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 DeleteEnvironmentMembership
instance Prelude.NFData DeleteEnvironmentMembership
instance Core.ToHeaders DeleteEnvironmentMembership where
toHeaders :: DeleteEnvironmentMembership -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteEnvironmentMembership -> 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.DeleteEnvironmentMembership" ::
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 DeleteEnvironmentMembership where
toJSON :: DeleteEnvironmentMembership -> Value
toJSON DeleteEnvironmentMembership' {Text
userArn :: Text
environmentId :: Text
$sel:userArn:DeleteEnvironmentMembership' :: DeleteEnvironmentMembership -> Text
$sel:environmentId:DeleteEnvironmentMembership' :: DeleteEnvironmentMembership -> 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)
]
)
instance Core.ToPath DeleteEnvironmentMembership where
toPath :: DeleteEnvironmentMembership -> ByteString
toPath = ByteString -> DeleteEnvironmentMembership -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteEnvironmentMembership where
toQuery :: DeleteEnvironmentMembership -> QueryString
toQuery = QueryString -> DeleteEnvironmentMembership -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteEnvironmentMembershipResponse = DeleteEnvironmentMembershipResponse'
{
DeleteEnvironmentMembershipResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteEnvironmentMembershipResponse
-> DeleteEnvironmentMembershipResponse -> Bool
(DeleteEnvironmentMembershipResponse
-> DeleteEnvironmentMembershipResponse -> Bool)
-> (DeleteEnvironmentMembershipResponse
-> DeleteEnvironmentMembershipResponse -> Bool)
-> Eq DeleteEnvironmentMembershipResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteEnvironmentMembershipResponse
-> DeleteEnvironmentMembershipResponse -> Bool
$c/= :: DeleteEnvironmentMembershipResponse
-> DeleteEnvironmentMembershipResponse -> Bool
== :: DeleteEnvironmentMembershipResponse
-> DeleteEnvironmentMembershipResponse -> Bool
$c== :: DeleteEnvironmentMembershipResponse
-> DeleteEnvironmentMembershipResponse -> Bool
Prelude.Eq, ReadPrec [DeleteEnvironmentMembershipResponse]
ReadPrec DeleteEnvironmentMembershipResponse
Int -> ReadS DeleteEnvironmentMembershipResponse
ReadS [DeleteEnvironmentMembershipResponse]
(Int -> ReadS DeleteEnvironmentMembershipResponse)
-> ReadS [DeleteEnvironmentMembershipResponse]
-> ReadPrec DeleteEnvironmentMembershipResponse
-> ReadPrec [DeleteEnvironmentMembershipResponse]
-> Read DeleteEnvironmentMembershipResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteEnvironmentMembershipResponse]
$creadListPrec :: ReadPrec [DeleteEnvironmentMembershipResponse]
readPrec :: ReadPrec DeleteEnvironmentMembershipResponse
$creadPrec :: ReadPrec DeleteEnvironmentMembershipResponse
readList :: ReadS [DeleteEnvironmentMembershipResponse]
$creadList :: ReadS [DeleteEnvironmentMembershipResponse]
readsPrec :: Int -> ReadS DeleteEnvironmentMembershipResponse
$creadsPrec :: Int -> ReadS DeleteEnvironmentMembershipResponse
Prelude.Read, Int -> DeleteEnvironmentMembershipResponse -> ShowS
[DeleteEnvironmentMembershipResponse] -> ShowS
DeleteEnvironmentMembershipResponse -> String
(Int -> DeleteEnvironmentMembershipResponse -> ShowS)
-> (DeleteEnvironmentMembershipResponse -> String)
-> ([DeleteEnvironmentMembershipResponse] -> ShowS)
-> Show DeleteEnvironmentMembershipResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteEnvironmentMembershipResponse] -> ShowS
$cshowList :: [DeleteEnvironmentMembershipResponse] -> ShowS
show :: DeleteEnvironmentMembershipResponse -> String
$cshow :: DeleteEnvironmentMembershipResponse -> String
showsPrec :: Int -> DeleteEnvironmentMembershipResponse -> ShowS
$cshowsPrec :: Int -> DeleteEnvironmentMembershipResponse -> ShowS
Prelude.Show, (forall x.
DeleteEnvironmentMembershipResponse
-> Rep DeleteEnvironmentMembershipResponse x)
-> (forall x.
Rep DeleteEnvironmentMembershipResponse x
-> DeleteEnvironmentMembershipResponse)
-> Generic DeleteEnvironmentMembershipResponse
forall x.
Rep DeleteEnvironmentMembershipResponse x
-> DeleteEnvironmentMembershipResponse
forall x.
DeleteEnvironmentMembershipResponse
-> Rep DeleteEnvironmentMembershipResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteEnvironmentMembershipResponse x
-> DeleteEnvironmentMembershipResponse
$cfrom :: forall x.
DeleteEnvironmentMembershipResponse
-> Rep DeleteEnvironmentMembershipResponse x
Prelude.Generic)
newDeleteEnvironmentMembershipResponse ::
Prelude.Int ->
DeleteEnvironmentMembershipResponse
newDeleteEnvironmentMembershipResponse :: Int -> DeleteEnvironmentMembershipResponse
newDeleteEnvironmentMembershipResponse Int
pHttpStatus_ =
DeleteEnvironmentMembershipResponse' :: Int -> DeleteEnvironmentMembershipResponse
DeleteEnvironmentMembershipResponse'
{ $sel:httpStatus:DeleteEnvironmentMembershipResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteEnvironmentMembershipResponse_httpStatus :: Lens.Lens' DeleteEnvironmentMembershipResponse Prelude.Int
deleteEnvironmentMembershipResponse_httpStatus :: (Int -> f Int)
-> DeleteEnvironmentMembershipResponse
-> f DeleteEnvironmentMembershipResponse
deleteEnvironmentMembershipResponse_httpStatus = (DeleteEnvironmentMembershipResponse -> Int)
-> (DeleteEnvironmentMembershipResponse
-> Int -> DeleteEnvironmentMembershipResponse)
-> Lens
DeleteEnvironmentMembershipResponse
DeleteEnvironmentMembershipResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteEnvironmentMembershipResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteEnvironmentMembershipResponse' :: DeleteEnvironmentMembershipResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteEnvironmentMembershipResponse
s@DeleteEnvironmentMembershipResponse' {} Int
a -> DeleteEnvironmentMembershipResponse
s {$sel:httpStatus:DeleteEnvironmentMembershipResponse' :: Int
httpStatus = Int
a} :: DeleteEnvironmentMembershipResponse)
instance
Prelude.NFData
DeleteEnvironmentMembershipResponse