{-# 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.AdminAccount where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AdminStatus
data AdminAccount = AdminAccount'
{
AdminAccount -> Maybe AdminStatus
status :: Prelude.Maybe AdminStatus,
AdminAccount -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
}
deriving (AdminAccount -> AdminAccount -> Bool
(AdminAccount -> AdminAccount -> Bool)
-> (AdminAccount -> AdminAccount -> Bool) -> Eq AdminAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdminAccount -> AdminAccount -> Bool
$c/= :: AdminAccount -> AdminAccount -> Bool
== :: AdminAccount -> AdminAccount -> Bool
$c== :: AdminAccount -> AdminAccount -> Bool
Prelude.Eq, ReadPrec [AdminAccount]
ReadPrec AdminAccount
Int -> ReadS AdminAccount
ReadS [AdminAccount]
(Int -> ReadS AdminAccount)
-> ReadS [AdminAccount]
-> ReadPrec AdminAccount
-> ReadPrec [AdminAccount]
-> Read AdminAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdminAccount]
$creadListPrec :: ReadPrec [AdminAccount]
readPrec :: ReadPrec AdminAccount
$creadPrec :: ReadPrec AdminAccount
readList :: ReadS [AdminAccount]
$creadList :: ReadS [AdminAccount]
readsPrec :: Int -> ReadS AdminAccount
$creadsPrec :: Int -> ReadS AdminAccount
Prelude.Read, Int -> AdminAccount -> ShowS
[AdminAccount] -> ShowS
AdminAccount -> String
(Int -> AdminAccount -> ShowS)
-> (AdminAccount -> String)
-> ([AdminAccount] -> ShowS)
-> Show AdminAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdminAccount] -> ShowS
$cshowList :: [AdminAccount] -> ShowS
show :: AdminAccount -> String
$cshow :: AdminAccount -> String
showsPrec :: Int -> AdminAccount -> ShowS
$cshowsPrec :: Int -> AdminAccount -> ShowS
Prelude.Show, (forall x. AdminAccount -> Rep AdminAccount x)
-> (forall x. Rep AdminAccount x -> AdminAccount)
-> Generic AdminAccount
forall x. Rep AdminAccount x -> AdminAccount
forall x. AdminAccount -> Rep AdminAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdminAccount x -> AdminAccount
$cfrom :: forall x. AdminAccount -> Rep AdminAccount x
Prelude.Generic)
newAdminAccount ::
AdminAccount
newAdminAccount :: AdminAccount
newAdminAccount =
AdminAccount' :: Maybe AdminStatus -> Maybe Text -> AdminAccount
AdminAccount'
{ $sel:status:AdminAccount' :: Maybe AdminStatus
status = Maybe AdminStatus
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:AdminAccount' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
adminAccount_status :: Lens.Lens' AdminAccount (Prelude.Maybe AdminStatus)
adminAccount_status :: (Maybe AdminStatus -> f (Maybe AdminStatus))
-> AdminAccount -> f AdminAccount
adminAccount_status = (AdminAccount -> Maybe AdminStatus)
-> (AdminAccount -> Maybe AdminStatus -> AdminAccount)
-> Lens
AdminAccount AdminAccount (Maybe AdminStatus) (Maybe AdminStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminAccount' {Maybe AdminStatus
status :: Maybe AdminStatus
$sel:status:AdminAccount' :: AdminAccount -> Maybe AdminStatus
status} -> Maybe AdminStatus
status) (\s :: AdminAccount
s@AdminAccount' {} Maybe AdminStatus
a -> AdminAccount
s {$sel:status:AdminAccount' :: Maybe AdminStatus
status = Maybe AdminStatus
a} :: AdminAccount)
adminAccount_accountId :: Lens.Lens' AdminAccount (Prelude.Maybe Prelude.Text)
adminAccount_accountId :: (Maybe Text -> f (Maybe Text)) -> AdminAccount -> f AdminAccount
adminAccount_accountId = (AdminAccount -> Maybe Text)
-> (AdminAccount -> Maybe Text -> AdminAccount)
-> Lens AdminAccount AdminAccount (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdminAccount' {Maybe Text
accountId :: Maybe Text
$sel:accountId:AdminAccount' :: AdminAccount -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: AdminAccount
s@AdminAccount' {} Maybe Text
a -> AdminAccount
s {$sel:accountId:AdminAccount' :: Maybe Text
accountId = Maybe Text
a} :: AdminAccount)
instance Core.FromJSON AdminAccount where
parseJSON :: Value -> Parser AdminAccount
parseJSON =
String
-> (Object -> Parser AdminAccount) -> Value -> Parser AdminAccount
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AdminAccount"
( \Object
x ->
Maybe AdminStatus -> Maybe Text -> AdminAccount
AdminAccount'
(Maybe AdminStatus -> Maybe Text -> AdminAccount)
-> Parser (Maybe AdminStatus)
-> Parser (Maybe Text -> AdminAccount)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AdminStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser (Maybe Text -> AdminAccount)
-> Parser (Maybe Text) -> Parser AdminAccount
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 AdminAccount
instance Prelude.NFData AdminAccount