{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_pageSize,
    describePortfolioShares_pageToken,
    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.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:/ 'newDescribePortfolioShares' smart constructor.
data DescribePortfolioShares = DescribePortfolioShares'
  { -- | The maximum number of items to return with this call.
    DescribePortfolioShares -> 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.
    DescribePortfolioShares -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | 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
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]
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
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. 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:
--
-- 'pageSize', 'describePortfolioShares_pageSize' - The maximum number of items to return with this call.
--
-- 'pageToken', 'describePortfolioShares_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- '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'
    { $sel:pageSize:DescribePortfolioShares' :: Maybe Natural
pageSize =
        forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:DescribePortfolioShares' :: Maybe Text
pageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:portfolioId:DescribePortfolioShares' :: Text
portfolioId = Text
pPortfolioId_,
      $sel:type':DescribePortfolioShares' :: DescribePortfolioShareType
type' = DescribePortfolioShareType
pType_
    }

-- | The maximum number of items to return with this call.
describePortfolioShares_pageSize :: Lens.Lens' DescribePortfolioShares (Prelude.Maybe Prelude.Natural)
describePortfolioShares_pageSize :: Lens' DescribePortfolioShares (Maybe Natural)
describePortfolioShares_pageSize = 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 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 :: Lens' DescribePortfolioShares (Maybe Text)
describePortfolioShares_pageToken = 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 unique identifier of the portfolio for which shares will be
-- retrieved.
describePortfolioShares_portfolioId :: Lens.Lens' DescribePortfolioShares Prelude.Text
describePortfolioShares_portfolioId :: Lens' DescribePortfolioShares Text
describePortfolioShares_portfolioId = 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 :: Lens' DescribePortfolioShares DescribePortfolioShareType
describePortfolioShares_type = 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 :: (Service -> Service)
-> DescribePortfolioShares -> Request DescribePortfolioShares
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 DescribePortfolioShares
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribePortfolioShares)))
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 [PortfolioShareDetail]
-> Int
-> DescribePortfolioSharesResponse
DescribePortfolioSharesResponse'
            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
"NextPageToken")
            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
"PortfolioShareDetails"
                            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribePortfolioShares where
  hashWithSalt :: Int -> DescribePortfolioShares -> Int
hashWithSalt Int
_salt DescribePortfolioShares' {Maybe Natural
Maybe Text
Text
DescribePortfolioShareType
type' :: DescribePortfolioShareType
portfolioId :: Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
$sel:type':DescribePortfolioShares' :: DescribePortfolioShares -> DescribePortfolioShareType
$sel:portfolioId:DescribePortfolioShares' :: DescribePortfolioShares -> Text
$sel:pageToken:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Text
$sel:pageSize:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Natural
..} =
    Int
_salt
      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
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DescribePortfolioShareType
type'

instance Prelude.NFData DescribePortfolioShares where
  rnf :: DescribePortfolioShares -> ()
rnf DescribePortfolioShares' {Maybe Natural
Maybe Text
Text
DescribePortfolioShareType
type' :: DescribePortfolioShareType
portfolioId :: Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
$sel:type':DescribePortfolioShares' :: DescribePortfolioShares -> DescribePortfolioShareType
$sel:portfolioId:DescribePortfolioShares' :: DescribePortfolioShares -> Text
$sel:pageToken:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Text
$sel:pageSize:DescribePortfolioShares' :: DescribePortfolioShares -> Maybe Natural
..} =
    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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DescribePortfolioShareType
type'

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

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

instance Data.ToQuery DescribePortfolioShares where
  toQuery :: DescribePortfolioShares -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
    { $sel:nextPageToken:DescribePortfolioSharesResponse' :: Maybe Text
nextPageToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:portfolioShareDetails:DescribePortfolioSharesResponse' :: Maybe [PortfolioShareDetail]
portfolioShareDetails = 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 :: Lens' DescribePortfolioSharesResponse (Maybe Text)
describePortfolioSharesResponse_nextPageToken = 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 :: Lens'
  DescribePortfolioSharesResponse (Maybe [PortfolioShareDetail])
describePortfolioSharesResponse_portfolioShareDetails = 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) 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 response's http status code.
describePortfolioSharesResponse_httpStatus :: Lens.Lens' DescribePortfolioSharesResponse Prelude.Int
describePortfolioSharesResponse_httpStatus :: Lens' DescribePortfolioSharesResponse Int
describePortfolioSharesResponse_httpStatus = 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
  where
  rnf :: DescribePortfolioSharesResponse -> ()
rnf DescribePortfolioSharesResponse' {Int
Maybe [PortfolioShareDetail]
Maybe Text
httpStatus :: Int
portfolioShareDetails :: Maybe [PortfolioShareDetail]
nextPageToken :: Maybe Text
$sel:httpStatus:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Int
$sel:portfolioShareDetails:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Maybe [PortfolioShareDetail]
$sel:nextPageToken:DescribePortfolioSharesResponse' :: DescribePortfolioSharesResponse -> Maybe Text
..} =
    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 Maybe [PortfolioShareDetail]
portfolioShareDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus