{-# 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.AwsAccount 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 AwsAccount = AwsAccount'
{
AwsAccount -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
AwsAccount -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text
}
deriving (AwsAccount -> AwsAccount -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsAccount -> AwsAccount -> Bool
$c/= :: AwsAccount -> AwsAccount -> Bool
== :: AwsAccount -> AwsAccount -> Bool
$c== :: AwsAccount -> AwsAccount -> Bool
Prelude.Eq, ReadPrec [AwsAccount]
ReadPrec AwsAccount
Int -> ReadS AwsAccount
ReadS [AwsAccount]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsAccount]
$creadListPrec :: ReadPrec [AwsAccount]
readPrec :: ReadPrec AwsAccount
$creadPrec :: ReadPrec AwsAccount
readList :: ReadS [AwsAccount]
$creadList :: ReadS [AwsAccount]
readsPrec :: Int -> ReadS AwsAccount
$creadsPrec :: Int -> ReadS AwsAccount
Prelude.Read, Int -> AwsAccount -> ShowS
[AwsAccount] -> ShowS
AwsAccount -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsAccount] -> ShowS
$cshowList :: [AwsAccount] -> ShowS
show :: AwsAccount -> String
$cshow :: AwsAccount -> String
showsPrec :: Int -> AwsAccount -> ShowS
$cshowsPrec :: Int -> AwsAccount -> ShowS
Prelude.Show, forall x. Rep AwsAccount x -> AwsAccount
forall x. AwsAccount -> Rep AwsAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AwsAccount x -> AwsAccount
$cfrom :: forall x. AwsAccount -> Rep AwsAccount x
Prelude.Generic)
newAwsAccount ::
AwsAccount
newAwsAccount :: AwsAccount
newAwsAccount =
AwsAccount'
{ $sel:accountId:AwsAccount' :: Maybe Text
accountId = forall a. Maybe a
Prelude.Nothing,
$sel:principalId:AwsAccount' :: Maybe Text
principalId = forall a. Maybe a
Prelude.Nothing
}
awsAccount_accountId :: Lens.Lens' AwsAccount (Prelude.Maybe Prelude.Text)
awsAccount_accountId :: Lens' AwsAccount (Maybe Text)
awsAccount_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAccount' {Maybe Text
accountId :: Maybe Text
$sel:accountId:AwsAccount' :: AwsAccount -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: AwsAccount
s@AwsAccount' {} Maybe Text
a -> AwsAccount
s {$sel:accountId:AwsAccount' :: Maybe Text
accountId = Maybe Text
a} :: AwsAccount)
awsAccount_principalId :: Lens.Lens' AwsAccount (Prelude.Maybe Prelude.Text)
awsAccount_principalId :: Lens' AwsAccount (Maybe Text)
awsAccount_principalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsAccount' {Maybe Text
principalId :: Maybe Text
$sel:principalId:AwsAccount' :: AwsAccount -> Maybe Text
principalId} -> Maybe Text
principalId) (\s :: AwsAccount
s@AwsAccount' {} Maybe Text
a -> AwsAccount
s {$sel:principalId:AwsAccount' :: Maybe Text
principalId = Maybe Text
a} :: AwsAccount)
instance Data.FromJSON AwsAccount where
parseJSON :: Value -> Parser AwsAccount
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AwsAccount"
( \Object
x ->
Maybe Text -> Maybe Text -> AwsAccount
AwsAccount'
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
"accountId")
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
"principalId")
)
instance Prelude.Hashable AwsAccount where
hashWithSalt :: Int -> AwsAccount -> Int
hashWithSalt Int
_salt AwsAccount' {Maybe Text
principalId :: Maybe Text
accountId :: Maybe Text
$sel:principalId:AwsAccount' :: AwsAccount -> Maybe Text
$sel:accountId:AwsAccount' :: AwsAccount -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
principalId
instance Prelude.NFData AwsAccount where
rnf :: AwsAccount -> ()
rnf AwsAccount' {Maybe Text
principalId :: Maybe Text
accountId :: Maybe Text
$sel:principalId:AwsAccount' :: AwsAccount -> Maybe Text
$sel:accountId:AwsAccount' :: AwsAccount -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
principalId