{-# 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.ManagedBlockChain.DeleteMember
(
DeleteMember (..),
newDeleteMember,
deleteMember_networkId,
deleteMember_memberId,
DeleteMemberResponse (..),
newDeleteMemberResponse,
deleteMemberResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.ManagedBlockChain.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteMember = DeleteMember'
{
DeleteMember -> Text
networkId :: Prelude.Text,
DeleteMember -> Text
memberId :: Prelude.Text
}
deriving (DeleteMember -> DeleteMember -> Bool
(DeleteMember -> DeleteMember -> Bool)
-> (DeleteMember -> DeleteMember -> Bool) -> Eq DeleteMember
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMember -> DeleteMember -> Bool
$c/= :: DeleteMember -> DeleteMember -> Bool
== :: DeleteMember -> DeleteMember -> Bool
$c== :: DeleteMember -> DeleteMember -> Bool
Prelude.Eq, ReadPrec [DeleteMember]
ReadPrec DeleteMember
Int -> ReadS DeleteMember
ReadS [DeleteMember]
(Int -> ReadS DeleteMember)
-> ReadS [DeleteMember]
-> ReadPrec DeleteMember
-> ReadPrec [DeleteMember]
-> Read DeleteMember
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMember]
$creadListPrec :: ReadPrec [DeleteMember]
readPrec :: ReadPrec DeleteMember
$creadPrec :: ReadPrec DeleteMember
readList :: ReadS [DeleteMember]
$creadList :: ReadS [DeleteMember]
readsPrec :: Int -> ReadS DeleteMember
$creadsPrec :: Int -> ReadS DeleteMember
Prelude.Read, Int -> DeleteMember -> ShowS
[DeleteMember] -> ShowS
DeleteMember -> String
(Int -> DeleteMember -> ShowS)
-> (DeleteMember -> String)
-> ([DeleteMember] -> ShowS)
-> Show DeleteMember
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMember] -> ShowS
$cshowList :: [DeleteMember] -> ShowS
show :: DeleteMember -> String
$cshow :: DeleteMember -> String
showsPrec :: Int -> DeleteMember -> ShowS
$cshowsPrec :: Int -> DeleteMember -> ShowS
Prelude.Show, (forall x. DeleteMember -> Rep DeleteMember x)
-> (forall x. Rep DeleteMember x -> DeleteMember)
-> Generic DeleteMember
forall x. Rep DeleteMember x -> DeleteMember
forall x. DeleteMember -> Rep DeleteMember x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteMember x -> DeleteMember
$cfrom :: forall x. DeleteMember -> Rep DeleteMember x
Prelude.Generic)
newDeleteMember ::
Prelude.Text ->
Prelude.Text ->
DeleteMember
newDeleteMember :: Text -> Text -> DeleteMember
newDeleteMember Text
pNetworkId_ Text
pMemberId_ =
DeleteMember' :: Text -> Text -> DeleteMember
DeleteMember'
{ $sel:networkId:DeleteMember' :: Text
networkId = Text
pNetworkId_,
$sel:memberId:DeleteMember' :: Text
memberId = Text
pMemberId_
}
deleteMember_networkId :: Lens.Lens' DeleteMember Prelude.Text
deleteMember_networkId :: (Text -> f Text) -> DeleteMember -> f DeleteMember
deleteMember_networkId = (DeleteMember -> Text)
-> (DeleteMember -> Text -> DeleteMember)
-> Lens DeleteMember DeleteMember Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMember' {Text
networkId :: Text
$sel:networkId:DeleteMember' :: DeleteMember -> Text
networkId} -> Text
networkId) (\s :: DeleteMember
s@DeleteMember' {} Text
a -> DeleteMember
s {$sel:networkId:DeleteMember' :: Text
networkId = Text
a} :: DeleteMember)
deleteMember_memberId :: Lens.Lens' DeleteMember Prelude.Text
deleteMember_memberId :: (Text -> f Text) -> DeleteMember -> f DeleteMember
deleteMember_memberId = (DeleteMember -> Text)
-> (DeleteMember -> Text -> DeleteMember)
-> Lens DeleteMember DeleteMember Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMember' {Text
memberId :: Text
$sel:memberId:DeleteMember' :: DeleteMember -> Text
memberId} -> Text
memberId) (\s :: DeleteMember
s@DeleteMember' {} Text
a -> DeleteMember
s {$sel:memberId:DeleteMember' :: Text
memberId = Text
a} :: DeleteMember)
instance Core.AWSRequest DeleteMember where
type AWSResponse DeleteMember = DeleteMemberResponse
request :: DeleteMember -> Request DeleteMember
request = Service -> DeleteMember -> Request DeleteMember
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteMember
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteMember)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteMember))
-> Logger
-> Service
-> Proxy DeleteMember
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteMember)))
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 -> DeleteMemberResponse
DeleteMemberResponse'
(Int -> DeleteMemberResponse)
-> Either String Int -> Either String DeleteMemberResponse
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 DeleteMember
instance Prelude.NFData DeleteMember
instance Core.ToHeaders DeleteMember where
toHeaders :: DeleteMember -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteMember -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath DeleteMember where
toPath :: DeleteMember -> ByteString
toPath DeleteMember' {Text
memberId :: Text
networkId :: Text
$sel:memberId:DeleteMember' :: DeleteMember -> Text
$sel:networkId:DeleteMember' :: DeleteMember -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/networks/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
networkId,
ByteString
"/members/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
memberId
]
instance Core.ToQuery DeleteMember where
toQuery :: DeleteMember -> QueryString
toQuery = QueryString -> DeleteMember -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteMemberResponse = DeleteMemberResponse'
{
DeleteMemberResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteMemberResponse -> DeleteMemberResponse -> Bool
(DeleteMemberResponse -> DeleteMemberResponse -> Bool)
-> (DeleteMemberResponse -> DeleteMemberResponse -> Bool)
-> Eq DeleteMemberResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteMemberResponse -> DeleteMemberResponse -> Bool
$c/= :: DeleteMemberResponse -> DeleteMemberResponse -> Bool
== :: DeleteMemberResponse -> DeleteMemberResponse -> Bool
$c== :: DeleteMemberResponse -> DeleteMemberResponse -> Bool
Prelude.Eq, ReadPrec [DeleteMemberResponse]
ReadPrec DeleteMemberResponse
Int -> ReadS DeleteMemberResponse
ReadS [DeleteMemberResponse]
(Int -> ReadS DeleteMemberResponse)
-> ReadS [DeleteMemberResponse]
-> ReadPrec DeleteMemberResponse
-> ReadPrec [DeleteMemberResponse]
-> Read DeleteMemberResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteMemberResponse]
$creadListPrec :: ReadPrec [DeleteMemberResponse]
readPrec :: ReadPrec DeleteMemberResponse
$creadPrec :: ReadPrec DeleteMemberResponse
readList :: ReadS [DeleteMemberResponse]
$creadList :: ReadS [DeleteMemberResponse]
readsPrec :: Int -> ReadS DeleteMemberResponse
$creadsPrec :: Int -> ReadS DeleteMemberResponse
Prelude.Read, Int -> DeleteMemberResponse -> ShowS
[DeleteMemberResponse] -> ShowS
DeleteMemberResponse -> String
(Int -> DeleteMemberResponse -> ShowS)
-> (DeleteMemberResponse -> String)
-> ([DeleteMemberResponse] -> ShowS)
-> Show DeleteMemberResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteMemberResponse] -> ShowS
$cshowList :: [DeleteMemberResponse] -> ShowS
show :: DeleteMemberResponse -> String
$cshow :: DeleteMemberResponse -> String
showsPrec :: Int -> DeleteMemberResponse -> ShowS
$cshowsPrec :: Int -> DeleteMemberResponse -> ShowS
Prelude.Show, (forall x. DeleteMemberResponse -> Rep DeleteMemberResponse x)
-> (forall x. Rep DeleteMemberResponse x -> DeleteMemberResponse)
-> Generic DeleteMemberResponse
forall x. Rep DeleteMemberResponse x -> DeleteMemberResponse
forall x. DeleteMemberResponse -> Rep DeleteMemberResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteMemberResponse x -> DeleteMemberResponse
$cfrom :: forall x. DeleteMemberResponse -> Rep DeleteMemberResponse x
Prelude.Generic)
newDeleteMemberResponse ::
Prelude.Int ->
DeleteMemberResponse
newDeleteMemberResponse :: Int -> DeleteMemberResponse
newDeleteMemberResponse Int
pHttpStatus_ =
DeleteMemberResponse' :: Int -> DeleteMemberResponse
DeleteMemberResponse' {$sel:httpStatus:DeleteMemberResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteMemberResponse_httpStatus :: Lens.Lens' DeleteMemberResponse Prelude.Int
deleteMemberResponse_httpStatus :: (Int -> f Int) -> DeleteMemberResponse -> f DeleteMemberResponse
deleteMemberResponse_httpStatus = (DeleteMemberResponse -> Int)
-> (DeleteMemberResponse -> Int -> DeleteMemberResponse)
-> Lens DeleteMemberResponse DeleteMemberResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteMemberResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteMemberResponse' :: DeleteMemberResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteMemberResponse
s@DeleteMemberResponse' {} Int
a -> DeleteMemberResponse
s {$sel:httpStatus:DeleteMemberResponse' :: Int
httpStatus = Int
a} :: DeleteMemberResponse)
instance Prelude.NFData DeleteMemberResponse