{-# 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.MechanicalTurk.ListReviewableHITs
-- 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)
--
-- The @ListReviewableHITs@ operation retrieves the HITs with Status equal
-- to Reviewable or Status equal to Reviewing that belong to the Requester
-- calling the operation.
--
-- This operation returns paginated results.
module Amazonka.MechanicalTurk.ListReviewableHITs
  ( -- * Creating a Request
    ListReviewableHITs (..),
    newListReviewableHITs,

    -- * Request Lenses
    listReviewableHITs_status,
    listReviewableHITs_hITTypeId,
    listReviewableHITs_nextToken,
    listReviewableHITs_maxResults,

    -- * Destructuring the Response
    ListReviewableHITsResponse (..),
    newListReviewableHITsResponse,

    -- * Response Lenses
    listReviewableHITsResponse_nextToken,
    listReviewableHITsResponse_numResults,
    listReviewableHITsResponse_hITs,
    listReviewableHITsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListReviewableHITs' smart constructor.
data ListReviewableHITs = ListReviewableHITs'
  { -- | Can be either @Reviewable@ or @Reviewing@. Reviewable is the default
    -- value.
    ListReviewableHITs -> Maybe ReviewableHITStatus
status :: Prelude.Maybe ReviewableHITStatus,
    -- | The ID of the HIT type of the HITs to consider for the query. If not
    -- specified, all HITs for the Reviewer are considered
    ListReviewableHITs -> Maybe Text
hITTypeId :: Prelude.Maybe Prelude.Text,
    -- | Pagination Token
    ListReviewableHITs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Limit the number of results returned.
    ListReviewableHITs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListReviewableHITs -> ListReviewableHITs -> Bool
(ListReviewableHITs -> ListReviewableHITs -> Bool)
-> (ListReviewableHITs -> ListReviewableHITs -> Bool)
-> Eq ListReviewableHITs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReviewableHITs -> ListReviewableHITs -> Bool
$c/= :: ListReviewableHITs -> ListReviewableHITs -> Bool
== :: ListReviewableHITs -> ListReviewableHITs -> Bool
$c== :: ListReviewableHITs -> ListReviewableHITs -> Bool
Prelude.Eq, ReadPrec [ListReviewableHITs]
ReadPrec ListReviewableHITs
Int -> ReadS ListReviewableHITs
ReadS [ListReviewableHITs]
(Int -> ReadS ListReviewableHITs)
-> ReadS [ListReviewableHITs]
-> ReadPrec ListReviewableHITs
-> ReadPrec [ListReviewableHITs]
-> Read ListReviewableHITs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReviewableHITs]
$creadListPrec :: ReadPrec [ListReviewableHITs]
readPrec :: ReadPrec ListReviewableHITs
$creadPrec :: ReadPrec ListReviewableHITs
readList :: ReadS [ListReviewableHITs]
$creadList :: ReadS [ListReviewableHITs]
readsPrec :: Int -> ReadS ListReviewableHITs
$creadsPrec :: Int -> ReadS ListReviewableHITs
Prelude.Read, Int -> ListReviewableHITs -> ShowS
[ListReviewableHITs] -> ShowS
ListReviewableHITs -> String
(Int -> ListReviewableHITs -> ShowS)
-> (ListReviewableHITs -> String)
-> ([ListReviewableHITs] -> ShowS)
-> Show ListReviewableHITs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReviewableHITs] -> ShowS
$cshowList :: [ListReviewableHITs] -> ShowS
show :: ListReviewableHITs -> String
$cshow :: ListReviewableHITs -> String
showsPrec :: Int -> ListReviewableHITs -> ShowS
$cshowsPrec :: Int -> ListReviewableHITs -> ShowS
Prelude.Show, (forall x. ListReviewableHITs -> Rep ListReviewableHITs x)
-> (forall x. Rep ListReviewableHITs x -> ListReviewableHITs)
-> Generic ListReviewableHITs
forall x. Rep ListReviewableHITs x -> ListReviewableHITs
forall x. ListReviewableHITs -> Rep ListReviewableHITs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListReviewableHITs x -> ListReviewableHITs
$cfrom :: forall x. ListReviewableHITs -> Rep ListReviewableHITs x
Prelude.Generic)

-- |
-- Create a value of 'ListReviewableHITs' 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:
--
-- 'status', 'listReviewableHITs_status' - Can be either @Reviewable@ or @Reviewing@. Reviewable is the default
-- value.
--
-- 'hITTypeId', 'listReviewableHITs_hITTypeId' - The ID of the HIT type of the HITs to consider for the query. If not
-- specified, all HITs for the Reviewer are considered
--
-- 'nextToken', 'listReviewableHITs_nextToken' - Pagination Token
--
-- 'maxResults', 'listReviewableHITs_maxResults' - Limit the number of results returned.
newListReviewableHITs ::
  ListReviewableHITs
newListReviewableHITs :: ListReviewableHITs
newListReviewableHITs =
  ListReviewableHITs' :: Maybe ReviewableHITStatus
-> Maybe Text -> Maybe Text -> Maybe Natural -> ListReviewableHITs
ListReviewableHITs'
    { $sel:status:ListReviewableHITs' :: Maybe ReviewableHITStatus
status = Maybe ReviewableHITStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:hITTypeId:ListReviewableHITs' :: Maybe Text
hITTypeId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListReviewableHITs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListReviewableHITs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Can be either @Reviewable@ or @Reviewing@. Reviewable is the default
-- value.
listReviewableHITs_status :: Lens.Lens' ListReviewableHITs (Prelude.Maybe ReviewableHITStatus)
listReviewableHITs_status :: (Maybe ReviewableHITStatus -> f (Maybe ReviewableHITStatus))
-> ListReviewableHITs -> f ListReviewableHITs
listReviewableHITs_status = (ListReviewableHITs -> Maybe ReviewableHITStatus)
-> (ListReviewableHITs
    -> Maybe ReviewableHITStatus -> ListReviewableHITs)
-> Lens
     ListReviewableHITs
     ListReviewableHITs
     (Maybe ReviewableHITStatus)
     (Maybe ReviewableHITStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReviewableHITs' {Maybe ReviewableHITStatus
status :: Maybe ReviewableHITStatus
$sel:status:ListReviewableHITs' :: ListReviewableHITs -> Maybe ReviewableHITStatus
status} -> Maybe ReviewableHITStatus
status) (\s :: ListReviewableHITs
s@ListReviewableHITs' {} Maybe ReviewableHITStatus
a -> ListReviewableHITs
s {$sel:status:ListReviewableHITs' :: Maybe ReviewableHITStatus
status = Maybe ReviewableHITStatus
a} :: ListReviewableHITs)

-- | The ID of the HIT type of the HITs to consider for the query. If not
-- specified, all HITs for the Reviewer are considered
listReviewableHITs_hITTypeId :: Lens.Lens' ListReviewableHITs (Prelude.Maybe Prelude.Text)
listReviewableHITs_hITTypeId :: (Maybe Text -> f (Maybe Text))
-> ListReviewableHITs -> f ListReviewableHITs
listReviewableHITs_hITTypeId = (ListReviewableHITs -> Maybe Text)
-> (ListReviewableHITs -> Maybe Text -> ListReviewableHITs)
-> Lens
     ListReviewableHITs ListReviewableHITs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReviewableHITs' {Maybe Text
hITTypeId :: Maybe Text
$sel:hITTypeId:ListReviewableHITs' :: ListReviewableHITs -> Maybe Text
hITTypeId} -> Maybe Text
hITTypeId) (\s :: ListReviewableHITs
s@ListReviewableHITs' {} Maybe Text
a -> ListReviewableHITs
s {$sel:hITTypeId:ListReviewableHITs' :: Maybe Text
hITTypeId = Maybe Text
a} :: ListReviewableHITs)

-- | Pagination Token
listReviewableHITs_nextToken :: Lens.Lens' ListReviewableHITs (Prelude.Maybe Prelude.Text)
listReviewableHITs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListReviewableHITs -> f ListReviewableHITs
listReviewableHITs_nextToken = (ListReviewableHITs -> Maybe Text)
-> (ListReviewableHITs -> Maybe Text -> ListReviewableHITs)
-> Lens
     ListReviewableHITs ListReviewableHITs (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReviewableHITs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReviewableHITs' :: ListReviewableHITs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReviewableHITs
s@ListReviewableHITs' {} Maybe Text
a -> ListReviewableHITs
s {$sel:nextToken:ListReviewableHITs' :: Maybe Text
nextToken = Maybe Text
a} :: ListReviewableHITs)

-- | Limit the number of results returned.
listReviewableHITs_maxResults :: Lens.Lens' ListReviewableHITs (Prelude.Maybe Prelude.Natural)
listReviewableHITs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListReviewableHITs -> f ListReviewableHITs
listReviewableHITs_maxResults = (ListReviewableHITs -> Maybe Natural)
-> (ListReviewableHITs -> Maybe Natural -> ListReviewableHITs)
-> Lens
     ListReviewableHITs
     ListReviewableHITs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReviewableHITs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListReviewableHITs' :: ListReviewableHITs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListReviewableHITs
s@ListReviewableHITs' {} Maybe Natural
a -> ListReviewableHITs
s {$sel:maxResults:ListReviewableHITs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListReviewableHITs)

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

instance Prelude.NFData ListReviewableHITs

instance Core.ToHeaders ListReviewableHITs where
  toHeaders :: ListReviewableHITs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListReviewableHITs -> 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
"MTurkRequesterServiceV20170117.ListReviewableHITs" ::
                          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 ListReviewableHITs where
  toJSON :: ListReviewableHITs -> Value
toJSON ListReviewableHITs' {Maybe Natural
Maybe Text
Maybe ReviewableHITStatus
maxResults :: Maybe Natural
nextToken :: Maybe Text
hITTypeId :: Maybe Text
status :: Maybe ReviewableHITStatus
$sel:maxResults:ListReviewableHITs' :: ListReviewableHITs -> Maybe Natural
$sel:nextToken:ListReviewableHITs' :: ListReviewableHITs -> Maybe Text
$sel:hITTypeId:ListReviewableHITs' :: ListReviewableHITs -> Maybe Text
$sel:status:ListReviewableHITs' :: ListReviewableHITs -> Maybe ReviewableHITStatus
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Status" Text -> ReviewableHITStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ReviewableHITStatus -> Pair)
-> Maybe ReviewableHITStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReviewableHITStatus
status,
            (Text
"HITTypeId" 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
hITTypeId,
            (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 ListReviewableHITs where
  toPath :: ListReviewableHITs -> ByteString
toPath = ByteString -> ListReviewableHITs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListReviewableHITsResponse' smart constructor.
data ListReviewableHITsResponse = ListReviewableHITsResponse'
  { ListReviewableHITsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of HITs on this page in the filtered results list, equivalent
    -- to the number of HITs being returned by this call.
    ListReviewableHITsResponse -> Maybe Int
numResults :: Prelude.Maybe Prelude.Int,
    -- | The list of HIT elements returned by the query.
    ListReviewableHITsResponse -> Maybe [HIT]
hITs :: Prelude.Maybe [HIT],
    -- | The response's http status code.
    ListReviewableHITsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListReviewableHITsResponse -> ListReviewableHITsResponse -> Bool
(ListReviewableHITsResponse -> ListReviewableHITsResponse -> Bool)
-> (ListReviewableHITsResponse
    -> ListReviewableHITsResponse -> Bool)
-> Eq ListReviewableHITsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReviewableHITsResponse -> ListReviewableHITsResponse -> Bool
$c/= :: ListReviewableHITsResponse -> ListReviewableHITsResponse -> Bool
== :: ListReviewableHITsResponse -> ListReviewableHITsResponse -> Bool
$c== :: ListReviewableHITsResponse -> ListReviewableHITsResponse -> Bool
Prelude.Eq, ReadPrec [ListReviewableHITsResponse]
ReadPrec ListReviewableHITsResponse
Int -> ReadS ListReviewableHITsResponse
ReadS [ListReviewableHITsResponse]
(Int -> ReadS ListReviewableHITsResponse)
-> ReadS [ListReviewableHITsResponse]
-> ReadPrec ListReviewableHITsResponse
-> ReadPrec [ListReviewableHITsResponse]
-> Read ListReviewableHITsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReviewableHITsResponse]
$creadListPrec :: ReadPrec [ListReviewableHITsResponse]
readPrec :: ReadPrec ListReviewableHITsResponse
$creadPrec :: ReadPrec ListReviewableHITsResponse
readList :: ReadS [ListReviewableHITsResponse]
$creadList :: ReadS [ListReviewableHITsResponse]
readsPrec :: Int -> ReadS ListReviewableHITsResponse
$creadsPrec :: Int -> ReadS ListReviewableHITsResponse
Prelude.Read, Int -> ListReviewableHITsResponse -> ShowS
[ListReviewableHITsResponse] -> ShowS
ListReviewableHITsResponse -> String
(Int -> ListReviewableHITsResponse -> ShowS)
-> (ListReviewableHITsResponse -> String)
-> ([ListReviewableHITsResponse] -> ShowS)
-> Show ListReviewableHITsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReviewableHITsResponse] -> ShowS
$cshowList :: [ListReviewableHITsResponse] -> ShowS
show :: ListReviewableHITsResponse -> String
$cshow :: ListReviewableHITsResponse -> String
showsPrec :: Int -> ListReviewableHITsResponse -> ShowS
$cshowsPrec :: Int -> ListReviewableHITsResponse -> ShowS
Prelude.Show, (forall x.
 ListReviewableHITsResponse -> Rep ListReviewableHITsResponse x)
-> (forall x.
    Rep ListReviewableHITsResponse x -> ListReviewableHITsResponse)
-> Generic ListReviewableHITsResponse
forall x.
Rep ListReviewableHITsResponse x -> ListReviewableHITsResponse
forall x.
ListReviewableHITsResponse -> Rep ListReviewableHITsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListReviewableHITsResponse x -> ListReviewableHITsResponse
$cfrom :: forall x.
ListReviewableHITsResponse -> Rep ListReviewableHITsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListReviewableHITsResponse' 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', 'listReviewableHITsResponse_nextToken' - Undocumented member.
--
-- 'numResults', 'listReviewableHITsResponse_numResults' - The number of HITs on this page in the filtered results list, equivalent
-- to the number of HITs being returned by this call.
--
-- 'hITs', 'listReviewableHITsResponse_hITs' - The list of HIT elements returned by the query.
--
-- 'httpStatus', 'listReviewableHITsResponse_httpStatus' - The response's http status code.
newListReviewableHITsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListReviewableHITsResponse
newListReviewableHITsResponse :: Int -> ListReviewableHITsResponse
newListReviewableHITsResponse Int
pHttpStatus_ =
  ListReviewableHITsResponse' :: Maybe Text
-> Maybe Int -> Maybe [HIT] -> Int -> ListReviewableHITsResponse
ListReviewableHITsResponse'
    { $sel:nextToken:ListReviewableHITsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:numResults:ListReviewableHITsResponse' :: Maybe Int
numResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:hITs:ListReviewableHITsResponse' :: Maybe [HIT]
hITs = Maybe [HIT]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListReviewableHITsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
listReviewableHITsResponse_nextToken :: Lens.Lens' ListReviewableHITsResponse (Prelude.Maybe Prelude.Text)
listReviewableHITsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListReviewableHITsResponse -> f ListReviewableHITsResponse
listReviewableHITsResponse_nextToken = (ListReviewableHITsResponse -> Maybe Text)
-> (ListReviewableHITsResponse
    -> Maybe Text -> ListReviewableHITsResponse)
-> Lens' ListReviewableHITsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReviewableHITsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReviewableHITsResponse' :: ListReviewableHITsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReviewableHITsResponse
s@ListReviewableHITsResponse' {} Maybe Text
a -> ListReviewableHITsResponse
s {$sel:nextToken:ListReviewableHITsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListReviewableHITsResponse)

-- | The number of HITs on this page in the filtered results list, equivalent
-- to the number of HITs being returned by this call.
listReviewableHITsResponse_numResults :: Lens.Lens' ListReviewableHITsResponse (Prelude.Maybe Prelude.Int)
listReviewableHITsResponse_numResults :: (Maybe Int -> f (Maybe Int))
-> ListReviewableHITsResponse -> f ListReviewableHITsResponse
listReviewableHITsResponse_numResults = (ListReviewableHITsResponse -> Maybe Int)
-> (ListReviewableHITsResponse
    -> Maybe Int -> ListReviewableHITsResponse)
-> Lens
     ListReviewableHITsResponse
     ListReviewableHITsResponse
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReviewableHITsResponse' {Maybe Int
numResults :: Maybe Int
$sel:numResults:ListReviewableHITsResponse' :: ListReviewableHITsResponse -> Maybe Int
numResults} -> Maybe Int
numResults) (\s :: ListReviewableHITsResponse
s@ListReviewableHITsResponse' {} Maybe Int
a -> ListReviewableHITsResponse
s {$sel:numResults:ListReviewableHITsResponse' :: Maybe Int
numResults = Maybe Int
a} :: ListReviewableHITsResponse)

