{-# 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.ServiceCatalog.ListPortfolioAccess
-- 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 IDs that have access to the specified portfolio.
--
-- A delegated admin can list the accounts that have access to the shared
-- portfolio. Note that if a delegated admin is de-registered, they can no
-- longer perform this operation.
module Amazonka.ServiceCatalog.ListPortfolioAccess
  ( -- * Creating a Request
    ListPortfolioAccess (..),
    newListPortfolioAccess,

    -- * Request Lenses
    listPortfolioAccess_acceptLanguage,
    listPortfolioAccess_organizationParentId,
    listPortfolioAccess_pageSize,
    listPortfolioAccess_pageToken,
    listPortfolioAccess_portfolioId,

    -- * Destructuring the Response
    ListPortfolioAccessResponse (..),
    newListPortfolioAccessResponse,

    -- * Response Lenses
    listPortfolioAccessResponse_accountIds,
    listPortfolioAccessResponse_nextPageToken,
    listPortfolioAccessResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.ServiceCatalog.Types

-- | /See:/ 'newListPortfolioAccess' smart constructor.
data ListPortfolioAccess = ListPortfolioAccess'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    ListPortfolioAccess -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The ID of an organization node the portfolio is shared with. All
    -- children of this node with an inherited portfolio share will be
    -- returned.
    ListPortfolioAccess -> Maybe Text
organizationParentId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return with this call.
    ListPortfolioAccess -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
    -- | The page token for the next set of results. To retrieve the first set of
    -- results, use null.
    ListPortfolioAccess -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | The portfolio identifier.
    ListPortfolioAccess -> Text
portfolioId :: Prelude.Text
  }
  deriving (ListPortfolioAccess -> ListPortfolioAccess -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPortfolioAccess -> ListPortfolioAccess -> Bool
$c/= :: ListPortfolioAccess -> ListPortfolioAccess -> Bool
== :: ListPortfolioAccess -> ListPortfolioAccess -> Bool
$c== :: ListPortfolioAccess -> ListPortfolioAccess -> Bool
Prelude.Eq, ReadPrec [ListPortfolioAccess]
ReadPrec ListPortfolioAccess
Int -> ReadS ListPortfolioAccess
ReadS [ListPortfolioAccess]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPortfolioAccess]
$creadListPrec :: ReadPrec [ListPortfolioAccess]
readPrec :: ReadPrec ListPortfolioAccess
$creadPrec :: ReadPrec ListPortfolioAccess
readList :: ReadS [ListPortfolioAccess]
$creadList :: ReadS [ListPortfolioAccess]
readsPrec :: Int -> ReadS ListPortfolioAccess
$creadsPrec :: Int -> ReadS ListPortfolioAccess
Prelude.Read, Int -> ListPortfolioAccess -> ShowS
[ListPortfolioAccess] -> ShowS
ListPortfolioAccess -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPortfolioAccess] -> ShowS
$cshowList :: [ListPortfolioAccess] -> ShowS
show :: ListPortfolioAccess -> String
$cshow :: ListPortfolioAccess -> String
showsPrec :: Int -> ListPortfolioAccess -> ShowS
$cshowsPrec :: Int -> ListPortfolioAccess -> ShowS
Prelude.Show, forall x. Rep ListPortfolioAccess x -> ListPortfolioAccess
forall x. ListPortfolioAccess -> Rep ListPortfolioAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPortfolioAccess x -> ListPortfolioAccess
$cfrom :: forall x. ListPortfolioAccess -> Rep ListPortfolioAccess x
Prelude.Generic)

-- |
-- Create a value of 'ListPortfolioAccess' 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:
--
-- 'acceptLanguage', 'listPortfolioAccess_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'organizationParentId', 'listPortfolioAccess_organizationParentId' - The ID of an organization node the portfolio is shared with. All
-- children of this node with an inherited portfolio share will be
-- returned.
--
-- 'pageSize', 'listPortfolioAccess_pageSize' - The maximum number of items to return with this call.
--
-- 'pageToken', 'listPortfolioAccess_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- 'portfolioId', 'listPortfolioAccess_portfolioId' - The portfolio identifier.
newListPortfolioAccess ::
  -- | 'portfolioId'
  Prelude.Text ->
  ListPortfolioAccess
