{-# 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.UpdateMember
(
UpdateMember (..),
newUpdateMember,
updateMember_logPublishingConfiguration,
updateMember_networkId,
updateMember_memberId,
UpdateMemberResponse (..),
newUpdateMemberResponse,
updateMemberResponse_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 UpdateMember = UpdateMember'
{
UpdateMember -> Maybe MemberLogPublishingConfiguration
logPublishingConfiguration :: Prelude.Maybe MemberLogPublishingConfiguration,
UpdateMember -> Text
networkId :: Prelude.Text,
UpdateMember -> Text
memberId :: Prelude.Text
}
deriving (UpdateMember -> UpdateMember -> Bool
(UpdateMember -> UpdateMember -> Bool)
-> (UpdateMember -> UpdateMember -> Bool) -> Eq UpdateMember
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMember -> UpdateMember -> Bool
$c/= :: UpdateMember -> UpdateMember -> Bool
== :: UpdateMember -> UpdateMember -> Bool
$c== :: UpdateMember -> UpdateMember -> Bool
Prelude.Eq, ReadPrec [UpdateMember]
ReadPrec UpdateMember
Int -> ReadS UpdateMember
ReadS [UpdateMember]
(Int -> ReadS UpdateMember)
-> ReadS [UpdateMember]
-> ReadPrec UpdateMember
-> ReadPrec [UpdateMember]
-> Read UpdateMember
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMember]
$creadListPrec :: ReadPrec [UpdateMember]
readPrec :: ReadPrec UpdateMember
$creadPrec :: ReadPrec UpdateMember
readList :: ReadS [UpdateMember]
$creadList :: ReadS [UpdateMember]
readsPrec :: Int -> ReadS UpdateMember
$creadsPrec :: Int -> ReadS UpdateMember
Prelude.Read, Int -> UpdateMember -> ShowS
[UpdateMember] -> ShowS
UpdateMember -> String
(Int -> UpdateMember -> ShowS)
-> (UpdateMember -> String)
-> ([UpdateMember] -> ShowS)
-> Show UpdateMember
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMember] -> ShowS
$cshowList :: [UpdateMember] -> ShowS
show :: UpdateMember -> String
$cshow :: UpdateMember -> String
showsPrec :: Int -> UpdateMember -> ShowS
$cshowsPrec :: Int -> UpdateMember -> ShowS
Prelude.Show, (forall x. UpdateMember -> Rep UpdateMember x)
-> (forall x. Rep UpdateMember x -> UpdateMember)
-> Generic UpdateMember
forall x. Rep UpdateMember x -> UpdateMember
forall x. UpdateMember -> Rep UpdateMember x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMember x -> UpdateMember
$cfrom :: forall x. UpdateMember -> Rep UpdateMember x
Prelude.Generic)
newUpdateMember ::
Prelude.Text ->
Prelude.Text ->
UpdateMember
newUpdateMember :: Text -> Text -> UpdateMember
newUpdateMember Text
pNetworkId_ Text
pMemberId_ =
UpdateMember' :: Maybe MemberLogPublishingConfiguration
-> Text -> Text -> UpdateMember
UpdateMember'
{ $sel:logPublishingConfiguration:UpdateMember' :: Maybe MemberLogPublishingConfiguration
logPublishingConfiguration =
Maybe MemberLogPublishingConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:networkId:UpdateMember' :: Text
networkId = Text
pNetworkId_,
$sel:memberId:UpdateMember' :: Text
memberId = Text
pMemberId_
}
updateMember_logPublishingConfiguration :: Lens.Lens' UpdateMember (Prelude.Maybe MemberLogPublishingConfiguration)
updateMember_logPublishingConfiguration :: (Maybe MemberLogPublishingConfiguration
-> f (Maybe MemberLogPublishingConfiguration))
-> UpdateMember -> f UpdateMember
updateMember_logPublishingConfiguration = (UpdateMember -> Maybe MemberLogPublishingConfiguration)
-> (UpdateMember
-> Maybe MemberLogPublishingConfiguration -> UpdateMember)
-> Lens
UpdateMember
UpdateMember
(Maybe MemberLogPublishingConfiguration)
(Maybe MemberLogPublishingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMember' {Maybe MemberLogPublishingConfiguration
logPublishingConfiguration :: Maybe MemberLogPublishingConfiguration
$sel:logPublishingConfiguration:UpdateMember' :: UpdateMember -> Maybe MemberLogPublishingConfiguration
logPublishingConfiguration} -> Maybe MemberLogPublishingConfiguration
logPublishingConfiguration) (\s :: UpdateMember
s@UpdateMember' {} Maybe MemberLogPublishingConfiguration
a -> UpdateMember
s {$sel:logPublishingConfiguration:UpdateMember' :: Maybe MemberLogPublishingConfiguration
logPublishingConfiguration = Maybe MemberLogPublishingConfiguration
a} :: UpdateMember)
updateMember_networkId :: Lens.Lens' UpdateMember Prelude.Text
updateMember_networkId :: (Text -> f Text) -> UpdateMember -> f UpdateMember
updateMember_networkId = (UpdateMember -> Text)
-> (UpdateMember -> Text -> UpdateMember)
-> Lens UpdateMember UpdateMember Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMember' {Text
networkId :: Text
$sel:networkId:UpdateMember' :: UpdateMember -> Text
networkId} -> Text
networkId) (\s :: UpdateMember
s@UpdateMember' {} Text
a -> UpdateMember
s {$sel:networkId:UpdateMember' :: Text
networkId = Text
a} :: UpdateMember)
updateMember_memberId :: Lens.Lens' UpdateMember Prelude.Text
updateMember_memberId :: (Text -> f Text) -> UpdateMember -> f UpdateMember
updateMember_memberId = (UpdateMember -> Text)
-> (UpdateMember -> Text -> UpdateMember)
-> Lens UpdateMember UpdateMember Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMember' {Text
memberId :: Text
$sel:memberId:UpdateMember' :: UpdateMember -> Text
memberId} -> Text
memberId) (\s :: UpdateMember
s@UpdateMember' {} Text
a -> UpdateMember
s {$sel:memberId:UpdateMember' :: Text
memberId = Text
a} :: UpdateMember)
instance Core.AWSRequest UpdateMember where
type AWSResponse UpdateMember = UpdateMemberResponse
request :: UpdateMember -> Request UpdateMember
request = Service -> UpdateMember -> Request UpdateMember
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateMember
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateMember)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateMember))
-> Logger
-> Service
-> Proxy UpdateMember
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateMember)))
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 -> UpdateMemberResponse
UpdateMemberResponse'
(Int -> UpdateMemberResponse)
-> Either String Int -> Either String UpdateMemberResponse
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 UpdateMember
instance Prelude.NFData UpdateMember
instance Core.ToHeaders UpdateMember where
toHeaders :: UpdateMember -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateMember -> 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.ToJSON UpdateMember where
toJSON :: UpdateMember -> Value
toJSON UpdateMember' {Maybe MemberLogPublishingConfiguration
Text
memberId :: Text
networkId :: Text
logPublishingConfiguration :: Maybe MemberLogPublishingConfiguration
$sel:memberId:UpdateMember' :: UpdateMember -> Text
$sel:networkId:UpdateMember' :: UpdateMember -> Text
$sel:logPublishingConfiguration:UpdateMember' :: UpdateMember -> Maybe MemberLogPublishingConfiguration
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"LogPublishingConfiguration" Text -> MemberLogPublishingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(MemberLogPublishingConfiguration -> Pair)
-> Maybe MemberLogPublishingConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MemberLogPublishingConfiguration
logPublishingConfiguration
]
)
instance Core.ToPath UpdateMember where
toPath :: UpdateMember -> ByteString
toPath UpdateMember' {Maybe MemberLogPublishingConfiguration
Text
memberId :: Text
networkId :: Text
logPublishingConfiguration :: Maybe MemberLogPublishingConfiguration
$sel:memberId:UpdateMember' :: UpdateMember -> Text
$sel:networkId:UpdateMember' :: UpdateMember -> Text
$sel:logPublishingConfiguration:UpdateMember' :: UpdateMember -> Maybe MemberLogPublishingConfiguration
..} =
[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 UpdateMember where
toQuery :: UpdateMember -> QueryString
toQuery = QueryString -> UpdateMember -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateMemberResponse = UpdateMemberResponse'
{
UpdateMemberResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateMemberResponse -> UpdateMemberResponse -> Bool
(UpdateMemberResponse -> UpdateMemberResponse -> Bool)
-> (UpdateMemberResponse -> UpdateMemberResponse -> Bool)
-> Eq UpdateMemberResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMemberResponse -> UpdateMemberResponse -> Bool
$c/= :: UpdateMemberResponse -> UpdateMemberResponse -> Bool
== :: UpdateMemberResponse -> UpdateMemberResponse -> Bool
$c== :: UpdateMemberResponse -> UpdateMemberResponse -> Bool
Prelude.Eq, ReadPrec [UpdateMemberResponse]
ReadPrec UpdateMemberResponse
Int -> ReadS UpdateMemberResponse
ReadS [UpdateMemberResponse]
(Int -> ReadS UpdateMemberResponse)
-> ReadS [UpdateMemberResponse]
-> ReadPrec UpdateMemberResponse
-> ReadPrec [UpdateMemberResponse]
-> Read UpdateMemberResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMemberResponse]
$creadListPrec :: ReadPrec [UpdateMemberResponse]
readPrec :: ReadPrec UpdateMemberResponse
$creadPrec :: ReadPrec UpdateMemberResponse
readList :: ReadS [UpdateMemberResponse]
$creadList :: ReadS [UpdateMemberResponse]
readsPrec :: Int -> ReadS UpdateMemberResponse
$creadsPrec :: Int -> ReadS UpdateMemberResponse
Prelude.Read, Int -> UpdateMemberResponse -> ShowS
[UpdateMemberResponse] -> ShowS
UpdateMemberResponse -> String
(Int -> UpdateMemberResponse -> ShowS)
-> (UpdateMemberResponse -> String)
-> ([UpdateMemberResponse] -> ShowS)
-> Show UpdateMemberResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMemberResponse] -> ShowS
$cshowList :: [UpdateMemberResponse] -> ShowS
show :: UpdateMemberResponse -> String
$cshow :: UpdateMemberResponse -> String
showsPrec :: Int -> UpdateMemberResponse -> ShowS
$cshowsPrec :: Int -> UpdateMemberResponse -> ShowS
Prelude.Show, (forall x. UpdateMemberResponse -> Rep UpdateMemberResponse x)
-> (forall x. Rep UpdateMemberResponse x -> UpdateMemberResponse)
-> Generic UpdateMemberResponse
forall x. Rep UpdateMemberResponse x -> UpdateMemberResponse
forall x. UpdateMemberResponse -> Rep UpdateMemberResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMemberResponse x -> UpdateMemberResponse
$cfrom :: forall x. UpdateMemberResponse -> Rep UpdateMemberResponse x
Prelude.Generic)
newUpdateMemberResponse ::
Prelude.Int ->
UpdateMemberResponse
newUpdateMemberResponse :: Int -> UpdateMemberResponse
newUpdateMemberResponse Int
pHttpStatus_ =
UpdateMemberResponse' :: Int -> UpdateMemberResponse
UpdateMemberResponse' {$sel:httpStatus:UpdateMemberResponse' :: Int
httpStatus = Int
pHttpStatus_}
updateMemberResponse_httpStatus :: Lens.Lens' UpdateMemberResponse Prelude.Int
updateMemberResponse_httpStatus :: (Int -> f Int) -> UpdateMemberResponse -> f UpdateMemberResponse
updateMemberResponse_httpStatus = (UpdateMemberResponse -> Int)
-> (UpdateMemberResponse -> Int -> UpdateMemberResponse)
-> Lens UpdateMemberResponse UpdateMemberResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMemberResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateMemberResponse' :: UpdateMemberResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateMemberResponse
s@UpdateMemberResponse' {} Int
a -> UpdateMemberResponse
s {$sel:httpStatus:UpdateMemberResponse' :: Int
httpStatus = Int
a} :: UpdateMemberResponse)
instance Prelude.NFData UpdateMemberResponse