{-# 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.FMS.ListMemberAccounts
-- 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)
--
-- Returns a @MemberAccounts@ object that lists the member accounts in the
-- administrator\'s Amazon Web Services organization.
--
-- The @ListMemberAccounts@ must be submitted by the account that is set as
-- the Firewall Manager administrator.
--
-- This operation returns paginated results.
module Amazonka.FMS.ListMemberAccounts
  ( -- * Creating a Request
    ListMemberAccounts (..),
    newListMemberAccounts,

    -- * Request Lenses
    listMemberAccounts_nextToken,
    listMemberAccounts_maxResults,

    -- * Destructuring the Response
    ListMemberAccountsResponse (..),
    newListMemberAccountsResponse,

    -- * Response Lenses
    listMemberAccountsResponse_nextToken,
    listMemberAccountsResponse_memberAccounts,
    listMemberAccountsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.FMS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListMemberAccounts' smart constructor.
data ListMemberAccounts = ListMemberAccounts'
  { -- | If you specify a value for @MaxResults@ and you have more account IDs
    -- than the number that you specify for @MaxResults@, Firewall Manager
    -- returns a @NextToken@ value in the response that allows you to list
    -- another group of IDs. For the second and subsequent
    -- @ListMemberAccountsRequest@ requests, specify the value of @NextToken@
    -- from the previous response to get information about another batch of
    -- member account IDs.
    ListMemberAccounts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Specifies the number of member account IDs that you want Firewall
    -- Manager to return for this request. If you have more IDs than the number
    -- that you specify for @MaxResults@, the response includes a @NextToken@
    -- value that you can use to get another batch of member account IDs.
    ListMemberAccounts -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListMemberAccounts -> ListMemberAccounts -> Bool
(ListMemberAccounts -> ListMemberAccounts -> Bool)
-> (ListMemberAccounts -> ListMemberAccounts -> Bool)
-> Eq ListMemberAccounts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMemberAccounts -> ListMemberAccounts -> Bool
$c/= :: ListMemberAccounts -> ListMemberAccounts -> Bool
== :: ListMemberAccounts -> ListMemberAccounts -> Bool
$c== :: ListMemberAccounts -> ListMemberAccounts -> Bool
Prelude.Eq, ReadPrec [ListMemberAccounts]
ReadPrec ListMemberAccounts
Int -> ReadS ListMemberAccounts
ReadS [ListMemberAccounts]
(Int -> ReadS ListMemberAccounts)
-> ReadS [ListMemberAccounts]
-> ReadPrec ListMemberAccounts
-> ReadPrec [ListMemberAccounts]
-> Read ListMemberAccounts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMemberAccounts]
$creadListPrec :: ReadPrec [ListMemberAccounts]
readPrec :: ReadPrec ListMemberAccounts
$creadPrec :: ReadPrec ListMemberAccounts
readList :: ReadS [ListMemberAccounts]
$creadList :: ReadS [ListMemberAccounts]
readsPrec :: Int -> ReadS ListMemberAccounts
$creadsPrec :: Int -> ReadS ListMemberAccounts
Prelude.Read, Int -> ListMemberAccounts -> ShowS
[ListMemberAccounts] -> ShowS
ListMemberAccounts -> String
(Int -> ListMemberAccounts -> ShowS)
-> (ListMemberAccounts -> String)
-> ([ListMemberAccounts] -> ShowS)
-> Show ListMemberAccounts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMemberAccounts] -> ShowS
$cshowList :: [ListMemberAccounts] -> ShowS
show :: ListMemberAccounts -> String
$cshow :: ListMemberAccounts -> String
showsPrec :: Int -> ListMemberAccounts -> ShowS
$cshowsPrec :: Int -> ListMemberAccounts -> ShowS
Prelude.Show, (forall x. ListMemberAccounts -> Rep ListMemberAccounts x)
-> (forall x. Rep ListMemberAccounts x -> ListMemberAccounts)
-> Generic ListMemberAccounts
forall x. Rep ListMemberAccounts x -> ListMemberAccounts
forall x. ListMemberAccounts -> Rep ListMemberAccounts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMemberAccounts x -> ListMemberAccounts
$cfrom :: forall x. ListMemberAccounts -> Rep ListMemberAccounts x
Prelude.Generic)

