{-# 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.Rekognition.ListCollections
-- 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)
--
-- Returns list of collection IDs in your account. If the result is
-- truncated, the response also provides a @NextToken@ that you can use in
-- the subsequent request to fetch the next set of collection IDs.
--
-- For an example, see Listing Collections in the Amazon Rekognition
-- Developer Guide.
--
-- This operation requires permissions to perform the
-- @rekognition:ListCollections@ action.
--
-- This operation returns paginated results.
module Amazonka.Rekognition.ListCollections
  ( -- * Creating a Request
    ListCollections (..),
    newListCollections,

    -- * Request Lenses
    listCollections_nextToken,
    listCollections_maxResults,

    -- * Destructuring the Response
    ListCollectionsResponse (..),
    newListCollectionsResponse,

    -- * Response Lenses
    listCollectionsResponse_collectionIds,
    listCollectionsResponse_nextToken,
    listCollectionsResponse_faceModelVersions,
    listCollectionsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListCollections' smart constructor.
data ListCollections = ListCollections'
  { -- | Pagination token from the previous response.
    ListCollections -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Maximum number of collection IDs to return.
    ListCollections -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListCollections -> ListCollections -> Bool
(ListCollections -> ListCollections -> Bool)
-> (ListCollections -> ListCollections -> Bool)
-> Eq ListCollections
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCollections -> ListCollections -> Bool
$c/= :: ListCollections -> ListCollections -> Bool
== :: ListCollections -> ListCollections -> Bool
$c== :: ListCollections -> ListCollections -> Bool
Prelude.Eq, ReadPrec [ListCollections]
ReadPrec ListCollections
Int -> ReadS ListCollections
ReadS [ListCollections]
(Int -> ReadS ListCollections)
-> ReadS [ListCollections]
-> ReadPrec ListCollections
-> ReadPrec [ListCollections]
-> Read ListCollections
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCollections]
$creadListPrec :: ReadPrec [ListCollections]
readPrec :: ReadPrec ListCollections
$creadPrec :: ReadPrec ListCollections
readList :: ReadS [ListCollections]
$creadList :: ReadS [ListCollections]
readsPrec :: Int -> ReadS ListCollections
$creadsPrec :: Int -> ReadS ListCollections
Prelude.Read, Int -> ListCollections -> ShowS
[ListCollections] -> ShowS
ListCollections -> String
(Int -> ListCollections -> ShowS)
-> (ListCollections -> String)
-> ([ListCollections] -> ShowS)
-> Show ListCollections
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCollections] -> ShowS
$cshowList :: [ListCollections] -> ShowS
show :: ListCollections -> String
$cshow :: ListCollections -> String
showsPrec :: Int -> ListCollections -> ShowS
$cshowsPrec :: Int -> ListCollections -> ShowS
Prelude.Show, (forall x. ListCollections -> Rep ListCollections x)
-> (forall x. Rep ListCollections x -> ListCollections)
-> Generic ListCollections
forall x. Rep ListCollections x -> ListCollections
forall x. ListCollections -> Rep ListCollections x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCollections x -> ListCollections
$cfrom :: forall x. ListCollections -> Rep ListCollections x
Prelude.Generic)

-- |
-- Create a value of 'ListCollections' 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', 'listCollections_nextToken' - Pagination token from the previous response.
--
-- 'maxResults', 'listCollections_maxResults' - Maximum number of collection IDs to return.
newListCollections ::
  ListCollections
newListCollections :: ListCollections
newListCollections =
  ListCollections' :: Maybe Text -> Maybe Natural -> ListCollections
