{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.ListCreateAccountStatus
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the account creation requests that match the specified status that
-- is currently being tracked for the organization.
--
-- Always check the @NextToken@ response parameter for a @null@ value when
-- calling a @List*@ operation. These operations can occasionally return an
-- empty set of results even when there are more results available. The
-- @NextToken@ response parameter value is @null@ /only/ when there are no
-- more results to display.
--
-- This operation can be called only from the organization\'s management
-- account or by a member account that is a delegated administrator for an
-- Amazon Web Services service.
--
-- This operation returns paginated results.
module Amazonka.Organizations.ListCreateAccountStatus
  ( -- * Creating a Request
    ListCreateAccountStatus (..),
    newListCreateAccountStatus,

    -- * Request Lenses
    listCreateAccountStatus_maxResults,
    listCreateAccountStatus_nextToken,
    listCreateAccountStatus_states,

    -- * Destructuring the Response
    ListCreateAccountStatusResponse (..),
    newListCreateAccountStatusResponse,

    -- * Response Lenses
    listCreateAccountStatusResponse_createAccountStatuses,
    listCreateAccountStatusResponse_nextToken,
    listCreateAccountStatusResponse_httpStatus,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListCreateAccountStatus' smart constructor.
data ListCreateAccountStatus = ListCreateAccountStatus'
  { -- | The total number of results that you want included on each page of the
    -- response. If you do not include this parameter, it defaults to a value
    -- that is specific to the operation. If additional items exist beyond the
    -- maximum you specify, the @NextToken@ response element is present and has
    -- a value (is not null). Include that value as the @NextToken@ request
    -- parameter in the next call to the operation to get the next part of the
    -- results. Note that Organizations might return fewer results than the
    -- maximum even when there are more results available. You should check
    -- @NextToken@ after every operation to ensure that you receive all of the
    -- results.
    ListCreateAccountStatus -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The parameter for receiving additional results if you receive a
    -- @NextToken@ response in a previous request. A @NextToken@ response
    -- indicates that more output is available. Set this parameter to the value
    -- of the previous call\'s @NextToken@ response to indicate where the
    -- output should continue from.
    ListCreateAccountStatus -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of one or more states that you want included in the response. If
    -- this parameter isn\'t present, all requests are included in the
    -- response.
    ListCreateAccountStatus -> Maybe [CreateAccountState]
states :: Prelude.Maybe [CreateAccountState]
  }
  deriving (ListCreateAccountStatus -> ListCreateAccountStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCreateAccountStatus -> ListCreateAccountStatus -> Bool
$c/= :: ListCreateAccountStatus -> ListCreateAccountStatus -> Bool
== :: ListCreateAccountStatus -> ListCreateAccountStatus -> Bool
$c== :: ListCreateAccountStatus -> ListCreateAccountStatus -> Bool
Prelude.Eq, ReadPrec [ListCreateAccountStatus]
ReadPrec ListCreateAccountStatus
Int -> ReadS ListCreateAccountStatus
ReadS [ListCreateAccountStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCreateAccountStatus]
$creadListPrec :: ReadPrec [ListCreateAccountStatus]
readPrec :: ReadPrec ListCreateAccountStatus
$creadPrec :: ReadPrec ListCreateAccountStatus
readList :: ReadS [ListCreateAccountStatus]
$creadList :: ReadS [ListCreateAccountStatus]
readsPrec :: Int -> ReadS ListCreateAccountStatus
$creadsPrec :: Int -> ReadS ListCreateAccountStatus
Prelude.Read, Int -> ListCreateAccountStatus -> ShowS
[ListCreateAccountStatus] -> ShowS
ListCreateAccountStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCreateAccountStatus] -> ShowS
$cshowList :: [ListCreateAccountStatus] -> ShowS
show :: ListCreateAccountStatus -> String
$cshow :: ListCreateAccountStatus -> String
showsPrec :: Int -> ListCreateAccountStatus -> ShowS
$cshowsPrec :: Int -> ListCreateAccountStatus -> ShowS
Prelude.Show, forall x. Rep ListCreateAccountStatus x -> ListCreateAccountStatus
forall x. ListCreateAccountStatus -> Rep ListCreateAccountStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCreateAccountStatus x -> ListCreateAccountStatus
$cfrom :: forall x. ListCreateAccountStatus -> Rep ListCreateAccountStatus x
Prelude.Generic)

-- |
-- Create a value of 'ListCreateAccountStatus' 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:
--
-- 'maxResults', 'listCreateAccountStatus_maxResults' - The total number of results that you want included on each page of the
-- response. If you do not include this parameter, it defaults to a value
-- that is specific to the operation. If additional items exist beyond the
-- maximum you specify, the @NextToken@ response element is present and has
-- a value (is not null). Include that value as the @NextToken@ request
-- parameter in the next call to the operation to get the next part of the
-- results. Note that Organizations might return fewer results than the
-- maximum even when there are more results available. You should check
-- @NextToken@ after every operation to ensure that you receive all of the
-- results.
--
-- 'nextToken', 'listCreateAccountStatus_nextToken' - The parameter for receiving additional results if you receive a
-- @NextToken@ response in a previous request. A @NextToken@ response
-- indicates that more output is available. Set this parameter to the value
-- of the previous call\'s @NextToken@ response to indicate where the
-- output should continue from.
--
-- 'states', 'listCreateAccountStatus_states' - A list of one or more states that you want included in the response. If
-- this parameter isn\'t present, all requests are included in the
-- response.
newListCreateAccountStatus ::
  ListCreateAccountStatus
newListCreateAccountStatus :: ListCreateAccountStatus
newListCreateAccountStatus =
  ListCreateAccountStatus'
    { $sel:maxResults:ListCreateAccountStatus' :: Maybe Natural
maxResults =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCreateAccountStatus' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:states:ListCreateAccountStatus' :: Maybe [CreateAccountState]
states = forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of results that you want included on each page of the
-- response. If you do not include this parameter, it defaults to a value
-- that is specific to the operation. If additional items exist beyond the
-- maximum you specify, the @NextToken@ response element is present and has
-- a value (is not null). Include that value as the @NextToken@ request
-- parameter in the next call to the operation to get the next part of the
-- results. Note that Organizations might return fewer results than the
-- maximum even when there are more results available. You should check
-- @NextToken@ after every operation to ensure that you receive all of the
-- results.
listCreateAccountStatus_maxResults :: Lens.Lens' ListCreateAccountStatus (Prelude.Maybe Prelude.Natural)
listCreateAccountStatus_maxResults :: Lens' ListCreateAccountStatus (Maybe Natural)
listCreateAccountStatus_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatus' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCreateAccountStatus
s@ListCreateAccountStatus' {} Maybe Natural
a -> ListCreateAccountStatus
s {$sel:maxResults:ListCreateAccountStatus' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCreateAccountStatus)

-- | The parameter for receiving additional results if you receive a
-- @NextToken@ response in a previous request. A @NextToken@ response
-- indicates that more output is available. Set this parameter to the value
-- of the previous call\'s @NextToken@ response to indicate where the
-- output should continue from.
listCreateAccountStatus_nextToken :: Lens.Lens' ListCreateAccountStatus (Prelude.Maybe Prelude.Text)
listCreateAccountStatus_nextToken :: Lens' ListCreateAccountStatus (Maybe Text)
listCreateAccountStatus_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatus' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCreateAccountStatus
s@ListCreateAccountStatus' {} Maybe Text
a -> ListCreateAccountStatus
s {$sel:nextToken:ListCreateAccountStatus' :: Maybe Text
nextToken = Maybe Text
a} :: ListCreateAccountStatus)

-- | A list of one or more states that you want included in the response. If
-- this parameter isn\'t present, all requests are included in the
-- response.
listCreateAccountStatus_states :: Lens.Lens' ListCreateAccountStatus (Prelude.Maybe [CreateAccountState])
listCreateAccountStatus_states :: Lens' ListCreateAccountStatus (Maybe [CreateAccountState])
listCreateAccountStatus_states = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatus' {Maybe [CreateAccountState]
states :: Maybe [CreateAccountState]
$sel:states:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe [CreateAccountState]
states} -> Maybe [CreateAccountState]
states) (\s :: ListCreateAccountStatus
s@ListCreateAccountStatus' {} Maybe [CreateAccountState]
a -> ListCreateAccountStatus
s {$sel:states:ListCreateAccountStatus' :: Maybe [CreateAccountState]
states = Maybe [CreateAccountState]
a} :: ListCreateAccountStatus) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager ListCreateAccountStatus where
  page :: ListCreateAccountStatus
