{-# 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.MarketplaceCatalog.ListEntities
-- 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)
--
-- Provides the list of entities of a given type.
module Amazonka.MarketplaceCatalog.ListEntities
  ( -- * Creating a Request
    ListEntities (..),
    newListEntities,

    -- * Request Lenses
    listEntities_nextToken,
    listEntities_filterList,
    listEntities_sort,
    listEntities_maxResults,
    listEntities_catalog,
    listEntities_entityType,

    -- * Destructuring the Response
    ListEntitiesResponse (..),
    newListEntitiesResponse,

    -- * Response Lenses
    listEntitiesResponse_entitySummaryList,
    listEntitiesResponse_nextToken,
    listEntitiesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListEntities' smart constructor.
data ListEntities = ListEntities'
  { -- | The value of the next token, if it exists. Null if there are no more
    -- results.
    ListEntities -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of filter objects. Each filter object contains two attributes,
    -- @filterName@ and @filterValues@.
    ListEntities -> Maybe (NonEmpty Filter)
filterList :: Prelude.Maybe (Prelude.NonEmpty Filter),
    -- | An object that contains two attributes, @SortBy@ and @SortOrder@.
    ListEntities -> Maybe Sort
sort :: Prelude.Maybe Sort,
    -- | Specifies the upper limit of the elements on a single page. If a value
    -- isn\'t provided, the default value is 20.
    ListEntities -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The catalog related to the request. Fixed value: @AWSMarketplace@
    ListEntities -> Text
catalog :: Prelude.Text,
    -- | The type of entities to retrieve.
    ListEntities -> Text
entityType :: Prelude.Text
  }
  deriving (ListEntities -> ListEntities -> Bool
(ListEntities -> ListEntities -> Bool)
-> (ListEntities -> ListEntities -> Bool) -> Eq ListEntities
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEntities -> ListEntities -> Bool
$c/= :: ListEntities -> ListEntities -> Bool
== :: ListEntities -> ListEntities -> Bool
$c== :: ListEntities -> ListEntities -> Bool
Prelude.Eq, ReadPrec [ListEntities]
ReadPrec ListEntities
Int -> ReadS ListEntities
ReadS [ListEntities]
(Int -> ReadS ListEntities)
-> ReadS [ListEntities]
-> ReadPrec ListEntities
-> ReadPrec [ListEntities]
-> Read ListEntities
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEntities]
$creadListPrec :: ReadPrec [ListEntities]
readPrec :: ReadPrec ListEntities
$creadPrec :: ReadPrec ListEntities
readList :: ReadS [ListEntities]
$creadList :: ReadS [ListEntities]
readsPrec :: Int -> ReadS ListEntities
$creadsPrec :: Int -> ReadS ListEntities
Prelude.Read, Int -> ListEntities -> ShowS
[ListEntities] -> ShowS
ListEntities -> String
(Int -> ListEntities -> ShowS)
-> (ListEntities -> String)
-> ([ListEntities] -> ShowS)
-> Show ListEntities
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEntities] -> ShowS
$cshowList :: [ListEntities] -> ShowS
show :: ListEntities -> String
$cshow :: ListEntities -> String
showsPrec :: Int -> ListEntities -> ShowS
$cshowsPrec :: Int -> ListEntities -> ShowS
Prelude.Show, (forall x. ListEntities -> Rep ListEntities x)
-> (forall x. Rep ListEntities x -> ListEntities)
-> Generic ListEntities
forall x. Rep ListEntities x -> ListEntities
forall x. ListEntities -> Rep ListEntities x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListEntities x -> ListEntities
$cfrom :: forall x. ListEntities -> Rep ListEntities x
Prelude.Generic)

