{-# 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.ScanProvisionedProducts
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the provisioned products that are available (not terminated).
--
-- To use additional filtering, see SearchProvisionedProducts.
--
-- This operation returns paginated results.
module Amazonka.ServiceCatalog.ScanProvisionedProducts
  ( -- * Creating a Request
    ScanProvisionedProducts (..),
    newScanProvisionedProducts,

    -- * Request Lenses
    scanProvisionedProducts_acceptLanguage,
    scanProvisionedProducts_accessLevelFilter,
    scanProvisionedProducts_pageToken,
    scanProvisionedProducts_pageSize,

    -- * Destructuring the Response
    ScanProvisionedProductsResponse (..),
    newScanProvisionedProductsResponse,

    -- * Response Lenses
    scanProvisionedProductsResponse_nextPageToken,
    scanProvisionedProductsResponse_provisionedProducts,
    scanProvisionedProductsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.ServiceCatalog.Types

-- | /See:/ 'newScanProvisionedProducts' smart constructor.
data ScanProvisionedProducts = ScanProvisionedProducts'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    ScanProvisionedProducts -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The access level to use to obtain results. The default is @User@.
    ScanProvisionedProducts -> Maybe AccessLevelFilter
accessLevelFilter :: Prelude.Maybe AccessLevelFilter,
    -- | The page token for the next set of results. To retrieve the first set of
    -- results, use null.
    ScanProvisionedProducts -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return with this call.
    ScanProvisionedProducts -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural
  }
  deriving (ScanProvisionedProducts -> ScanProvisionedProducts -> Bool
(ScanProvisionedProducts -> ScanProvisionedProducts -> Bool)
-> (ScanProvisionedProducts -> ScanProvisionedProducts -> Bool)
-> Eq ScanProvisionedProducts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScanProvisionedProducts -> ScanProvisionedProducts -> Bool
$c/= :: ScanProvisionedProducts -> ScanProvisionedProducts -> Bool
== :: ScanProvisionedProducts -> ScanProvisionedProducts -> Bool
$c== :: ScanProvisionedProducts -> ScanProvisionedProducts -> Bool
Prelude.Eq, ReadPrec [ScanProvisionedProducts]
ReadPrec ScanProvisionedProducts
Int -> ReadS ScanProvisionedProducts
ReadS [ScanProvisionedProducts]
(Int -> ReadS ScanProvisionedProducts)
-> ReadS [ScanProvisionedProducts]
-> ReadPrec ScanProvisionedProducts
-> ReadPrec [ScanProvisionedProducts]
-> Read ScanProvisionedProducts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScanProvisionedProducts]
$creadListPrec :: ReadPrec [ScanProvisionedProducts]
readPrec :: ReadPrec ScanProvisionedProducts
$creadPrec :: ReadPrec ScanProvisionedProducts
readList :: ReadS [ScanProvisionedProducts]
$creadList :: ReadS [ScanProvisionedProducts]
readsPrec :: Int -> ReadS ScanProvisionedProducts
$creadsPrec :: Int -> ReadS ScanProvisionedProducts
Prelude.Read, Int -> ScanProvisionedProducts -> ShowS
[ScanProvisionedProducts] -> ShowS
ScanProvisionedProducts -> String
(Int -> ScanProvisionedProducts -> ShowS)
-> (ScanProvisionedProducts -> String)
-> ([ScanProvisionedProducts] -> ShowS)
-> Show ScanProvisionedProducts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScanProvisionedProducts] -> ShowS
$cshowList :: [ScanProvisionedProducts] -> ShowS
show :: ScanProvisionedProducts -> String
$cshow :: ScanProvisionedProducts -> String
showsPrec :: Int -> ScanProvisionedProducts -> ShowS
$cshowsPrec :: Int -> ScanProvisionedProducts -> ShowS
Prelude.Show, (forall x.
 ScanProvisionedProducts -> Rep ScanProvisionedProducts x)
-> (forall x.
    Rep ScanProvisionedProducts x -> ScanProvisionedProducts)
-> Generic ScanProvisionedProducts
forall x. Rep ScanProvisionedProducts x -> ScanProvisionedProducts
forall x. ScanProvisionedProducts -> Rep ScanProvisionedProducts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScanProvisionedProducts x -> ScanProvisionedProducts
$cfrom :: forall x. ScanProvisionedProducts -> Rep ScanProvisionedProducts x
Prelude.Generic)

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

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

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

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

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

instance Core.AWSPager ScanProvisionedProducts where
  page :: ScanProvisionedProducts
-> AWSResponse ScanProvisionedProducts
-> Maybe ScanProvisionedProducts
page ScanProvisionedProducts
rq AWSResponse ScanProvisionedProducts
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ScanProvisionedProducts
ScanProvisionedProductsResponse
rs
            ScanProvisionedProductsResponse
-> Getting (First Text) ScanProvisionedProductsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ScanProvisionedProductsResponse
-> Const (First Text) ScanProvisionedProductsResponse
Lens' ScanProvisionedProductsResponse (Maybe Text)
scanProvisionedProductsResponse_nextPageToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ScanProvisionedProductsResponse
 -> Const (First Text) ScanProvisionedProductsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ScanProvisionedProductsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ScanProvisionedProducts
forall a. Maybe a
Prelude.Nothing
    | Maybe [ProvisionedProductDetail] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ScanProvisionedProducts
ScanProvisionedProductsResponse
rs
            ScanProvisionedProductsResponse
-> Getting
     (First [ProvisionedProductDetail])
     ScanProvisionedProductsResponse
     [ProvisionedProductDetail]
-> Maybe [ProvisionedProductDetail]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ProvisionedProductDetail]
 -> Const
      (First [ProvisionedProductDetail])
      (Maybe [ProvisionedProductDetail]))
-> ScanProvisionedProductsResponse
-> Const
     (First [ProvisionedProductDetail]) ScanProvisionedProductsResponse
Lens'
  ScanProvisionedProductsResponse (Maybe [ProvisionedProductDetail])
scanProvisionedProductsResponse_provisionedProducts
              ((Maybe [ProvisionedProductDetail]
  -> Const
       (First [ProvisionedProductDetail])
       (Maybe [ProvisionedProductDetail]))
 -> ScanProvisionedProductsResponse
 -> Const
      (First [ProvisionedProductDetail]) ScanProvisionedProductsResponse)
-> (([ProvisionedProductDetail]
     -> Const
          (First [ProvisionedProductDetail]) [ProvisionedProductDetail])
    -> Maybe [ProvisionedProductDetail]
    -> Const
         (First [ProvisionedProductDetail])
         (Maybe [ProvisionedProductDetail]))
-> Getting
     (First [ProvisionedProductDetail])
     ScanProvisionedProductsResponse
     [ProvisionedProductDetail]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ProvisionedProductDetail]
 -> Const
      (First [ProvisionedProductDetail]) [ProvisionedProductDetail])
-> Maybe [ProvisionedProductDetail]
-> Const
     (First [ProvisionedProductDetail])
     (Maybe [ProvisionedProductDetail])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ScanProvisionedProducts
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ScanProvisionedProducts -> Maybe ScanProvisionedProducts
forall a. a -> Maybe a
Prelude.Just (ScanProvisionedProducts -> Maybe ScanProvisionedProducts)
-> ScanProvisionedProducts -> Maybe ScanProvisionedProducts
forall a b. (a -> b) -> a -> b
Prelude.$
        ScanProvisionedProducts
rq
          ScanProvisionedProducts
-> (ScanProvisionedProducts -> ScanProvisionedProducts)
-> ScanProvisionedProducts
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ScanProvisionedProducts -> Identity ScanProvisionedProducts
Lens
  ScanProvisionedProducts
  ScanProvisionedProducts
  (Maybe Text)
  (Maybe Text)
scanProvisionedProducts_pageToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ScanProvisionedProducts -> Identity ScanProvisionedProducts)
-> Maybe Text -> ScanProvisionedProducts -> ScanProvisionedProducts
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ScanProvisionedProducts
ScanProvisionedProductsResponse
rs
          ScanProvisionedProductsResponse
-> Getting (First Text) ScanProvisionedProductsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ScanProvisionedProductsResponse
-> Const (First Text) ScanProvisionedProductsResponse
Lens' ScanProvisionedProductsResponse (Maybe Text)
scanProvisionedProductsResponse_nextPageToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ScanProvisionedProductsResponse
 -> Const (First Text) ScanProvisionedProductsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ScanProvisionedProductsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ScanProvisionedProducts where
  type
    AWSResponse ScanProvisionedProducts =
      ScanProvisionedProductsResponse
  request :: ScanProvisionedProducts -> Request ScanProvisionedProducts
request = Service
-> ScanProvisionedProducts -> Request ScanProvisionedProducts
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ScanProvisionedProducts
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ScanProvisionedProducts)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ScanProvisionedProducts))
-> Logger
-> Service
-> Proxy ScanProvisionedProducts
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ScanProvisionedProducts)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [ProvisionedProductDetail]
-> Int
-> ScanProvisionedProductsResponse
ScanProvisionedProductsResponse'
            (Maybe Text
 -> Maybe [ProvisionedProductDetail]
 -> Int
 -> ScanProvisionedProductsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ProvisionedProductDetail]
      -> Int -> ScanProvisionedProductsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextPageToken")
            Either
  String
  (Maybe [ProvisionedProductDetail]
   -> Int -> ScanProvisionedProductsResponse)