-- | The list of HIT elements returned by the query.
listReviewableHITsResponse_hITs :: Lens.Lens' ListReviewableHITsResponse (Prelude.Maybe [HIT])
listReviewableHITsResponse_hITs :: (Maybe [HIT] -> f (Maybe [HIT]))
-> ListReviewableHITsResponse -> f ListReviewableHITsResponse
listReviewableHITsResponse_hITs = (ListReviewableHITsResponse -> Maybe [HIT])
-> (ListReviewableHITsResponse
    -> Maybe [HIT] -> ListReviewableHITsResponse)
-> Lens' ListReviewableHITsResponse (Maybe [HIT])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReviewableHITsResponse' {Maybe [HIT]
hITs :: Maybe [HIT]
$sel:hITs:ListReviewableHITsResponse' :: ListReviewableHITsResponse -> Maybe [HIT]
hITs} -> Maybe [HIT]
hITs) (\s :: ListReviewableHITsResponse
s@ListReviewableHITsResponse' {} Maybe [HIT]
a -> ListReviewableHITsResponse
s {$sel:hITs:ListReviewableHITsResponse' :: Maybe [HIT]
hITs = Maybe [HIT]
a} :: ListReviewableHITsResponse) ((Maybe [HIT] -> f (Maybe [HIT]))
 -> ListReviewableHITsResponse -> f ListReviewableHITsResponse)
-> ((Maybe [HIT] -> f (Maybe [HIT]))
    -> Maybe [HIT] -> f (Maybe [HIT]))
-> (Maybe [HIT] -> f (Maybe [HIT]))
-> ListReviewableHITsResponse
-> f ListReviewableHITsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [HIT] [HIT] [HIT] [HIT]
-> Iso (Maybe [HIT]) (Maybe [HIT]) (Maybe [HIT]) (Maybe [HIT])
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 [HIT] [HIT] [HIT] [HIT]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListReviewableHITsResponse