{-# 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.Macie.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)
--
-- Lists all Amazon Macie Classic member accounts for the current Macie
-- Classic administrator account.
--
-- This operation returns paginated results.
module Amazonka.Macie.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 qualified Amazonka.Lens as Lens
import Amazonka.Macie.Types
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'
  { -- | Use this parameter when paginating results. Set the value of this
    -- parameter to null on your first call to the ListMemberAccounts action.
    -- Subsequent calls to the action fill nextToken in the request with the
    -- value of nextToken from the previous response to continue listing data.
    ListMemberAccounts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Use this parameter to indicate the maximum number of items that you want
    -- in the response. The default value is 250.
    ListMemberAccounts -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  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' - Use this parameter when paginating results. Set the value of this
-- parameter to null on your first call to the ListMemberAccounts action.
-- Subsequent calls to the action fill nextToken in the request with the
-- value of nextToken from the previous response to continue listing data.
--
-- 'maxResults', 'listMemberAccounts_maxResults' - Use this parameter to indicate the maximum number of items that you want
-- in the response. The default value is 250.
newListMemberAccounts ::
  ListMemberAccounts
newListMemberAccounts :: ListMemberAccounts
newListMemberAccounts =
  ListMemberAccounts' :: Maybe Text -> Maybe Int -> ListMemberAccounts
ListMemberAccounts'
    { $sel:nextToken:ListMemberAccounts' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListMemberAccounts' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Use this parameter when paginating results. Set the value of this
-- parameter to null on your first call to the ListMemberAccounts action.
-- Subsequent calls to the action fill nextToken in the request with the
-- value of nextToken from the previous response to continue listing data.
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)

-- | Use this parameter to indicate the maximum number of items that you want
-- in the response. The default value is 250.
listMemberAccounts_maxResults :: Lens.Lens' ListMemberAccounts (Prelude.Maybe Prelude.Int)
listMemberAccounts_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListMemberAccounts -> f ListMemberAccounts
listMemberAccounts_maxResults = (ListMemberAccounts -> Maybe Int)
-> (ListMemberAccounts -> Maybe Int -> ListMemberAccounts)
-> Lens
     ListMemberAccounts ListMemberAccounts (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMemberAccounts' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListMemberAccounts' :: ListMemberAccounts -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListMemberAccounts
s@ListMemberAccounts' {} Maybe Int
a -> ListMemberAccounts
s {$sel:maxResults:ListMemberAccounts' :: Maybe Int
maxResults = Maybe Int
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 [MemberAccount] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListMemberAccounts
ListMemberAccountsResponse
rs
            ListMemberAccountsResponse
-> Getting
     (First [MemberAccount]) ListMemberAccountsResponse [MemberAccount]
-> Maybe [MemberAccount]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [MemberAccount]
 -> Const (First [MemberAccount]) (Maybe [MemberAccount]))
-> ListMemberAccountsResponse
-> Const (First [MemberAccount]) ListMemberAccountsResponse
Lens' ListMemberAccountsResponse (Maybe [MemberAccount])
listMemberAccountsResponse_memberAccounts
              ((Maybe [MemberAccount]
  -> Const (First [MemberAccount]) (Maybe [MemberAccount]))
 -> ListMemberAccountsResponse
 -> Const (First [MemberAccount]) ListMemberAccountsResponse)
-> (([MemberAccount]
     -> Const (First [MemberAccount]) [MemberAccount])
    -> Maybe [MemberAccount]
    -> Const (First [MemberAccount]) (Maybe [MemberAccount]))
-> Getting
     (First [MemberAccount]) ListMemberAccountsResponse [MemberAccount]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([MemberAccount] -> Const (First [MemberAccount]) [MemberAccount])
-> Maybe [MemberAccount]
-> Const (First [MemberAccount]) (Maybe [MemberAccount])
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 [MemberAccount] -> Int -> ListMemberAccountsResponse
ListMemberAccountsResponse'
            (Maybe Text
 -> Maybe [MemberAccount] -> Int -> ListMemberAccountsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [MemberAccount] -> 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 [MemberAccount] -> Int -> ListMemberAccountsResponse)
-> Either String (Maybe [MemberAccount])
-> 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 [MemberAccount]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"memberAccounts" Either String (Maybe (Maybe [MemberAccount]))
-> Maybe [MemberAccount] -> Either String (Maybe [MemberAccount])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MemberAccount]
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
"MacieService.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 Int
Maybe Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:maxResults:ListMemberAccounts' :: ListMemberAccounts -> Maybe Int
$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 -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
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'
  { -- | When a response is generated, if there is more data to be listed, this
    -- parameter is present in the response and contains the value to use for
    -- the nextToken parameter in a subsequent pagination request. If there is
    -- no more data to be listed, this parameter is set to null.
    ListMemberAccountsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of the Amazon Macie Classic member accounts returned by the
    -- action. The current Macie Classic administrator account is also included
    -- in this list.
    ListMemberAccountsResponse -> Maybe [MemberAccount]
memberAccounts :: Prelude.Maybe [MemberAccount],
    -- | 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' - When a response is generated, if there is more data to be listed, this
-- parameter is present in the response and contains the value to use for
-- the nextToken parameter in a subsequent pagination request. If there is
-- no more data to be listed, this parameter is set to null.
--
-- 'memberAccounts', 'listMemberAccountsResponse_memberAccounts' - A list of the Amazon Macie Classic member accounts returned by the
-- action. The current Macie Classic administrator account is also included
-- in this list.
--
-- 'httpStatus', 'listMemberAccountsResponse_httpStatus' - The response's http status code.
newListMemberAccountsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListMemberAccountsResponse
newListMemberAccountsResponse :: Int -> ListMemberAccountsResponse
newListMemberAccountsResponse Int
pHttpStatus_ =
  ListMemberAccountsResponse' :: Maybe Text
-> Maybe [MemberAccount] -> Int -> ListMemberAccountsResponse
ListMemberAccountsResponse'
    { $sel:nextToken:ListMemberAccountsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:memberAccounts:ListMemberAccountsResponse' :: Maybe [MemberAccount]
memberAccounts = Maybe [MemberAccount]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListMemberAccountsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | When a response is generated, if there is more data to be listed, this
-- parameter is present in the response and contains the value to use for
-- the nextToken parameter in a subsequent pagination request. If there is
-- no more data to be listed, this parameter is set to null.
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)

-- | A list of the Amazon Macie Classic member accounts returned by the
-- action. The current Macie Classic administrator account is also included
-- in this list.
listMemberAccountsResponse_memberAccounts :: Lens.Lens' ListMemberAccountsResponse (Prelude.Maybe [MemberAccount])
listMemberAccountsResponse_memberAccounts :: (Maybe [MemberAccount] -> f (Maybe [MemberAccount]))
-> ListMemberAccountsResponse -> f ListMemberAccountsResponse
listMemberAccountsResponse_memberAccounts = (ListMemberAccountsResponse -> Maybe [MemberAccount])
-> (ListMemberAccountsResponse
    -> Maybe [MemberAccount] -> ListMemberAccountsResponse)
-> Lens' ListMemberAccountsResponse (Maybe [MemberAccount])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMemberAccountsResponse' {Maybe [MemberAccount]
memberAccounts :: Maybe [MemberAccount]
$sel:memberAccounts:ListMemberAccountsResponse' :: ListMemberAccountsResponse -> Maybe [MemberAccount]
memberAccounts} -> Maybe [MemberAccount]
memberAccounts) (\s :: ListMemberAccountsResponse
s@ListMemberAccountsResponse' {} Maybe [MemberAccount]
a -> ListMemberAccountsResponse
s {$sel:memberAccounts:ListMemberAccountsResponse' :: Maybe [MemberAccount]
memberAccounts = Maybe [MemberAccount]
a} :: ListMemberAccountsResponse) ((Maybe [MemberAccount] -> f (Maybe [MemberAccount]))
 -> ListMemberAccountsResponse -> f ListMemberAccountsResponse)
-> ((Maybe [MemberAccount] -> f (Maybe [MemberAccount]))
    -> Maybe [MemberAccount] -> f (Maybe [MemberAccount]))
-> (Maybe [MemberAccount] -> f (Maybe [MemberAccount]))
-> ListMemberAccountsResponse
-> f ListMemberAccountsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MemberAccount] [MemberAccount] [MemberAccount] [MemberAccount]
-> Iso
     (Maybe [MemberAccount])
     (Maybe [MemberAccount])
     (Maybe [MemberAccount])
     (Maybe [MemberAccount])
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
  [MemberAccount] [MemberAccount] [MemberAccount] [MemberAccount]
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