{-# 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.SearchProvisionedProducts
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets information about the provisioned products that meet the specified
-- criteria.
--
-- To ensure a complete list of provisioned products and remove duplicate
-- products, use @sort-by createdTime@.
--
-- Here is a CLI example: @ @
--
-- @aws servicecatalog search-provisioned-products --sort-by createdTime @
module Amazonka.ServiceCatalog.SearchProvisionedProducts
  ( -- * Creating a Request
    SearchProvisionedProducts (..),
    newSearchProvisionedProducts,

    -- * Request Lenses
    searchProvisionedProducts_acceptLanguage,
    searchProvisionedProducts_accessLevelFilter,
    searchProvisionedProducts_filters,
    searchProvisionedProducts_pageSize,
    searchProvisionedProducts_pageToken,
    searchProvisionedProducts_sortBy,
    searchProvisionedProducts_sortOrder,

    -- * Destructuring the Response
    SearchProvisionedProductsResponse (..),
    newSearchProvisionedProductsResponse,

    -- * Response Lenses
    searchProvisionedProductsResponse_nextPageToken,
    searchProvisionedProductsResponse_provisionedProducts,
    searchProvisionedProductsResponse_totalResultsCount,
    searchProvisionedProductsResponse_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:/ 'newSearchProvisionedProducts' smart constructor.
data SearchProvisionedProducts = SearchProvisionedProducts'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    SearchProvisionedProducts -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The access level to use to obtain results. The default is @User@.
    SearchProvisionedProducts -> Maybe AccessLevelFilter
accessLevelFilter :: Prelude.Maybe AccessLevelFilter,
    -- | The search filters.
    --
    -- When the key is @SearchQuery@, the searchable fields are @arn@,
    -- @createdTime@, @id@, @lastRecordId@, @idempotencyToken@, @name@,
    -- @physicalId@, @productId@, @provisioningArtifact@, @type@, @status@,
    -- @tags@, @userArn@, @userArnSession@, @lastProvisioningRecordId@,
    -- @lastSuccessfulProvisioningRecordId@, @productName@, and
    -- @provisioningArtifactName@.
    --
    -- Example: @\"SearchQuery\":[\"status:AVAILABLE\"]@
    SearchProvisionedProducts
-> Maybe (HashMap ProvisionedProductViewFilterBy [Text])
filters :: Prelude.Maybe (Prelude.HashMap ProvisionedProductViewFilterBy [Prelude.Text]),
    -- | The maximum number of items to return with this call.
    SearchProvisionedProducts -> 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.
    SearchProvisionedProducts -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | The sort field. If no value is specified, the results are not sorted.
    -- The valid values are @arn@, @id@, @name@, and @lastRecordId@.
    SearchProvisionedProducts -> Maybe Text
sortBy :: Prelude.Maybe Prelude.Text,
    -- | The sort order. If no value is specified, the results are not sorted.
    SearchProvisionedProducts -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder
  }
  deriving (SearchProvisionedProducts -> SearchProvisionedProducts -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchProvisionedProducts -> SearchProvisionedProducts -> Bool
$c/= :: SearchProvisionedProducts -> SearchProvisionedProducts -> Bool
== :: SearchProvisionedProducts -> SearchProvisionedProducts -> Bool
$c== :: SearchProvisionedProducts -> SearchProvisionedProducts -> Bool
Prelude.Eq, ReadPrec [SearchProvisionedProducts]
ReadPrec SearchProvisionedProducts
Int -> ReadS SearchProvisionedProducts
ReadS [SearchProvisionedProducts]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchProvisionedProducts]
$creadListPrec :: ReadPrec [SearchProvisionedProducts]
readPrec :: ReadPrec SearchProvisionedProducts
$creadPrec :: ReadPrec SearchProvisionedProducts
readList :: ReadS [SearchProvisionedProducts]
$creadList :: ReadS [SearchProvisionedProducts]
readsPrec :: Int -> ReadS SearchProvisionedProducts
$creadsPrec :: Int -> ReadS SearchProvisionedProducts
Prelude.Read, Int -> SearchProvisionedProducts -> ShowS
[SearchProvisionedProducts] -> ShowS
SearchProvisionedProducts -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchProvisionedProducts] -> ShowS
$cshowList :: [SearchProvisionedProducts] -> ShowS
show :: SearchProvisionedProducts -> String
$cshow :: SearchProvisionedProducts -> String
showsPrec :: Int -> SearchProvisionedProducts -> ShowS
$cshowsPrec :: Int -> SearchProvisionedProducts -> ShowS
Prelude.Show, forall x.
Rep SearchProvisionedProducts x -> SearchProvisionedProducts
forall x.
SearchProvisionedProducts -> Rep SearchProvisionedProducts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchProvisionedProducts x -> SearchProvisionedProducts
$cfrom :: forall x.
SearchProvisionedProducts -> Rep SearchProvisionedProducts x
Prelude.Generic)

-- |
-- Create a value of 'SearchProvisionedProducts' 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', 'searchProvisionedProducts_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'accessLevelFilter', 'searchProvisionedProducts_accessLevelFilter' - The access level to use to obtain results. The default is @User@.
--
-- 'filters', 'searchProvisionedProducts_filters' - The search filters.
--
-- When the key is @SearchQuery@, the searchable fields are @arn@,
-- @createdTime@, @id@, @lastRecordId@, @idempotencyToken@, @name@,
-- @physicalId@, @productId@, @provisioningArtifact@, @type@, @status@,
-- @tags@, @userArn@, @userArnSession@, @lastProvisioningRecordId@,
-- @lastSuccessfulProvisioningRecordId@, @productName@, and
-- @provisioningArtifactName@.
--
-- Example: @\"SearchQuery\":[\"status:AVAILABLE\"]@
--
-- 'pageSize', 'searchProvisionedProducts_pageSize' - The maximum number of items to return with this call.
--
-- 'pageToken', 'searchProvisionedProducts_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- 'sortBy', 'searchProvisionedProducts_sortBy' - The sort field. If no value is specified, the results are not sorted.
-- The valid values are @arn@, @id@, @name@, and @lastRecordId@.
--
-- 'sortOrder', 'searchProvisionedProducts_sortOrder' - The sort order. If no value is specified, the results are not sorted.
newSearchProvisionedProducts ::
  SearchProvisionedProducts
newSearchProvisionedProducts :: SearchProvisionedProducts
newSearchProvisionedProducts =
  SearchProvisionedProducts'
    { $sel:acceptLanguage:SearchProvisionedProducts' :: Maybe Text
acceptLanguage =
        forall a. Maybe a
Prelude.Nothing,
      $sel:accessLevelFilter:SearchProvisionedProducts' :: Maybe AccessLevelFilter
accessLevelFilter = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:SearchProvisionedProducts' :: Maybe (HashMap ProvisionedProductViewFilterBy [Text])
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:SearchProvisionedProducts' :: Maybe Natural
pageSize = forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:SearchProvisionedProducts' :: Maybe Text
pageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:SearchProvisionedProducts' :: Maybe Text
sortBy = forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:SearchProvisionedProducts' :: Maybe SortOrder
sortOrder = forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | The search filters.
--
-- When the key is @SearchQuery@, the searchable fields are @arn@,
-- @createdTime@, @id@, @lastRecordId@, @idempotencyToken@, @name@,
-- @physicalId@, @productId@, @provisioningArtifact@, @type@, @status@,
-- @tags@, @userArn@, @userArnSession@, @lastProvisioningRecordId@,
-- @lastSuccessfulProvisioningRecordId@, @productName@, and
-- @provisioningArtifactName@.
--
-- Example: @\"SearchQuery\":[\"status:AVAILABLE\"]@
searchProvisionedProducts_filters :: Lens.Lens' SearchProvisionedProducts (Prelude.Maybe (Prelude.HashMap ProvisionedProductViewFilterBy [Prelude.Text]))
searchProvisionedProducts_filters :: Lens'
  SearchProvisionedProducts
  (Maybe (HashMap ProvisionedProductViewFilterBy [Text]))
searchProvisionedProducts_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProvisionedProducts' {Maybe (HashMap ProvisionedProductViewFilterBy [Text])
filters :: Maybe (HashMap ProvisionedProductViewFilterBy [Text])
$sel:filters:SearchProvisionedProducts' :: SearchProvisionedProducts
-> Maybe (HashMap ProvisionedProductViewFilterBy [Text])
filters} -> Maybe (HashMap ProvisionedProductViewFilterBy [Text])
filters) (\s :: SearchProvisionedProducts
s@SearchProvisionedProducts' {} Maybe (HashMap ProvisionedProductViewFilterBy [Text])
a -> SearchProvisionedProducts
s {$sel:filters:SearchProvisionedProducts' :: Maybe (HashMap ProvisionedProductViewFilterBy [Text])
filters = Maybe (HashMap ProvisionedProductViewFilterBy [Text])
a} :: SearchProvisionedProducts) 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 maximum number of items to return with this call.
searchProvisionedProducts_pageSize :: Lens.Lens' SearchProvisionedProducts (Prelude.Maybe Prelude.Natural)
searchProvisionedProducts_pageSize :: Lens' SearchProvisionedProducts (Maybe Natural)
searchProvisionedProducts_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProvisionedProducts' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: SearchProvisionedProducts
s@SearchProvisionedProducts' {} Maybe Natural
a -> SearchProvisionedProducts
s {$sel:pageSize:SearchProvisionedProducts' :: Maybe Natural
pageSize = Maybe Natural
a} :: SearchProvisionedProducts)

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

-- | The sort field. If no value is specified, the results are not sorted.
-- The valid values are @arn@, @id@, @name@, and @lastRecordId@.
searchProvisionedProducts_sortBy :: Lens.Lens' SearchProvisionedProducts (Prelude.Maybe Prelude.Text)
searchProvisionedProducts_sortBy :: Lens' SearchProvisionedProducts (Maybe Text)
searchProvisionedProducts_sortBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProvisionedProducts' {Maybe Text
sortBy :: Maybe Text
$sel:sortBy:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Text
sortBy} -> Maybe Text
sortBy) (\s :: SearchProvisionedProducts
s@SearchProvisionedProducts' {} Maybe Text
a -> SearchProvisionedProducts
s {$sel:sortBy:SearchProvisionedProducts' :: Maybe Text
sortBy = Maybe Text
a} :: SearchProvisionedProducts)

-- | The sort order. If no value is specified, the results are not sorted.
searchProvisionedProducts_sortOrder :: Lens.Lens' SearchProvisionedProducts (Prelude.Maybe SortOrder)
searchProvisionedProducts_sortOrder :: Lens' SearchProvisionedProducts (Maybe SortOrder)
searchProvisionedProducts_sortOrder = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProvisionedProducts' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: SearchProvisionedProducts
s@SearchProvisionedProducts' {} Maybe SortOrder
a -> SearchProvisionedProducts
s {$sel:sortOrder:SearchProvisionedProducts' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: SearchProvisionedProducts)

instance Core.AWSRequest SearchProvisionedProducts where
  type
    AWSResponse SearchProvisionedProducts =
      SearchProvisionedProductsResponse
  request :: (Service -> Service)
-> SearchProvisionedProducts -> Request SearchProvisionedProducts
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 SearchProvisionedProducts
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SearchProvisionedProducts)))
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 [ProvisionedProductAttribute]
-> Maybe Int
-> Int
-> SearchProvisionedProductsResponse
SearchProvisionedProductsResponse'
            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
"ProvisionedProducts"
                            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
"TotalResultsCount")
            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 SearchProvisionedProducts where
  hashWithSalt :: Int -> SearchProvisionedProducts -> Int
hashWithSalt Int
_salt SearchProvisionedProducts' {Maybe Natural
Maybe Text
Maybe (HashMap ProvisionedProductViewFilterBy [Text])
Maybe AccessLevelFilter
Maybe SortOrder
sortOrder :: Maybe SortOrder
sortBy :: Maybe Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
filters :: Maybe (HashMap ProvisionedProductViewFilterBy [Text])
accessLevelFilter :: Maybe AccessLevelFilter
acceptLanguage :: Maybe Text
$sel:sortOrder:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe SortOrder
$sel:sortBy:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Text
$sel:pageToken:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Text
$sel:pageSize:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Natural
$sel:filters:SearchProvisionedProducts' :: SearchProvisionedProducts
-> Maybe (HashMap ProvisionedProductViewFilterBy [Text])
$sel:accessLevelFilter:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe AccessLevelFilter
$sel:acceptLanguage:SearchProvisionedProducts' :: SearchProvisionedProducts -> 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 (HashMap ProvisionedProductViewFilterBy [Text])
filters
      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
sortBy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SortOrder
sortOrder

instance Prelude.NFData SearchProvisionedProducts where
  rnf :: SearchProvisionedProducts -> ()
rnf SearchProvisionedProducts' {Maybe Natural
Maybe Text
Maybe (HashMap ProvisionedProductViewFilterBy [Text])
Maybe AccessLevelFilter
Maybe SortOrder
sortOrder :: Maybe SortOrder
sortBy :: Maybe Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
filters :: Maybe (HashMap ProvisionedProductViewFilterBy [Text])
accessLevelFilter :: Maybe AccessLevelFilter
acceptLanguage :: Maybe Text
$sel:sortOrder:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe SortOrder
$sel:sortBy:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Text
$sel:pageToken:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Text
$sel:pageSize:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Natural
$sel:filters:SearchProvisionedProducts' :: SearchProvisionedProducts
-> Maybe (HashMap ProvisionedProductViewFilterBy [Text])
$sel:accessLevelFilter:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe AccessLevelFilter
$sel:acceptLanguage:SearchProvisionedProducts' :: SearchProvisionedProducts -> 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 (HashMap ProvisionedProductViewFilterBy [Text])
filters
      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
sortBy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SortOrder
sortOrder

instance Data.ToHeaders SearchProvisionedProducts where
  toHeaders :: SearchProvisionedProducts -> 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.SearchProvisionedProducts" ::
                          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 SearchProvisionedProducts where
  toJSON :: SearchProvisionedProducts -> Value
toJSON SearchProvisionedProducts' {Maybe Natural
Maybe Text
Maybe (HashMap ProvisionedProductViewFilterBy [Text])
Maybe AccessLevelFilter
Maybe SortOrder
sortOrder :: Maybe SortOrder
sortBy :: Maybe Text
pageToken :: Maybe Text
pageSize :: Maybe Natural
filters :: Maybe (HashMap ProvisionedProductViewFilterBy [Text])
accessLevelFilter :: Maybe AccessLevelFilter
acceptLanguage :: Maybe Text
$sel:sortOrder:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe SortOrder
$sel:sortBy:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Text
$sel:pageToken:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Text
$sel:pageSize:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe Natural
$sel:filters:SearchProvisionedProducts' :: SearchProvisionedProducts
-> Maybe (HashMap ProvisionedProductViewFilterBy [Text])
$sel:accessLevelFilter:SearchProvisionedProducts' :: SearchProvisionedProducts -> Maybe AccessLevelFilter
$sel:acceptLanguage:SearchProvisionedProducts' :: SearchProvisionedProducts -> 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
"Filters" 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 (HashMap ProvisionedProductViewFilterBy [Text])
filters,
            (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
"SortBy" 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
sortBy,
            (Key
"SortOrder" 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 SortOrder
sortOrder
          ]
      )

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

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

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

-- |
-- Create a value of 'SearchProvisionedProductsResponse' 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', 'searchProvisionedProductsResponse_nextPageToken' - The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
--
-- 'provisionedProducts', 'searchProvisionedProductsResponse_provisionedProducts' - Information about the provisioned products.
--
-- 'totalResultsCount', 'searchProvisionedProductsResponse_totalResultsCount' - The number of provisioned products found.
--
-- 'httpStatus', 'searchProvisionedProductsResponse_httpStatus' - The response's http status code.
newSearchProvisionedProductsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchProvisionedProductsResponse
newSearchProvisionedProductsResponse :: Int -> SearchProvisionedProductsResponse
newSearchProvisionedProductsResponse Int
pHttpStatus_ =
  SearchProvisionedProductsResponse'
    { $sel:nextPageToken:SearchProvisionedProductsResponse' :: Maybe Text
nextPageToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:provisionedProducts:SearchProvisionedProductsResponse' :: Maybe [ProvisionedProductAttribute]
provisionedProducts = forall a. Maybe a
Prelude.Nothing,
      $sel:totalResultsCount:SearchProvisionedProductsResponse' :: Maybe Int
totalResultsCount = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchProvisionedProductsResponse' :: 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.
searchProvisionedProductsResponse_nextPageToken :: Lens.Lens' SearchProvisionedProductsResponse (Prelude.Maybe Prelude.Text)
searchProvisionedProductsResponse_nextPageToken :: Lens' SearchProvisionedProductsResponse (Maybe Text)
searchProvisionedProductsResponse_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProvisionedProductsResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:SearchProvisionedProductsResponse' :: SearchProvisionedProductsResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: SearchProvisionedProductsResponse
s@SearchProvisionedProductsResponse' {} Maybe Text
a -> SearchProvisionedProductsResponse
s {$sel:nextPageToken:SearchProvisionedProductsResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: SearchProvisionedProductsResponse)

-- | Information about the provisioned products.
searchProvisionedProductsResponse_provisionedProducts :: Lens.Lens' SearchProvisionedProductsResponse (Prelude.Maybe [ProvisionedProductAttribute])
searchProvisionedProductsResponse_provisionedProducts :: Lens'
  SearchProvisionedProductsResponse
  (Maybe [ProvisionedProductAttribute])
searchProvisionedProductsResponse_provisionedProducts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProvisionedProductsResponse' {Maybe [ProvisionedProductAttribute]
provisionedProducts :: Maybe [ProvisionedProductAttribute]
$sel:provisionedProducts:SearchProvisionedProductsResponse' :: SearchProvisionedProductsResponse
-> Maybe [ProvisionedProductAttribute]
provisionedProducts} -> Maybe [ProvisionedProductAttribute]
provisionedProducts) (\s :: SearchProvisionedProductsResponse
s@SearchProvisionedProductsResponse' {} Maybe [ProvisionedProductAttribute]
a -> SearchProvisionedProductsResponse
s {$sel:provisionedProducts:SearchProvisionedProductsResponse' :: Maybe [ProvisionedProductAttribute]
provisionedProducts = Maybe [ProvisionedProductAttribute]
a} :: SearchProvisionedProductsResponse) 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 number of provisioned products found.
searchProvisionedProductsResponse_totalResultsCount :: Lens.Lens' SearchProvisionedProductsResponse (Prelude.Maybe Prelude.Int)
searchProvisionedProductsResponse_totalResultsCount :: Lens' SearchProvisionedProductsResponse (Maybe Int)
searchProvisionedProductsResponse_totalResultsCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProvisionedProductsResponse' {Maybe Int
totalResultsCount :: Maybe Int
$sel:totalResultsCount:SearchProvisionedProductsResponse' :: SearchProvisionedProductsResponse -> Maybe Int
totalResultsCount} -> Maybe Int
totalResultsCount) (\s :: SearchProvisionedProductsResponse
s@SearchProvisionedProductsResponse' {} Maybe Int
a -> SearchProvisionedProductsResponse
s {$sel:totalResultsCount:SearchProvisionedProductsResponse' :: Maybe Int
totalResultsCount = Maybe Int
a} :: SearchProvisionedProductsResponse)

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

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