-- |
-- Create a value of 'ListMemberAccounts' 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:
--
-- 'nextToken', 'listMemberAccounts_nextToken' - If you specify a value for @MaxResults@ and you have more account IDs
-- than the number that you specify for @MaxResults@, Firewall Manager
-- returns a @NextToken@ value in the response that allows you to list
-- another group of IDs. For the second and subsequent
-- @ListMemberAccountsRequest@ requests, specify the value of @NextToken@
-- from the previous response to get information about another batch of
-- member account IDs.
--
-- 'maxResults', 'listMemberAccounts_maxResults' - Specifies the number of member account IDs that you want Firewall
-- Manager to return for this request. If you have more IDs than the number
-- that you specify for @MaxResults@, the response includes a @NextToken@
-- value that you can use to get another batch of member account IDs.
newListMemberAccounts ::
  ListMemberAccounts
newListMemberAccounts :: ListMemberAccounts
newListMemberAccounts =
  ListMemberAccounts' :: Maybe Text -> Maybe Natural -> ListMemberAccounts
ListMemberAccounts'
    { $sel:nextToken:ListMemberAccounts' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListMemberAccounts' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | If you specify a value for @MaxResults@ and you have more account IDs
-- than the number that you specify for @MaxResults@, Firewall Manager
-- returns a @NextToken@ value in the response that allows you to list
-- another group of IDs. For the second and subsequent
-- @ListMemberAccountsRequest@ requests, specify the value of @NextToken@
-- from the previous response to get information about another batch of
-- member account IDs.
listMemberAccounts_nextToken :: Lens.Lens' ListMemberAccounts (Prelude.Maybe Prelude.Text)
listMemberAccounts_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListMemberAccounts -> f ListMemberAccounts
listMemberAccounts_nextToken = (ListMemberAccounts -> Maybe Text)
-> (ListMemberAccounts -> Maybe Text -> ListMemberAccounts)
-> Lens
     ListMemberAccounts ListMemberAccounts (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMemberAccounts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListMemberAccounts' :: ListMemberAccounts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListMemberAccounts
s@ListMemberAccounts' {} Maybe Text
a -> ListMemberAccounts
s {$sel:nextToken:ListMemberAccounts' :: Maybe Text
nextToken = Maybe Text
a} :: ListMemberAccounts)

-- | Specifies the number of member account IDs that you want Firewall
-- Manager to return for this request. If you have more IDs than the number
-- that you specify for @MaxResults@, the response includes a @NextToken@
-- value that you can use to get another batch of member account IDs.
listMemberAccounts_maxResults :: Lens.Lens' ListMemberAccounts (Prelude.Maybe Prelude.Natural)
listMemberAccounts_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListMemberAccounts -> f ListMemberAccounts
listMemberAccounts_maxResults = (ListMemberAccounts -> Maybe Natural)
-> (ListMemberAccounts -> Maybe Natural -> ListMemberAccounts)
-> Lens
     ListMemberAccounts
     ListMemberAccounts
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMemberAccounts' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListMemberAccounts' :: ListMemberAccounts -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListMemberAccounts
s@ListMemberAccounts' {} Maybe Natural
a -> ListMemberAccounts
s {$sel:maxResults:ListMemberAccounts' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListMemberAccounts)

instance Core.AWSPager ListMemberAccounts where
  page :: ListMemberAccounts
-> AWSResponse ListMemberAccounts -> Maybe ListMemberAccounts
page ListMemberAccounts
rq AWSResponse ListMemberAccounts
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListMemberAccounts
ListMemberAccountsResponse
rs
            ListMemberAccountsResponse
-> Getting (First Text) ListMemberAccountsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListMemberAccountsResponse
-> Const (First Text) ListMemberAccountsResponse
Lens' ListMemberAccountsResponse (Maybe Text)
listMemberAccountsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListMemberAccountsResponse
 -> Const (First Text) ListMemberAccountsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListMemberAccountsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListMemberAccounts
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListMemberAccounts
ListMemberAccountsResponse
rs
            ListMemberAccountsResponse
-> Getting (First [Text]) ListMemberAccountsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListMemberAccountsResponse
-> Const (First [Text]) ListMemberAccountsResponse
Lens' ListMemberAccountsResponse (Maybe [Text])
listMemberAccountsResponse_memberAccounts
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListMemberAccountsResponse
 -> Const (First [Text]) ListMemberAccountsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListMemberAccountsResponse [Text]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> Const (First [Text]) [Text])
-> Maybe [Text] -> Const (First [Text]) (Maybe [Text])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListMemberAccounts
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListMemberAccounts -> Maybe ListMemberAccounts
forall a. a -> Maybe a
Prelude.Just (ListMemberAccounts -> Maybe ListMemberAccounts)
-> ListMemberAccounts -> Maybe ListMemberAccounts
forall a b. (a -> b) -> a -> b
Prelude.$
        ListMemberAccounts
rq
          ListMemberAccounts
-> (ListMemberAccounts -> ListMemberAccounts) -> ListMemberAccounts
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListMemberAccounts -> Identity ListMemberAccounts
Lens
  ListMemberAccounts ListMemberAccounts (Maybe Text) (Maybe Text)
listMemberAccounts_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListMemberAccounts -> Identity ListMemberAccounts)
-> Maybe Text -> ListMemberAccounts -> ListMemberAccounts
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListMemberAccounts
ListMemberAccountsResponse
rs
          ListMemberAccountsResponse
