{-# 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.IoTSiteWise.ListAssets
-- 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)
--
-- Retrieves a paginated list of asset summaries.
--
-- You can use this operation to do the following:
--
-- -   List assets based on a specific asset model.
--
-- -   List top-level assets.
--
-- You can\'t use this operation to list all assets. To retrieve summaries
-- for all of your assets, use
-- <https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_ListAssetModels.html ListAssetModels>
-- to get all of your asset model IDs. Then, use ListAssets to get all
-- assets for each asset model.
--
-- This operation returns paginated results.
module Amazonka.IoTSiteWise.ListAssets
  ( -- * Creating a Request
    ListAssets (..),
    newListAssets,

    -- * Request Lenses
    listAssets_assetModelId,
    listAssets_nextToken,
    listAssets_filter,
    listAssets_maxResults,

    -- * Destructuring the Response
    ListAssetsResponse (..),
    newListAssetsResponse,

    -- * Response Lenses
    listAssetsResponse_nextToken,
    listAssetsResponse_httpStatus,
    listAssetsResponse_assetSummaries,
  )
where

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

-- | /See:/ 'newListAssets' smart constructor.
data ListAssets = ListAssets'
  { -- | The ID of the asset model by which to filter the list of assets. This
    -- parameter is required if you choose @ALL@ for @filter@.
    ListAssets -> Maybe Text
assetModelId :: Prelude.Maybe Prelude.Text,
    -- | The token to be used for the next set of paginated results.
    ListAssets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The filter for the requested list of assets. Choose one of the following
    -- options:
    --
    -- -   @ALL@ – The list includes all assets for a given asset model ID. The
    --     @assetModelId@ parameter is required if you filter by @ALL@.
    --
    -- -   @TOP_LEVEL@ – The list includes only top-level assets in the asset
    --     hierarchy tree.
    --
    -- Default: @ALL@
    ListAssets -> Maybe ListAssetsFilter
filter' :: Prelude.Maybe ListAssetsFilter,
    -- | The maximum number of results to return for each paginated request.
    --
    -- Default: 50
    ListAssets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListAssets -> ListAssets -> Bool
(ListAssets -> ListAssets -> Bool)
-> (ListAssets -> ListAssets -> Bool) -> Eq ListAssets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssets -> ListAssets -> Bool
$c/= :: ListAssets -> ListAssets -> Bool
== :: ListAssets -> ListAssets -> Bool
$c== :: ListAssets -> ListAssets -> Bool
Prelude.Eq, ReadPrec [ListAssets]
ReadPrec ListAssets
Int -> ReadS ListAssets
ReadS [ListAssets]
(Int -> ReadS ListAssets)
-> ReadS [ListAssets]
-> ReadPrec ListAssets
-> ReadPrec [ListAssets]
-> Read ListAssets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssets]
$creadListPrec :: ReadPrec [ListAssets]
readPrec :: ReadPrec ListAssets
$creadPrec :: ReadPrec ListAssets
readList :: ReadS [ListAssets]
$creadList :: ReadS [ListAssets]
readsPrec :: Int -> ReadS ListAssets
$creadsPrec :: Int -> ReadS ListAssets
Prelude.Read, Int -> ListAssets -> ShowS
[ListAssets] -> ShowS
ListAssets -> String
(Int -> ListAssets -> ShowS)
-> (ListAssets -> String)
-> ([ListAssets] -> ShowS)
-> Show ListAssets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssets] -> ShowS
$cshowList :: [ListAssets] -> ShowS
show :: ListAssets -> String
$cshow :: ListAssets -> String
showsPrec :: Int -> ListAssets -> ShowS
$cshowsPrec :: Int -> ListAssets -> ShowS
Prelude.Show, (forall x. ListAssets -> Rep ListAssets x)
-> (forall x. Rep ListAssets x -> ListAssets) -> Generic ListAssets
forall x. Rep ListAssets x -> ListAssets
forall x. ListAssets -> Rep ListAssets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAssets x -> ListAssets
$cfrom :: forall x. ListAssets -> Rep ListAssets x
Prelude.Generic)

-- |
-- Create a value of 'ListAssets' 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:
--
-- 'assetModelId', 'listAssets_assetModelId' - The ID of the asset model by which to filter the list of assets. This
-- parameter is required if you choose @ALL@ for @filter@.
--
-- 'nextToken', 'listAssets_nextToken' - The token to be used for the next set of paginated results.
--
-- 'filter'', 'listAssets_filter' - The filter for the requested list of assets. Choose one of the following
-- options:
--
-- -   @ALL@ – The list includes all assets for a given asset model ID. The
--     @assetModelId@ parameter is required if you filter by @ALL@.
--
-- -   @TOP_LEVEL@ – The list includes only top-level assets in the asset
--     hierarchy tree.
--
-- Default: @ALL@
--
-- 'maxResults', 'listAssets_maxResults' - The maximum number of results to return for each paginated request.
--
-- Default: 50
newListAssets ::
  ListAssets
