{-# 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.DescribePortfolioShares
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a summary of each of the portfolio shares that were created for
-- the specified portfolio.
--
-- You can use this API to determine which accounts or organizational nodes
-- this portfolio have been shared, whether the recipient entity has
-- imported the share, and whether TagOptions are included with the share.
--
-- The @PortfolioId@ and @Type@ parameters are both required.
module Amazonka.ServiceCatalog.DescribePortfolioShares
  ( -- * Creating a Request
    DescribePortfolioShares (..),
    newDescribePortfolioShares,

    -- * Request Lenses
    describePortfolioShares_pageToken,
    describePortfolioShares_pageSize,
    describePortfolioShares_portfolioId,
    describePortfolioShares_type,

    -- * Destructuring the Response
    DescribePortfolioSharesResponse (..),
    newDescribePortfolioSharesResponse,

    -- * Response Lenses
    describePortfolioSharesResponse_nextPageToken,
    describePortfolioSharesResponse_portfolioShareDetails,
    describePortfolioSharesResponse_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:/ 'newDescribePortfolioShares' smart constructor.
data DescribePortfolioShares = DescribePortfolioShares'
  { -- | The page token for the next set of results. To retrieve the first set of
    -- results, use null.
    DescribePortfolioShares -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return with this call.
    DescribePortfolioShares -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
    -- | The unique identifier of the portfolio for which shares will be
    -- retrieved.
    DescribePortfolioShares -> Text
portfolioId :: Prelude.Text,
    -- | The type of portfolio share to summarize. This field acts as a filter on
    -- the type of portfolio share, which can be one of the following:
    --
    -- 1. @ACCOUNT@ - Represents an external account to account share.
    --
    -- 2. @ORGANIZATION@ - Represents a share to an organization. This share is
    -- available to every account in the organization.
    --
    -- 3. @ORGANIZATIONAL_UNIT@ - Represents a share to an organizational unit.
    --
    -- 4. @ORGANIZATION_MEMBER_ACCOUNT@ - Represents a share to an account in
    -- the organization.
    DescribePortfolioShares -> DescribePortfolioShareType
type' :: DescribePortfolioShareType
  }
  deriving (DescribePortfolioShares -> DescribePortfolioShares -> Bool
(DescribePortfolioShares -> DescribePortfolioShares -> Bool)
-> (DescribePortfolioShares -> DescribePortfolioShares -> Bool)
-> Eq DescribePortfolioShares
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribePortfolioShares -> DescribePortfolioShares -> Bool
$c/= :: DescribePortfolioShares -> DescribePortfolioShares -> Bool
== :: DescribePortfolioShares -> DescribePortfolioShares -> Bool
$c== :: DescribePortfolioShares -> DescribePortfolioShares -> Bool
Prelude.Eq, ReadPrec [DescribePortfolioShares]
ReadPrec DescribePortfolioShares
Int -> ReadS DescribePortfolioShares
ReadS [DescribePortfolioShares]
(Int -> ReadS DescribePortfolioShares)
-> ReadS [DescribePortfolioShares]
-> ReadPrec DescribePortfolioShares
-> ReadPrec [DescribePortfolioShares]
-> Read DescribePortfolioShares
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribePortfolioShares]
$creadListPrec :: ReadPrec [DescribePortfolioShares]
readPrec :: ReadPrec DescribePortfolioShares
$creadPrec :: ReadPrec DescribePortfolioShares
readList :: ReadS [DescribePortfolioShares]
$creadList :: ReadS [DescribePortfolioShares]
readsPrec :: Int -> ReadS DescribePortfolioShares
$creadsPrec :: Int -> ReadS DescribePortfolioShares
Prelude.Read, Int -> DescribePortfolioShares -> ShowS
[DescribePortfolioShares] -> ShowS
DescribePortfolioShares -> String
(Int -> DescribePortfolioShares -> ShowS)
-> (DescribePortfolioShares -> String)
-> ([DescribePortfolioShares] -> ShowS)
-> Show DescribePortfolioShares
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribePortfolioShares] -> ShowS
$cshowList :: [DescribePortfolioShares] -> ShowS
show :: DescribePortfolioShares -> String
$cshow :: DescribePortfolioShares -> String
showsPrec :: Int -> DescribePortfolioShares -> ShowS
$cshowsPrec :: Int -> DescribePortfolioShares -> ShowS
Prelude.Show, (forall x.
 DescribePortfolioShares -> Rep DescribePortfolioShares x)
-> (forall x.
    Rep DescribePortfolioShares x -> DescribePortfolioShares)
-> Generic DescribePortfolioShares
forall x. Rep DescribePortfolioShares x -> DescribePortfolioShares
forall x. DescribePortfolioShares -> Rep DescribePortfolioShares x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribePortfolioShares x -> DescribePortfolioShares
$cfrom :: forall x. DescribePortfolioShares -> Rep DescribePortfolioShares x
Prelude.Generic)

-- |
-- Create a value of 'DescribePortfolioShares' 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:
--
-- 'pageToken', 'describePortfolioShares_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- 'pageSize', 'describePortfolioShares_pageSize' - The maximum number of items to return with this call.
--
-- 'portfolioId', 'describePortfolioShares_portfolioId' - The unique identifier of the portfolio for which shares will be
-- retrieved.
--
-- 'type'', 'describePortfolioShares_type' - The type of portfolio share to summarize. This field acts as a filter on
-- the type of portfolio share, which can be one of the following:
--
-- 1. @ACCOUNT@ - Represents an external account to account share.
--
-- 2. @ORGANIZATION@ - Represents a share to an organization. This share is
-- available to every account in the organization.
--
-- 3. @ORGANIZATIONAL_UNIT@ - Represents a share to an organizational unit.
--
-- 4. @ORGANIZATION_MEMBER_ACCOUNT@ - Represents a share to an account in
-- the organization.
newDescribePortfolioShares ::
  -- | 'portfolioId'
  Prelude.Text ->
  -- | 'type''
  DescribePortfolioShareType ->
  DescribePortfolioShares
newDescribePortfolioShares :: Text -> DescribePortfolioShareType -> DescribePortfolioShares
newDescribePortfolioShares Text
pPortfolioId_ DescribePortfolioShareType
pType_ =
  DescribePortfolioShares' :: Maybe Text
-> Maybe Natural
-> Text
-> DescribePortfolioShareType
-> DescribePortfolioShares
DescribePortfolioShares'
    { $sel:pageToken:DescribePortfolioShares' :: Maybe Text
pageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:DescribePortfolioShares' :: Maybe Natural
pageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:portfolioId:DescribePortfolioShares' :: Text
portfolioId = Text
pPortfolioId_,
      $sel:type':DescribePortfolioShares' :: DescribePortfolioShareType
type' = DescribePortfolioShareType
pType_
    }

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

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

-- | The unique identifier of the portfolio for which shares will be
-- retrieved.
describePortfolioShares_portfolioId :: Lens.Lens' DescribePortfolioShares Prelude.Text
describePortfolioShares_portfolioId :: (Text -> f Text)
-> DescribePortfolioShares -> f DescribePortfolioShares
describePortfolioShares_portfolioId = (DescribePortfolioShares -> Text)
-> (DescribePortfolioShares -> Text -> DescribePortfolioShares)
-> Lens DescribePortfolioShares DescribePortfolioShares Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioShares' {Text
portfolioId :: Text
$sel:portfolioId:DescribePortfolioShares' :: DescribePortfolioShares -> Text
portfolioId} -> Text
portfolioId) (\s :: DescribePortfolioShares
s@DescribePortfolioShares' {} Text
a -> DescribePortfolioShares
s {$sel:portfolioId:DescribePortfolioShares' :: Text
portfolioId = Text
a} :: DescribePortfolioShares)

-- | The type of portfolio share to summarize. This field acts as a filter on
-- the type of portfolio share, which can be one of the following:
--
-- 1. @ACCOUNT@ - Represents an external account to account share.
--
-- 2. @ORGANIZATION@ - Represents a share to an organization. This share is
-- available to every account in the organization.
--
-- 3. @ORGANIZATIONAL_UNIT@ - Represents a share to an organizational unit.
--
-- 4. @ORGANIZATION_MEMBER_ACCOUNT@ - Represents a share to an account in
-- the organization.
describePortfolioShares_type :: Lens.Lens' DescribePortfolioShares DescribePortfolioShareType
describePortfolioShares_type :: (DescribePortfolioShareType -> f DescribePortfolioShareType)
-> DescribePortfolioShares -> f DescribePortfolioShares
describePortfolioShares_type = (DescribePortfolioShares -> DescribePortfolioShareType)
-> (DescribePortfolioShares
    -> DescribePortfolioShareType -> DescribePortfolioShares)
