{-# 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.SecurityHub.Types.AccountDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AccountDetails = AccountDetails'
{
AccountDetails -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
AccountDetails -> Text
accountId :: Prelude.Text
}
deriving (AccountDetails -> AccountDetails -> Bool
(AccountDetails -> AccountDetails -> Bool)
-> (AccountDetails -> AccountDetails -> Bool) -> Eq AccountDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountDetails -> AccountDetails -> Bool
$c/= :: AccountDetails -> AccountDetails -> Bool
== :: AccountDetails -> AccountDetails -> Bool
$c== :: AccountDetails -> AccountDetails -> Bool
Prelude.Eq, ReadPrec [AccountDetails]
ReadPrec AccountDetails
Int -> ReadS AccountDetails
ReadS [AccountDetails]
(Int -> ReadS AccountDetails)
-> ReadS [AccountDetails]
-> ReadPrec AccountDetails
-> ReadPrec [AccountDetails]
-> Read AccountDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountDetails]
$creadListPrec :: ReadPrec [AccountDetails]
readPrec :: ReadPrec AccountDetails
$creadPrec :: ReadPrec AccountDetails
readList :: ReadS [AccountDetails]
$creadList :: ReadS [AccountDetails]
readsPrec :: Int -> ReadS AccountDetails
$creadsPrec :: Int -> ReadS AccountDetails
Prelude.Read, Int -> AccountDetails -> ShowS
[AccountDetails] -> ShowS
AccountDetails -> String
(Int -> AccountDetails -> ShowS)
-> (AccountDetails -> String)
-> ([AccountDetails] -> ShowS)
-> Show AccountDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountDetails] -> ShowS
$cshowList :: [AccountDetails] -> ShowS
show :: AccountDetails -> String
$cshow :: AccountDetails -> String
showsPrec :: Int -> AccountDetails -> ShowS
$cshowsPrec :: Int -> AccountDetails -> ShowS
Prelude.Show, (forall x. AccountDetails -> Rep AccountDetails x)
-> (forall x. Rep AccountDetails x -> AccountDetails)
-> Generic AccountDetails
forall x. Rep AccountDetails x -> AccountDetails
forall x. AccountDetails -> Rep AccountDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountDetails x -> AccountDetails
$cfrom :: forall x. AccountDetails -> Rep AccountDetails x
Prelude.Generic)
newAccountDetails ::
Prelude.Text ->
AccountDetails
newAccountDetails :: Text -> AccountDetails
newAccountDetails Text
pAccountId_ =
AccountDetails' :: Maybe Text -> Text -> AccountDetails
AccountDetails'
{ $sel:email:AccountDetails' :: Maybe Text
email = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:AccountDetails' :: Text
accountId = Text
pAccountId_
}
accountDetails_email :: Lens.Lens' AccountDetails (Prelude.Maybe Prelude.Text)
accountDetails_email :: (Maybe Text -> f (Maybe Text))
-> AccountDetails -> f AccountDetails
accountDetails_email = (AccountDetails -> Maybe Text)
-> (AccountDetails -> Maybe Text -> AccountDetails)
-> Lens AccountDetails AccountDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountDetails' {Maybe Text
email :: Maybe Text
$sel:email:AccountDetails' :: AccountDetails -> Maybe Text
email} -> Maybe Text
email) (\s :: AccountDetails
s@AccountDetails' {} Maybe Text
a -> AccountDetails
s {$sel:email:AccountDetails' :: Maybe Text
email = Maybe Text
a} :: AccountDetails)
accountDetails_accountId :: Lens.Lens' AccountDetails Prelude.Text
accountDetails_accountId :: (Text -> f Text) -> AccountDetails -> f AccountDetails
accountDetails_accountId = (AccountDetails -> Text)
-> (AccountDetails -> Text -> AccountDetails)
-> Lens AccountDetails AccountDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountDetails' {Text
accountId :: Text
$sel:accountId:AccountDetails' :: AccountDetails -> Text
accountId} -> Text
accountId) (\s :: AccountDetails
s@AccountDetails' {} Text
a -> AccountDetails
s {$sel:accountId:AccountDetails' :: Text
accountId = Text
a} :: AccountDetails)
instance Prelude.Hashable AccountDetails
instance Prelude.NFData AccountDetails
instance Core.ToJSON AccountDetails where
toJSON :: AccountDetails -> Value
toJSON AccountDetails' {Maybe Text
Text
accountId :: Text
email :: Maybe Text
$sel:accountId:AccountDetails' :: AccountDetails -> Text
$sel:email:AccountDetails' :: AccountDetails -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Email" 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
email,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
accountId)
]
)