{-# 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.InviteAction where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InviteAction = InviteAction'
{
InviteAction -> Text
principal :: Prelude.Text
}
deriving (InviteAction -> InviteAction -> Bool
(InviteAction -> InviteAction -> Bool)
-> (InviteAction -> InviteAction -> Bool) -> Eq InviteAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InviteAction -> InviteAction -> Bool
$c/= :: InviteAction -> InviteAction -> Bool
== :: InviteAction -> InviteAction -> Bool
$c== :: InviteAction -> InviteAction -> Bool
Prelude.Eq, ReadPrec [InviteAction]
ReadPrec InviteAction
Int -> ReadS InviteAction
ReadS [InviteAction]
(Int -> ReadS InviteAction)
-> ReadS [InviteAction]
-> ReadPrec InviteAction
-> ReadPrec [InviteAction]
-> Read InviteAction
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InviteAction]
$creadListPrec :: ReadPrec [InviteAction]
readPrec :: ReadPrec InviteAction
$creadPrec :: ReadPrec InviteAction
readList :: ReadS [InviteAction]
$creadList :: ReadS [InviteAction]
readsPrec :: Int -> ReadS InviteAction
$creadsPrec :: Int -> ReadS InviteAction
Prelude.Read, Int -> InviteAction -> ShowS
[InviteAction] -> ShowS
InviteAction -> String
(Int -> InviteAction -> ShowS)
-> (InviteAction -> String)
-> ([InviteAction] -> ShowS)
-> Show InviteAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InviteAction] -> ShowS
$cshowList :: [InviteAction] -> ShowS
show :: InviteAction -> String
$cshow :: InviteAction -> String
showsPrec :: Int -> InviteAction -> ShowS
$cshowsPrec :: Int -> InviteAction -> ShowS
Prelude.Show, (forall x. InviteAction -> Rep InviteAction x)
-> (forall x. Rep InviteAction x -> InviteAction)
-> Generic InviteAction
forall x. Rep InviteAction x -> InviteAction
forall x. InviteAction -> Rep InviteAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InviteAction x -> InviteAction
$cfrom :: forall x. InviteAction -> Rep InviteAction x
Prelude.Generic)
newInviteAction ::
Prelude.Text ->
InviteAction
newInviteAction :: Text -> InviteAction
newInviteAction Text
pPrincipal_ =
InviteAction' :: Text -> InviteAction
InviteAction' {$sel:principal:InviteAction' :: Text
principal = Text
pPrincipal_}
inviteAction_principal :: Lens.Lens' InviteAction Prelude.Text
inviteAction_principal :: (Text -> f Text) -> InviteAction -> f InviteAction
inviteAction_principal = (InviteAction -> Text)
-> (InviteAction -> Text -> InviteAction)
-> Lens InviteAction InviteAction Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InviteAction' {Text
principal :: Text
$sel:principal:InviteAction' :: InviteAction -> Text
principal} -> Text
principal) (\s :: InviteAction
s@InviteAction' {} Text
a -> InviteAction
s {$sel:principal:InviteAction' :: Text
principal = Text
a} :: InviteAction)
instance Core.FromJSON InviteAction where
parseJSON :: Value -> Parser InviteAction
parseJSON =
String
-> (Object -> Parser InviteAction) -> Value -> Parser InviteAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InviteAction"
( \Object
x ->
Text -> InviteAction
InviteAction' (Text -> InviteAction) -> Parser Text -> Parser InviteAction
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
"Principal")
)
instance Prelude.Hashable InviteAction
instance Prelude.NFData InviteAction
instance Core.ToJSON InviteAction where
toJSON :: InviteAction -> Value
toJSON InviteAction' {Text
principal :: Text
$sel:principal:InviteAction' :: InviteAction -> 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
"Principal" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
principal)]
)