newListAssets :: ListAssets
newListAssets =
  ListAssets' :: Maybe Text
-> Maybe Text
-> Maybe ListAssetsFilter
-> Maybe Natural
-> ListAssets
ListAssets'
    { $sel:assetModelId:ListAssets' :: Maybe Text
assetModelId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAssets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ListAssets' :: Maybe ListAssetsFilter
filter' = Maybe ListAssetsFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAssets' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the asset model by which to filter the list of assets. This
-- parameter is required if you choose @ALL@ for @filter@.
listAssets_assetModelId :: Lens.Lens' ListAssets (Prelude.Maybe Prelude.Text)
listAssets_assetModelId :: (Maybe Text -> f (Maybe Text)) -> ListAssets -> f ListAssets
listAssets_assetModelId = (ListAssets -> Maybe Text)
-> (ListAssets -> Maybe Text -> ListAssets)
-> Lens ListAssets ListAssets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssets' {Maybe Text
assetModelId :: Maybe Text
$sel:assetModelId:ListAssets' :: ListAssets -> Maybe Text
assetModelId} -> Maybe Text
assetModelId) (\s :: ListAssets
s@ListAssets' {} Maybe Text
a -> ListAssets
s {$sel:assetModelId:ListAssets' :: Maybe Text
assetModelId = Maybe Text
a} :: ListAssets)

-- | The token to be used for the next set of paginated results.
listAssets_nextToken :: Lens.Lens' ListAssets (Prelude.Maybe Prelude.Text)
listAssets_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListAssets -> f ListAssets
listAssets_nextToken = (ListAssets -> Maybe Text)
-> (ListAssets -> Maybe Text -> ListAssets)
-> Lens ListAssets ListAssets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssets' :: ListAssets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssets
s@ListAssets' {} Maybe Text
a -> ListAssets
s {$sel:nextToken:ListAssets' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssets)

-- | The filter for the requested list of assets. Choose one of the following
-- options:
--
-- -   @ALL@ – The list includes all assets for a given asset model ID. The
--     @assetModelId@ parameter is required if you filter by @ALL@.
--
-- -   @TOP_LEVEL@ – The list includes only top-level assets in the asset
--     hierarchy tree.
--
-- Default: @ALL@
listAssets_filter :: Lens.Lens' ListAssets (Prelude.Maybe ListAssetsFilter)
listAssets_filter :: (Maybe ListAssetsFilter -> f (Maybe ListAssetsFilter))
-> ListAssets -> f ListAssets
listAssets_filter = (ListAssets -> Maybe ListAssetsFilter)
-> (ListAssets -> Maybe ListAssetsFilter -> ListAssets)
-> Lens
     ListAssets
     ListAssets
     (Maybe ListAssetsFilter)
     (Maybe ListAssetsFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssets' {Maybe ListAssetsFilter
filter' :: Maybe ListAssetsFilter
$sel:filter':ListAssets' :: ListAssets -> Maybe ListAssetsFilter
filter'} -> Maybe ListAssetsFilter
filter') (\s :: ListAssets
s@ListAssets' {} Maybe ListAssetsFilter
a -> ListAssets
s {$sel:filter':ListAssets' :: Maybe ListAssetsFilter
filter' = Maybe ListAssetsFilter
a} :: ListAssets)

-- | The maximum number of results to return for each paginated request.
--
-- Default: 50
listAssets_maxResults :: Lens.Lens' ListAssets (Prelude.Maybe Prelude.Natural)
listAssets_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> ListAssets -> f ListAssets
listAssets_maxResults = (ListAssets -> Maybe Natural)
-> (ListAssets -> Maybe Natural -> ListAssets)
-> Lens ListAssets ListAssets (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssets' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAssets' :: ListAssets -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAssets
s@ListAssets' {} Maybe Natural
a -> ListAssets
s {$sel:maxResults:ListAssets' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAssets)

instance Core.AWSPager ListAssets where
  page :: ListAssets -> AWSResponse ListAssets -> Maybe ListAssets
page ListAssets
rq AWSResponse ListAssets
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAssets
ListAssetsResponse
rs
            ListAssetsResponse
-> Getting (First Text) ListAssetsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssetsResponse -> Const (First Text) ListAssetsResponse
Lens' ListAssetsResponse (Maybe Text)
listAssetsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAssetsResponse -> Const (First Text) ListAssetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssetsResponse 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 ListAssets
forall a. Maybe a
Prelude.Nothing
    | [AssetSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListAssets
ListAssetsResponse
rs ListAssetsResponse
-> Getting [AssetSummary] ListAssetsResponse [AssetSummary]
-> [AssetSummary]
forall s a. s -> Getting a s a -> a
Lens.^. Getting [AssetSummary] ListAssetsResponse [AssetSummary]
Lens' ListAssetsResponse [AssetSummary]
listAssetsResponse_assetSummaries) =
      Maybe ListAssets
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAssets -> Maybe ListAssets
forall a. a -> Maybe a
Prelude.Just (ListAssets -> Maybe ListAssets) -> ListAssets -> Maybe ListAssets
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAssets
rq
          ListAssets -> (ListAssets -> ListAssets) -> ListAssets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAssets -> Identity ListAssets
Lens ListAssets ListAssets (Maybe Text) (Maybe Text)
listAssets_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAssets -> Identity ListAssets)
-> Maybe Text -> ListAssets -> ListAssets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAssets
ListAssetsResponse
rs
          ListAssetsResponse
-> Getting (First Text) ListAssetsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssetsResponse -> Const (First Text) ListAssetsResponse
Lens' ListAssetsResponse (Maybe Text)
listAssetsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAssetsResponse -> Const (First Text) ListAssetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssetsResponse 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 ListAssets where
  type AWSResponse ListAssets = ListAssetsResponse
  request :: ListAssets -> Request ListAssets
request = Service -> ListAssets -> Request ListAssets
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAssets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAssets)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAssets))
-> Logger
-> Service
-> Proxy ListAssets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAssets)))
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 -> Int -> [AssetSummary] -> ListAssetsResponse
ListAssetsResponse'
            (Maybe Text -> Int -> [AssetSummary] -> ListAssetsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> [AssetSummary] -> ListAssetsResponse)
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
"nextToken")
            Either String (Int -> [AssetSummary] -> ListAssetsResponse)