-> Either String (Maybe [ProvisionedProductDetail])
-> Either String (Int -> ScanProvisionedProductsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ProvisionedProductDetail]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProvisionedProducts"
                            Either String (Maybe (Maybe [ProvisionedProductDetail]))
-> Maybe [ProvisionedProductDetail]
-> Either String (Maybe [ProvisionedProductDetail])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ProvisionedProductDetail]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ScanProvisionedProductsResponse)
-> Either String Int
-> Either String ScanProvisionedProductsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ScanProvisionedProducts

instance Prelude.NFData ScanProvisionedProducts

instance Core.ToHeaders ScanProvisionedProducts where
  toHeaders :: ScanProvisionedProducts -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ScanProvisionedProducts -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWS242ServiceCatalogService.ScanProvisionedProducts" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ScanProvisionedProducts where
  toJSON :: ScanProvisionedProducts -> Value
toJSON ScanProvisionedProducts' {Maybe Natural
Maybe Text
Maybe AccessLevelFilter
pageSize :: Maybe Natural
pageToken :: Maybe Text
accessLevelFilter :: Maybe AccessLevelFilter
acceptLanguage :: Maybe Text
$sel:pageSize:ScanProvisionedProducts' :: ScanProvisionedProducts -> Maybe Natural
$sel:pageToken:ScanProvisionedProducts' :: ScanProvisionedProducts -> Maybe Text
$sel:accessLevelFilter:ScanProvisionedProducts' :: ScanProvisionedProducts -> Maybe AccessLevelFilter
$sel:acceptLanguage:ScanProvisionedProducts' :: ScanProvisionedProducts -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AcceptLanguage" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
acceptLanguage,
            (Text
"AccessLevelFilter" Text -> AccessLevelFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AccessLevelFilter -> Pair)
-> Maybe AccessLevelFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccessLevelFilter
accessLevelFilter,
            (Text
"PageToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
pageToken,
            (Text
"PageSize" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
pageSize
          ]
      )

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

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

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

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

-- | Information about the provisioned products.
scanProvisionedProductsResponse_provisionedProducts :: Lens.Lens' ScanProvisionedProductsResponse (Prelude.Maybe [ProvisionedProductDetail])
scanProvisionedProductsResponse_provisionedProducts :: (Maybe [ProvisionedProductDetail]
 -> f (Maybe [ProvisionedProductDetail]))
-> ScanProvisionedProductsResponse
-> f ScanProvisionedProductsResponse
scanProvisionedProductsResponse_provisionedProducts = (ScanProvisionedProductsResponse
 -> Maybe [ProvisionedProductDetail])
-> (ScanProvisionedProductsResponse
    -> Maybe [ProvisionedProductDetail]
    -> ScanProvisionedProductsResponse)
-> Lens'
     ScanProvisionedProductsResponse (Maybe [ProvisionedProductDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScanProvisionedProductsResponse' {Maybe [ProvisionedProductDetail]
provisionedProducts :: Maybe [ProvisionedProductDetail]
$sel:provisionedProducts:ScanProvisionedProductsResponse' :: ScanProvisionedProductsResponse -> Maybe [ProvisionedProductDetail]
provisionedProducts} -> Maybe [ProvisionedProductDetail]
provisionedProducts) (\s :: ScanProvisionedProductsResponse
s@ScanProvisionedProductsResponse' {} Maybe [ProvisionedProductDetail]
a -> ScanProvisionedProductsResponse
s {$sel:provisionedProducts:ScanProvisionedProductsResponse' :: Maybe [ProvisionedProductDetail]
provisionedProducts = Maybe [ProvisionedProductDetail]
a} :: ScanProvisionedProductsResponse) ((Maybe [ProvisionedProductDetail]
  -> f (Maybe [ProvisionedProductDetail]))
 -> ScanProvisionedProductsResponse
 -> f ScanProvisionedProductsResponse)
-> ((Maybe [ProvisionedProductDetail]
     -> f (Maybe [ProvisionedProductDetail]))
    -> Maybe [ProvisionedProductDetail]
    -> f (Maybe [ProvisionedProductDetail]))
-> (Maybe [ProvisionedProductDetail]
    -> f (Maybe [ProvisionedProductDetail]))
-> ScanProvisionedProductsResponse
-> f ScanProvisionedProductsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProvisionedProductDetail]
  [ProvisionedProductDetail]
  [ProvisionedProductDetail]
  [ProvisionedProductDetail]
-> Iso
     (Maybe [ProvisionedProductDetail])
     (Maybe [ProvisionedProductDetail])
     (Maybe [ProvisionedProductDetail])
     (Maybe [ProvisionedProductDetail])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ProvisionedProductDetail]
  [ProvisionedProductDetail]
  [ProvisionedProductDetail]
  [ProvisionedProductDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ScanProvisionedProductsResponse