newListPortfolioAccess :: Text -> ListPortfolioAccess
newListPortfolioAccess Text
pPortfolioId_ =
  ListPortfolioAccess'
    { $sel:acceptLanguage:ListPortfolioAccess' :: Maybe Text
acceptLanguage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:organizationParentId:ListPortfolioAccess' :: Maybe Text
organizationParentId = forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListPortfolioAccess' :: Maybe Natural
pageSize = forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:ListPortfolioAccess' :: Maybe Text
pageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:portfolioId:ListPortfolioAccess' :: Text
portfolioId = Text
pPortfolioId_
    }

-- | The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
listPortfolioAccess_acceptLanguage :: Lens.Lens' ListPortfolioAccess (Prelude.Maybe Prelude.Text)
listPortfolioAccess_acceptLanguage :: Lens' ListPortfolioAccess (Maybe Text)
listPortfolioAccess_acceptLanguage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPortfolioAccess' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: ListPortfolioAccess
s@ListPortfolioAccess' {} Maybe Text
a -> ListPortfolioAccess
s {$sel:acceptLanguage:ListPortfolioAccess' :: Maybe Text
acceptLanguage = Maybe Text
a} :: ListPortfolioAccess)

-- | The ID of an organization node the portfolio is shared with. All
-- children of this node with an inherited portfolio share will be
-- returned.
listPortfolioAccess_organizationParentId :: Lens.Lens' ListPortfolioAccess (Prelude.Maybe Prelude.Text)
listPortfolioAccess_organizationParentId :: Lens' ListPortfolioAccess (Maybe Text)
listPortfolioAccess_organizationParentId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPortfolioAccess' {Maybe Text
organizationParentId :: Maybe Text
$sel:organizationParentId:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
organizationParentId} -> Maybe Text
organizationParentId) (\s :: ListPortfolioAccess
s@ListPortfolioAccess' {} Maybe Text
a -> ListPortfolioAccess
s {$sel:organizationParentId:ListPortfolioAccess' :: Maybe Text
organizationParentId = Maybe Text
a} :: ListPortfolioAccess)

-- | The maximum number of items to return with this call.
listPortfolioAccess_pageSize :: Lens.Lens' ListPortfolioAccess (Prelude.Maybe Prelude.Natural)
listPortfolioAccess_pageSize :: Lens' ListPortfolioAccess (Maybe Natural)
listPortfolioAccess_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPortfolioAccess' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: ListPortfolioAccess
s@ListPortfolioAccess' {} Maybe Natural
a -> ListPortfolioAccess
s {$sel:pageSize:ListPortfolioAccess' :: Maybe Natural
pageSize = Maybe Natural
a} :: ListPortfolioAccess)

-- | The page token for the next set of results. To retrieve the first set of
-- results, use null.
listPortfolioAccess_pageToken :: Lens.Lens' ListPortfolioAccess (Prelude.Maybe Prelude.Text)
listPortfolioAccess_pageToken :: Lens' ListPortfolioAccess (Maybe Text)
listPortfolioAccess_pageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPortfolioAccess' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: ListPortfolioAccess
s@ListPortfolioAccess' {} Maybe Text
a -> ListPortfolioAccess
s {$sel:pageToken:ListPortfolioAccess' :: Maybe Text
pageToken = Maybe Text
a} :: ListPortfolioAccess)

-- | The portfolio identifier.
listPortfolioAccess_portfolioId :: Lens.Lens' ListPortfolioAccess Prelude.Text
listPortfolioAccess_portfolioId :: Lens' ListPortfolioAccess Text
listPortfolioAccess_portfolioId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPortfolioAccess' {Text
portfolioId :: Text
$sel:portfolioId:ListPortfolioAccess' :: ListPortfolioAccess -> Text
portfolioId} -> Text
portfolioId) (\s :: ListPortfolioAccess
s@ListPortfolioAccess' {} Text
a -> ListPortfolioAccess
s {$sel:portfolioId:ListPortfolioAccess' :: Text
portfolioId = Text
a} :: ListPortfolioAccess)

instance Core.AWSRequest ListPortfolioAccess where
  type
    AWSResponse ListPortfolioAccess =
      ListPortfolioAccessResponse
  request :: (Service -> Service)
-> ListPortfolioAccess -> Request ListPortfolioAccess
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 ListPortfolioAccess
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPortfolioAccess)))
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 [Text] -> Maybe Text -> Int -> ListPortfolioAccessResponse
ListPortfolioAccessResponse'
            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
"AccountIds" 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
"NextPageToken")
            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 ListPortfolioAccess where
  hashWithSalt :: Int -> ListPortfolioAccess -> Int
hashWithSalt Int
_salt ListPortfolioAccess' {Maybe Natural
Maybe Text
Text
portfolioId :: Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
organizationParentId :: Maybe Text
acceptLanguage :: Maybe Text
$sel:portfolioId:ListPortfolioAccess' :: ListPortfolioAccess -> Text
$sel:pageToken:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
$sel:pageSize:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Natural
$sel:organizationParentId:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
$sel:acceptLanguage:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
acceptLanguage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
organizationParentId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pageSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pageToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
portfolioId

instance Prelude.NFData ListPortfolioAccess where
  rnf :: ListPortfolioAccess -> ()
rnf ListPortfolioAccess' {Maybe Natural
Maybe Text
Text
portfolioId :: Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
organizationParentId :: Maybe Text
acceptLanguage :: Maybe Text
$sel:portfolioId:ListPortfolioAccess' :: ListPortfolioAccess -> Text
$sel:pageToken:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
$sel:pageSize:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Natural
$sel:organizationParentId:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
$sel:acceptLanguage:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
acceptLanguage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
organizationParentId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
pageSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pageToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
portfolioId

instance Data.ToHeaders ListPortfolioAccess where
  toHeaders :: ListPortfolioAccess -> 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
"AWS242ServiceCatalogService.ListPortfolioAccess" ::
                          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 ListPortfolioAccess where
  toJSON :: ListPortfolioAccess -> Value
toJSON ListPortfolioAccess' {Maybe Natural
Maybe Text
Text
portfolioId :: Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
organizationParentId :: Maybe Text
acceptLanguage :: Maybe Text
$sel:portfolioId:ListPortfolioAccess' :: ListPortfolioAccess -> Text
$sel:pageToken:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
$sel:pageSize:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Natural
$sel:organizationParentId:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
$sel:acceptLanguage:ListPortfolioAccess' :: ListPortfolioAccess -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AcceptLanguage" 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
acceptLanguage,
            (Key
"OrganizationParentId" 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
organizationParentId,
            (Key
"PageSize" 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
pageSize,
            (Key
"PageToken" 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
pageToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"PortfolioId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
portfolioId)
          ]
      )

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

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

-- | /See:/ 'newListPortfolioAccessResponse' smart constructor.
data ListPortfolioAccessResponse = ListPortfolioAccessResponse'
  { -- | Information about the Amazon Web Services accounts with access to the
    -- portfolio.
    ListPortfolioAccessResponse -> Maybe [Text]
accountIds :: Prelude.Maybe [Prelude.Text],
    -- | The page token to use to retrieve the next set of results. If there are
    -- no additional results, this value is null.
    ListPortfolioAccessResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPortfolioAccessResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPortfolioAccessResponse -> ListPortfolioAccessResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPortfolioAccessResponse -> ListPortfolioAccessResponse -> Bool
$c/= :: ListPortfolioAccessResponse -> ListPortfolioAccessResponse -> Bool
== :: ListPortfolioAccessResponse -> ListPortfolioAccessResponse -> Bool
$c== :: ListPortfolioAccessResponse -> ListPortfolioAccessResponse -> Bool
Prelude.Eq, ReadPrec [ListPortfolioAccessResponse]
ReadPrec ListPortfolioAccessResponse
Int -> ReadS ListPortfolioAccessResponse
ReadS [ListPortfolioAccessResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPortfolioAccessResponse]
$creadListPrec :: ReadPrec [ListPortfolioAccessResponse]
readPrec :: ReadPrec ListPortfolioAccessResponse
$creadPrec :: ReadPrec ListPortfolioAccessResponse
readList :: ReadS [ListPortfolioAccessResponse]
$creadList :: ReadS [ListPortfolioAccessResponse]
readsPrec :: Int -> ReadS ListPortfolioAccessResponse
$creadsPrec :: Int -> ReadS ListPortfolioAccessResponse
Prelude.Read, Int -> ListPortfolioAccessResponse -> ShowS
[ListPortfolioAccessResponse] -> ShowS
ListPortfolioAccessResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPortfolioAccessResponse] -> ShowS
$cshowList :: [ListPortfolioAccessResponse] -> ShowS
show :: ListPortfolioAccessResponse -> String
$cshow :: ListPortfolioAccessResponse -> String
showsPrec :: Int -> ListPortfolioAccessResponse -> ShowS
$cshowsPrec :: Int -> ListPortfolioAccessResponse -> ShowS
Prelude.Show, forall x.
Rep ListPortfolioAccessResponse x -> ListPortfolioAccessResponse
forall x.
ListPortfolioAccessResponse -> Rep ListPortfolioAccessResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPortfolioAccessResponse x -> ListPortfolioAccessResponse
$cfrom :: forall x.
ListPortfolioAccessResponse -> Rep ListPortfolioAccessResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPortfolioAccessResponse' 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:
--
-- 'accountIds', 'listPortfolioAccessResponse_accountIds' - Information about the Amazon Web Services accounts with access to the
-- portfolio.
--
-- 'nextPageToken', 'listPortfolioAccessResponse_nextPageToken' - The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
--
-- 'httpStatus', 'listPortfolioAccessResponse_httpStatus' - The response's http status code.
newListPortfolioAccessResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPortfolioAccessResponse
newListPortfolioAccessResponse :: Int -> ListPortfolioAccessResponse
newListPortfolioAccessResponse Int
pHttpStatus_ =
  ListPortfolioAccessResponse'
    { $sel:accountIds:ListPortfolioAccessResponse' :: Maybe [Text]
accountIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextPageToken:ListPortfolioAccessResponse' :: Maybe Text
nextPageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPortfolioAccessResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the Amazon Web Services accounts with access to the
-- portfolio.
listPortfolioAccessResponse_accountIds :: Lens.Lens' ListPortfolioAccessResponse (Prelude.Maybe [Prelude.Text])
listPortfolioAccessResponse_accountIds :: Lens' ListPortfolioAccessResponse (Maybe [Text])
listPortfolioAccessResponse_accountIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPortfolioAccessResponse' {Maybe [Text]
accountIds :: Maybe [Text]
$sel:accountIds:ListPortfolioAccessResponse' :: ListPortfolioAccessResponse -> Maybe [Text]
accountIds} -> Maybe [Text]
accountIds) (\s :: ListPortfolioAccessResponse
s@ListPortfolioAccessResponse' {} Maybe [Text]
a -> ListPortfolioAccessResponse
s {$sel:accountIds:ListPortfolioAccessResponse' :: Maybe [Text]
accountIds = Maybe [Text]
a} :: ListPortfolioAccessResponse) 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

-- | The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
listPortfolioAccessResponse_nextPageToken :: Lens.Lens' ListPortfolioAccessResponse (Prelude.Maybe Prelude.Text)
listPortfolioAccessResponse_nextPageToken :: Lens' ListPortfolioAccessResponse (Maybe Text)
listPortfolioAccessResponse_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPortfolioAccessResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:ListPortfolioAccessResponse' :: ListPortfolioAccessResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: ListPortfolioAccessResponse
s@ListPortfolioAccessResponse' {} Maybe Text
a -> ListPortfolioAccessResponse
s {$sel:nextPageToken:ListPortfolioAccessResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: ListPortfolioAccessResponse)

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

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