{-# 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-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 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_organizationParentId,
    listPortfolioAccess_acceptLanguage,
    listPortfolioAccess_pageToken,
    listPortfolioAccess_pageSize,
    listPortfolioAccess_portfolioId,

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

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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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 language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    ListPortfolioAccess -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | 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 maximum number of items to return with this call.
    ListPortfolioAccess -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
    -- | The portfolio identifier.
    ListPortfolioAccess -> Text
portfolioId :: Prelude.Text
  }
  deriving (ListPortfolioAccess -> ListPortfolioAccess -> Bool
(ListPortfolioAccess -> ListPortfolioAccess -> Bool)
-> (ListPortfolioAccess -> ListPortfolioAccess -> Bool)
-> Eq ListPortfolioAccess
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]
(Int -> ReadS ListPortfolioAccess)
-> ReadS [ListPortfolioAccess]
-> ReadPrec ListPortfolioAccess
-> ReadPrec [ListPortfolioAccess]
-> Read 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
(Int -> ListPortfolioAccess -> ShowS)
-> (ListPortfolioAccess -> String)
-> ([ListPortfolioAccess] -> ShowS)
-> Show ListPortfolioAccess
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. ListPortfolioAccess -> Rep ListPortfolioAccess x)
-> (forall x. Rep ListPortfolioAccess x -> ListPortfolioAccess)
-> Generic ListPortfolioAccess
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:
--
-- '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.
--
-- 'acceptLanguage', 'listPortfolioAccess_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'pageToken', 'listPortfolioAccess_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- 'pageSize', 'listPortfolioAccess_pageSize' - The maximum number of items to return with this call.
--
-- 'portfolioId', 'listPortfolioAccess_portfolioId' - The portfolio identifier.
newListPortfolioAccess ::
  -- | 'portfolioId'
  Prelude.Text ->
  ListPortfolioAccess
newListPortfolioAccess :: Text -> ListPortfolioAccess
newListPortfolioAccess Text
pPortfolioId_ =
  ListPortfolioAccess' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Text
-> ListPortfolioAccess
ListPortfolioAccess'
    { $sel:organizationParentId:ListPortfolioAccess' :: Maybe Text
organizationParentId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:acceptLanguage:ListPortfolioAccess' :: Maybe Text
acceptLanguage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:ListPortfolioAccess' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListPortfolioAccess' :: Maybe Natural
pageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:portfolioId:ListPortfolioAccess' :: Text
portfolioId = Text
pPortfolioId_
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListPortfolioAccess -> f ListPortfolioAccess
listPortfolioAccess_organizationParentId = (ListPortfolioAccess -> Maybe Text)
-> (ListPortfolioAccess -> Maybe Text -> ListPortfolioAccess)
-> Lens
     ListPortfolioAccess ListPortfolioAccess (Maybe Text) (Maybe Text)
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 language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
listPortfolioAccess_acceptLanguage :: Lens.Lens' ListPortfolioAccess (Prelude.Maybe Prelude.Text)
listPortfolioAccess_acceptLanguage :: (Maybe Text -> f (Maybe Text))
-> ListPortfolioAccess -> f ListPortfolioAccess
listPortfolioAccess_acceptLanguage = (ListPortfolioAccess -> Maybe Text)
-> (ListPortfolioAccess -> Maybe Text -> ListPortfolioAccess)
-> Lens
     ListPortfolioAccess ListPortfolioAccess (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text))
-> ListPortfolioAccess -> f ListPortfolioAccess
listPortfolioAccess_pageToken = (ListPortfolioAccess -> Maybe Text)
-> (ListPortfolioAccess -> Maybe Text -> ListPortfolioAccess)
-> Lens
     ListPortfolioAccess ListPortfolioAccess (Maybe Text) (Maybe Text)
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 maximum number of items to return with this call.
listPortfolioAccess_pageSize :: Lens.Lens' ListPortfolioAccess (Prelude.Maybe Prelude.Natural)
listPortfolioAccess_pageSize :: (Maybe Natural -> f (Maybe Natural))
-> ListPortfolioAccess -> f ListPortfolioAccess
listPortfolioAccess_pageSize = (ListPortfolioAccess -> Maybe Natural)
-> (ListPortfolioAccess -> Maybe Natural -> ListPortfolioAccess)
-> Lens
     ListPortfolioAccess
     ListPortfolioAccess
     (Maybe Natural)
     (Maybe Natural)
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 portfolio identifier.
listPortfolioAccess_portfolioId :: Lens.Lens' ListPortfolioAccess Prelude.Text
listPortfolioAccess_portfolioId :: (Text -> f Text) -> ListPortfolioAccess -> f ListPortfolioAccess
listPortfolioAccess_portfolioId = (ListPortfolioAccess -> Text)
-> (ListPortfolioAccess -> Text -> ListPortfolioAccess)
-> Lens ListPortfolioAccess ListPortfolioAccess Text Text
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 :: ListPortfolioAccess -> Request ListPortfolioAccess
request = Service -> ListPortfolioAccess -> Request ListPortfolioAccess
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPortfolioAccess
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPortfolioAccess)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPortfolioAccess))
-> Logger
-> Service
-> Proxy ListPortfolioAccess
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPortfolioAccess)))
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 -> ListPortfolioAccessResponse
ListPortfolioAccessResponse'
            (Maybe Text -> Maybe [Text] -> Int -> ListPortfolioAccessResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Text] -> Int -> ListPortfolioAccessResponse)
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
"NextPageToken")
            Either String (Maybe [Text] -> Int -> ListPortfolioAccessResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> ListPortfolioAccessResponse)
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
"AccountIds" 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 -> ListPortfolioAccessResponse)
-> Either String Int -> Either String ListPortfolioAccessResponse
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 ListPortfolioAccess

instance Prelude.NFData ListPortfolioAccess

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

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

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

-- | /See:/ 'newListPortfolioAccessResponse' smart constructor.
data ListPortfolioAccessResponse = ListPortfolioAccessResponse'
  { -- | 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,
    -- | Information about the AWS accounts with access to the portfolio.
    ListPortfolioAccessResponse -> Maybe [Text]
accountIds :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListPortfolioAccessResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPortfolioAccessResponse -> ListPortfolioAccessResponse -> Bool
(ListPortfolioAccessResponse
 -> ListPortfolioAccessResponse -> Bool)
-> (ListPortfolioAccessResponse
    -> ListPortfolioAccessResponse -> Bool)
-> Eq ListPortfolioAccessResponse
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]
(Int -> ReadS ListPortfolioAccessResponse)
-> ReadS [ListPortfolioAccessResponse]
-> ReadPrec ListPortfolioAccessResponse
-> ReadPrec [ListPortfolioAccessResponse]
-> Read 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
(Int -> ListPortfolioAccessResponse -> ShowS)
-> (ListPortfolioAccessResponse -> String)
-> ([ListPortfolioAccessResponse] -> ShowS)
-> Show ListPortfolioAccessResponse
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.
 ListPortfolioAccessResponse -> Rep ListPortfolioAccessResponse x)
-> (forall x.
    Rep ListPortfolioAccessResponse x -> ListPortfolioAccessResponse)
-> Generic ListPortfolioAccessResponse
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:
--
-- '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.
--
-- 'accountIds', 'listPortfolioAccessResponse_accountIds' - Information about the AWS accounts with access to the portfolio.
--
-- 'httpStatus', 'listPortfolioAccessResponse_httpStatus' - The response's http status code.
newListPortfolioAccessResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPortfolioAccessResponse
newListPortfolioAccessResponse :: Int -> ListPortfolioAccessResponse
newListPortfolioAccessResponse Int
pHttpStatus_ =
  ListPortfolioAccessResponse' :: Maybe Text -> Maybe [Text] -> Int -> ListPortfolioAccessResponse
ListPortfolioAccessResponse'
    { $sel:nextPageToken:ListPortfolioAccessResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:accountIds:ListPortfolioAccessResponse' :: Maybe [Text]
accountIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPortfolioAccessResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListPortfolioAccessResponse -> f ListPortfolioAccessResponse
listPortfolioAccessResponse_nextPageToken = (ListPortfolioAccessResponse -> Maybe Text)
-> (ListPortfolioAccessResponse
    -> Maybe Text -> ListPortfolioAccessResponse)
-> Lens
     ListPortfolioAccessResponse
     ListPortfolioAccessResponse
     (Maybe Text)
     (Maybe Text)
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)

-- | Information about the AWS accounts with access to the portfolio.
listPortfolioAccessResponse_accountIds :: Lens.Lens' ListPortfolioAccessResponse (Prelude.Maybe [Prelude.Text])
listPortfolioAccessResponse_accountIds :: (Maybe [Text] -> f (Maybe [Text]))
-> ListPortfolioAccessResponse -> f ListPortfolioAccessResponse
listPortfolioAccessResponse_accountIds = (ListPortfolioAccessResponse -> Maybe [Text])
-> (ListPortfolioAccessResponse
    -> Maybe [Text] -> ListPortfolioAccessResponse)
-> Lens
     ListPortfolioAccessResponse
     ListPortfolioAccessResponse
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListPortfolioAccessResponse -> f ListPortfolioAccessResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListPortfolioAccessResponse
-> f ListPortfolioAccessResponse
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.
listPortfolioAccessResponse_httpStatus :: Lens.Lens' ListPortfolioAccessResponse Prelude.Int
listPortfolioAccessResponse_httpStatus :: (Int -> f Int)
-> ListPortfolioAccessResponse -> f ListPortfolioAccessResponse
listPortfolioAccessResponse_httpStatus = (ListPortfolioAccessResponse -> Int)
-> (ListPortfolioAccessResponse
    -> Int -> ListPortfolioAccessResponse)
-> Lens
     ListPortfolioAccessResponse ListPortfolioAccessResponse Int Int
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