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