{-# 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.MacieV2.Types.UserIdentityRoot where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UserIdentityRoot = UserIdentityRoot'
{
UserIdentityRoot -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
UserIdentityRoot -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
UserIdentityRoot -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
}
deriving (UserIdentityRoot -> UserIdentityRoot -> Bool
(UserIdentityRoot -> UserIdentityRoot -> Bool)
-> (UserIdentityRoot -> UserIdentityRoot -> Bool)
-> Eq UserIdentityRoot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserIdentityRoot -> UserIdentityRoot -> Bool
$c/= :: UserIdentityRoot -> UserIdentityRoot -> Bool
== :: UserIdentityRoot -> UserIdentityRoot -> Bool
$c== :: UserIdentityRoot -> UserIdentityRoot -> Bool
Prelude.Eq, ReadPrec [UserIdentityRoot]
ReadPrec UserIdentityRoot
Int -> ReadS UserIdentityRoot
ReadS [UserIdentityRoot]
(Int -> ReadS UserIdentityRoot)
-> ReadS [UserIdentityRoot]
-> ReadPrec UserIdentityRoot
-> ReadPrec [UserIdentityRoot]
-> Read UserIdentityRoot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserIdentityRoot]
$creadListPrec :: ReadPrec [UserIdentityRoot]
readPrec :: ReadPrec UserIdentityRoot
$creadPrec :: ReadPrec UserIdentityRoot
readList :: ReadS [UserIdentityRoot]
$creadList :: ReadS [UserIdentityRoot]
readsPrec :: Int -> ReadS UserIdentityRoot
$creadsPrec :: Int -> ReadS UserIdentityRoot
Prelude.Read, Int -> UserIdentityRoot -> ShowS
[UserIdentityRoot] -> ShowS
UserIdentityRoot -> String
(Int -> UserIdentityRoot -> ShowS)
-> (UserIdentityRoot -> String)
-> ([UserIdentityRoot] -> ShowS)
-> Show UserIdentityRoot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserIdentityRoot] -> ShowS
$cshowList :: [UserIdentityRoot] -> ShowS
show :: UserIdentityRoot -> String
$cshow :: UserIdentityRoot -> String
showsPrec :: Int -> UserIdentityRoot -> ShowS
$cshowsPrec :: Int -> UserIdentityRoot -> ShowS
Prelude.Show, (forall x. UserIdentityRoot -> Rep UserIdentityRoot x)
-> (forall x. Rep UserIdentityRoot x -> UserIdentityRoot)
-> Generic UserIdentityRoot
forall x. Rep UserIdentityRoot x -> UserIdentityRoot
forall x. UserIdentityRoot -> Rep UserIdentityRoot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserIdentityRoot x -> UserIdentityRoot
$cfrom :: forall x. UserIdentityRoot -> Rep UserIdentityRoot x
Prelude.Generic)
newUserIdentityRoot ::
UserIdentityRoot
newUserIdentityRoot :: UserIdentityRoot
newUserIdentityRoot =
UserIdentityRoot' :: Maybe Text -> Maybe Text -> Maybe Text -> UserIdentityRoot
UserIdentityRoot'
{ $sel:principalId:UserIdentityRoot' :: Maybe Text
principalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:UserIdentityRoot' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:UserIdentityRoot' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
userIdentityRoot_principalId :: Lens.Lens' UserIdentityRoot (Prelude.Maybe Prelude.Text)
userIdentityRoot_principalId :: (Maybe Text -> f (Maybe Text))
-> UserIdentityRoot -> f UserIdentityRoot
userIdentityRoot_principalId = (UserIdentityRoot -> Maybe Text)
-> (UserIdentityRoot -> Maybe Text -> UserIdentityRoot)
-> Lens UserIdentityRoot UserIdentityRoot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentityRoot' {Maybe Text
principalId :: Maybe Text
$sel:principalId:UserIdentityRoot' :: UserIdentityRoot -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: UserIdentityRoot
s@UserIdentityRoot' {} Maybe Text
a -> UserIdentityRoot
s {$sel:principalId:UserIdentityRoot' :: Maybe Text
principalId = Maybe Text
a} :: UserIdentityRoot)
userIdentityRoot_arn :: Lens.Lens' UserIdentityRoot (Prelude.Maybe Prelude.Text)
userIdentityRoot_arn :: (Maybe Text -> f (Maybe Text))
-> UserIdentityRoot -> f UserIdentityRoot
userIdentityRoot_arn = (UserIdentityRoot -> Maybe Text)
-> (UserIdentityRoot -> Maybe Text -> UserIdentityRoot)
-> Lens UserIdentityRoot UserIdentityRoot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentityRoot' {Maybe Text
arn :: Maybe Text
$sel:arn:UserIdentityRoot' :: UserIdentityRoot -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UserIdentityRoot
s@UserIdentityRoot' {} Maybe Text
a -> UserIdentityRoot
s {$sel:arn:UserIdentityRoot' :: Maybe Text
arn = Maybe Text
a} :: UserIdentityRoot)
userIdentityRoot_accountId :: Lens.Lens' UserIdentityRoot (Prelude.Maybe Prelude.Text)
userIdentityRoot_accountId :: (Maybe Text -> f (Maybe Text))
-> UserIdentityRoot -> f UserIdentityRoot
userIdentityRoot_accountId = (UserIdentityRoot -> Maybe Text)
-> (UserIdentityRoot -> Maybe Text -> UserIdentityRoot)
-> Lens UserIdentityRoot UserIdentityRoot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserIdentityRoot' {Maybe Text
accountId :: Maybe Text
$sel:accountId:UserIdentityRoot' :: UserIdentityRoot -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: UserIdentityRoot
s@UserIdentityRoot' {} Maybe Text
a -> UserIdentityRoot
s {$sel:accountId:UserIdentityRoot' :: Maybe Text
accountId = Maybe Text
a} :: UserIdentityRoot)
instance Core.FromJSON UserIdentityRoot where
parseJSON :: Value -> Parser UserIdentityRoot
parseJSON =
String
-> (Object -> Parser UserIdentityRoot)
-> Value
-> Parser UserIdentityRoot
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserIdentityRoot"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> UserIdentityRoot
UserIdentityRoot'
(Maybe Text -> Maybe Text -> Maybe Text -> UserIdentityRoot)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> UserIdentityRoot)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"principalId")
Parser (Maybe Text -> Maybe Text -> UserIdentityRoot)
-> Parser (Maybe Text) -> Parser (Maybe Text -> UserIdentityRoot)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"arn")
Parser (Maybe Text -> UserIdentityRoot)
-> Parser (Maybe Text) -> Parser UserIdentityRoot
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"accountId")
)
instance Prelude.Hashable UserIdentityRoot
instance Prelude.NFData UserIdentityRoot