ListCollections'
    { $sel:nextToken:ListCollections' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListCollections' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Pagination token from the previous response.
listCollections_nextToken :: Lens.Lens' ListCollections (Prelude.Maybe Prelude.Text)
listCollections_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCollections -> f ListCollections
listCollections_nextToken = (ListCollections -> Maybe Text)
-> (ListCollections -> Maybe Text -> ListCollections)
-> Lens ListCollections ListCollections (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCollections' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCollections' :: ListCollections -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCollections
s@ListCollections' {} Maybe Text
a -> ListCollections
s {$sel:nextToken:ListCollections' :: Maybe Text
nextToken = Maybe Text
a} :: ListCollections)

-- | Maximum number of collection IDs to return.
listCollections_maxResults :: Lens.Lens' ListCollections (Prelude.Maybe Prelude.Natural)
listCollections_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListCollections -> f ListCollections
listCollections_maxResults = (ListCollections -> Maybe Natural)
-> (ListCollections -> Maybe Natural -> ListCollections)
-> Lens
     ListCollections ListCollections (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCollections' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListCollections' :: ListCollections -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListCollections
s@ListCollections' {} Maybe Natural
a -> ListCollections
s {$sel:maxResults:ListCollections' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListCollections)

instance Core.AWSPager ListCollections where
  page :: ListCollections
-> AWSResponse ListCollections -> Maybe ListCollections
page ListCollections
rq AWSResponse ListCollections
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCollections
ListCollectionsResponse
rs
            ListCollectionsResponse
-> Getting (First Text) ListCollectionsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCollectionsResponse
-> Const (First Text) ListCollectionsResponse
Lens' ListCollectionsResponse (Maybe Text)
listCollectionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCollectionsResponse
 -> Const (First Text) ListCollectionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCollectionsResponse 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 ListCollections
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCollections
ListCollectionsResponse
rs
            ListCollectionsResponse
-> Getting (First [Text]) ListCollectionsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListCollectionsResponse
-> Const (First [Text]) ListCollectionsResponse
Lens' ListCollectionsResponse (Maybe [Text])
listCollectionsResponse_collectionIds
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListCollectionsResponse
 -> Const (First [Text]) ListCollectionsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListCollectionsResponse [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 ListCollections
forall a. Maybe a
Prelude.Nothing
    | Maybe [Text] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListCollections
ListCollectionsResponse
rs
            ListCollectionsResponse
-> Getting (First [Text]) ListCollectionsResponse [Text]
-> Maybe [Text]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> ListCollectionsResponse
-> Const (First [Text]) ListCollectionsResponse
Lens' ListCollectionsResponse (Maybe [Text])
listCollectionsResponse_faceModelVersions
              ((Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
 -> ListCollectionsResponse
 -> Const (First [Text]) ListCollectionsResponse)
-> (([Text] -> Const (First [Text]) [Text])
    -> Maybe [Text] -> Const (First [Text]) (Maybe [Text]))
-> Getting (First [Text]) ListCollectionsResponse [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 ListCollections
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListCollections -> Maybe ListCollections
forall a. a -> Maybe a
Prelude.Just (ListCollections -> Maybe ListCollections)
-> ListCollections -> Maybe ListCollections
forall a b. (a -> b) -> a -> b
Prelude.$
        ListCollections
rq
          ListCollections
-> (ListCollections -> ListCollections) -> ListCollections
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListCollections -> Identity ListCollections
Lens ListCollections ListCollections (Maybe Text) (Maybe Text)
listCollections_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListCollections -> Identity ListCollections)
-> Maybe Text -> ListCollections -> ListCollections
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListCollections
ListCollectionsResponse
rs
          ListCollectionsResponse
-> Getting (First Text) ListCollectionsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListCollectionsResponse
-> Const (First Text) ListCollectionsResponse
Lens' ListCollectionsResponse (Maybe Text)
listCollectionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListCollectionsResponse
 -> Const (First Text) ListCollectionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListCollectionsResponse 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 ListCollections where
  type
    AWSResponse ListCollections =
      ListCollectionsResponse
  request :: ListCollections -> Request ListCollections
request = Service -> ListCollections -> Request ListCollections
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListCollections
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListCollections)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListCollections))
-> Logger
-> Service
-> Proxy ListCollections
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListCollections)))
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 Text -> Maybe [Text] -> Int -> ListCollectionsResponse
ListCollectionsResponse'
            (Maybe [Text]
 -> Maybe Text -> Maybe [Text] -> Int -> ListCollectionsResponse)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text -> Maybe [Text] -> Int -> ListCollectionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CollectionIds" Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Text -> Maybe [Text] -> Int -> ListCollectionsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Text] -> Int -> ListCollectionsResponse)
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 (Maybe [Text] -> Int -> ListCollectionsResponse)
-> Either String (Maybe [Text])
-> Either String (Int -> ListCollectionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FaceModelVersions"
                            Either String (Maybe (Maybe [Text]))
-> Maybe [Text] -> Either String (Maybe [Text])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListCollectionsResponse)
-> Either String Int -> Either String ListCollectionsResponse
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 ListCollections

instance Prelude.NFData ListCollections

instance Core.ToHeaders ListCollections where
  toHeaders :: ListCollections -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListCollections -> 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
"RekognitionService.ListCollections" ::
                          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 ListCollections where
  toJSON :: ListCollections -> Value
toJSON ListCollections' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListCollections' :: ListCollections -> Maybe Natural
$sel:nextToken:ListCollections' :: ListCollections -> 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
"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
          ]
      )

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

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

-- | /See:/ 'newListCollectionsResponse' smart constructor.
data ListCollectionsResponse = ListCollectionsResponse'
  { -- | An array of collection IDs.
    ListCollectionsResponse -> Maybe [Text]
collectionIds :: Prelude.Maybe [Prelude.Text],
    -- | If the result is truncated, the response provides a @NextToken@ that you
    -- can use in the subsequent request to fetch the next set of collection
    -- IDs.
    ListCollectionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Version numbers of the face detection models associated with the
    -- collections in the array @CollectionIds@. For example, the value of
    -- @FaceModelVersions[2]@ is the version number for the face detection
    -- model used by the collection in @CollectionId[2]@.
    ListCollectionsResponse -> Maybe [Text]
faceModelVersions :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ListCollectionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListCollectionsResponse -> ListCollectionsResponse -> Bool
(ListCollectionsResponse -> ListCollectionsResponse -> Bool)
-> (ListCollectionsResponse -> ListCollectionsResponse -> Bool)
-> Eq ListCollectionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListCollectionsResponse -> ListCollectionsResponse -> Bool
$c/= :: ListCollectionsResponse -> ListCollectionsResponse -> Bool
== :: ListCollectionsResponse -> ListCollectionsResponse -> Bool
$c== :: ListCollectionsResponse -> ListCollectionsResponse -> Bool
Prelude.Eq, ReadPrec [ListCollectionsResponse]
ReadPrec ListCollectionsResponse
Int -> ReadS ListCollectionsResponse
ReadS [ListCollectionsResponse]
(Int -> ReadS ListCollectionsResponse)
-> ReadS [ListCollectionsResponse]
-> ReadPrec ListCollectionsResponse
-> ReadPrec [ListCollectionsResponse]
-> Read ListCollectionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListCollectionsResponse]
$creadListPrec :: ReadPrec [ListCollectionsResponse]
readPrec :: ReadPrec ListCollectionsResponse
$creadPrec :: ReadPrec ListCollectionsResponse
readList :: ReadS [ListCollectionsResponse]
$creadList :: ReadS [ListCollectionsResponse]
readsPrec :: Int -> ReadS ListCollectionsResponse
$creadsPrec :: Int -> ReadS ListCollectionsResponse
Prelude.Read, Int -> ListCollectionsResponse -> ShowS
[ListCollectionsResponse] -> ShowS
ListCollectionsResponse -> String
(Int -> ListCollectionsResponse -> ShowS)
-> (ListCollectionsResponse -> String)
-> ([ListCollectionsResponse] -> ShowS)
-> Show ListCollectionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListCollectionsResponse] -> ShowS
$cshowList :: [ListCollectionsResponse] -> ShowS
show :: ListCollectionsResponse -> String
$cshow :: ListCollectionsResponse -> String
showsPrec :: Int -> ListCollectionsResponse -> ShowS
$cshowsPrec :: Int -> ListCollectionsResponse -> ShowS
Prelude.Show, (forall x.
 ListCollectionsResponse -> Rep ListCollectionsResponse x)
-> (forall x.
    Rep ListCollectionsResponse x -> ListCollectionsResponse)
-> Generic ListCollectionsResponse
forall x. Rep ListCollectionsResponse x -> ListCollectionsResponse
forall x. ListCollectionsResponse -> Rep ListCollectionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListCollectionsResponse x -> ListCollectionsResponse
$cfrom :: forall x. ListCollectionsResponse -> Rep ListCollectionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListCollectionsResponse' 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:
--
-- 'collectionIds', 'listCollectionsResponse_collectionIds' - An array of collection IDs.
--
-- 'nextToken', 'listCollectionsResponse_nextToken' - If the result is truncated, the response provides a @NextToken@ that you
-- can use in the subsequent request to fetch the next set of collection
-- IDs.
--
-- 'faceModelVersions', 'listCollectionsResponse_faceModelVersions' - Version numbers of the face detection models associated with the
-- collections in the array @CollectionIds@. For example, the value of
-- @FaceModelVersions[2]@ is the version number for the face detection
-- model used by the collection in @CollectionId[2]@.
--
-- 'httpStatus', 'listCollectionsResponse_httpStatus' - The response's http status code.
newListCollectionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListCollectionsResponse
newListCollectionsResponse :: Int -> ListCollectionsResponse
newListCollectionsResponse Int
pHttpStatus_ =
  ListCollectionsResponse' :: Maybe [Text]