-> Lens
     DescribePortfolioShares
     DescribePortfolioShares
     DescribePortfolioShareType
     DescribePortfolioShareType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioShares' {DescribePortfolioShareType
type' :: DescribePortfolioShareType
$sel:type':DescribePortfolioShares' :: DescribePortfolioShares -> DescribePortfolioShareType
type'} -> DescribePortfolioShareType
type') (\s :: DescribePortfolioShares
s@DescribePortfolioShares' {} DescribePortfolioShareType
a -> DescribePortfolioShares
s {$sel:type':DescribePortfolioShares' :: DescribePortfolioShareType
type' = DescribePortfolioShareType
a} :: DescribePortfolioShares)

instance Core.AWSRequest DescribePortfolioShares where
  type
    AWSResponse DescribePortfolioShares =
      DescribePortfolioSharesResponse
  request :: DescribePortfolioShares -> Request DescribePortfolioShares
request = Service
-> DescribePortfolioShares -> Request DescribePortfolioShares
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribePortfolioShares
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribePortfolioShares)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribePortfolioShares))
-> Logger
-> Service
-> Proxy DescribePortfolioShares
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribePortfolioShares)))
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 [PortfolioShareDetail]
-> Int
-> DescribePortfolioSharesResponse
DescribePortfolioSharesResponse'
            (Maybe Text
 -> Maybe [PortfolioShareDetail]
 -> Int
 -> DescribePortfolioSharesResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [PortfolioShareDetail]
      -> Int -> DescribePortfolioSharesResponse)
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 [PortfolioShareDetail]
   -> Int -> DescribePortfolioSharesResponse)
-> Either String (Maybe [PortfolioShareDetail])
-> Either String (Int -> DescribePortfolioSharesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [PortfolioShareDetail]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PortfolioShareDetails"
                            Either String (Maybe (Maybe [PortfolioShareDetail]))
-> Maybe [PortfolioShareDetail]
-> Either String (Maybe [PortfolioShareDetail])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PortfolioShareDetail]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> DescribePortfolioSharesResponse)
-> Either String Int
-> Either String DescribePortfolioSharesResponse
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 DescribePortfolioShares

instance Prelude.NFData DescribePortfolioShares

instance Core.ToHeaders DescribePortfolioShares where
  toHeaders :: DescribePortfolioShares -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribePortfolioShares -> 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.DescribePortfolioShares" ::
                          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 DescribePortfolioShares where
  toJSON :: DescribePortfolioShares -> Value
toJSON DescribePortfolioShares' {Maybe Natural
Maybe Text
Text
DescribePortfolioShareType
type' :: DescribePortfolioShareType
portfolioId :: Text
pageSize :: Maybe Natural
pageToken :: Maybe Text
$sel:type':DescribePortfolioShares' :: DescribePortfolioShares -> DescribePortfolioShareType
$sel:portfolioId:DescribePortfolioShares' :: DescribePortfolioShares -> Text
$sel:pageSize:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Natural
$sel:pageToken:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> DescribePortfolioShareType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DescribePortfolioShareType
type')
          ]
      )

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

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

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

-- |
-- Create a value of 'DescribePortfolioSharesResponse' 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', 'describePortfolioSharesResponse_nextPageToken' - The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
--
-- 'portfolioShareDetails', 'describePortfolioSharesResponse_portfolioShareDetails' - Summaries about each of the portfolio shares.
--
-- 'httpStatus', 'describePortfolioSharesResponse_httpStatus' - The response's http status code.
newDescribePortfolioSharesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribePortfolioSharesResponse
newDescribePortfolioSharesResponse :: Int -> DescribePortfolioSharesResponse
newDescribePortfolioSharesResponse Int
pHttpStatus_ =
  DescribePortfolioSharesResponse' :: Maybe Text
-> Maybe [PortfolioShareDetail]
-> Int
-> DescribePortfolioSharesResponse
DescribePortfolioSharesResponse'
    { $sel:nextPageToken:DescribePortfolioSharesResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:portfolioShareDetails:DescribePortfolioSharesResponse' :: Maybe [PortfolioShareDetail]
portfolioShareDetails = Maybe [PortfolioShareDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribePortfolioSharesResponse' :: 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.
describePortfolioSharesResponse_nextPageToken :: Lens.Lens' DescribePortfolioSharesResponse (Prelude.Maybe Prelude.Text)
describePortfolioSharesResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> DescribePortfolioSharesResponse
-> f DescribePortfolioSharesResponse
describePortfolioSharesResponse_nextPageToken = (DescribePortfolioSharesResponse -> Maybe Text)
-> (DescribePortfolioSharesResponse
    -> Maybe Text -> DescribePortfolioSharesResponse)
-> Lens
     DescribePortfolioSharesResponse
     DescribePortfolioSharesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioSharesResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: DescribePortfolioSharesResponse
s@DescribePortfolioSharesResponse' {} Maybe Text
a -> DescribePortfolioSharesResponse
s {$sel:nextPageToken:DescribePortfolioSharesResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: DescribePortfolioSharesResponse)

-- | Summaries about each of the portfolio shares.
describePortfolioSharesResponse_portfolioShareDetails :: Lens.Lens' DescribePortfolioSharesResponse (Prelude.Maybe [PortfolioShareDetail])
describePortfolioSharesResponse_portfolioShareDetails :: (Maybe [PortfolioShareDetail] -> f (Maybe [PortfolioShareDetail]))
-> DescribePortfolioSharesResponse
-> f DescribePortfolioSharesResponse
describePortfolioSharesResponse_portfolioShareDetails = (DescribePortfolioSharesResponse -> Maybe [PortfolioShareDetail])
-> (DescribePortfolioSharesResponse
    -> Maybe [PortfolioShareDetail] -> DescribePortfolioSharesResponse)
-> Lens
     DescribePortfolioSharesResponse
     DescribePortfolioSharesResponse
     (Maybe [PortfolioShareDetail])
     (Maybe [PortfolioShareDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribePortfolioSharesResponse' {Maybe [PortfolioShareDetail]
portfolioShareDetails :: Maybe [PortfolioShareDetail]
$sel:portfolioShareDetails:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Maybe [PortfolioShareDetail]
portfolioShareDetails} -> Maybe [PortfolioShareDetail]
portfolioShareDetails) (\s :: DescribePortfolioSharesResponse
s@DescribePortfolioSharesResponse' {} Maybe [PortfolioShareDetail]
a -> DescribePortfolioSharesResponse
s {$sel:portfolioShareDetails:DescribePortfolioSharesResponse' :: Maybe [PortfolioShareDetail]
portfolioShareDetails = Maybe [PortfolioShareDetail]
a} :: DescribePortfolioSharesResponse) ((Maybe [PortfolioShareDetail] -> f (Maybe [PortfolioShareDetail]))
 -> DescribePortfolioSharesResponse
 -> f DescribePortfolioSharesResponse)
-> ((Maybe [PortfolioShareDetail]
     -> f (Maybe [PortfolioShareDetail]))
    -> Maybe [PortfolioShareDetail]
    -> f (Maybe [PortfolioShareDetail]))
-> (Maybe [PortfolioShareDetail]
    -> f (Maybe [PortfolioShareDetail]))
-> DescribePortfolioSharesResponse
-> f DescribePortfolioSharesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PortfolioShareDetail]
  [PortfolioShareDetail]
  [PortfolioShareDetail]
  [PortfolioShareDetail]
-> Iso
     (Maybe [PortfolioShareDetail])
     (Maybe [PortfolioShareDetail])
     (Maybe [PortfolioShareDetail])
     (Maybe [PortfolioShareDetail])
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
  [PortfolioShareDetail]
  [PortfolioShareDetail]
  [PortfolioShareDetail]
  [PortfolioShareDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribePortfolioSharesResponse