{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ManagedBlockChain.Types.RemoveAction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RemoveAction = RemoveAction'
{
RemoveAction -> Text
memberId :: Prelude.Text
}
deriving (RemoveAction -> RemoveAction -> Bool
(RemoveAction -> RemoveAction -> Bool)
-> (RemoveAction -> RemoveAction -> Bool) -> Eq RemoveAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoveAction -> RemoveAction -> Bool
$c/= :: RemoveAction -> RemoveAction -> Bool
== :: RemoveAction -> RemoveAction -> Bool
$c== :: RemoveAction -> RemoveAction -> Bool
Prelude.Eq, ReadPrec [RemoveAction]
ReadPrec RemoveAction
Int -> ReadS RemoveAction
ReadS [RemoveAction]
(Int -> ReadS RemoveAction)
-> ReadS [RemoveAction]
-> ReadPrec RemoveAction
-> ReadPrec [RemoveAction]
-> Read RemoveAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoveAction]
$creadListPrec :: ReadPrec [RemoveAction]
readPrec :: ReadPrec RemoveAction
$creadPrec :: ReadPrec RemoveAction
readList :: ReadS [RemoveAction]
$creadList :: ReadS [RemoveAction]
readsPrec :: Int -> ReadS RemoveAction
$creadsPrec :: Int -> ReadS RemoveAction
Prelude.Read, Int -> RemoveAction -> ShowS
[RemoveAction] -> ShowS
RemoveAction -> String
(Int -> RemoveAction -> ShowS)
-> (RemoveAction -> String)
-> ([RemoveAction] -> ShowS)
-> Show RemoveAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoveAction] -> ShowS
$cshowList :: [RemoveAction] -> ShowS
show :: RemoveAction -> String
$cshow :: RemoveAction -> String
showsPrec :: Int -> RemoveAction -> ShowS
$cshowsPrec :: Int -> RemoveAction -> ShowS
Prelude.Show, (forall x. RemoveAction -> Rep RemoveAction x)
-> (forall x. Rep RemoveAction x -> RemoveAction)
-> Generic RemoveAction
forall x. Rep RemoveAction x -> RemoveAction
forall x. RemoveAction -> Rep RemoveAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemoveAction x -> RemoveAction
$cfrom :: forall x. RemoveAction -> Rep RemoveAction x
Prelude.Generic)
newRemoveAction ::
Prelude.Text ->
RemoveAction
newRemoveAction :: Text -> RemoveAction
newRemoveAction Text
pMemberId_ =
RemoveAction' :: Text -> RemoveAction
RemoveAction' {$sel:memberId:RemoveAction' :: Text
memberId = Text
pMemberId_}
removeAction_memberId :: Lens.Lens' RemoveAction Prelude.Text
removeAction_memberId :: (Text -> f Text) -> RemoveAction -> f RemoveAction
removeAction_memberId = (RemoveAction -> Text)
-> (RemoveAction -> Text -> RemoveAction)
-> Lens RemoveAction RemoveAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoveAction' {Text
memberId :: Text
$sel:memberId:RemoveAction' :: RemoveAction -> Text
memberId} -> Text
memberId) (\s :: RemoveAction
s@RemoveAction' {} Text
a -> RemoveAction
s {$sel:memberId:RemoveAction' :: Text
memberId = Text
a} :: RemoveAction)
instance Core.FromJSON RemoveAction where
parseJSON :: Value -> Parser RemoveAction
parseJSON =
String
-> (Object -> Parser RemoveAction) -> Value -> Parser RemoveAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RemoveAction"
( \Object
x ->
Text -> RemoveAction
RemoveAction' (Text -> RemoveAction) -> Parser Text -> Parser RemoveAction
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"MemberId")
)
instance Prelude.Hashable RemoveAction
instance Prelude.NFData RemoveAction
instance Core.ToJSON RemoveAction where
toJSON :: RemoveAction -> Value
toJSON RemoveAction' {Text
memberId :: Text
$sel:memberId:RemoveAction' :: RemoveAction -> 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
"MemberId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
memberId)]
)