-> Maybe Text -> Maybe [Text] -> Int -> ListCollectionsResponse
ListCollectionsResponse'
    { $sel:collectionIds:ListCollectionsResponse' :: Maybe [Text]
collectionIds =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListCollectionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:faceModelVersions:ListCollectionsResponse' :: Maybe [Text]
faceModelVersions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListCollectionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of collection IDs.
listCollectionsResponse_collectionIds :: Lens.Lens' ListCollectionsResponse (Prelude.Maybe [Prelude.Text])
listCollectionsResponse_collectionIds :: (Maybe [Text] -> f (Maybe [Text]))
-> ListCollectionsResponse -> f ListCollectionsResponse
listCollectionsResponse_collectionIds = (ListCollectionsResponse -> Maybe [Text])
-> (ListCollectionsResponse
    -> Maybe [Text] -> ListCollectionsResponse)
-> Lens' ListCollectionsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCollectionsResponse' {Maybe [Text]
collectionIds :: Maybe [Text]
$sel:collectionIds:ListCollectionsResponse' :: ListCollectionsResponse -> Maybe [Text]
collectionIds} -> Maybe [Text]
collectionIds) (\s :: ListCollectionsResponse
s@ListCollectionsResponse' {} Maybe [Text]
a -> ListCollectionsResponse
s {$sel:collectionIds:ListCollectionsResponse' :: Maybe [Text]
collectionIds = Maybe [Text]
a} :: ListCollectionsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListCollectionsResponse -> f ListCollectionsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListCollectionsResponse
-> f ListCollectionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the result is truncated, the response provides a @NextToken@ that you
-- can use in the subsequent request to fetch the next set of collection
-- IDs.
listCollectionsResponse_nextToken :: Lens.Lens' ListCollectionsResponse (Prelude.Maybe Prelude.Text)
listCollectionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListCollectionsResponse -> f ListCollectionsResponse
listCollectionsResponse_nextToken = (ListCollectionsResponse -> Maybe Text)
-> (ListCollectionsResponse
    -> Maybe Text -> ListCollectionsResponse)
-> Lens' ListCollectionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCollectionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListCollectionsResponse' :: ListCollectionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListCollectionsResponse
s@ListCollectionsResponse' {} Maybe Text
a -> ListCollectionsResponse
s {$sel:nextToken:ListCollectionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListCollectionsResponse)

-- | Version numbers of the face detection models associated with the
-- collections in the array @CollectionIds@. For example, the value of
-- @FaceModelVersions[2]@ is the version number for the face detection
-- model used by the collection in @CollectionId[2]@.
listCollectionsResponse_faceModelVersions :: Lens.Lens' ListCollectionsResponse (Prelude.Maybe [Prelude.Text])
listCollectionsResponse_faceModelVersions :: (Maybe [Text] -> f (Maybe [Text]))
-> ListCollectionsResponse -> f ListCollectionsResponse
listCollectionsResponse_faceModelVersions = (ListCollectionsResponse -> Maybe [Text])
-> (ListCollectionsResponse
    -> Maybe [Text] -> ListCollectionsResponse)
-> Lens' ListCollectionsResponse (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListCollectionsResponse' {Maybe [Text]
faceModelVersions :: Maybe [Text]
$sel:faceModelVersions:ListCollectionsResponse' :: ListCollectionsResponse -> Maybe [Text]
faceModelVersions} -> Maybe [Text]
faceModelVersions) (\s :: ListCollectionsResponse
s@ListCollectionsResponse' {} Maybe [Text]
a -> ListCollectionsResponse
s {$sel:faceModelVersions:ListCollectionsResponse' :: Maybe [Text]
faceModelVersions = Maybe [Text]
a} :: ListCollectionsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListCollectionsResponse -> f ListCollectionsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListCollectionsResponse
-> f ListCollectionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListCollectionsResponse