{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data InviteAction = InviteAction'
{
InviteAction -> Text
principal :: Prelude.Text
}
deriving (InviteAction -> InviteAction -> Bool
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]
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
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. 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' {$sel:principal:InviteAction' :: Text
principal = Text
pPrincipal_}
inviteAction_principal :: Lens.Lens' InviteAction Prelude.Text
inviteAction_principal :: Lens' InviteAction Text
inviteAction_principal = 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 Data.FromJSON InviteAction where
parseJSON :: Value -> Parser InviteAction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InviteAction"
( \Object
x ->
Text -> InviteAction
InviteAction' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Principal")
)
instance Prelude.Hashable InviteAction where
hashWithSalt :: Int -> InviteAction -> Int
hashWithSalt Int
_salt InviteAction' {Text
principal :: Text
$sel:principal:InviteAction' :: InviteAction -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
principal
instance Prelude.NFData InviteAction where
rnf :: InviteAction -> ()
rnf InviteAction' {Text
principal :: Text
$sel:principal:InviteAction' :: InviteAction -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
principal
instance Data.ToJSON InviteAction where
toJSON :: InviteAction -> Value
toJSON InviteAction' {Text
principal :: Text
$sel:principal:InviteAction' :: InviteAction -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"Principal" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
principal)]
)