{-# 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.ListConstraintsForPortfolio
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the constraints for the specified portfolio and product.
--
-- This operation returns paginated results.
module Amazonka.ServiceCatalog.ListConstraintsForPortfolio
  ( -- * Creating a Request
    ListConstraintsForPortfolio (..),
    newListConstraintsForPortfolio,

    -- * Request Lenses
    listConstraintsForPortfolio_acceptLanguage,
    listConstraintsForPortfolio_pageSize,
    listConstraintsForPortfolio_pageToken,
    listConstraintsForPortfolio_productId,
    listConstraintsForPortfolio_portfolioId,

    -- * Destructuring the Response
    ListConstraintsForPortfolioResponse (..),
    newListConstraintsForPortfolioResponse,

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

-- |
-- Create a value of 'ListConstraintsForPortfolio' 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', 'listConstraintsForPortfolio_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'pageSize', 'listConstraintsForPortfolio_pageSize' - The maximum number of items to return with this call.
--
-- 'pageToken', 'listConstraintsForPortfolio_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- 'productId', 'listConstraintsForPortfolio_productId' - The product identifier.
--
-- 'portfolioId', 'listConstraintsForPortfolio_portfolioId' - The portfolio identifier.
newListConstraintsForPortfolio ::
  -- | 'portfolioId'
  Prelude.Text ->
  ListConstraintsForPortfolio
newListConstraintsForPortfolio :: Text -> ListConstraintsForPortfolio
newListConstraintsForPortfolio Text
pPortfolioId_ =
  ListConstraintsForPortfolio'
    { $sel:acceptLanguage:ListConstraintsForPortfolio' :: Maybe Text
acceptLanguage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListConstraintsForPortfolio' :: Maybe Natural
pageSize = forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:ListConstraintsForPortfolio' :: Maybe Text
pageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:productId:ListConstraintsForPortfolio' :: Maybe Text
productId = forall a. Maybe a
Prelude.Nothing,
      $sel:portfolioId:ListConstraintsForPortfolio' :: Text
portfolioId = Text
pPortfolioId_
    }

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

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

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

-- | The product identifier.
listConstraintsForPortfolio_productId :: Lens.Lens' ListConstraintsForPortfolio (Prelude.Maybe Prelude.Text)
listConstraintsForPortfolio_productId :: Lens' ListConstraintsForPortfolio (Maybe Text)
listConstraintsForPortfolio_productId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConstraintsForPortfolio' {Maybe Text
productId :: Maybe Text
$sel:productId:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Maybe Text
productId} -> Maybe Text
productId) (\s :: ListConstraintsForPortfolio
s@ListConstraintsForPortfolio' {} Maybe Text
a -> ListConstraintsForPortfolio
s {$sel:productId:ListConstraintsForPortfolio' :: Maybe Text
productId = Maybe Text
a} :: ListConstraintsForPortfolio)

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

instance Core.AWSPager ListConstraintsForPortfolio where
  page :: ListConstraintsForPortfolio
-> AWSResponse ListConstraintsForPortfolio
-> Maybe ListConstraintsForPortfolio
page ListConstraintsForPortfolio
rq AWSResponse ListConstraintsForPortfolio
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListConstraintsForPortfolio
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListConstraintsForPortfolioResponse (Maybe Text)
listConstraintsForPortfolioResponse_nextPageToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListConstraintsForPortfolio
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListConstraintsForPortfolioResponse (Maybe [ConstraintDetail])
listConstraintsForPortfolioResponse_constraintDetails
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListConstraintsForPortfolio
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListConstraintsForPortfolio (Maybe Text)
listConstraintsForPortfolio_pageToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListConstraintsForPortfolio
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListConstraintsForPortfolioResponse (Maybe Text)
listConstraintsForPortfolioResponse_nextPageToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListConstraintsForPortfolio where
  type
    AWSResponse ListConstraintsForPortfolio =
      ListConstraintsForPortfolioResponse
  request :: (Service -> Service)
-> ListConstraintsForPortfolio
-> Request ListConstraintsForPortfolio
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 ListConstraintsForPortfolio
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListConstraintsForPortfolio)))
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 [ConstraintDetail]
-> Maybe Text -> Int -> ListConstraintsForPortfolioResponse
ListConstraintsForPortfolioResponse'
            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
"ConstraintDetails"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextPageToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListConstraintsForPortfolio where
  hashWithSalt :: Int -> ListConstraintsForPortfolio -> Int
hashWithSalt Int
_salt ListConstraintsForPortfolio' {Maybe Natural
Maybe Text
Text
portfolioId :: Text
productId :: Maybe Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
acceptLanguage :: Maybe Text
$sel:portfolioId:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Text
$sel:productId:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Maybe Text
$sel:pageToken:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Maybe Text
$sel:pageSize:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Maybe Natural
$sel:acceptLanguage:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
acceptLanguage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pageSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pageToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
productId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
portfolioId

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

instance Data.ToHeaders ListConstraintsForPortfolio where
  toHeaders :: ListConstraintsForPortfolio -> 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.ListConstraintsForPortfolio" ::
                          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 ListConstraintsForPortfolio where
  toJSON :: ListConstraintsForPortfolio -> Value
toJSON ListConstraintsForPortfolio' {Maybe Natural
Maybe Text
Text
portfolioId :: Text
productId :: Maybe Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
acceptLanguage :: Maybe Text
$sel:portfolioId:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Text
$sel:productId:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Maybe Text
$sel:pageToken:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Maybe Text
$sel:pageSize:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Maybe Natural
$sel:acceptLanguage:ListConstraintsForPortfolio' :: ListConstraintsForPortfolio -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AcceptLanguage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
acceptLanguage,
            (Key
"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,
            (Key
"ProductId" 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
productId,
            forall a. a -> Maybe a
Prelude.Just (Key
"PortfolioId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
portfolioId)
          ]
      )

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

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

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

-- |
-- Create a value of 'ListConstraintsForPortfolioResponse' 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:
--
-- 'constraintDetails', 'listConstraintsForPortfolioResponse_constraintDetails' - Information about the constraints.
--
-- 'nextPageToken', 'listConstraintsForPortfolioResponse_nextPageToken' - The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
--
-- 'httpStatus', 'listConstraintsForPortfolioResponse_httpStatus' - The response's http status code.
newListConstraintsForPortfolioResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListConstraintsForPortfolioResponse
newListConstraintsForPortfolioResponse :: Int -> ListConstraintsForPortfolioResponse
newListConstraintsForPortfolioResponse Int
pHttpStatus_ =
  ListConstraintsForPortfolioResponse'
    { $sel:constraintDetails:ListConstraintsForPortfolioResponse' :: Maybe [ConstraintDetail]
constraintDetails =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextPageToken:ListConstraintsForPortfolioResponse' :: Maybe Text
nextPageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListConstraintsForPortfolioResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the constraints.
listConstraintsForPortfolioResponse_constraintDetails :: Lens.Lens' ListConstraintsForPortfolioResponse (Prelude.Maybe [ConstraintDetail])
listConstraintsForPortfolioResponse_constraintDetails :: Lens'
  ListConstraintsForPortfolioResponse (Maybe [ConstraintDetail])
listConstraintsForPortfolioResponse_constraintDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListConstraintsForPortfolioResponse' {Maybe [ConstraintDetail]
constraintDetails :: Maybe [ConstraintDetail]
$sel:constraintDetails:ListConstraintsForPortfolioResponse' :: ListConstraintsForPortfolioResponse -> Maybe [ConstraintDetail]
constraintDetails} -> Maybe [ConstraintDetail]
constraintDetails) (\s :: ListConstraintsForPortfolioResponse
s@ListConstraintsForPortfolioResponse' {} Maybe [ConstraintDetail]
a -> ListConstraintsForPortfolioResponse
s {$sel:constraintDetails:ListConstraintsForPortfolioResponse' :: Maybe [ConstraintDetail]
constraintDetails = Maybe [ConstraintDetail]
a} :: ListConstraintsForPortfolioResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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