{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsAccount = AwsAccount'
{
AwsAccount -> Maybe Text
principalId :: Prelude.Maybe Prelude.Text,
AwsAccount -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
}
deriving (AwsAccount -> AwsAccount -> Bool
(AwsAccount -> AwsAccount -> Bool)
-> (AwsAccount -> AwsAccount -> Bool) -> Eq AwsAccount
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]
(Int -> ReadS AwsAccount)
-> ReadS [AwsAccount]
-> ReadPrec AwsAccount
-> ReadPrec [AwsAccount]
-> Read 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
(Int -> AwsAccount -> ShowS)
-> (AwsAccount -> String)
-> ([AwsAccount] -> ShowS)
-> Show AwsAccount
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. AwsAccount -> Rep AwsAccount x)
-> (forall x. Rep AwsAccount x -> AwsAccount) -> Generic AwsAccount
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' :: Maybe Text -> Maybe Text -> AwsAccount
AwsAccount'
{ $sel:principalId:AwsAccount' :: Maybe Text
principalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:AwsAccount' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
awsAccount_principalId :: Lens.Lens' AwsAccount (Prelude.Maybe Prelude.Text)
awsAccount_principalId :: (Maybe Text -> f (Maybe Text)) -> AwsAccount -> f AwsAccount
awsAccount_principalId = (AwsAccount -> Maybe Text)
-> (AwsAccount -> Maybe Text -> AwsAccount)
-> Lens AwsAccount AwsAccount (Maybe Text) (Maybe Text)
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)
awsAccount_accountId :: Lens.Lens' AwsAccount (Prelude.Maybe Prelude.Text)
awsAccount_accountId :: (Maybe Text -> f (Maybe Text)) -> AwsAccount -> f AwsAccount
awsAccount_accountId = (AwsAccount -> Maybe Text)
-> (AwsAccount -> Maybe Text -> AwsAccount)
-> Lens AwsAccount AwsAccount (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON AwsAccount where
parseJSON :: Value -> Parser AwsAccount
parseJSON =
String
-> (Object -> Parser AwsAccount) -> Value -> Parser AwsAccount
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsAccount"
( \Object
x ->
Maybe Text -> Maybe Text -> AwsAccount
AwsAccount'
(Maybe Text -> Maybe Text -> AwsAccount)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AwsAccount)
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 -> AwsAccount)
-> Parser (Maybe Text) -> Parser AwsAccount
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 AwsAccount
instance Prelude.NFData AwsAccount