{-# 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.Organizations.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.Organizations.Types.AccountJoinedMethod
import Amazonka.Organizations.Types.AccountStatus
import qualified Amazonka.Prelude as Prelude
data Account = Account'
{
Account -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Account -> Maybe (Sensitive Text)
email :: Prelude.Maybe (Data.Sensitive Prelude.Text),
Account -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Account -> Maybe AccountJoinedMethod
joinedMethod :: Prelude.Maybe AccountJoinedMethod,
Account -> Maybe POSIX
joinedTimestamp :: Prelude.Maybe Data.POSIX,
Account -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Data.Sensitive Prelude.Text),
Account -> Maybe AccountStatus
status :: Prelude.Maybe AccountStatus
}
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, 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 ::
Account
newAccount :: Account
newAccount =
Account'
{ $sel:arn:Account' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:email:Account' :: Maybe (Sensitive Text)
email = forall a. Maybe a
Prelude.Nothing,
$sel:id:Account' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:joinedMethod:Account' :: Maybe AccountJoinedMethod
joinedMethod = forall a. Maybe a
Prelude.Nothing,
$sel:joinedTimestamp:Account' :: Maybe POSIX
joinedTimestamp = forall a. Maybe a
Prelude.Nothing,
$sel:name:Account' :: Maybe (Sensitive Text)
name = forall a. Maybe a
Prelude.Nothing,
$sel:status:Account' :: Maybe AccountStatus
status = forall a. Maybe a
Prelude.Nothing
}
account_arn :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_arn :: Lens' Account (Maybe Text)
account_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe Text
arn :: Maybe Text
$sel:arn:Account' :: Account -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Account
s@Account' {} Maybe Text
a -> Account
s {$sel:arn:Account' :: Maybe Text
arn = Maybe Text
a} :: Account)
account_email :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_email :: Lens' Account (Maybe Text)
account_email = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe (Sensitive Text)
email :: Maybe (Sensitive Text)
$sel:email:Account' :: Account -> Maybe (Sensitive Text)
email} -> Maybe (Sensitive Text)
email) (\s :: Account
s@Account' {} Maybe (Sensitive Text)
a -> Account
s {$sel:email:Account' :: Maybe (Sensitive Text)
email = Maybe (Sensitive Text)
a} :: Account) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
account_id :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_id :: Lens' Account (Maybe Text)
account_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe Text
id :: Maybe Text
$sel:id:Account' :: Account -> Maybe Text
id} -> Maybe Text
id) (\s :: Account
s@Account' {} Maybe Text
a -> Account
s {$sel:id:Account' :: Maybe Text
id = Maybe Text
a} :: Account)
account_joinedMethod :: Lens.Lens' Account (Prelude.Maybe AccountJoinedMethod)
account_joinedMethod :: Lens' Account (Maybe AccountJoinedMethod)
account_joinedMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe AccountJoinedMethod
joinedMethod :: Maybe AccountJoinedMethod
$sel:joinedMethod:Account' :: Account -> Maybe AccountJoinedMethod
joinedMethod} -> Maybe AccountJoinedMethod
joinedMethod) (\s :: Account
s@Account' {} Maybe AccountJoinedMethod
a -> Account
s {$sel:joinedMethod:Account' :: Maybe AccountJoinedMethod
joinedMethod = Maybe AccountJoinedMethod
a} :: Account)
account_joinedTimestamp :: Lens.Lens' Account (Prelude.Maybe Prelude.UTCTime)
account_joinedTimestamp :: Lens' Account (Maybe UTCTime)
account_joinedTimestamp = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe POSIX
joinedTimestamp :: Maybe POSIX
$sel:joinedTimestamp:Account' :: Account -> Maybe POSIX
joinedTimestamp} -> Maybe POSIX
joinedTimestamp) (\s :: Account
s@Account' {} Maybe POSIX
a -> Account
s {$sel:joinedTimestamp:Account' :: Maybe POSIX
joinedTimestamp = Maybe POSIX
a} :: Account) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
account_name :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_name :: Lens' Account (Maybe Text)
account_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe (Sensitive Text)
name :: Maybe (Sensitive Text)
$sel:name:Account' :: Account -> Maybe (Sensitive Text)
name} -> Maybe (Sensitive Text)
name) (\s :: Account
s@Account' {} Maybe (Sensitive Text)
a -> Account
s {$sel:name:Account' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
a} :: Account) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall a. Iso' (Sensitive a) a
Data._Sensitive
account_status :: Lens.Lens' Account (Prelude.Maybe AccountStatus)
account_status :: Lens' Account (Maybe AccountStatus)
account_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Account' {Maybe AccountStatus
status :: Maybe AccountStatus
$sel:status:Account' :: Account -> Maybe AccountStatus
status} -> Maybe AccountStatus
status) (\s :: Account
s@Account' {} Maybe AccountStatus
a -> Account
s {$sel:status:Account' :: Maybe AccountStatus
status = Maybe AccountStatus
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 ->
Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe AccountJoinedMethod
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe AccountStatus
-> Account
Account'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Email")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"JoinedMethod")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"JoinedTimestamp")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
)
instance Prelude.Hashable Account where
hashWithSalt :: Int -> Account -> Int
hashWithSalt Int
_salt Account' {Maybe Text
Maybe (Sensitive Text)
Maybe POSIX
Maybe AccountJoinedMethod
Maybe AccountStatus
status :: Maybe AccountStatus
name :: Maybe (Sensitive Text)
joinedTimestamp :: Maybe POSIX
joinedMethod :: Maybe AccountJoinedMethod
id :: Maybe Text
email :: Maybe (Sensitive Text)
arn :: Maybe Text
$sel:status:Account' :: Account -> Maybe AccountStatus
$sel:name:Account' :: Account -> Maybe (Sensitive Text)
$sel:joinedTimestamp:Account' :: Account -> Maybe POSIX
$sel:joinedMethod:Account' :: Account -> Maybe AccountJoinedMethod
$sel:id:Account' :: Account -> Maybe Text
$sel:email:Account' :: Account -> Maybe (Sensitive Text)
$sel:arn:Account' :: Account -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
email
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AccountJoinedMethod
joinedMethod
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
joinedTimestamp
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AccountStatus
status
instance Prelude.NFData Account where
rnf :: Account -> ()
rnf Account' {Maybe Text
Maybe (Sensitive Text)
Maybe POSIX
Maybe AccountJoinedMethod
Maybe AccountStatus
status :: Maybe AccountStatus
name :: Maybe (Sensitive Text)
joinedTimestamp :: Maybe POSIX
joinedMethod :: Maybe AccountJoinedMethod
id :: Maybe Text
email :: Maybe (Sensitive Text)
arn :: Maybe Text
$sel:status:Account' :: Account -> Maybe AccountStatus
$sel:name:Account' :: Account -> Maybe (Sensitive Text)
$sel:joinedTimestamp:Account' :: Account -> Maybe POSIX
$sel:joinedMethod:Account' :: Account -> Maybe AccountJoinedMethod
$sel:id:Account' :: Account -> Maybe Text
$sel:email:Account' :: Account -> Maybe (Sensitive Text)
$sel:arn:Account' :: Account -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
email
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AccountJoinedMethod
joinedMethod
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
joinedTimestamp
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AccountStatus
status