{-# 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.Inspector2.Types.Account where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Inspector2.Types.ResourceStatus
import Amazonka.Inspector2.Types.Status
import qualified Amazonka.Prelude as Prelude
data Account = Account'
{
Account -> Text
accountId :: Prelude.Text,
Account -> ResourceStatus
resourceStatus :: ResourceStatus,
Account -> Status
status :: Status
}
deriving (Account -> Account -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Account -> Account -> Bool
$c/= :: Account -> Account -> Bool
== :: Account -> Account -> Bool
$c== :: Account -> Account -> Bool
Prelude.Eq, ReadPrec [Account]
ReadPrec Account
Int -> ReadS Account
ReadS [Account]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Account]
$creadListPrec :: ReadPrec [Account]
readPrec :: ReadPrec Account
$creadPrec :: ReadPrec Account
readList :: ReadS [Account]
$creadList :: ReadS [Account]
readsPrec :: Int -> ReadS Account
$creadsPrec :: Int -> ReadS Account
Prelude.Read, Int -> Account -> ShowS
[Account] -> ShowS
Account -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Account] -> ShowS
$cshowList :: [Account] -> ShowS
show :: Account -> String
$cshow :: Account -> String
showsPrec :: Int -> Account -> ShowS
$cshowsPrec :: Int -> Account -> ShowS
Prelude.Show, forall x. Rep Account x -> Account
forall x. Account -> Rep Account x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Account x -> Account
$cfrom :: forall x. Account -> Rep Account x
Prelude.Generic)
newAccount ::
Prelude.Text ->
ResourceStatus ->
Status ->
Account
newAccount :: Text -> ResourceStatus -> Status -> Account
newAccount Text
pAccountId_ ResourceStatus
pResourceStatus_ Status
pStatus_ =
Account'
{ $sel:accountId:Account' :: Text
accountId = Text
pAccountId_,
$sel:resourceStatus:Account' :: ResourceStatus
resourceStatus = ResourceStatus
pResourceStatus_,
$sel:status:Account' :: Status
status = Status
pStatus_
}
account_accountId :: Lens.Lens' Account Prelude.Text
account_accountId :: Lens' Account Text
account_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Text
accountId :: Text
$sel:accountId:Account' :: Account -> Text
accountId} -> Text
accountId) (\s :: Account
s@Account' {} Text
a -> Account
s {$sel:accountId:Account' :: Text
accountId = Text
a} :: Account)
account_resourceStatus :: Lens.Lens' Account ResourceStatus
account_resourceStatus :: Lens' Account ResourceStatus
account_resourceStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {ResourceStatus
resourceStatus :: ResourceStatus
$sel:resourceStatus:Account' :: Account -> ResourceStatus
resourceStatus} -> ResourceStatus
resourceStatus) (\s :: Account
s@Account' {} ResourceStatus
a -> Account
s {$sel:resourceStatus:Account' :: ResourceStatus
resourceStatus = ResourceStatus
a} :: Account)
account_status :: Lens.Lens' Account Status
account_status :: Lens' Account Status
account_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Status
status :: Status
$sel:status:Account' :: Account -> Status
status} -> Status
status) (\s :: Account
s@Account' {} Status
a -> Account
s {$sel:status:Account' :: Status
status = Status
a} :: Account)
instance Data.FromJSON Account where
parseJSON :: Value -> Parser Account
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Account"
( \Object
x ->
Text -> ResourceStatus -> Status -> Account
Account'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"accountId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"resourceStatus")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"status")
)
instance Prelude.Hashable Account where
hashWithSalt :: Int -> Account -> Int
hashWithSalt Int
_salt Account' {Text
Status
ResourceStatus
status :: Status
resourceStatus :: ResourceStatus
accountId :: Text
$sel:status:Account' :: Account -> Status
$sel:resourceStatus:Account' :: Account -> ResourceStatus
$sel:accountId:Account' :: Account -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceStatus
resourceStatus
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Status
status
instance Prelude.NFData Account where
rnf :: Account -> ()
rnf Account' {Text
Status
ResourceStatus
status :: Status
resourceStatus :: ResourceStatus
accountId :: Text
$sel:status:Account' :: Account -> Status
$sel:resourceStatus:Account' :: Account -> ResourceStatus
$sel:accountId:Account' :: Account -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
accountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ResourceStatus
resourceStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Status
status