{-# 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.ListPortfolios
-- 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 portfolios in the catalog.
--
-- This operation returns paginated results.
module Amazonka.ServiceCatalog.ListPortfolios
  ( -- * Creating a Request
    ListPortfolios (..),
    newListPortfolios,

    -- * Request Lenses
    listPortfolios_acceptLanguage,
    listPortfolios_pageToken,
    listPortfolios_pageSize,

    -- * Destructuring the Response
    ListPortfoliosResponse (..),
    newListPortfoliosResponse,

    -- * Response Lenses
    listPortfoliosResponse_nextPageToken,
    listPortfoliosResponse_portfolioDetails,
    listPortfoliosResponse_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:/ 'newListPortfolios' smart constructor.
data ListPortfolios = ListPortfolios'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    ListPortfolios -> 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.
    ListPortfolios -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return with this call.
    ListPortfolios -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListPortfolios -> ListPortfolios -> Bool
(ListPortfolios -> ListPortfolios -> Bool)
-> (ListPortfolios -> ListPortfolios -> Bool) -> Eq ListPortfolios
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPortfolios -> ListPortfolios -> Bool
$c/= :: ListPortfolios -> ListPortfolios -> Bool
== :: ListPortfolios -> ListPortfolios -> Bool
$c== :: ListPortfolios -> ListPortfolios -> Bool
Prelude.Eq, ReadPrec [ListPortfolios]
ReadPrec ListPortfolios
Int -> ReadS ListPortfolios
ReadS [ListPortfolios]
(Int -> ReadS ListPortfolios)
-> ReadS [ListPortfolios]
-> ReadPrec ListPortfolios
-> ReadPrec [ListPortfolios]
-> Read ListPortfolios
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPortfolios]
$creadListPrec :: ReadPrec [ListPortfolios]
readPrec :: ReadPrec ListPortfolios
$creadPrec :: ReadPrec ListPortfolios
readList :: ReadS [ListPortfolios]
$creadList :: ReadS [ListPortfolios]
readsPrec :: Int -> ReadS ListPortfolios
$creadsPrec :: Int -> ReadS ListPortfolios
Prelude.Read, Int -> ListPortfolios -> ShowS
[ListPortfolios] -> ShowS
ListPortfolios -> String
(Int -> ListPortfolios -> ShowS)
-> (ListPortfolios -> String)
-> ([ListPortfolios] -> ShowS)
-> Show ListPortfolios
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPortfolios] -> ShowS
$cshowList :: [ListPortfolios] -> ShowS
show :: ListPortfolios -> String
$cshow :: ListPortfolios -> String
showsPrec :: Int -> ListPortfolios -> ShowS
$cshowsPrec :: Int -> ListPortfolios -> ShowS
Prelude.Show, (forall x. ListPortfolios -> Rep ListPortfolios x)
-> (forall x. Rep ListPortfolios x -> ListPortfolios)
-> Generic ListPortfolios
forall x. Rep ListPortfolios x -> ListPortfolios
forall x. ListPortfolios -> Rep ListPortfolios x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListPortfolios x -> ListPortfolios
$cfrom :: forall x. ListPortfolios -> Rep ListPortfolios x
Prelude.Generic)

-- |
-- Create a value of 'ListPortfolios' 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', 'listPortfolios_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'pageToken', 'listPortfolios_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- 'pageSize', 'listPortfolios_pageSize' - The maximum number of items to return with this call.
newListPortfolios ::
  ListPortfolios
newListPortfolios :: ListPortfolios
newListPortfolios =
  ListPortfolios' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListPortfolios
ListPortfolios'
    { $sel:acceptLanguage:ListPortfolios' :: Maybe Text
acceptLanguage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:ListPortfolios' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListPortfolios' :: Maybe Natural
pageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

instance Core.AWSPager ListPortfolios where
  page :: ListPortfolios
-> AWSResponse ListPortfolios -> Maybe ListPortfolios
page ListPortfolios
rq AWSResponse ListPortfolios
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPortfolios
ListPortfoliosResponse
rs
            ListPortfoliosResponse
-> Getting (First Text) ListPortfoliosResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPortfoliosResponse
-> Const (First Text) ListPortfoliosResponse
Lens' ListPortfoliosResponse (Maybe Text)
listPortfoliosResponse_nextPageToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPortfoliosResponse
 -> Const (First Text) ListPortfoliosResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPortfoliosResponse 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 ListPortfolios
forall a. Maybe a
Prelude.Nothing
    | Maybe [PortfolioDetail] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPortfolios
ListPortfoliosResponse
rs
            ListPortfoliosResponse
-> Getting
     (First [PortfolioDetail]) ListPortfoliosResponse [PortfolioDetail]
-> Maybe [PortfolioDetail]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [PortfolioDetail]
 -> Const (First [PortfolioDetail]) (Maybe [PortfolioDetail]))