-> Getting (First Text) ListMemberAccountsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListMemberAccountsResponse
-> Const (First Text) ListMemberAccountsResponse
Lens' ListMemberAccountsResponse (Maybe Text)
listMemberAccountsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListMemberAccountsResponse
 -> Const (First Text) ListMemberAccountsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListMemberAccountsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

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

instance Prelude.Hashable ListMemberAccounts

instance Prelude.NFData ListMemberAccounts

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

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

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

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

-- | /See:/ 'newListMemberAccountsResponse' smart constructor.
data ListMemberAccountsResponse = ListMemberAccountsResponse'
  { -- | If you have more member account IDs than the number that you specified
    -- for @MaxResults@ in the request, the response includes a @NextToken@
    -- value. To list more IDs, submit another @ListMemberAccounts@ request,
    -- and specify the @NextToken@ value from the response in the @NextToken@
    -- value in the next request.
    ListMemberAccountsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of account IDs.
    ListMemberAccountsResponse -> Maybe [Text]
memberAccounts :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListMemberAccountsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListMemberAccountsResponse -> ListMemberAccountsResponse -> Bool
(ListMemberAccountsResponse -> ListMemberAccountsResponse -> Bool)
-> (ListMemberAccountsResponse
    -> ListMemberAccountsResponse -> Bool)
-> Eq ListMemberAccountsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMemberAccountsResponse -> ListMemberAccountsResponse -> Bool
$c/= :: ListMemberAccountsResponse -> ListMemberAccountsResponse -> Bool
== :: ListMemberAccountsResponse -> ListMemberAccountsResponse -> Bool
$c== :: ListMemberAccountsResponse -> ListMemberAccountsResponse -> Bool
Prelude.Eq, ReadPrec [ListMemberAccountsResponse]
ReadPrec ListMemberAccountsResponse
Int -> ReadS ListMemberAccountsResponse
ReadS [ListMemberAccountsResponse]
(Int -> ReadS ListMemberAccountsResponse)
-> ReadS [ListMemberAccountsResponse]
-> ReadPrec ListMemberAccountsResponse
-> ReadPrec [ListMemberAccountsResponse]
-> Read ListMemberAccountsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMemberAccountsResponse]
$creadListPrec :: ReadPrec [ListMemberAccountsResponse]
readPrec :: ReadPrec ListMemberAccountsResponse
$creadPrec :: ReadPrec ListMemberAccountsResponse
readList :: ReadS [ListMemberAccountsResponse]
$creadList :: ReadS [ListMemberAccountsResponse]
readsPrec :: Int -> ReadS ListMemberAccountsResponse
$creadsPrec :: Int -> ReadS ListMemberAccountsResponse
Prelude.Read, Int -> ListMemberAccountsResponse -> ShowS
[ListMemberAccountsResponse] -> ShowS
ListMemberAccountsResponse -> String
(Int -> ListMemberAccountsResponse -> ShowS)
-> (ListMemberAccountsResponse -> String)
-> ([ListMemberAccountsResponse] -> ShowS)
-> Show ListMemberAccountsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMemberAccountsResponse] -> ShowS
$cshowList :: [ListMemberAccountsResponse] -> ShowS
show :: ListMemberAccountsResponse -> String
$cshow :: ListMemberAccountsResponse -> String
showsPrec :: Int -> ListMemberAccountsResponse -> ShowS
$cshowsPrec :: Int -> ListMemberAccountsResponse -> ShowS
Prelude.Show, (forall x.
 ListMemberAccountsResponse -> Rep ListMemberAccountsResponse x)
