{-# 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.CreateAccountStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Organizations.Types.CreateAccountFailureReason
import Amazonka.Organizations.Types.CreateAccountState
import qualified Amazonka.Prelude as Prelude
data CreateAccountStatus = CreateAccountStatus'
{
CreateAccountStatus -> Maybe CreateAccountFailureReason
failureReason :: Prelude.Maybe CreateAccountFailureReason,
CreateAccountStatus -> Maybe CreateAccountState
state :: Prelude.Maybe CreateAccountState,
CreateAccountStatus -> Maybe POSIX
completedTimestamp :: Prelude.Maybe Core.POSIX,
CreateAccountStatus -> Maybe (Sensitive Text)
accountName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
CreateAccountStatus -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
CreateAccountStatus -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
CreateAccountStatus -> Maybe Text
govCloudAccountId :: Prelude.Maybe Prelude.Text,
CreateAccountStatus -> Maybe POSIX
requestedTimestamp :: Prelude.Maybe Core.POSIX
}
deriving (CreateAccountStatus -> CreateAccountStatus -> Bool
(CreateAccountStatus -> CreateAccountStatus -> Bool)
-> (CreateAccountStatus -> CreateAccountStatus -> Bool)
-> Eq CreateAccountStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAccountStatus -> CreateAccountStatus -> Bool
$c/= :: CreateAccountStatus -> CreateAccountStatus -> Bool
== :: CreateAccountStatus -> CreateAccountStatus -> Bool
$c== :: CreateAccountStatus -> CreateAccountStatus -> Bool
Prelude.Eq, Int -> CreateAccountStatus -> ShowS
[CreateAccountStatus] -> ShowS
CreateAccountStatus -> String
(Int -> CreateAccountStatus -> ShowS)
-> (CreateAccountStatus -> String)
-> ([CreateAccountStatus] -> ShowS)
-> Show CreateAccountStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAccountStatus] -> ShowS
$cshowList :: [CreateAccountStatus] -> ShowS
show :: CreateAccountStatus -> String
$cshow :: CreateAccountStatus -> String
showsPrec :: Int -> CreateAccountStatus -> ShowS
$cshowsPrec :: Int -> CreateAccountStatus -> ShowS
Prelude.Show, (forall x. CreateAccountStatus -> Rep CreateAccountStatus x)
-> (forall x. Rep CreateAccountStatus x -> CreateAccountStatus)
-> Generic CreateAccountStatus
forall x. Rep CreateAccountStatus x -> CreateAccountStatus
forall x. CreateAccountStatus -> Rep CreateAccountStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAccountStatus x -> CreateAccountStatus
$cfrom :: forall x. CreateAccountStatus -> Rep CreateAccountStatus x
Prelude.Generic)
newCreateAccountStatus ::
CreateAccountStatus
newCreateAccountStatus :: CreateAccountStatus
newCreateAccountStatus =
CreateAccountStatus' :: Maybe CreateAccountFailureReason
-> Maybe CreateAccountState
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> CreateAccountStatus
CreateAccountStatus'
{ $sel:failureReason:CreateAccountStatus' :: Maybe CreateAccountFailureReason
failureReason =
Maybe CreateAccountFailureReason
forall a. Maybe a
Prelude.Nothing,
$sel:state:CreateAccountStatus' :: Maybe CreateAccountState
state = Maybe CreateAccountState
forall a. Maybe a
Prelude.Nothing,
$sel:completedTimestamp:CreateAccountStatus' :: Maybe POSIX
completedTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:accountName:CreateAccountStatus' :: Maybe (Sensitive Text)
accountName = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:CreateAccountStatus' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:CreateAccountStatus' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:govCloudAccountId:CreateAccountStatus' :: Maybe Text
govCloudAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:requestedTimestamp:CreateAccountStatus' :: Maybe POSIX
requestedTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
createAccountStatus_failureReason :: Lens.Lens' CreateAccountStatus (Prelude.Maybe CreateAccountFailureReason)
createAccountStatus_failureReason :: (Maybe CreateAccountFailureReason
-> f (Maybe CreateAccountFailureReason))
-> CreateAccountStatus -> f CreateAccountStatus
createAccountStatus_failureReason = (CreateAccountStatus -> Maybe CreateAccountFailureReason)
-> (CreateAccountStatus
-> Maybe CreateAccountFailureReason -> CreateAccountStatus)
-> Lens
CreateAccountStatus
CreateAccountStatus
(Maybe CreateAccountFailureReason)
(Maybe CreateAccountFailureReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountStatus' {Maybe CreateAccountFailureReason
failureReason :: Maybe CreateAccountFailureReason
$sel:failureReason:CreateAccountStatus' :: CreateAccountStatus -> Maybe CreateAccountFailureReason
failureReason} -> Maybe CreateAccountFailureReason
failureReason) (\s :: CreateAccountStatus
s@CreateAccountStatus' {} Maybe CreateAccountFailureReason
a -> CreateAccountStatus
s {$sel:failureReason:CreateAccountStatus' :: Maybe CreateAccountFailureReason
failureReason = Maybe CreateAccountFailureReason
a} :: CreateAccountStatus)
createAccountStatus_state :: Lens.Lens' CreateAccountStatus (Prelude.Maybe CreateAccountState)
createAccountStatus_state :: (Maybe CreateAccountState -> f (Maybe CreateAccountState))
-> CreateAccountStatus -> f CreateAccountStatus
createAccountStatus_state = (CreateAccountStatus -> Maybe CreateAccountState)
-> (CreateAccountStatus
-> Maybe CreateAccountState -> CreateAccountStatus)
-> Lens
CreateAccountStatus
CreateAccountStatus
(Maybe CreateAccountState)
(Maybe CreateAccountState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountStatus' {Maybe CreateAccountState
state :: Maybe CreateAccountState
$sel:state:CreateAccountStatus' :: CreateAccountStatus -> Maybe CreateAccountState
state} -> Maybe CreateAccountState
state) (\s :: CreateAccountStatus
s@CreateAccountStatus' {} Maybe CreateAccountState
a -> CreateAccountStatus
s {$sel:state:CreateAccountStatus' :: Maybe CreateAccountState
state = Maybe CreateAccountState
a} :: CreateAccountStatus)
createAccountStatus_completedTimestamp :: Lens.Lens' CreateAccountStatus (Prelude.Maybe Prelude.UTCTime)
createAccountStatus_completedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateAccountStatus -> f CreateAccountStatus
createAccountStatus_completedTimestamp = (CreateAccountStatus -> Maybe POSIX)
-> (CreateAccountStatus -> Maybe POSIX -> CreateAccountStatus)
-> Lens
CreateAccountStatus CreateAccountStatus (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountStatus' {Maybe POSIX
completedTimestamp :: Maybe POSIX
$sel:completedTimestamp:CreateAccountStatus' :: CreateAccountStatus -> Maybe POSIX
completedTimestamp} -> Maybe POSIX
completedTimestamp) (\s :: CreateAccountStatus
s@CreateAccountStatus' {} Maybe POSIX
a -> CreateAccountStatus
s {$sel:completedTimestamp:CreateAccountStatus' :: Maybe POSIX
completedTimestamp = Maybe POSIX
a} :: CreateAccountStatus) ((Maybe POSIX -> f (Maybe POSIX))
-> CreateAccountStatus -> f CreateAccountStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateAccountStatus
-> f CreateAccountStatus
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
createAccountStatus_accountName :: Lens.Lens' CreateAccountStatus (Prelude.Maybe Prelude.Text)
createAccountStatus_accountName :: (Maybe Text -> f (Maybe Text))
-> CreateAccountStatus -> f CreateAccountStatus
createAccountStatus_accountName = (CreateAccountStatus -> Maybe (Sensitive Text))
-> (CreateAccountStatus
-> Maybe (Sensitive Text) -> CreateAccountStatus)
-> Lens
CreateAccountStatus
CreateAccountStatus
(Maybe (Sensitive Text))
(Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountStatus' {Maybe (Sensitive Text)
accountName :: Maybe (Sensitive Text)
$sel:accountName:CreateAccountStatus' :: CreateAccountStatus -> Maybe (Sensitive Text)
accountName} -> Maybe (Sensitive Text)
accountName) (\s :: CreateAccountStatus
s@CreateAccountStatus' {} Maybe (Sensitive Text)
a -> CreateAccountStatus
s {$sel:accountName:CreateAccountStatus' :: Maybe (Sensitive Text)
accountName = Maybe (Sensitive Text)
a} :: CreateAccountStatus) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> CreateAccountStatus -> f CreateAccountStatus)
-> ((Maybe Text -> f (Maybe Text))
-> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> CreateAccountStatus
-> f CreateAccountStatus
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
createAccountStatus_accountId :: Lens.Lens' CreateAccountStatus (Prelude.Maybe Prelude.Text)
createAccountStatus_accountId :: (Maybe Text -> f (Maybe Text))
-> CreateAccountStatus -> f CreateAccountStatus
createAccountStatus_accountId = (CreateAccountStatus -> Maybe Text)
-> (CreateAccountStatus -> Maybe Text -> CreateAccountStatus)
-> Lens
CreateAccountStatus CreateAccountStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountStatus' {Maybe Text
accountId :: Maybe Text
$sel:accountId:CreateAccountStatus' :: CreateAccountStatus -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: CreateAccountStatus
s@CreateAccountStatus' {} Maybe Text
a -> CreateAccountStatus
s {$sel:accountId:CreateAccountStatus' :: Maybe Text
accountId = Maybe Text
a} :: CreateAccountStatus)
createAccountStatus_id :: Lens.Lens' CreateAccountStatus (Prelude.Maybe Prelude.Text)
createAccountStatus_id :: (Maybe Text -> f (Maybe Text))
-> CreateAccountStatus -> f CreateAccountStatus
createAccountStatus_id = (CreateAccountStatus -> Maybe Text)
-> (CreateAccountStatus -> Maybe Text -> CreateAccountStatus)
-> Lens
CreateAccountStatus CreateAccountStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountStatus' {Maybe Text
id :: Maybe Text
$sel:id:CreateAccountStatus' :: CreateAccountStatus -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateAccountStatus
s@CreateAccountStatus' {} Maybe Text
a -> CreateAccountStatus
s {$sel:id:CreateAccountStatus' :: Maybe Text
id = Maybe Text
a} :: CreateAccountStatus)
createAccountStatus_govCloudAccountId :: Lens.Lens' CreateAccountStatus (Prelude.Maybe Prelude.Text)
createAccountStatus_govCloudAccountId :: (Maybe Text -> f (Maybe Text))
-> CreateAccountStatus -> f CreateAccountStatus
createAccountStatus_govCloudAccountId = (CreateAccountStatus -> Maybe Text)
-> (CreateAccountStatus -> Maybe Text -> CreateAccountStatus)
-> Lens
CreateAccountStatus CreateAccountStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountStatus' {Maybe Text
govCloudAccountId :: Maybe Text
$sel:govCloudAccountId:CreateAccountStatus' :: CreateAccountStatus -> Maybe Text
govCloudAccountId} -> Maybe Text
govCloudAccountId) (\s :: CreateAccountStatus
s@CreateAccountStatus' {} Maybe Text
a -> CreateAccountStatus
s {$sel:govCloudAccountId:CreateAccountStatus' :: Maybe Text
govCloudAccountId = Maybe Text
a} :: CreateAccountStatus)
createAccountStatus_requestedTimestamp :: Lens.Lens' CreateAccountStatus (Prelude.Maybe Prelude.UTCTime)
createAccountStatus_requestedTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateAccountStatus -> f CreateAccountStatus
createAccountStatus_requestedTimestamp = (CreateAccountStatus -> Maybe POSIX)
-> (CreateAccountStatus -> Maybe POSIX -> CreateAccountStatus)
-> Lens
CreateAccountStatus CreateAccountStatus (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAccountStatus' {Maybe POSIX
requestedTimestamp :: Maybe POSIX
$sel:requestedTimestamp:CreateAccountStatus' :: CreateAccountStatus -> Maybe POSIX
requestedTimestamp} -> Maybe POSIX
requestedTimestamp) (\s :: CreateAccountStatus
s@CreateAccountStatus' {} Maybe POSIX
a -> CreateAccountStatus
s {$sel:requestedTimestamp:CreateAccountStatus' :: Maybe POSIX
requestedTimestamp = Maybe POSIX
a} :: CreateAccountStatus) ((Maybe POSIX -> f (Maybe POSIX))
-> CreateAccountStatus -> f CreateAccountStatus)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateAccountStatus
-> f CreateAccountStatus
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
instance Core.FromJSON CreateAccountStatus where
parseJSON :: Value -> Parser CreateAccountStatus
parseJSON =
String
-> (Object -> Parser CreateAccountStatus)
-> Value
-> Parser CreateAccountStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CreateAccountStatus"
( \Object
x ->
Maybe CreateAccountFailureReason
-> Maybe CreateAccountState
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> CreateAccountStatus
CreateAccountStatus'
(Maybe CreateAccountFailureReason
-> Maybe CreateAccountState
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> CreateAccountStatus)
-> Parser (Maybe CreateAccountFailureReason)
-> Parser
(Maybe CreateAccountState
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> CreateAccountStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CreateAccountFailureReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FailureReason")
Parser
(Maybe CreateAccountState
-> Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> CreateAccountStatus)
-> Parser (Maybe CreateAccountState)
-> Parser
(Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> CreateAccountStatus)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CreateAccountState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
Parser
(Maybe POSIX
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> CreateAccountStatus)
-> Parser (Maybe POSIX)
-> Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> CreateAccountStatus)
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
"CompletedTimestamp")
Parser
(Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> CreateAccountStatus)
-> Parser (Maybe (Sensitive Text))
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe POSIX -> CreateAccountStatus)
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
"AccountName")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe POSIX -> CreateAccountStatus)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe POSIX -> CreateAccountStatus)
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")
Parser
(Maybe Text -> Maybe Text -> Maybe POSIX -> CreateAccountStatus)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> CreateAccountStatus)
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")
Parser (Maybe Text -> Maybe POSIX -> CreateAccountStatus)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> CreateAccountStatus)
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
"GovCloudAccountId")
Parser (Maybe POSIX -> CreateAccountStatus)
-> Parser (Maybe POSIX) -> Parser CreateAccountStatus
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
"RequestedTimestamp")
)
instance Prelude.Hashable CreateAccountStatus
instance Prelude.NFData CreateAccountStatus