{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Organizations.Types.CreateAccountStatus
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Contains the status about a CreateAccount or CreateGovCloudAccount
-- request to create an AWS account or an AWS GovCloud (US) account in an
-- organization.
--
-- /See:/ 'newCreateAccountStatus' smart constructor.
data CreateAccountStatus = CreateAccountStatus'
  { -- | If the request failed, a description of the reason for the failure.
    --
    -- -   ACCOUNT_LIMIT_EXCEEDED: The account couldn\'t be created because you
    --     reached the limit on the number of accounts in your organization.
    --
    -- -   CONCURRENT_ACCOUNT_MODIFICATION: You already submitted a request
    --     with the same information.
    --
    -- -   EMAIL_ALREADY_EXISTS: The account could not be created because
    --     another AWS account with that email address already exists.
    --
    -- -   FAILED_BUSINESS_VALIDATION: The AWS account that owns your
    --     organization failed to receive business license validation.
    --
    -- -   GOVCLOUD_ACCOUNT_ALREADY_EXISTS: The account in the AWS GovCloud
    --     (US) Region could not be created because this Region already
    --     includes an account with that email address.
    --
    -- -   IDENTITY_INVALID_BUSINESS_VALIDATION: The AWS account that owns your
    --     organization can\'t complete business license validation because it
    --     doesn\'t have valid identity data.
    --
    -- -   INVALID_ADDRESS: The account could not be created because the
    --     address you provided is not valid.
    --
    -- -   INVALID_EMAIL: The account could not be created because the email
    --     address you provided is not valid.
    --
    -- -   INTERNAL_FAILURE: The account could not be created because of an
    --     internal failure. Try again later. If the problem persists, contact
    --     AWS Customer Support.
    --
    -- -   MISSING_BUSINESS_VALIDATION: The AWS account that owns your
    --     organization has not received Business Validation.
    --
    -- -   MISSING_PAYMENT_INSTRUMENT: You must configure the management
    --     account with a valid payment method, such as a credit card.
    --
    -- -   PENDING_BUSINESS_VALIDATION: The AWS account that owns your
    --     organization is still in the process of completing business license
    --     validation.
    --
    -- -   UNKNOWN_BUSINESS_VALIDATION: The AWS account that owns your
    --     organization has an unknown issue with business license validation.
    CreateAccountStatus -> Maybe CreateAccountFailureReason
failureReason :: Prelude.Maybe CreateAccountFailureReason,
    -- | The status of the asynchronous request to create an AWS account.
    CreateAccountStatus -> Maybe CreateAccountState
state :: Prelude.Maybe CreateAccountState,
    -- | The date and time that the account was created and the request
    -- completed.
    CreateAccountStatus -> Maybe POSIX
completedTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The account name given to the account when it was created.
    CreateAccountStatus -> Maybe (Sensitive Text)
accountName :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | If the account was created successfully, the unique identifier (ID) of
    -- the new account.
    --
    -- The <http://wikipedia.org/wiki/regex regex pattern> for an account ID
    -- string requires exactly 12 digits.
    CreateAccountStatus -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier (ID) that references this request. You get this
    -- value from the response of the initial CreateAccount request to create
    -- the account.
    --
    -- The <http://wikipedia.org/wiki/regex regex pattern> for a create account
    -- request ID string requires \"car-\" followed by from 8 to 32 lowercase
    -- letters or digits.
    CreateAccountStatus -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | If the account was created successfully, the unique identifier (ID) of
    -- the new account in the AWS GovCloud (US) Region.
    CreateAccountStatus -> Maybe Text
govCloudAccountId :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the request was made for the account creation.
    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)

-- |
-- Create a value of 'CreateAccountStatus' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'failureReason', 'createAccountStatus_failureReason' - If the request failed, a description of the reason for the failure.
--
-- -   ACCOUNT_LIMIT_EXCEEDED: The account couldn\'t be created because you
--     reached the limit on the number of accounts in your organization.
--
-- -   CONCURRENT_ACCOUNT_MODIFICATION: You already submitted a request
--     with the same information.
--
-- -   EMAIL_ALREADY_EXISTS: The account could not be created because
--     another AWS account with that email address already exists.
--
-- -   FAILED_BUSINESS_VALIDATION: The AWS account that owns your
--     organization failed to receive business license validation.
--
-- -   GOVCLOUD_ACCOUNT_ALREADY_EXISTS: The account in the AWS GovCloud
--     (US) Region could not be created because this Region already
--     includes an account with that email address.
--
-- -   IDENTITY_INVALID_BUSINESS_VALIDATION: The AWS account that owns your
--     organization can\'t complete business license validation because it
--     doesn\'t have valid identity data.
--
-- -   INVALID_ADDRESS: The account could not be created because the
--     address you provided is not valid.
--
-- -   INVALID_EMAIL: The account could not be created because the email
--     address you provided is not valid.
--
-- -   INTERNAL_FAILURE: The account could not be created because of an
--     internal failure. Try again later. If the problem persists, contact
--     AWS Customer Support.
--
-- -   MISSING_BUSINESS_VALIDATION: The AWS account that owns your
--     organization has not received Business Validation.
--
-- -   MISSING_PAYMENT_INSTRUMENT: You must configure the management
--     account with a valid payment method, such as a credit card.
--
-- -   PENDING_BUSINESS_VALIDATION: The AWS account that owns your
--     organization is still in the process of completing business license
--     validation.
--
-- -   UNKNOWN_BUSINESS_VALIDATION: The AWS account that owns your
--     organization has an unknown issue with business license validation.
--
-- 'state', 'createAccountStatus_state' - The status of the asynchronous request to create an AWS account.
--
-- 'completedTimestamp', 'createAccountStatus_completedTimestamp' - The date and time that the account was created and the request
-- completed.
--
-- 'accountName', 'createAccountStatus_accountName' - The account name given to the account when it was created.
--
-- 'accountId', 'createAccountStatus_accountId' - If the account was created successfully, the unique identifier (ID) of
-- the new account.
--
-- The <http://wikipedia.org/wiki/regex regex pattern> for an account ID
-- string requires exactly 12 digits.
--
-- 'id', 'createAccountStatus_id' - The unique identifier (ID) that references this request. You get this
-- value from the response of the initial CreateAccount request to create
-- the account.
--
-- The <http://wikipedia.org/wiki/regex regex pattern> for a create account
-- request ID string requires \"car-\" followed by from 8 to 32 lowercase
-- letters or digits.
--
-- 'govCloudAccountId', 'createAccountStatus_govCloudAccountId' - If the account was created successfully, the unique identifier (ID) of
-- the new account in the AWS GovCloud (US) Region.
--
-- 'requestedTimestamp', 'createAccountStatus_requestedTimestamp' - The date and time that the request was made for the account creation.
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
    }

-- | If the request failed, a description of the reason for the failure.
--
-- -   ACCOUNT_LIMIT_EXCEEDED: The account couldn\'t be created because you
--     reached the limit on the number of accounts in your organization.
--
-- -   CONCURRENT_ACCOUNT_MODIFICATION: You already submitted a request
--     with the same information.
--
-- -   EMAIL_ALREADY_EXISTS: The account could not be created because
--     another AWS account with that email address already exists.
--
-- -   FAILED_BUSINESS_VALIDATION: The AWS account that owns your
--     organization failed to receive business license validation.
--
-- -   GOVCLOUD_ACCOUNT_ALREADY_EXISTS: The account in the AWS GovCloud
--     (US) Region could not be created because this Region already
--     includes an account with that email address.
--
-- -   IDENTITY_INVALID_BUSINESS_VALIDATION: The AWS account that owns your
--     organization can\'t complete business license validation because it
--     doesn\'t have valid identity data.
--
-- -   INVALID_ADDRESS: The account could not be created because the
--     address you provided is not valid.
--
-- -   INVALID_EMAIL: The account could not be created because the email
--     address you provided is not valid.
--
-- -   INTERNAL_FAILURE: The account could not be created because of an
--     internal failure. Try again later. If the problem persists, contact
--     AWS Customer Support.
--
-- -   MISSING_BUSINESS_VALIDATION: The AWS account that owns your
--     organization has not received Business Validation.
--
-- -   MISSING_PAYMENT_INSTRUMENT: You must configure the management
--     account with a valid payment method, such as a credit card.
--
-- -   PENDING_BUSINESS_VALIDATION: The AWS account that owns your
--     organization is still in the process of completing business license
--     validation.
--
-- -   UNKNOWN_BUSINESS_VALIDATION: The AWS account that owns your
--     organization has an unknown issue with business license validation.
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)

-- | The status of the asynchronous request to create an AWS account.
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)

-- | The date and time that the account was created and the request
-- completed.
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

-- | The account name given to the account when it was created.
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

-- | If the account was created successfully, the unique identifier (ID) of
-- the new account.
--
-- The <http://wikipedia.org/wiki/regex regex pattern> for an account ID
-- string requires exactly 12 digits.
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)

-- | The unique identifier (ID) that references this request. You get this
-- value from the response of the initial CreateAccount request to create
-- the account.
--
-- The <http://wikipedia.org/wiki/regex regex pattern> for a create account
-- request ID string requires \"car-\" followed by from 8 to 32 lowercase
-- letters or digits.
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)

-- | If the account was created successfully, the unique identifier (ID) of
-- the new account in the AWS GovCloud (US) Region.
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)

-- | The date and time that the request was made for the account creation.
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