-> (forall x.
    Rep ListMemberAccountsResponse x -> ListMemberAccountsResponse)
-> Generic ListMemberAccountsResponse
forall x.
Rep ListMemberAccountsResponse x -> ListMemberAccountsResponse
forall x.
ListMemberAccountsResponse -> Rep ListMemberAccountsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListMemberAccountsResponse x -> ListMemberAccountsResponse
$cfrom :: forall x.
ListMemberAccountsResponse -> Rep ListMemberAccountsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListMemberAccountsResponse' 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:
--
-- 'nextToken', 'listMemberAccountsResponse_nextToken' - If you have more member account IDs than the number that you specified
-- for @MaxResults@ in the request, the response includes a @NextToken@
-- value. To list more IDs, submit another @ListMemberAccounts@ request,
-- and specify the @NextToken@ value from the response in the @NextToken@
-- value in the next request.
--
-- 'memberAccounts', 'listMemberAccountsResponse_memberAccounts' - An array of account IDs.
--
-- 'httpStatus', 'listMemberAccountsResponse_httpStatus' - The response's http status code.
newListMemberAccountsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListMemberAccountsResponse
newListMemberAccountsResponse :: Int -> ListMemberAccountsResponse
newListMemberAccountsResponse Int
pHttpStatus_ =
  ListMemberAccountsResponse' :: Maybe Text -> Maybe [Text] -> Int -> ListMemberAccountsResponse
ListMemberAccountsResponse'
    { $sel:nextToken:ListMemberAccountsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:memberAccounts:ListMemberAccountsResponse' :: Maybe [Text]
memberAccounts = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListMemberAccountsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If you have more member account IDs than the number that you specified
-- for @MaxResults@ in the request, the response includes a @NextToken@
-- value. To list more IDs, submit another @ListMemberAccounts@ request,
-- and specify the @NextToken@ value from the response in the @NextToken@
-- value in the next request.
listMemberAccountsResponse_nextToken :: Lens.Lens' ListMemberAccountsResponse (Prelude.Maybe Prelude.Text)
listMemberAccountsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListMemberAccountsResponse -> f ListMemberAccountsResponse
listMemberAccountsResponse_nextToken = (ListMemberAccountsResponse -> Maybe Text)
-> (ListMemberAccountsResponse
    -> Maybe Text -> ListMemberAccountsResponse)
-> Lens' ListMemberAccountsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMemberAccountsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListMemberAccountsResponse' :: ListMemberAccountsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListMemberAccountsResponse
s@ListMemberAccountsResponse' {} Maybe Text
a -> ListMemberAccountsResponse
s {$sel:nextToken:ListMemberAccountsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListMemberAccountsResponse)

-- | An array of account IDs.
listMemberAccountsResponse_memberAccounts :: Lens.Lens' ListMemberAccountsResponse (Prelude.Maybe [Prelude.Text])
listMemberAccountsResponse_memberAccounts :: (Maybe [Text] -> f (Maybe [Text]))
-> ListMemberAccountsResponse -> f ListMemberAccountsResponse
listMemberAccountsResponse_memberAccounts = (ListMemberAccountsResponse -> Maybe [Text])
-> (ListMemberAccountsResponse
    -> Maybe [Text] -> ListMemberAccountsResponse)
-> Lens' ListMemberAccountsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMemberAccountsResponse' {Maybe [Text]
memberAccounts :: Maybe [Text]
$sel:memberAccounts:ListMemberAccountsResponse' :: ListMemberAccountsResponse -> Maybe [Text]
memberAccounts} -> Maybe [Text]
memberAccounts) (\s :: ListMemberAccountsResponse
s@ListMemberAccountsResponse' {} Maybe [Text]
a -> ListMemberAccountsResponse
s {$sel:memberAccounts:ListMemberAccountsResponse' :: Maybe [Text]
memberAccounts = Maybe [Text]
a} :: ListMemberAccountsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListMemberAccountsResponse -> f ListMemberAccountsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListMemberAccountsResponse
-> f ListMemberAccountsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListMemberAccountsResponse