{-# 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.ListProvisionedProductPlans
-- 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 plans for the specified provisioned product or all plans to
-- which the user has access.
--
-- This operation returns paginated results.
module Amazonka.ServiceCatalog.ListProvisionedProductPlans
  ( -- * Creating a Request
    ListProvisionedProductPlans (..),
    newListProvisionedProductPlans,

    -- * Request Lenses
    listProvisionedProductPlans_acceptLanguage,
    listProvisionedProductPlans_accessLevelFilter,
    listProvisionedProductPlans_pageSize,
    listProvisionedProductPlans_pageToken,
    listProvisionedProductPlans_provisionProductId,

    -- * Destructuring the Response
    ListProvisionedProductPlansResponse (..),
    newListProvisionedProductPlansResponse,

    -- * Response Lenses
    listProvisionedProductPlansResponse_nextPageToken,
    listProvisionedProductPlansResponse_provisionedProductPlans,
    listProvisionedProductPlansResponse_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:/ 'newListProvisionedProductPlans' smart constructor.
data ListProvisionedProductPlans = ListProvisionedProductPlans'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    ListProvisionedProductPlans -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The access level to use to obtain results. The default is @User@.
    ListProvisionedProductPlans -> Maybe AccessLevelFilter
accessLevelFilter :: Prelude.Maybe AccessLevelFilter,
    -- | The maximum number of items to return with this call.
    ListProvisionedProductPlans -> 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.
    ListProvisionedProductPlans -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | The product identifier.
    ListProvisionedProductPlans -> Maybe Text
provisionProductId :: Prelude.Maybe Prelude.Text
  }
  deriving (ListProvisionedProductPlans -> ListProvisionedProductPlans -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProvisionedProductPlans -> ListProvisionedProductPlans -> Bool
$c/= :: ListProvisionedProductPlans -> ListProvisionedProductPlans -> Bool
== :: ListProvisionedProductPlans -> ListProvisionedProductPlans -> Bool
$c== :: ListProvisionedProductPlans -> ListProvisionedProductPlans -> Bool
Prelude.Eq, ReadPrec [ListProvisionedProductPlans]
ReadPrec ListProvisionedProductPlans
Int -> ReadS ListProvisionedProductPlans
ReadS [ListProvisionedProductPlans]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProvisionedProductPlans]
$creadListPrec :: ReadPrec [ListProvisionedProductPlans]
readPrec :: ReadPrec ListProvisionedProductPlans
$creadPrec :: ReadPrec ListProvisionedProductPlans
readList :: ReadS [ListProvisionedProductPlans]
$creadList :: ReadS [ListProvisionedProductPlans]
readsPrec :: Int -> ReadS ListProvisionedProductPlans
$creadsPrec :: Int -> ReadS ListProvisionedProductPlans
Prelude.Read, Int -> ListProvisionedProductPlans -> ShowS
[ListProvisionedProductPlans] -> ShowS
ListProvisionedProductPlans -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProvisionedProductPlans] -> ShowS
$cshowList :: [ListProvisionedProductPlans] -> ShowS
show :: ListProvisionedProductPlans -> String
$cshow :: ListProvisionedProductPlans -> String
showsPrec :: Int -> ListProvisionedProductPlans -> ShowS
$cshowsPrec :: Int -> ListProvisionedProductPlans -> ShowS
Prelude.Show, forall x.
Rep ListProvisionedProductPlans x -> ListProvisionedProductPlans
forall x.
ListProvisionedProductPlans -> Rep ListProvisionedProductPlans x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProvisionedProductPlans x -> ListProvisionedProductPlans
$cfrom :: forall x.
ListProvisionedProductPlans -> Rep ListProvisionedProductPlans x
Prelude.Generic)

-- |
-- Create a value of 'ListProvisionedProductPlans' 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', 'listProvisionedProductPlans_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'accessLevelFilter', 'listProvisionedProductPlans_accessLevelFilter' - The access level to use to obtain results. The default is @User@.
--
-- 'pageSize', 'listProvisionedProductPlans_pageSize' - The maximum number of items to return with this call.
--
-- 'pageToken', 'listProvisionedProductPlans_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- 'provisionProductId', 'listProvisionedProductPlans_provisionProductId' - The product identifier.
newListProvisionedProductPlans ::
  ListProvisionedProductPlans
newListProvisionedProductPlans :: ListProvisionedProductPlans
newListProvisionedProductPlans =
  ListProvisionedProductPlans'
    { $sel:acceptLanguage:ListProvisionedProductPlans' :: Maybe Text
acceptLanguage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:accessLevelFilter:ListProvisionedProductPlans' :: Maybe AccessLevelFilter
accessLevelFilter = forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListProvisionedProductPlans' :: Maybe Natural
pageSize = forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:ListProvisionedProductPlans' :: Maybe Text
pageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:provisionProductId:ListProvisionedProductPlans' :: Maybe Text
provisionProductId = forall a. Maybe a
Prelude.Nothing
    }

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

-- | The access level to use to obtain results. The default is @User@.
listProvisionedProductPlans_accessLevelFilter :: Lens.Lens' ListProvisionedProductPlans (Prelude.Maybe AccessLevelFilter)
listProvisionedProductPlans_accessLevelFilter :: Lens' ListProvisionedProductPlans (Maybe AccessLevelFilter)
listProvisionedProductPlans_accessLevelFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisionedProductPlans' {Maybe AccessLevelFilter
accessLevelFilter :: Maybe AccessLevelFilter
$sel:accessLevelFilter:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe AccessLevelFilter
accessLevelFilter} -> Maybe AccessLevelFilter
accessLevelFilter) (\s :: ListProvisionedProductPlans
s@ListProvisionedProductPlans' {} Maybe AccessLevelFilter
a -> ListProvisionedProductPlans
s {$sel:accessLevelFilter:ListProvisionedProductPlans' :: Maybe AccessLevelFilter
accessLevelFilter = Maybe AccessLevelFilter
a} :: ListProvisionedProductPlans)

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

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

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

instance Core.AWSPager ListProvisionedProductPlans where
  page :: ListProvisionedProductPlans
-> AWSResponse ListProvisionedProductPlans
-> Maybe ListProvisionedProductPlans
page ListProvisionedProductPlans
rq AWSResponse ListProvisionedProductPlans
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListProvisionedProductPlans
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListProvisionedProductPlansResponse (Maybe Text)
listProvisionedProductPlansResponse_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 ListProvisionedProductPlans
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  ListProvisionedProductPlansResponse
  (Maybe [ProvisionedProductPlanSummary])
listProvisionedProductPlansResponse_provisionedProductPlans
            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.$ ListProvisionedProductPlans
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListProvisionedProductPlans (Maybe Text)
listProvisionedProductPlans_pageToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListProvisionedProductPlans
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListProvisionedProductPlansResponse (Maybe Text)
listProvisionedProductPlansResponse_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 ListProvisionedProductPlans where
  type
    AWSResponse ListProvisionedProductPlans =
      ListProvisionedProductPlansResponse
  request :: (Service -> Service)
-> ListProvisionedProductPlans
-> Request ListProvisionedProductPlans
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 ListProvisionedProductPlans
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListProvisionedProductPlans)))
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 [ProvisionedProductPlanSummary]
-> Int
-> ListProvisionedProductPlansResponse
ListProvisionedProductPlansResponse'
            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
"ProvisionedProductPlans"
                            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 ListProvisionedProductPlans where
  hashWithSalt :: Int -> ListProvisionedProductPlans -> Int
hashWithSalt Int
_salt ListProvisionedProductPlans' {Maybe Natural
Maybe Text
Maybe AccessLevelFilter
provisionProductId :: Maybe Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
accessLevelFilter :: Maybe AccessLevelFilter
acceptLanguage :: Maybe Text
$sel:provisionProductId:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe Text
$sel:pageToken:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe Text
$sel:pageSize:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe Natural
$sel:accessLevelFilter:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe AccessLevelFilter
$sel:acceptLanguage:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> 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 AccessLevelFilter
accessLevelFilter
      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
provisionProductId

instance Prelude.NFData ListProvisionedProductPlans where
  rnf :: ListProvisionedProductPlans -> ()
rnf ListProvisionedProductPlans' {Maybe Natural
Maybe Text
Maybe AccessLevelFilter
provisionProductId :: Maybe Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
accessLevelFilter :: Maybe AccessLevelFilter
acceptLanguage :: Maybe Text
$sel:provisionProductId:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe Text
$sel:pageToken:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe Text
$sel:pageSize:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe Natural
$sel:accessLevelFilter:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe AccessLevelFilter
$sel:acceptLanguage:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> 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 AccessLevelFilter
accessLevelFilter
      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
provisionProductId

instance Data.ToHeaders ListProvisionedProductPlans where
  toHeaders :: ListProvisionedProductPlans -> 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.ListProvisionedProductPlans" ::
                          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 ListProvisionedProductPlans where
  toJSON :: ListProvisionedProductPlans -> Value
toJSON ListProvisionedProductPlans' {Maybe Natural
Maybe Text
Maybe AccessLevelFilter
provisionProductId :: Maybe Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
accessLevelFilter :: Maybe AccessLevelFilter
acceptLanguage :: Maybe Text
$sel:provisionProductId:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe Text
$sel:pageToken:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe Text
$sel:pageSize:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe Natural
$sel:accessLevelFilter:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> Maybe AccessLevelFilter
$sel:acceptLanguage:ListProvisionedProductPlans' :: ListProvisionedProductPlans -> 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
"AccessLevelFilter" 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 AccessLevelFilter
accessLevelFilter,
            (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
"ProvisionProductId" 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
provisionProductId
          ]
      )

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

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

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

-- |
-- Create a value of 'ListProvisionedProductPlansResponse' 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', 'listProvisionedProductPlansResponse_nextPageToken' - The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
--
-- 'provisionedProductPlans', 'listProvisionedProductPlansResponse_provisionedProductPlans' - Information about the plans.
--
-- 'httpStatus', 'listProvisionedProductPlansResponse_httpStatus' - The response's http status code.
newListProvisionedProductPlansResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListProvisionedProductPlansResponse
newListProvisionedProductPlansResponse :: Int -> ListProvisionedProductPlansResponse
newListProvisionedProductPlansResponse Int
pHttpStatus_ =
  ListProvisionedProductPlansResponse'
    { $sel:nextPageToken:ListProvisionedProductPlansResponse' :: Maybe Text
nextPageToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedProductPlans:ListProvisionedProductPlansResponse' :: Maybe [ProvisionedProductPlanSummary]
provisionedProductPlans =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListProvisionedProductPlansResponse' :: 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.
listProvisionedProductPlansResponse_nextPageToken :: Lens.Lens' ListProvisionedProductPlansResponse (Prelude.Maybe Prelude.Text)
listProvisionedProductPlansResponse_nextPageToken :: Lens' ListProvisionedProductPlansResponse (Maybe Text)
listProvisionedProductPlansResponse_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisionedProductPlansResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:ListProvisionedProductPlansResponse' :: ListProvisionedProductPlansResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: ListProvisionedProductPlansResponse
s@ListProvisionedProductPlansResponse' {} Maybe Text
a -> ListProvisionedProductPlansResponse
s {$sel:nextPageToken:ListProvisionedProductPlansResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: ListProvisionedProductPlansResponse)

-- | Information about the plans.
listProvisionedProductPlansResponse_provisionedProductPlans :: Lens.Lens' ListProvisionedProductPlansResponse (Prelude.Maybe [ProvisionedProductPlanSummary])
listProvisionedProductPlansResponse_provisionedProductPlans :: Lens'
  ListProvisionedProductPlansResponse
  (Maybe [ProvisionedProductPlanSummary])
listProvisionedProductPlansResponse_provisionedProductPlans = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisionedProductPlansResponse' {Maybe [ProvisionedProductPlanSummary]
provisionedProductPlans :: Maybe [ProvisionedProductPlanSummary]
$sel:provisionedProductPlans:ListProvisionedProductPlansResponse' :: ListProvisionedProductPlansResponse
-> Maybe [ProvisionedProductPlanSummary]
provisionedProductPlans} -> Maybe [ProvisionedProductPlanSummary]
provisionedProductPlans) (\s :: ListProvisionedProductPlansResponse
s@ListProvisionedProductPlansResponse' {} Maybe [ProvisionedProductPlanSummary]
a -> ListProvisionedProductPlansResponse
s {$sel:provisionedProductPlans:ListProvisionedProductPlansResponse' :: Maybe [ProvisionedProductPlanSummary]
provisionedProductPlans = Maybe [ProvisionedProductPlanSummary]
a} :: ListProvisionedProductPlansResponse) 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.
listProvisionedProductPlansResponse_httpStatus :: Lens.Lens' ListProvisionedProductPlansResponse Prelude.Int
listProvisionedProductPlansResponse_httpStatus :: Lens' ListProvisionedProductPlansResponse Int
listProvisionedProductPlansResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProvisionedProductPlansResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListProvisionedProductPlansResponse' :: ListProvisionedProductPlansResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListProvisionedProductPlansResponse
s@ListProvisionedProductPlansResponse' {} Int
a -> ListProvisionedProductPlansResponse
s {$sel:httpStatus:ListProvisionedProductPlansResponse' :: Int
httpStatus = Int
a} :: ListProvisionedProductPlansResponse)

instance
  Prelude.NFData
    ListProvisionedProductPlansResponse
  where
  rnf :: ListProvisionedProductPlansResponse -> ()
rnf ListProvisionedProductPlansResponse' {Int
Maybe [ProvisionedProductPlanSummary]
Maybe Text
httpStatus :: Int
provisionedProductPlans :: Maybe [ProvisionedProductPlanSummary]
nextPageToken :: Maybe Text
$sel:httpStatus:ListProvisionedProductPlansResponse' :: ListProvisionedProductPlansResponse -> Int
$sel:provisionedProductPlans:ListProvisionedProductPlansResponse' :: ListProvisionedProductPlansResponse
-> Maybe [ProvisionedProductPlanSummary]
$sel:nextPageToken:ListProvisionedProductPlansResponse' :: ListProvisionedProductPlansResponse -> 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 [ProvisionedProductPlanSummary]
provisionedProductPlans
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus