{-# 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.Lens as Lens
import Amazonka.Organizations.Types.AccountJoinedMethod
import Amazonka.Organizations.Types.AccountStatus
import qualified Amazonka.Prelude as Prelude
data Account = Account'
{
Account -> Maybe AccountStatus
status :: Prelude.Maybe AccountStatus,
Account -> Maybe AccountJoinedMethod
joinedMethod :: Prelude.Maybe AccountJoinedMethod,
Account -> Maybe (Sensitive Text)
email :: Prelude.Maybe (Core.Sensitive Prelude.Text),
Account -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Account -> Maybe POSIX
joinedTimestamp :: Prelude.Maybe Core.POSIX,
Account -> Maybe (Sensitive Text)
name :: Prelude.Maybe (Core.Sensitive Prelude.Text),
Account -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (Account -> Account -> Bool
(Account -> Account -> Bool)
-> (Account -> Account -> Bool) -> Eq Account
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
(Int -> Account -> ShowS)
-> (Account -> String) -> ([Account] -> ShowS) -> Show Account
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. Account -> Rep Account x)
-> (forall x. Rep Account x -> Account) -> Generic Account
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' :: Maybe AccountStatus
-> Maybe AccountJoinedMethod
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Account
Account'
{ $sel:status:Account' :: Maybe AccountStatus
status = Maybe AccountStatus
forall a. Maybe a
Prelude.Nothing,
$sel:joinedMethod:Account' :: Maybe AccountJoinedMethod
joinedMethod = Maybe AccountJoinedMethod
forall a. Maybe a
Prelude.Nothing,
$sel:email:Account' :: Maybe (Sensitive Text)
email = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:arn:Account' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:joinedTimestamp:Account' :: Maybe POSIX
joinedTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:name:Account' :: Maybe (Sensitive Text)
name = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:id:Account' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
account_status :: Lens.Lens' Account (Prelude.Maybe AccountStatus)
account_status :: (Maybe AccountStatus -> f (Maybe AccountStatus))
-> Account -> f Account
account_status = (Account -> Maybe AccountStatus)
-> (Account -> Maybe AccountStatus -> Account)
-> Lens Account Account (Maybe AccountStatus) (Maybe AccountStatus)
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)
account_joinedMethod :: Lens.Lens' Account (Prelude.Maybe AccountJoinedMethod)
account_joinedMethod :: (Maybe AccountJoinedMethod -> f (Maybe AccountJoinedMethod))
-> Account -> f Account
account_joinedMethod = (Account -> Maybe AccountJoinedMethod)
-> (Account -> Maybe AccountJoinedMethod -> Account)
-> Lens
Account
Account
(Maybe AccountJoinedMethod)
(Maybe AccountJoinedMethod)
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_email :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_email :: (Maybe Text -> f (Maybe Text)) -> Account -> f Account
account_email = (Account -> Maybe (Sensitive Text))
-> (Account -> Maybe (Sensitive Text) -> Account)
-> Lens
Account Account (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Account -> f Account)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Account
-> f Account
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
account_arn :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_arn :: (Maybe Text -> f (Maybe Text)) -> Account -> f Account
account_arn = (Account -> Maybe Text)
-> (Account -> Maybe Text -> Account)
-> Lens Account Account (Maybe Text) (Maybe Text)
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_joinedTimestamp :: Lens.Lens' Account (Prelude.Maybe Prelude.UTCTime)
account_joinedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Account -> f Account
account_joinedTimestamp = (Account -> Maybe POSIX)
-> (Account -> Maybe POSIX -> Account)
-> Lens Account Account (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX)) -> Account -> f Account)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Account
-> f Account
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
account_name :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_name :: (Maybe Text -> f (Maybe Text)) -> Account -> f Account
account_name = (Account -> Maybe (Sensitive Text))
-> (Account -> Maybe (Sensitive Text) -> Account)
-> Lens
Account Account (Maybe (Sensitive Text)) (Maybe (Sensitive Text))
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) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> Account -> f Account)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> Account
-> f Account
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
(Maybe Text)
(Maybe Text)
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 AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive
account_id :: Lens.Lens' Account (Prelude.Maybe Prelude.Text)
account_id :: (Maybe Text -> f (Maybe Text)) -> Account -> f Account
account_id = (Account -> Maybe Text)
-> (Account -> Maybe Text -> Account)
-> Lens Account Account (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON Account where
parseJSON :: Value -> Parser Account
parseJSON =
String -> (Object -> Parser Account) -> Value -> Parser Account
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Account"
( \Object
x ->
Maybe AccountStatus
-> Maybe AccountJoinedMethod
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Account
Account'
(Maybe AccountStatus
-> Maybe AccountJoinedMethod
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Account)
-> Parser (Maybe AccountStatus)
-> Parser
(Maybe AccountJoinedMethod
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Account)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AccountStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe AccountJoinedMethod
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Account)
-> Parser (Maybe AccountJoinedMethod)
-> Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Account)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AccountJoinedMethod)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JoinedMethod")
Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Account)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe Text
-> Maybe POSIX -> Maybe (Sensitive Text) -> Maybe Text -> Account)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Email")
Parser
(Maybe Text
-> Maybe POSIX -> Maybe (Sensitive Text) -> Maybe Text -> Account)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX -> Maybe (Sensitive Text) -> Maybe Text -> Account)
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
"Arn")
Parser
(Maybe POSIX -> Maybe (Sensitive Text) -> Maybe Text -> Account)
-> Parser (Maybe POSIX)
-> Parser (Maybe (Sensitive Text) -> Maybe Text -> Account)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JoinedTimestamp")
Parser (Maybe (Sensitive Text) -> Maybe Text -> Account)
-> Parser (Maybe (Sensitive Text))
-> Parser (Maybe Text -> Account)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
Parser (Maybe Text -> Account)
-> Parser (Maybe Text) -> Parser Account
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
"Id")
)
instance Prelude.Hashable Account
instance Prelude.NFData Account