-> ListPortfoliosResponse
-> Const (First [PortfolioDetail]) ListPortfoliosResponse
Lens' ListPortfoliosResponse (Maybe [PortfolioDetail])
listPortfoliosResponse_portfolioDetails
              ((Maybe [PortfolioDetail]
  -> Const (First [PortfolioDetail]) (Maybe [PortfolioDetail]))
 -> ListPortfoliosResponse
 -> Const (First [PortfolioDetail]) ListPortfoliosResponse)
-> (([PortfolioDetail]
     -> Const (First [PortfolioDetail]) [PortfolioDetail])
    -> Maybe [PortfolioDetail]
    -> Const (First [PortfolioDetail]) (Maybe [PortfolioDetail]))
-> Getting
     (First [PortfolioDetail]) ListPortfoliosResponse [PortfolioDetail]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PortfolioDetail]
 -> Const (First [PortfolioDetail]) [PortfolioDetail])
-> Maybe [PortfolioDetail]
-> Const (First [PortfolioDetail]) (Maybe [PortfolioDetail])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListPortfolios
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListPortfolios -> Maybe ListPortfolios
forall a. a -> Maybe a
Prelude.Just (ListPortfolios -> Maybe ListPortfolios)
-> ListPortfolios -> Maybe ListPortfolios
forall a b. (a -> b) -> a -> b
Prelude.$
        ListPortfolios
rq
          ListPortfolios
-> (ListPortfolios -> ListPortfolios) -> ListPortfolios
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPortfolios -> Identity ListPortfolios
Lens ListPortfolios ListPortfolios (Maybe Text) (Maybe Text)
listPortfolios_pageToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListPortfolios -> Identity ListPortfolios)
-> Maybe Text -> ListPortfolios -> ListPortfolios
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPortfolios
ListPortfoliosResponse
rs
          ListPortfoliosResponse
-> Getting (First Text) ListPortfoliosResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPortfoliosResponse
-> Const (First Text) ListPortfoliosResponse
Lens' ListPortfoliosResponse (Maybe Text)
listPortfoliosResponse_nextPageToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPortfoliosResponse
 -> Const (First Text) ListPortfoliosResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPortfoliosResponse 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 ListPortfolios where
  type
    AWSResponse ListPortfolios =
      ListPortfoliosResponse
  request :: ListPortfolios -> Request ListPortfolios
request = Service -> ListPortfolios -> Request ListPortfolios
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPortfolios
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPortfolios)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPortfolios))
-> Logger
-> Service
-> Proxy ListPortfolios
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListPortfolios)))
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 [PortfolioDetail] -> Int -> ListPortfoliosResponse
ListPortfoliosResponse'
            (Maybe Text
 -> Maybe [PortfolioDetail] -> Int -> ListPortfoliosResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [PortfolioDetail] -> Int -> ListPortfoliosResponse)
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 [PortfolioDetail] -> Int -> ListPortfoliosResponse)
-> Either String (Maybe [PortfolioDetail])
-> Either String (Int -> ListPortfoliosResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [PortfolioDetail]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PortfolioDetails"
                            Either String (Maybe (Maybe [PortfolioDetail]))
-> Maybe [PortfolioDetail]
-> Either String (Maybe [PortfolioDetail])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PortfolioDetail]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListPortfoliosResponse)
-> Either String Int -> Either String ListPortfoliosResponse
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 ListPortfolios

instance Prelude.NFData ListPortfolios

instance Core.ToHeaders ListPortfolios where
  toHeaders :: ListPortfolios -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPortfolios -> 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.ListPortfolios" ::
                          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 ListPortfolios where
  toJSON :: ListPortfolios -> Value
toJSON ListPortfolios' {Maybe Natural
Maybe Text
pageSize :: Maybe Natural
pageToken :: Maybe Text
acceptLanguage :: Maybe Text
$sel:pageSize:ListPortfolios' :: ListPortfolios -> Maybe Natural
$sel:pageToken:ListPortfolios' :: ListPortfolios -> Maybe Text
$sel:acceptLanguage:ListPortfolios' :: ListPortfolios -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
          ]
      )

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

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

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

-- |
-- Create a value of 'ListPortfoliosResponse' 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', 'listPortfoliosResponse_nextPageToken' - The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
--
-- 'portfolioDetails', 'listPortfoliosResponse_portfolioDetails' - Information about the portfolios.
--
-- 'httpStatus', 'listPortfoliosResponse_httpStatus' - The response's http status code.
newListPortfoliosResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPortfoliosResponse
newListPortfoliosResponse :: Int -> ListPortfoliosResponse
newListPortfoliosResponse Int
pHttpStatus_ =
  ListPortfoliosResponse' :: Maybe Text
-> Maybe [PortfolioDetail] -> Int -> ListPortfoliosResponse
ListPortfoliosResponse'
    { $sel:nextPageToken:ListPortfoliosResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:portfolioDetails:ListPortfoliosResponse' :: Maybe [PortfolioDetail]
portfolioDetails = Maybe [PortfolioDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPortfoliosResponse' :: 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.
listPortfoliosResponse_nextPageToken :: Lens.Lens' ListPortfoliosResponse (Prelude.Maybe Prelude.Text)
listPortfoliosResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> ListPortfoliosResponse -> f ListPortfoliosResponse
listPortfoliosResponse_nextPageToken = (ListPortfoliosResponse -> Maybe Text)
-> (ListPortfoliosResponse -> Maybe Text -> ListPortfoliosResponse)
-> Lens' ListPortfoliosResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPortfoliosResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:ListPortfoliosResponse' :: ListPortfoliosResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: ListPortfoliosResponse
s@ListPortfoliosResponse' {} Maybe Text
a -> ListPortfoliosResponse
s {$sel:nextPageToken:ListPortfoliosResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: ListPortfoliosResponse)

-- | Information about the portfolios.
listPortfoliosResponse_portfolioDetails :: Lens.Lens' ListPortfoliosResponse (Prelude.Maybe [PortfolioDetail])
listPortfoliosResponse_portfolioDetails :: (Maybe [PortfolioDetail] -> f (Maybe [PortfolioDetail]))
-> ListPortfoliosResponse -> f ListPortfoliosResponse
listPortfoliosResponse_portfolioDetails = (ListPortfoliosResponse -> Maybe [PortfolioDetail])
-> (ListPortfoliosResponse
    -> Maybe [PortfolioDetail] -> ListPortfoliosResponse)
-> Lens' ListPortfoliosResponse (Maybe [PortfolioDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPortfoliosResponse' {Maybe [PortfolioDetail]
portfolioDetails :: Maybe [PortfolioDetail]
$sel:portfolioDetails:ListPortfoliosResponse' :: ListPortfoliosResponse -> Maybe [PortfolioDetail]
portfolioDetails} -> Maybe [PortfolioDetail]
portfolioDetails) (\s :: ListPortfoliosResponse
s@ListPortfoliosResponse' {} Maybe [PortfolioDetail]
a -> ListPortfoliosResponse
s {$sel:portfolioDetails:ListPortfoliosResponse' :: Maybe [PortfolioDetail]
portfolioDetails = Maybe [PortfolioDetail]
a} :: ListPortfoliosResponse) ((Maybe [PortfolioDetail] -> f (Maybe [PortfolioDetail]))
 -> ListPortfoliosResponse -> f ListPortfoliosResponse)
-> ((Maybe [PortfolioDetail] -> f (Maybe [PortfolioDetail]))
    -> Maybe [PortfolioDetail] -> f (Maybe [PortfolioDetail]))
-> (Maybe [PortfolioDetail] -> f (Maybe [PortfolioDetail]))
-> ListPortfoliosResponse
-> f ListPortfoliosResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PortfolioDetail]
  [PortfolioDetail]
  [PortfolioDetail]
  [PortfolioDetail]
-> Iso
     (Maybe [PortfolioDetail])
     (Maybe [PortfolioDetail])
     (Maybe [PortfolioDetail])
     (Maybe [PortfolioDetail])
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
  [PortfolioDetail]
  [PortfolioDetail]
  [PortfolioDetail]
  [PortfolioDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListPortfoliosResponse