{-# 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.AuditManager.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
name :: Prelude.Maybe Prelude.Text,
AWSAccount -> Maybe Text
emailAddress :: Prelude.Maybe Prelude.Text,
AWSAccount -> Maybe Text
id :: 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 -> Maybe Text -> AWSAccount
AWSAccount'
{ $sel:name:AWSAccount' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:emailAddress:AWSAccount' :: Maybe Text
emailAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:AWSAccount' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
aWSAccount_name :: Lens.Lens' AWSAccount (Prelude.Maybe Prelude.Text)
aWSAccount_name :: (Maybe Text -> f (Maybe Text)) -> AWSAccount -> f AWSAccount
aWSAccount_name = (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
name :: Maybe Text
$sel:name:AWSAccount' :: AWSAccount -> Maybe Text
name} -> Maybe Text
name) (\s :: AWSAccount
s@AWSAccount' {} Maybe Text
a -> AWSAccount
s {$sel:name:AWSAccount' :: Maybe Text
name = Maybe Text
a} :: AWSAccount)
aWSAccount_emailAddress :: Lens.Lens' AWSAccount (Prelude.Maybe Prelude.Text)
aWSAccount_emailAddress :: (Maybe Text -> f (Maybe Text)) -> AWSAccount -> f AWSAccount
aWSAccount_emailAddress = (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
emailAddress :: Maybe Text
$sel:emailAddress:AWSAccount' :: AWSAccount -> Maybe Text
emailAddress} -> Maybe Text
emailAddress) (\s :: AWSAccount
s@AWSAccount' {} Maybe Text
a -> AWSAccount
s {$sel:emailAddress:AWSAccount' :: Maybe Text
emailAddress = Maybe Text
a} :: AWSAccount)
aWSAccount_id :: Lens.Lens' AWSAccount (Prelude.Maybe Prelude.Text)
aWSAccount_id :: (Maybe Text -> f (Maybe Text)) -> AWSAccount -> f AWSAccount
aWSAccount_id = (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
id :: Maybe Text
$sel:id:AWSAccount' :: AWSAccount -> Maybe Text
id} -> Maybe Text
id) (\s :: AWSAccount
s@AWSAccount' {} Maybe Text
a -> AWSAccount
s {$sel:id:AWSAccount' :: Maybe Text
id = 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 -> Maybe Text -> AWSAccount
AWSAccount'
(Maybe Text -> Maybe Text -> Maybe Text -> AWSAccount)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> 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
"name")
Parser (Maybe Text -> Maybe Text -> AWSAccount)
-> Parser (Maybe Text) -> Parser (Maybe Text -> 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
"emailAddress")
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
"id")
)
instance Prelude.Hashable AWSAccount
instance Prelude.NFData AWSAccount
instance Core.ToJSON AWSAccount where
toJSON :: AWSAccount -> Value
toJSON AWSAccount' {Maybe Text
id :: Maybe Text
emailAddress :: Maybe Text
name :: Maybe Text
$sel:id:AWSAccount' :: AWSAccount -> Maybe Text
$sel:emailAddress:AWSAccount' :: AWSAccount -> Maybe Text
$sel:name:AWSAccount' :: AWSAccount -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Text
"emailAddress" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
emailAddress,
(Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
id
]
)