-- |
-- Create a value of 'ListEntities' 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', 'listEntities_nextToken' - The value of the next token, if it exists. Null if there are no more
-- results.
--
-- 'filterList', 'listEntities_filterList' - An array of filter objects. Each filter object contains two attributes,
-- @filterName@ and @filterValues@.
--
-- 'sort', 'listEntities_sort' - An object that contains two attributes, @SortBy@ and @SortOrder@.
--
-- 'maxResults', 'listEntities_maxResults' - Specifies the upper limit of the elements on a single page. If a value
-- isn\'t provided, the default value is 20.
--
-- 'catalog', 'listEntities_catalog' - The catalog related to the request. Fixed value: @AWSMarketplace@
--
-- 'entityType', 'listEntities_entityType' - The type of entities to retrieve.
newListEntities ::
  -- | 'catalog'
  Prelude.Text ->
  -- | 'entityType'
  Prelude.Text ->
  ListEntities
newListEntities :: Text -> Text -> ListEntities
newListEntities Text
pCatalog_ Text
pEntityType_ =
  ListEntities' :: Maybe Text
-> Maybe (NonEmpty Filter)
-> Maybe Sort
-> Maybe Natural
-> Text
-> Text
-> ListEntities
ListEntities'
    { $sel:nextToken:ListEntities' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filterList:ListEntities' :: Maybe (NonEmpty Filter)
filterList = Maybe (NonEmpty Filter)
forall a. Maybe a
Prelude.Nothing,
      $sel:sort:ListEntities' :: Maybe Sort
sort = Maybe Sort
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListEntities' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:catalog:ListEntities' :: Text
catalog = Text
pCatalog_,
      $sel:entityType:ListEntities' :: Text
entityType = Text
pEntityType_
    }

-- | The value of the next token, if it exists. Null if there are no more
-- results.
listEntities_nextToken :: Lens.Lens' ListEntities (Prelude.Maybe Prelude.Text)
listEntities_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListEntities -> f ListEntities
listEntities_nextToken = (ListEntities -> Maybe Text)
-> (ListEntities -> Maybe Text -> ListEntities)
-> Lens ListEntities ListEntities (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntities' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEntities' :: ListEntities -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEntities
s@ListEntities' {} Maybe Text
a -> ListEntities
s {$sel:nextToken:ListEntities' :: Maybe Text
nextToken = Maybe Text
a} :: ListEntities)

-- | An array of filter objects. Each filter object contains two attributes,
-- @filterName@ and @filterValues@.
listEntities_filterList :: Lens.Lens' ListEntities (Prelude.Maybe (Prelude.NonEmpty Filter))
listEntities_filterList :: (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListEntities -> f ListEntities
listEntities_filterList = (ListEntities -> Maybe (NonEmpty Filter))
-> (ListEntities -> Maybe (NonEmpty Filter) -> ListEntities)
-> Lens
     ListEntities
     ListEntities
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntities' {Maybe (NonEmpty Filter)
filterList :: Maybe (NonEmpty Filter)
$sel:filterList:ListEntities' :: ListEntities -> Maybe (NonEmpty Filter)
filterList} -> Maybe (NonEmpty Filter)
filterList) (\s :: ListEntities
s@ListEntities' {} Maybe (NonEmpty Filter)
a -> ListEntities
s {$sel:filterList:ListEntities' :: Maybe (NonEmpty Filter)
filterList = Maybe (NonEmpty Filter)
a} :: ListEntities) ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
 -> ListEntities -> f ListEntities)
-> ((Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
    -> Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> (Maybe (NonEmpty Filter) -> f (Maybe (NonEmpty Filter)))
-> ListEntities
-> f ListEntities
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
-> Iso
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
     (Maybe (NonEmpty Filter))
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
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
  (NonEmpty Filter)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An object that contains two attributes, @SortBy@ and @SortOrder@.
listEntities_sort :: Lens.Lens' ListEntities (Prelude.Maybe Sort)
listEntities_sort :: (Maybe Sort -> f (Maybe Sort)) -> ListEntities -> f ListEntities
listEntities_sort = (ListEntities -> Maybe Sort)
-> (ListEntities -> Maybe Sort -> ListEntities)
-> Lens ListEntities ListEntities (Maybe Sort) (Maybe Sort)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntities' {Maybe Sort
sort :: Maybe Sort
$sel:sort:ListEntities' :: ListEntities -> Maybe Sort
sort} -> Maybe Sort
sort) (\s :: ListEntities
s@ListEntities' {} Maybe Sort
a -> ListEntities
s {$sel:sort:ListEntities' :: Maybe Sort
sort = Maybe Sort
a} :: ListEntities)

-- | Specifies the upper limit of the elements on a single page. If a value
-- isn\'t provided, the default value is 20.
listEntities_maxResults :: Lens.Lens' ListEntities (Prelude.Maybe Prelude.Natural)
listEntities_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListEntities -> f ListEntities
listEntities_maxResults = (ListEntities -> Maybe Natural)
-> (ListEntities -> Maybe Natural -> ListEntities)
-> Lens ListEntities ListEntities (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntities' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListEntities' :: ListEntities -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListEntities
s@ListEntities' {} Maybe Natural
a -> ListEntities
s {$sel:maxResults:ListEntities' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListEntities)

-- | The catalog related to the request. Fixed value: @AWSMarketplace@
listEntities_catalog :: Lens.Lens' ListEntities Prelude.Text
listEntities_catalog :: (Text -> f Text) -> ListEntities -> f ListEntities
listEntities_catalog = (ListEntities -> Text)
-> (ListEntities -> Text -> ListEntities)
-> Lens ListEntities ListEntities Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntities' {Text
catalog :: Text
$sel:catalog:ListEntities' :: ListEntities -> Text
catalog} -> Text
catalog) (\s :: ListEntities
s@ListEntities' {} Text
a -> ListEntities
s {$sel:catalog:ListEntities' :: Text
catalog = Text
a} :: ListEntities)

-- | The type of entities to retrieve.
listEntities_entityType :: Lens.Lens' ListEntities Prelude.Text
listEntities_entityType :: (Text -> f Text) -> ListEntities -> f ListEntities
listEntities_entityType = (ListEntities -> Text)
-> (ListEntities -> Text -> ListEntities)
-> Lens ListEntities ListEntities Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntities' {Text
entityType :: Text
$sel:entityType:ListEntities' :: ListEntities -> Text
entityType} -> Text
entityType) (\s :: ListEntities
s@ListEntities' {} Text
a -> ListEntities
s {$sel:entityType:ListEntities' :: Text
entityType = Text
a} :: ListEntities)

instance Core.AWSRequest ListEntities where
  type AWSResponse ListEntities = ListEntitiesResponse
  request :: ListEntities -> Request ListEntities
request = Service -> ListEntities -> Request ListEntities
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListEntities
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListEntities)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListEntities))
-> Logger
-> Service
-> Proxy ListEntities
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListEntities)))
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 [EntitySummary] -> Maybe Text -> Int -> ListEntitiesResponse
ListEntitiesResponse'
            (Maybe [EntitySummary]
 -> Maybe Text -> Int -> ListEntitiesResponse)
-> Either String (Maybe [EntitySummary])
-> Either String (Maybe Text -> Int -> ListEntitiesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [EntitySummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EntitySummaryList"
                            Either String (Maybe (Maybe [EntitySummary]))
-> Maybe [EntitySummary] -> Either String (Maybe [EntitySummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [EntitySummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Maybe Text -> Int -> ListEntitiesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListEntitiesResponse)
forall (f :: * -> *) a b. Applicative f => 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 -> ListEntitiesResponse)
-> Either String Int -> Either String ListEntitiesResponse
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 ListEntities

instance Prelude.NFData ListEntities

instance Core.ToHeaders ListEntities where
  toHeaders :: ListEntities -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListEntities -> 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.ToJSON ListEntities where
  toJSON :: ListEntities -> Value
toJSON ListEntities' {Maybe Natural
Maybe (NonEmpty Filter)
Maybe Text
Maybe Sort
Text
entityType :: Text
catalog :: Text
maxResults :: Maybe Natural
sort :: Maybe Sort
filterList :: Maybe (NonEmpty Filter)
nextToken :: Maybe Text
$sel:entityType:ListEntities' :: ListEntities -> Text
$sel:catalog:ListEntities' :: ListEntities -> Text
$sel:maxResults:ListEntities' :: ListEntities -> Maybe Natural
$sel:sort:ListEntities' :: ListEntities -> Maybe Sort
$sel:filterList:ListEntities' :: ListEntities -> Maybe (NonEmpty Filter)
$sel:nextToken:ListEntities' :: ListEntities -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" 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
nextToken,
            (Text
"FilterList" Text -> NonEmpty Filter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Filter -> Pair) -> Maybe (NonEmpty Filter) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Filter)
filterList,
            (Text
"Sort" Text -> Sort -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sort -> Pair) -> Maybe Sort -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Sort
sort,
            (Text
"MaxResults" 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
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Catalog" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
catalog),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EntityType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
entityType)
          ]
      )

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

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

-- | /See:/ 'newListEntitiesResponse' smart constructor.
data ListEntitiesResponse = ListEntitiesResponse'
  { -- | Array of @EntitySummary@ object.
    ListEntitiesResponse -> Maybe [EntitySummary]
entitySummaryList :: Prelude.Maybe [EntitySummary],
    -- | The value of the next token if it exists. Null if there is no more
    -- result.
    ListEntitiesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListEntitiesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListEntitiesResponse -> ListEntitiesResponse -> Bool
(ListEntitiesResponse -> ListEntitiesResponse -> Bool)
-> (ListEntitiesResponse -> ListEntitiesResponse -> Bool)
-> Eq ListEntitiesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListEntitiesResponse -> ListEntitiesResponse -> Bool
$c/= :: ListEntitiesResponse -> ListEntitiesResponse -> Bool
== :: ListEntitiesResponse -> ListEntitiesResponse -> Bool
$c== :: ListEntitiesResponse -> ListEntitiesResponse -> Bool
Prelude.Eq, ReadPrec [ListEntitiesResponse]
ReadPrec ListEntitiesResponse
Int -> ReadS ListEntitiesResponse
ReadS [ListEntitiesResponse]
(Int -> ReadS ListEntitiesResponse)
-> ReadS [ListEntitiesResponse]
-> ReadPrec ListEntitiesResponse
-> ReadPrec [ListEntitiesResponse]
-> Read ListEntitiesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListEntitiesResponse]
$creadListPrec :: ReadPrec [ListEntitiesResponse]
readPrec :: ReadPrec ListEntitiesResponse
$creadPrec :: ReadPrec ListEntitiesResponse
readList :: ReadS [ListEntitiesResponse]
$creadList :: ReadS [ListEntitiesResponse]
readsPrec :: Int -> ReadS ListEntitiesResponse
$creadsPrec :: Int -> ReadS ListEntitiesResponse
Prelude.Read, Int -> ListEntitiesResponse -> ShowS
[ListEntitiesResponse] -> ShowS
ListEntitiesResponse -> String
(Int -> ListEntitiesResponse -> ShowS)
-> (ListEntitiesResponse -> String)
-> ([ListEntitiesResponse] -> ShowS)
-> Show ListEntitiesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListEntitiesResponse] -> ShowS
$cshowList :: [ListEntitiesResponse] -> ShowS
show :: ListEntitiesResponse -> String
$cshow :: ListEntitiesResponse -> String
showsPrec :: Int -> ListEntitiesResponse -> ShowS
$cshowsPrec :: Int -> ListEntitiesResponse -> ShowS
Prelude.Show, (forall x. ListEntitiesResponse -> Rep ListEntitiesResponse x)
-> (forall x. Rep ListEntitiesResponse x -> ListEntitiesResponse)
-> Generic ListEntitiesResponse
forall x. Rep ListEntitiesResponse x -> ListEntitiesResponse
forall x. ListEntitiesResponse -> Rep ListEntitiesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListEntitiesResponse x -> ListEntitiesResponse
$cfrom :: forall x. ListEntitiesResponse -> Rep ListEntitiesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListEntitiesResponse' 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:
--
-- 'entitySummaryList', 'listEntitiesResponse_entitySummaryList' - Array of @EntitySummary@ object.
--
-- 'nextToken', 'listEntitiesResponse_nextToken' - The value of the next token if it exists. Null if there is no more
-- result.
--
-- 'httpStatus', 'listEntitiesResponse_httpStatus' - The response's http status code.
newListEntitiesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListEntitiesResponse
newListEntitiesResponse :: Int -> ListEntitiesResponse
newListEntitiesResponse Int
pHttpStatus_ =
  ListEntitiesResponse' :: Maybe [EntitySummary] -> Maybe Text -> Int -> ListEntitiesResponse