-> AWSResponse ListCreateAccountStatus
-> Maybe ListCreateAccountStatus
page ListCreateAccountStatus
rq AWSResponse ListCreateAccountStatus
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCreateAccountStatus
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCreateAccountStatusResponse (Maybe Text)
listCreateAccountStatusResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCreateAccountStatus
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCreateAccountStatusResponse (Maybe [CreateAccountStatus])
listCreateAccountStatusResponse_createAccountStatuses
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListCreateAccountStatus
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListCreateAccountStatus (Maybe Text)
listCreateAccountStatus_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCreateAccountStatus
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListCreateAccountStatusResponse (Maybe Text)
listCreateAccountStatusResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListCreateAccountStatus where
  type
    AWSResponse ListCreateAccountStatus =
      ListCreateAccountStatusResponse
  request :: (Service -> Service)
-> ListCreateAccountStatus -> Request ListCreateAccountStatus
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListCreateAccountStatus
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListCreateAccountStatus)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [CreateAccountStatus]
-> Maybe Text -> Int -> ListCreateAccountStatusResponse
ListCreateAccountStatusResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreateAccountStatuses"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListCreateAccountStatus where
  hashWithSalt :: Int -> ListCreateAccountStatus -> Int
hashWithSalt Int
_salt ListCreateAccountStatus' {Maybe Natural
Maybe [CreateAccountState]
Maybe Text
states :: Maybe [CreateAccountState]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:states:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe [CreateAccountState]
$sel:nextToken:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Text
$sel:maxResults:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CreateAccountState]
states

instance Prelude.NFData ListCreateAccountStatus where
  rnf :: ListCreateAccountStatus -> ()
rnf ListCreateAccountStatus' {Maybe Natural
Maybe [CreateAccountState]
Maybe Text
states :: Maybe [CreateAccountState]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:states:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe [CreateAccountState]
$sel:nextToken:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Text
$sel:maxResults:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [CreateAccountState]
states

instance Data.ToHeaders ListCreateAccountStatus where
  toHeaders :: ListCreateAccountStatus -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSOrganizationsV20161128.ListCreateAccountStatus" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListCreateAccountStatus where
  toJSON :: ListCreateAccountStatus -> Value
toJSON ListCreateAccountStatus' {Maybe Natural
Maybe [CreateAccountState]
Maybe Text
states :: Maybe [CreateAccountState]
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:states:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe [CreateAccountState]
$sel:nextToken:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Text
$sel:maxResults:ListCreateAccountStatus' :: ListCreateAccountStatus -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"States" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CreateAccountState]
states
          ]
      )

instance Data.ToPath ListCreateAccountStatus where
  toPath :: ListCreateAccountStatus -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ListCreateAccountStatus where
  toQuery :: ListCreateAccountStatus -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListCreateAccountStatusResponse' smart constructor.
data ListCreateAccountStatusResponse = ListCreateAccountStatusResponse'
  { -- | A list of objects with details about the requests. Certain elements,
    -- such as the accountId number, are present in the output only after the
    -- account has been successfully created.
    ListCreateAccountStatusResponse -> Maybe [CreateAccountStatus]
createAccountStatuses :: Prelude.Maybe [CreateAccountStatus],
    -- | If present, indicates that more output is available than is included in
    -- the current response. Use this value in the @NextToken@ request
    -- parameter in a subsequent call to the operation to get the next part of
    -- the output. You should repeat this until the @NextToken@ response
    -- element comes back as @null@.
    ListCreateAccountStatusResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListCreateAccountStatusResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCreateAccountStatusResponse
-> ListCreateAccountStatusResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCreateAccountStatusResponse
-> ListCreateAccountStatusResponse -> Bool
$c/= :: ListCreateAccountStatusResponse
-> ListCreateAccountStatusResponse -> Bool
== :: ListCreateAccountStatusResponse
-> ListCreateAccountStatusResponse -> Bool
$c== :: ListCreateAccountStatusResponse
-> ListCreateAccountStatusResponse -> Bool
Prelude.Eq, Int -> ListCreateAccountStatusResponse -> ShowS
[ListCreateAccountStatusResponse] -> ShowS
ListCreateAccountStatusResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCreateAccountStatusResponse] -> ShowS
$cshowList :: [ListCreateAccountStatusResponse] -> ShowS
show :: ListCreateAccountStatusResponse -> String
$cshow :: ListCreateAccountStatusResponse -> String
showsPrec :: Int -> ListCreateAccountStatusResponse -> ShowS
$cshowsPrec :: Int -> ListCreateAccountStatusResponse -> ShowS
Prelude.Show, forall x.
Rep ListCreateAccountStatusResponse x
-> ListCreateAccountStatusResponse
forall x.
ListCreateAccountStatusResponse
-> Rep ListCreateAccountStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListCreateAccountStatusResponse x
-> ListCreateAccountStatusResponse
$cfrom :: forall x.
ListCreateAccountStatusResponse
-> Rep ListCreateAccountStatusResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListCreateAccountStatusResponse' 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:
--
-- 'createAccountStatuses', 'listCreateAccountStatusResponse_createAccountStatuses' - A list of objects with details about the requests. Certain elements,
-- such as the accountId number, are present in the output only after the
-- account has been successfully created.
--
-- 'nextToken', 'listCreateAccountStatusResponse_nextToken' - If present, indicates that more output is available than is included in
-- the current response. Use this value in the @NextToken@ request
-- parameter in a subsequent call to the operation to get the next part of
-- the output. You should repeat this until the @NextToken@ response
-- element comes back as @null@.
--
-- 'httpStatus', 'listCreateAccountStatusResponse_httpStatus' - The response's http status code.
newListCreateAccountStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCreateAccountStatusResponse
newListCreateAccountStatusResponse :: Int -> ListCreateAccountStatusResponse
newListCreateAccountStatusResponse Int
pHttpStatus_ =
  ListCreateAccountStatusResponse'
    { $sel:createAccountStatuses:ListCreateAccountStatusResponse' :: Maybe [CreateAccountStatus]
createAccountStatuses =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCreateAccountStatusResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCreateAccountStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of objects with details about the requests. Certain elements,
-- such as the accountId number, are present in the output only after the
-- account has been successfully created.
listCreateAccountStatusResponse_createAccountStatuses :: Lens.Lens' ListCreateAccountStatusResponse (Prelude.Maybe [CreateAccountStatus])
listCreateAccountStatusResponse_createAccountStatuses :: Lens' ListCreateAccountStatusResponse (Maybe [CreateAccountStatus])
listCreateAccountStatusResponse_createAccountStatuses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatusResponse' {Maybe [CreateAccountStatus]
createAccountStatuses :: Maybe [CreateAccountStatus]
$sel:createAccountStatuses:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Maybe [CreateAccountStatus]
createAccountStatuses} -> Maybe [CreateAccountStatus]
createAccountStatuses) (\s :: ListCreateAccountStatusResponse
s@ListCreateAccountStatusResponse' {} Maybe [CreateAccountStatus]
a -> ListCreateAccountStatusResponse
s {$sel:createAccountStatuses:ListCreateAccountStatusResponse' :: Maybe [CreateAccountStatus]
createAccountStatuses = Maybe [CreateAccountStatus]
a} :: ListCreateAccountStatusResponse) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If present, indicates that more output is available than is included in
-- the current response. Use this value in the @NextToken@ request
-- parameter in a subsequent call to the operation to get the next part of
-- the output. You should repeat this until the @NextToken@ response
-- element comes back as @null@.
listCreateAccountStatusResponse_nextToken :: Lens.Lens' ListCreateAccountStatusResponse (Prelude.Maybe Prelude.Text)
listCreateAccountStatusResponse_nextToken :: Lens' ListCreateAccountStatusResponse (Maybe Text)
listCreateAccountStatusResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatusResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCreateAccountStatusResponse
s@ListCreateAccountStatusResponse' {} Maybe Text
a -> ListCreateAccountStatusResponse
s {$sel:nextToken:ListCreateAccountStatusResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCreateAccountStatusResponse)

-- | The response's http status code.
listCreateAccountStatusResponse_httpStatus :: Lens.Lens' ListCreateAccountStatusResponse Prelude.Int
listCreateAccountStatusResponse_httpStatus :: Lens' ListCreateAccountStatusResponse Int
listCreateAccountStatusResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCreateAccountStatusResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListCreateAccountStatusResponse
s@ListCreateAccountStatusResponse' {} Int
a -> ListCreateAccountStatusResponse
s {$sel:httpStatus:ListCreateAccountStatusResponse' :: Int
httpStatus = Int
a} :: ListCreateAccountStatusResponse)

instance
  Prelude.NFData
    ListCreateAccountStatusResponse
  where
  rnf :: ListCreateAccountStatusResponse -> ()
rnf ListCreateAccountStatusResponse' {Int
Maybe [CreateAccountStatus]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
createAccountStatuses :: Maybe [CreateAccountStatus]
$sel:httpStatus:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Int
$sel:nextToken:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Maybe Text
$sel:createAccountStatuses:ListCreateAccountStatusResponse' :: ListCreateAccountStatusResponse -> Maybe [CreateAccountStatus]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CreateAccountStatus]
createAccountStatuses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus