{-# 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.DynamoDBStreams.Types.Identity where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DynamoDBStreams.Internal
import qualified Amazonka.Prelude as Prelude
data Identity = Identity'
{
Identity -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
Identity -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (Identity -> Identity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Identity -> Identity -> Bool
$c/= :: Identity -> Identity -> Bool
== :: Identity -> Identity -> Bool
$c== :: Identity -> Identity -> Bool
Prelude.Eq, ReadPrec [Identity]
ReadPrec Identity
Int -> ReadS Identity
ReadS [Identity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Identity]
$creadListPrec :: ReadPrec [Identity]
readPrec :: ReadPrec Identity
$creadPrec :: ReadPrec Identity
readList :: ReadS [Identity]
$creadList :: ReadS [Identity]
readsPrec :: Int -> ReadS Identity
$creadsPrec :: Int -> ReadS Identity
Prelude.Read, Int -> Identity -> ShowS
[Identity] -> ShowS
Identity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Identity] -> ShowS
$cshowList :: [Identity] -> ShowS
show :: Identity -> String
$cshow :: Identity -> String
showsPrec :: Int -> Identity -> ShowS
$cshowsPrec :: Int -> Identity -> ShowS
Prelude.Show, forall x. Rep Identity x -> Identity
forall x. Identity -> Rep Identity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Identity x -> Identity
$cfrom :: forall x. Identity -> Rep Identity x
Prelude.Generic)
newIdentity ::
Identity
newIdentity :: Identity
newIdentity =
Identity'
{ $sel:principalId:Identity' :: Maybe Text
principalId = forall a. Maybe a
Prelude.Nothing,
$sel:type':Identity' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing
}
identity_principalId :: Lens.Lens' Identity (Prelude.Maybe Prelude.Text)
identity_principalId :: Lens' Identity (Maybe Text)
identity_principalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Identity' {Maybe Text
principalId :: Maybe Text
$sel:principalId:Identity' :: Identity -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: Identity
s@Identity' {} Maybe Text
a -> Identity
s {$sel:principalId:Identity' :: Maybe Text
principalId = Maybe Text
a} :: Identity)
identity_type :: Lens.Lens' Identity (Prelude.Maybe Prelude.Text)
identity_type :: Lens' Identity (Maybe Text)
identity_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Identity' {Maybe Text
type' :: Maybe Text
$sel:type':Identity' :: Identity -> Maybe Text
type'} -> Maybe Text
type') (\s :: Identity
s@Identity' {} Maybe Text
a -> Identity
s {$sel:type':Identity' :: Maybe Text
type' = Maybe Text
a} :: Identity)
instance Data.FromJSON Identity where
parseJSON :: Value -> Parser Identity
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Identity"
( \Object
x ->
Maybe Text -> Maybe Text -> Identity
Identity'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PrincipalId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Type")
)
instance Prelude.Hashable Identity where
hashWithSalt :: Int -> Identity -> Int
hashWithSalt Int
_salt Identity' {Maybe Text
type' :: Maybe Text
principalId :: Maybe Text
$sel:type':Identity' :: Identity -> Maybe Text
$sel:principalId:Identity' :: Identity -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
principalId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'
instance Prelude.NFData Identity where
rnf :: Identity -> ()
rnf Identity' {Maybe Text
type' :: Maybe Text
principalId :: Maybe Text
$sel:type':Identity' :: Identity -> Maybe Text
$sel:principalId:Identity' :: Identity -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
principalId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'