ListEntitiesResponse'
    { $sel:entitySummaryList:ListEntitiesResponse' :: Maybe [EntitySummary]
entitySummaryList =
        Maybe [EntitySummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListEntitiesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListEntitiesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Array of @EntitySummary@ object.
listEntitiesResponse_entitySummaryList :: Lens.Lens' ListEntitiesResponse (Prelude.Maybe [EntitySummary])
listEntitiesResponse_entitySummaryList :: (Maybe [EntitySummary] -> f (Maybe [EntitySummary]))
-> ListEntitiesResponse -> f ListEntitiesResponse
listEntitiesResponse_entitySummaryList = (ListEntitiesResponse -> Maybe [EntitySummary])
-> (ListEntitiesResponse
    -> Maybe [EntitySummary] -> ListEntitiesResponse)
-> Lens
     ListEntitiesResponse
     ListEntitiesResponse
     (Maybe [EntitySummary])
     (Maybe [EntitySummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntitiesResponse' {Maybe [EntitySummary]
entitySummaryList :: Maybe [EntitySummary]
$sel:entitySummaryList:ListEntitiesResponse' :: ListEntitiesResponse -> Maybe [EntitySummary]
entitySummaryList} -> Maybe [EntitySummary]
entitySummaryList) (\s :: ListEntitiesResponse
s@ListEntitiesResponse' {} Maybe [EntitySummary]
a -> ListEntitiesResponse
s {$sel:entitySummaryList:ListEntitiesResponse' :: Maybe [EntitySummary]
entitySummaryList = Maybe [EntitySummary]
a} :: ListEntitiesResponse) ((Maybe [EntitySummary] -> f (Maybe [EntitySummary]))
 -> ListEntitiesResponse -> f ListEntitiesResponse)
-> ((Maybe [EntitySummary] -> f (Maybe [EntitySummary]))
    -> Maybe [EntitySummary] -> f (Maybe [EntitySummary]))
-> (Maybe [EntitySummary] -> f (Maybe [EntitySummary]))
-> ListEntitiesResponse
-> f ListEntitiesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EntitySummary] [EntitySummary] [EntitySummary] [EntitySummary]
-> Iso
     (Maybe [EntitySummary])
     (Maybe [EntitySummary])
     (Maybe [EntitySummary])
     (Maybe [EntitySummary])
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
  [EntitySummary] [EntitySummary] [EntitySummary] [EntitySummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The value of the next token if it exists. Null if there is no more
-- result.
listEntitiesResponse_nextToken :: Lens.Lens' ListEntitiesResponse (Prelude.Maybe Prelude.Text)
listEntitiesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListEntitiesResponse -> f ListEntitiesResponse
listEntitiesResponse_nextToken = (ListEntitiesResponse -> Maybe Text)
-> (ListEntitiesResponse -> Maybe Text -> ListEntitiesResponse)
-> Lens
     ListEntitiesResponse ListEntitiesResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListEntitiesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListEntitiesResponse' :: ListEntitiesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListEntitiesResponse
s@ListEntitiesResponse' {} Maybe Text
a -> ListEntitiesResponse
s {$sel:nextToken:ListEntitiesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListEntitiesResponse)

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

instance Prelude.NFData ListEntitiesResponse