-> Either String Int
-> Either String ([AssetSummary] -> ListAssetsResponse)
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))
            Either String ([AssetSummary] -> ListAssetsResponse)
-> Either String [AssetSummary] -> Either String ListAssetsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [AssetSummary])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"assetSummaries"
                            Either String (Maybe [AssetSummary])
-> [AssetSummary] -> Either String [AssetSummary]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [AssetSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ListAssets

instance Prelude.NFData ListAssets

instance Core.ToHeaders ListAssets where
  toHeaders :: ListAssets -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAssets -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListAssets where
  toPath :: ListAssets -> ByteString
toPath = ByteString -> ListAssets -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/assets"

instance Core.ToQuery ListAssets where
  toQuery :: ListAssets -> QueryString
toQuery ListAssets' {Maybe Natural
Maybe Text
Maybe ListAssetsFilter
maxResults :: Maybe Natural
filter' :: Maybe ListAssetsFilter
nextToken :: Maybe Text
assetModelId :: Maybe Text
$sel:maxResults:ListAssets' :: ListAssets -> Maybe Natural
$sel:filter':ListAssets' :: ListAssets -> Maybe ListAssetsFilter
$sel:nextToken:ListAssets' :: ListAssets -> Maybe Text
$sel:assetModelId:ListAssets' :: ListAssets -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"assetModelId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
assetModelId,
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"filter" ByteString -> Maybe ListAssetsFilter -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ListAssetsFilter
filter',
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListAssetsResponse' smart constructor.
data ListAssetsResponse = ListAssetsResponse'
  { -- | The token for the next set of results, or null if there are no
    -- additional results.
    ListAssetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListAssetsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list that summarizes each asset.
    ListAssetsResponse -> [AssetSummary]
assetSummaries :: [AssetSummary]
  }
  deriving (ListAssetsResponse -> ListAssetsResponse -> Bool
(ListAssetsResponse -> ListAssetsResponse -> Bool)
-> (ListAssetsResponse -> ListAssetsResponse -> Bool)
-> Eq ListAssetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssetsResponse -> ListAssetsResponse -> Bool
$c/= :: ListAssetsResponse -> ListAssetsResponse -> Bool
== :: ListAssetsResponse -> ListAssetsResponse -> Bool
$c== :: ListAssetsResponse -> ListAssetsResponse -> Bool
Prelude.Eq, ReadPrec [ListAssetsResponse]
ReadPrec ListAssetsResponse
Int -> ReadS ListAssetsResponse
ReadS [ListAssetsResponse]
(Int -> ReadS ListAssetsResponse)
-> ReadS [ListAssetsResponse]
-> ReadPrec ListAssetsResponse
-> ReadPrec [ListAssetsResponse]
-> Read ListAssetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssetsResponse]
$creadListPrec :: ReadPrec [ListAssetsResponse]
readPrec :: ReadPrec ListAssetsResponse
$creadPrec :: ReadPrec ListAssetsResponse
readList :: ReadS [ListAssetsResponse]
$creadList :: ReadS [ListAssetsResponse]
readsPrec :: Int -> ReadS ListAssetsResponse
$creadsPrec :: Int -> ReadS ListAssetsResponse
Prelude.Read, Int -> ListAssetsResponse -> ShowS
[ListAssetsResponse] -> ShowS
ListAssetsResponse -> String
(Int -> ListAssetsResponse -> ShowS)
-> (ListAssetsResponse -> String)
-> ([ListAssetsResponse] -> ShowS)
-> Show ListAssetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssetsResponse] -> ShowS
$cshowList :: [ListAssetsResponse] -> ShowS
show :: ListAssetsResponse -> String
$cshow :: ListAssetsResponse -> String
showsPrec :: Int -> ListAssetsResponse -> ShowS
$cshowsPrec :: Int -> ListAssetsResponse -> ShowS
Prelude.Show, (forall x. ListAssetsResponse -> Rep ListAssetsResponse x)
-> (forall x. Rep ListAssetsResponse x -> ListAssetsResponse)
-> Generic ListAssetsResponse
forall x. Rep ListAssetsResponse x -> ListAssetsResponse
forall x. ListAssetsResponse -> Rep ListAssetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAssetsResponse x -> ListAssetsResponse
$cfrom :: forall x. ListAssetsResponse -> Rep ListAssetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAssetsResponse' 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:
--
-- 'nextToken', 'listAssetsResponse_nextToken' - The token for the next set of results, or null if there are no
-- additional results.
--
-- 'httpStatus', 'listAssetsResponse_httpStatus' - The response's http status code.
--
-- 'assetSummaries', 'listAssetsResponse_assetSummaries' - A list that summarizes each asset.
newListAssetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAssetsResponse
newListAssetsResponse :: Int -> ListAssetsResponse
newListAssetsResponse Int
pHttpStatus_ =
  ListAssetsResponse' :: Maybe Text -> Int -> [AssetSummary] -> ListAssetsResponse
ListAssetsResponse'
    { $sel:nextToken:ListAssetsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAssetsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:assetSummaries:ListAssetsResponse' :: [AssetSummary]
assetSummaries = [AssetSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The token for the next set of results, or null if there are no
-- additional results.
listAssetsResponse_nextToken :: Lens.Lens' ListAssetsResponse (Prelude.Maybe Prelude.Text)
listAssetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssetsResponse -> f ListAssetsResponse
listAssetsResponse_nextToken = (ListAssetsResponse -> Maybe Text)
-> (ListAssetsResponse -> Maybe Text -> ListAssetsResponse)
-> Lens' ListAssetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssetsResponse' :: ListAssetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssetsResponse
s@ListAssetsResponse' {} Maybe Text
a -> ListAssetsResponse
s {$sel:nextToken:ListAssetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssetsResponse)

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

-- | A list that summarizes each asset.
listAssetsResponse_assetSummaries :: Lens.Lens' ListAssetsResponse [AssetSummary]
listAssetsResponse_assetSummaries :: ([AssetSummary] -> f [AssetSummary])
-> ListAssetsResponse -> f ListAssetsResponse
listAssetsResponse_assetSummaries = (ListAssetsResponse -> [AssetSummary])
-> (ListAssetsResponse -> [AssetSummary] -> ListAssetsResponse)
-> Lens' ListAssetsResponse [AssetSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssetsResponse' {[AssetSummary]
assetSummaries :: [AssetSummary]
$sel:assetSummaries:ListAssetsResponse' :: ListAssetsResponse -> [AssetSummary]
assetSummaries} -> [AssetSummary]
assetSummaries) (\s :: ListAssetsResponse
s@ListAssetsResponse' {} [AssetSummary]
a -> ListAssetsResponse
s {$sel:assetSummaries:ListAssetsResponse' :: [AssetSummary]
assetSummaries = [AssetSummary]
a} :: ListAssetsResponse) (([AssetSummary] -> f [AssetSummary])
 -> ListAssetsResponse -> f ListAssetsResponse)
-> (([AssetSummary] -> f [AssetSummary])
    -> [AssetSummary] -> f [AssetSummary])
-> ([AssetSummary] -> f [AssetSummary])
-> ListAssetsResponse
-> f ListAssetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssetSummary] -> f [AssetSummary])
-> [AssetSummary] -> f [AssetSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListAssetsResponse