{-# 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.DescribeProjects
-- 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 and gets information about your Amazon Rekognition Custom Labels
-- projects.
--
-- This operation requires permissions to perform the
-- @rekognition:DescribeProjects@ action.
--
-- This operation returns paginated results.
module Amazonka.Rekognition.DescribeProjects
  ( -- * Creating a Request
    DescribeProjects (..),
    newDescribeProjects,

    -- * Request Lenses
    describeProjects_nextToken,
    describeProjects_maxResults,

    -- * Destructuring the Response
    DescribeProjectsResponse (..),
    newDescribeProjectsResponse,

    -- * Response Lenses
    describeProjectsResponse_nextToken,
    describeProjectsResponse_projectDescriptions,
    describeProjectsResponse_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:/ 'newDescribeProjects' smart constructor.
data DescribeProjects = DescribeProjects'
  { -- | If the previous response was incomplete (because there is more results
    -- to retrieve), Amazon Rekognition Custom Labels returns a pagination
    -- token in the response. You can use this pagination token to retrieve the
    -- next set of results.
    DescribeProjects -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return per paginated call. The largest
    -- value you can specify is 100. If you specify a value greater than 100, a
    -- ValidationException error occurs. The default value is 100.
    DescribeProjects -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeProjects -> DescribeProjects -> Bool
(DescribeProjects -> DescribeProjects -> Bool)
-> (DescribeProjects -> DescribeProjects -> Bool)
-> Eq DescribeProjects
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeProjects -> DescribeProjects -> Bool
$c/= :: DescribeProjects -> DescribeProjects -> Bool
== :: DescribeProjects -> DescribeProjects -> Bool
$c== :: DescribeProjects -> DescribeProjects -> Bool
Prelude.Eq, ReadPrec [DescribeProjects]
ReadPrec DescribeProjects
Int -> ReadS DescribeProjects
ReadS [DescribeProjects]
(Int -> ReadS DescribeProjects)
-> ReadS [DescribeProjects]
-> ReadPrec DescribeProjects
-> ReadPrec [DescribeProjects]
-> Read DescribeProjects
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeProjects]
$creadListPrec :: ReadPrec [DescribeProjects]
readPrec :: ReadPrec DescribeProjects
$creadPrec :: ReadPrec DescribeProjects
readList :: ReadS [DescribeProjects]
$creadList :: ReadS [DescribeProjects]
readsPrec :: Int -> ReadS DescribeProjects
$creadsPrec :: Int -> ReadS DescribeProjects
Prelude.Read, Int -> DescribeProjects -> ShowS
[DescribeProjects] -> ShowS
DescribeProjects -> String
(Int -> DescribeProjects -> ShowS)
-> (DescribeProjects -> String)
-> ([DescribeProjects] -> ShowS)
-> Show DescribeProjects
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeProjects] -> ShowS
$cshowList :: [DescribeProjects] -> ShowS
show :: DescribeProjects -> String
$cshow :: DescribeProjects -> String
showsPrec :: Int -> DescribeProjects -> ShowS
$cshowsPrec :: Int -> DescribeProjects -> ShowS
Prelude.Show, (forall x. DescribeProjects -> Rep DescribeProjects x)
-> (forall x. Rep DescribeProjects x -> DescribeProjects)
-> Generic DescribeProjects
forall x. Rep DescribeProjects x -> DescribeProjects
forall x. DescribeProjects -> Rep DescribeProjects x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeProjects x -> DescribeProjects
$cfrom :: forall x. DescribeProjects -> Rep DescribeProjects x
Prelude.Generic)

-- |
-- Create a value of 'DescribeProjects' 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', 'describeProjects_nextToken' - If the previous response was incomplete (because there is more results
-- to retrieve), Amazon Rekognition Custom Labels returns a pagination
-- token in the response. You can use this pagination token to retrieve the
-- next set of results.
--
-- 'maxResults', 'describeProjects_maxResults' - The maximum number of results to return per paginated call. The largest
-- value you can specify is 100. If you specify a value greater than 100, a
-- ValidationException error occurs. The default value is 100.
newDescribeProjects ::
  DescribeProjects
newDescribeProjects :: DescribeProjects
newDescribeProjects =
  DescribeProjects' :: Maybe Text -> Maybe Natural -> DescribeProjects
DescribeProjects'
    { $sel:nextToken:DescribeProjects' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeProjects' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | If the previous response was incomplete (because there is more results
-- to retrieve), Amazon Rekognition Custom Labels returns a pagination
-- token in the response. You can use this pagination token to retrieve the
-- next set of results.
describeProjects_nextToken :: Lens.Lens' DescribeProjects (Prelude.Maybe Prelude.Text)
describeProjects_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeProjects -> f DescribeProjects
describeProjects_nextToken = (DescribeProjects -> Maybe Text)
-> (DescribeProjects -> Maybe Text -> DescribeProjects)
-> Lens DescribeProjects DescribeProjects (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjects' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeProjects' :: DescribeProjects -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeProjects
s@DescribeProjects' {} Maybe Text
a -> DescribeProjects
s {$sel:nextToken:DescribeProjects' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeProjects)

-- | The maximum number of results to return per paginated call. The largest
-- value you can specify is 100. If you specify a value greater than 100, a
-- ValidationException error occurs. The default value is 100.
describeProjects_maxResults :: Lens.Lens' DescribeProjects (Prelude.Maybe Prelude.Natural)
describeProjects_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeProjects -> f DescribeProjects
describeProjects_maxResults = (DescribeProjects -> Maybe Natural)
-> (DescribeProjects -> Maybe Natural -> DescribeProjects)
-> Lens
     DescribeProjects DescribeProjects (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjects' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeProjects' :: DescribeProjects -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeProjects
s@DescribeProjects' {} Maybe Natural
a -> DescribeProjects
s {$sel:maxResults:DescribeProjects' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeProjects)

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

instance Prelude.NFData DescribeProjects

instance Core.ToHeaders DescribeProjects where
  toHeaders :: DescribeProjects -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeProjects -> 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.DescribeProjects" ::
                          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 DescribeProjects where
  toJSON :: DescribeProjects -> Value
toJSON DescribeProjects' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:DescribeProjects' :: DescribeProjects -> Maybe Natural
$sel:nextToken:DescribeProjects' :: DescribeProjects -> 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 DescribeProjects where
  toPath :: DescribeProjects -> ByteString
toPath = ByteString -> DescribeProjects -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newDescribeProjectsResponse' smart constructor.
data DescribeProjectsResponse = DescribeProjectsResponse'
  { -- | If the previous response was incomplete (because there is more results
    -- to retrieve), Amazon Rekognition Custom Labels returns a pagination
    -- token in the response. You can use this pagination token to retrieve the
    -- next set of results.
    DescribeProjectsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of project descriptions. The list is sorted by the date and time
    -- the projects are created.
    DescribeProjectsResponse -> Maybe [ProjectDescription]
projectDescriptions :: Prelude.Maybe [ProjectDescription],
    -- | The response's http status code.
    DescribeProjectsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeProjectsResponse -> DescribeProjectsResponse -> Bool
(DescribeProjectsResponse -> DescribeProjectsResponse -> Bool)
-> (DescribeProjectsResponse -> DescribeProjectsResponse -> Bool)
-> Eq DescribeProjectsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeProjectsResponse -> DescribeProjectsResponse -> Bool
$c/= :: DescribeProjectsResponse -> DescribeProjectsResponse -> Bool
== :: DescribeProjectsResponse -> DescribeProjectsResponse -> Bool
$c== :: DescribeProjectsResponse -> DescribeProjectsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeProjectsResponse]
ReadPrec DescribeProjectsResponse
Int -> ReadS DescribeProjectsResponse
ReadS [DescribeProjectsResponse]
(Int -> ReadS DescribeProjectsResponse)
-> ReadS [DescribeProjectsResponse]
-> ReadPrec DescribeProjectsResponse
-> ReadPrec [DescribeProjectsResponse]
-> Read DescribeProjectsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeProjectsResponse]
$creadListPrec :: ReadPrec [DescribeProjectsResponse]
readPrec :: ReadPrec DescribeProjectsResponse
$creadPrec :: ReadPrec DescribeProjectsResponse
readList :: ReadS [DescribeProjectsResponse]
$creadList :: ReadS [DescribeProjectsResponse]
readsPrec :: Int -> ReadS DescribeProjectsResponse
$creadsPrec :: Int -> ReadS DescribeProjectsResponse
Prelude.Read, Int -> DescribeProjectsResponse -> ShowS
[DescribeProjectsResponse] -> ShowS
DescribeProjectsResponse -> String
(Int -> DescribeProjectsResponse -> ShowS)
-> (DescribeProjectsResponse -> String)
-> ([DescribeProjectsResponse] -> ShowS)
-> Show DescribeProjectsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeProjectsResponse] -> ShowS
$cshowList :: [DescribeProjectsResponse] -> ShowS
show :: DescribeProjectsResponse -> String
$cshow :: DescribeProjectsResponse -> String
showsPrec :: Int -> DescribeProjectsResponse -> ShowS
$cshowsPrec :: Int -> DescribeProjectsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeProjectsResponse -> Rep DescribeProjectsResponse x)
-> (forall x.
    Rep DescribeProjectsResponse x -> DescribeProjectsResponse)
-> Generic DescribeProjectsResponse
forall x.
Rep DescribeProjectsResponse x -> DescribeProjectsResponse
forall x.
DescribeProjectsResponse -> Rep DescribeProjectsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeProjectsResponse x -> DescribeProjectsResponse
$cfrom :: forall x.
DescribeProjectsResponse -> Rep DescribeProjectsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeProjectsResponse' 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', 'describeProjectsResponse_nextToken' - If the previous response was incomplete (because there is more results
-- to retrieve), Amazon Rekognition Custom Labels returns a pagination
-- token in the response. You can use this pagination token to retrieve the
-- next set of results.
--
-- 'projectDescriptions', 'describeProjectsResponse_projectDescriptions' - A list of project descriptions. The list is sorted by the date and time
-- the projects are created.
--
-- 'httpStatus', 'describeProjectsResponse_httpStatus' - The response's http status code.
newDescribeProjectsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeProjectsResponse
newDescribeProjectsResponse :: Int -> DescribeProjectsResponse
newDescribeProjectsResponse Int
pHttpStatus_ =
  DescribeProjectsResponse' :: Maybe Text
-> Maybe [ProjectDescription] -> Int -> DescribeProjectsResponse
DescribeProjectsResponse'
    { $sel:nextToken:DescribeProjectsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:projectDescriptions:DescribeProjectsResponse' :: Maybe [ProjectDescription]
projectDescriptions = Maybe [ProjectDescription]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeProjectsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If the previous response was incomplete (because there is more results
-- to retrieve), Amazon Rekognition Custom Labels returns a pagination
-- token in the response. You can use this pagination token to retrieve the
-- next set of results.
describeProjectsResponse_nextToken :: Lens.Lens' DescribeProjectsResponse (Prelude.Maybe Prelude.Text)
describeProjectsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeProjectsResponse -> f DescribeProjectsResponse
describeProjectsResponse_nextToken = (DescribeProjectsResponse -> Maybe Text)
-> (DescribeProjectsResponse
    -> Maybe Text -> DescribeProjectsResponse)
-> Lens' DescribeProjectsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeProjectsResponse' :: DescribeProjectsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeProjectsResponse
s@DescribeProjectsResponse' {} Maybe Text
a -> DescribeProjectsResponse
s {$sel:nextToken:DescribeProjectsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeProjectsResponse)

-- | A list of project descriptions. The list is sorted by the date and time
-- the projects are created.
describeProjectsResponse_projectDescriptions :: Lens.Lens' DescribeProjectsResponse (Prelude.Maybe [ProjectDescription])
describeProjectsResponse_projectDescriptions :: (Maybe [ProjectDescription] -> f (Maybe [ProjectDescription]))
-> DescribeProjectsResponse -> f DescribeProjectsResponse
describeProjectsResponse_projectDescriptions = (DescribeProjectsResponse -> Maybe [ProjectDescription])
-> (DescribeProjectsResponse
    -> Maybe [ProjectDescription] -> DescribeProjectsResponse)
-> Lens' DescribeProjectsResponse (Maybe [ProjectDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeProjectsResponse' {Maybe [ProjectDescription]
projectDescriptions :: Maybe [ProjectDescription]
$sel:projectDescriptions:DescribeProjectsResponse' :: DescribeProjectsResponse -> Maybe [ProjectDescription]
projectDescriptions} -> Maybe [ProjectDescription]
projectDescriptions) (\s :: DescribeProjectsResponse
s@DescribeProjectsResponse' {} Maybe [ProjectDescription]
a -> DescribeProjectsResponse
s {$sel:projectDescriptions:DescribeProjectsResponse' :: Maybe [ProjectDescription]
projectDescriptions = Maybe [ProjectDescription]
a} :: DescribeProjectsResponse) ((Maybe [ProjectDescription] -> f (Maybe [ProjectDescription]))
 -> DescribeProjectsResponse -> f DescribeProjectsResponse)
-> ((Maybe [ProjectDescription] -> f (Maybe [ProjectDescription]))
    -> Maybe [ProjectDescription] -> f (Maybe [ProjectDescription]))
-> (Maybe [ProjectDescription] -> f (Maybe [ProjectDescription]))
-> DescribeProjectsResponse
-> f DescribeProjectsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProjectDescription]
  [ProjectDescription]
  [ProjectDescription]
  [ProjectDescription]
-> Iso
     (Maybe [ProjectDescription])
     (Maybe [ProjectDescription])
     (Maybe [ProjectDescription])
     (Maybe [ProjectDescription])
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
  [ProjectDescription]
  [ProjectDescription]
  [ProjectDescription]
  [ProjectDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeProjectsResponse