{-# 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.ListWorkerBlocks
-- 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 @ListWorkersBlocks@ operation retrieves a list of Workers who are
-- blocked from working on your HITs.
--
-- This operation returns paginated results.
module Amazonka.MechanicalTurk.ListWorkerBlocks
  ( -- * Creating a Request
    ListWorkerBlocks (..),
    newListWorkerBlocks,

    -- * Request Lenses
    listWorkerBlocks_nextToken,
    listWorkerBlocks_maxResults,

    -- * Destructuring the Response
    ListWorkerBlocksResponse (..),
    newListWorkerBlocksResponse,

    -- * Response Lenses
    listWorkerBlocksResponse_workerBlocks,
    listWorkerBlocksResponse_nextToken,
    listWorkerBlocksResponse_numResults,
    listWorkerBlocksResponse_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:/ 'newListWorkerBlocks' smart constructor.
data ListWorkerBlocks = ListWorkerBlocks'
  { -- | Pagination token
    ListWorkerBlocks -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    ListWorkerBlocks -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListWorkerBlocks -> ListWorkerBlocks -> Bool
(ListWorkerBlocks -> ListWorkerBlocks -> Bool)
-> (ListWorkerBlocks -> ListWorkerBlocks -> Bool)
-> Eq ListWorkerBlocks
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkerBlocks -> ListWorkerBlocks -> Bool
$c/= :: ListWorkerBlocks -> ListWorkerBlocks -> Bool
== :: ListWorkerBlocks -> ListWorkerBlocks -> Bool
$c== :: ListWorkerBlocks -> ListWorkerBlocks -> Bool
Prelude.Eq, ReadPrec [ListWorkerBlocks]
ReadPrec ListWorkerBlocks
Int -> ReadS ListWorkerBlocks
ReadS [ListWorkerBlocks]
(Int -> ReadS ListWorkerBlocks)
-> ReadS [ListWorkerBlocks]
-> ReadPrec ListWorkerBlocks
-> ReadPrec [ListWorkerBlocks]
-> Read ListWorkerBlocks
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkerBlocks]
$creadListPrec :: ReadPrec [ListWorkerBlocks]
readPrec :: ReadPrec ListWorkerBlocks
$creadPrec :: ReadPrec ListWorkerBlocks
readList :: ReadS [ListWorkerBlocks]
$creadList :: ReadS [ListWorkerBlocks]
readsPrec :: Int -> ReadS ListWorkerBlocks
$creadsPrec :: Int -> ReadS ListWorkerBlocks
Prelude.Read, Int -> ListWorkerBlocks -> ShowS
[ListWorkerBlocks] -> ShowS
ListWorkerBlocks -> String
(Int -> ListWorkerBlocks -> ShowS)
-> (ListWorkerBlocks -> String)
-> ([ListWorkerBlocks] -> ShowS)
-> Show ListWorkerBlocks
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkerBlocks] -> ShowS
$cshowList :: [ListWorkerBlocks] -> ShowS
show :: ListWorkerBlocks -> String
$cshow :: ListWorkerBlocks -> String
showsPrec :: Int -> ListWorkerBlocks -> ShowS
$cshowsPrec :: Int -> ListWorkerBlocks -> ShowS
Prelude.Show, (forall x. ListWorkerBlocks -> Rep ListWorkerBlocks x)
-> (forall x. Rep ListWorkerBlocks x -> ListWorkerBlocks)
-> Generic ListWorkerBlocks
forall x. Rep ListWorkerBlocks x -> ListWorkerBlocks
forall x. ListWorkerBlocks -> Rep ListWorkerBlocks x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListWorkerBlocks x -> ListWorkerBlocks
$cfrom :: forall x. ListWorkerBlocks -> Rep ListWorkerBlocks x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkerBlocks' 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', 'listWorkerBlocks_nextToken' - Pagination token
--
-- 'maxResults', 'listWorkerBlocks_maxResults' - Undocumented member.
newListWorkerBlocks ::
  ListWorkerBlocks
newListWorkerBlocks :: ListWorkerBlocks
newListWorkerBlocks =
  ListWorkerBlocks' :: Maybe Text -> Maybe Natural -> ListWorkerBlocks
ListWorkerBlocks'
    { $sel:nextToken:ListWorkerBlocks' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListWorkerBlocks' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

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

-- | Undocumented member.
listWorkerBlocks_maxResults :: Lens.Lens' ListWorkerBlocks (Prelude.Maybe Prelude.Natural)
listWorkerBlocks_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListWorkerBlocks -> f ListWorkerBlocks
listWorkerBlocks_maxResults = (ListWorkerBlocks -> Maybe Natural)
-> (ListWorkerBlocks -> Maybe Natural -> ListWorkerBlocks)
-> Lens
     ListWorkerBlocks ListWorkerBlocks (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkerBlocks' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListWorkerBlocks' :: ListWorkerBlocks -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListWorkerBlocks
s@ListWorkerBlocks' {} Maybe Natural
a -> ListWorkerBlocks
s {$sel:maxResults:ListWorkerBlocks' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListWorkerBlocks)

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

instance Prelude.NFData ListWorkerBlocks

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

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

-- | /See:/ 'newListWorkerBlocksResponse' smart constructor.
data ListWorkerBlocksResponse = ListWorkerBlocksResponse'
  { -- | The list of WorkerBlocks, containing the collection of Worker IDs and
    -- reasons for blocking.
    ListWorkerBlocksResponse -> Maybe [WorkerBlock]
workerBlocks :: Prelude.Maybe [WorkerBlock],
    ListWorkerBlocksResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The number of assignments on the page in the filtered results list,
    -- equivalent to the number of assignments returned by this call.
    ListWorkerBlocksResponse -> Maybe Int
numResults :: Prelude.Maybe Prelude.Int,
    -- | The response's http status code.
    ListWorkerBlocksResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListWorkerBlocksResponse -> ListWorkerBlocksResponse -> Bool
(ListWorkerBlocksResponse -> ListWorkerBlocksResponse -> Bool)
-> (ListWorkerBlocksResponse -> ListWorkerBlocksResponse -> Bool)
-> Eq ListWorkerBlocksResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListWorkerBlocksResponse -> ListWorkerBlocksResponse -> Bool
$c/= :: ListWorkerBlocksResponse -> ListWorkerBlocksResponse -> Bool
== :: ListWorkerBlocksResponse -> ListWorkerBlocksResponse -> Bool
$c== :: ListWorkerBlocksResponse -> ListWorkerBlocksResponse -> Bool
Prelude.Eq, ReadPrec [ListWorkerBlocksResponse]
ReadPrec ListWorkerBlocksResponse
Int -> ReadS ListWorkerBlocksResponse
ReadS [ListWorkerBlocksResponse]
(Int -> ReadS ListWorkerBlocksResponse)
-> ReadS [ListWorkerBlocksResponse]
-> ReadPrec ListWorkerBlocksResponse
-> ReadPrec [ListWorkerBlocksResponse]
-> Read ListWorkerBlocksResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListWorkerBlocksResponse]
$creadListPrec :: ReadPrec [ListWorkerBlocksResponse]
readPrec :: ReadPrec ListWorkerBlocksResponse
$creadPrec :: ReadPrec ListWorkerBlocksResponse
readList :: ReadS [ListWorkerBlocksResponse]
$creadList :: ReadS [ListWorkerBlocksResponse]
readsPrec :: Int -> ReadS ListWorkerBlocksResponse
$creadsPrec :: Int -> ReadS ListWorkerBlocksResponse
Prelude.Read, Int -> ListWorkerBlocksResponse -> ShowS
[ListWorkerBlocksResponse] -> ShowS
ListWorkerBlocksResponse -> String
(Int -> ListWorkerBlocksResponse -> ShowS)
-> (ListWorkerBlocksResponse -> String)
-> ([ListWorkerBlocksResponse] -> ShowS)
-> Show ListWorkerBlocksResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListWorkerBlocksResponse] -> ShowS
$cshowList :: [ListWorkerBlocksResponse] -> ShowS
show :: ListWorkerBlocksResponse -> String
$cshow :: ListWorkerBlocksResponse -> String
showsPrec :: Int -> ListWorkerBlocksResponse -> ShowS
$cshowsPrec :: Int -> ListWorkerBlocksResponse -> ShowS
Prelude.Show, (forall x.
 ListWorkerBlocksResponse -> Rep ListWorkerBlocksResponse x)
-> (forall x.
    Rep ListWorkerBlocksResponse x -> ListWorkerBlocksResponse)
-> Generic ListWorkerBlocksResponse
forall x.
Rep ListWorkerBlocksResponse x -> ListWorkerBlocksResponse
forall x.
ListWorkerBlocksResponse -> Rep ListWorkerBlocksResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListWorkerBlocksResponse x -> ListWorkerBlocksResponse
$cfrom :: forall x.
ListWorkerBlocksResponse -> Rep ListWorkerBlocksResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListWorkerBlocksResponse' 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:
--
-- 'workerBlocks', 'listWorkerBlocksResponse_workerBlocks' - The list of WorkerBlocks, containing the collection of Worker IDs and
-- reasons for blocking.
--
-- 'nextToken', 'listWorkerBlocksResponse_nextToken' - Undocumented member.
--
-- 'numResults', 'listWorkerBlocksResponse_numResults' - The number of assignments on the page in the filtered results list,
-- equivalent to the number of assignments returned by this call.
--
-- 'httpStatus', 'listWorkerBlocksResponse_httpStatus' - The response's http status code.
newListWorkerBlocksResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListWorkerBlocksResponse
newListWorkerBlocksResponse :: Int -> ListWorkerBlocksResponse
newListWorkerBlocksResponse Int
pHttpStatus_ =
  ListWorkerBlocksResponse' :: Maybe [WorkerBlock]
-> Maybe Text -> Maybe Int -> Int -> ListWorkerBlocksResponse
ListWorkerBlocksResponse'
    { $sel:workerBlocks:ListWorkerBlocksResponse' :: Maybe [WorkerBlock]
workerBlocks =
        Maybe [WorkerBlock]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListWorkerBlocksResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:numResults:ListWorkerBlocksResponse' :: Maybe Int
numResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListWorkerBlocksResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The list of WorkerBlocks, containing the collection of Worker IDs and
-- reasons for blocking.
listWorkerBlocksResponse_workerBlocks :: Lens.Lens' ListWorkerBlocksResponse (Prelude.Maybe [WorkerBlock])
listWorkerBlocksResponse_workerBlocks :: (Maybe [WorkerBlock] -> f (Maybe [WorkerBlock]))
-> ListWorkerBlocksResponse -> f ListWorkerBlocksResponse
listWorkerBlocksResponse_workerBlocks = (ListWorkerBlocksResponse -> Maybe [WorkerBlock])
-> (ListWorkerBlocksResponse
    -> Maybe [WorkerBlock] -> ListWorkerBlocksResponse)
-> Lens' ListWorkerBlocksResponse (Maybe [WorkerBlock])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListWorkerBlocksResponse' {Maybe [WorkerBlock]
workerBlocks :: Maybe [WorkerBlock]
$sel:workerBlocks:ListWorkerBlocksResponse' :: ListWorkerBlocksResponse -> Maybe [WorkerBlock]
workerBlocks} -> Maybe [WorkerBlock]
workerBlocks) (\s :: ListWorkerBlocksResponse
s@ListWorkerBlocksResponse' {} Maybe [WorkerBlock]
a -> ListWorkerBlocksResponse
s {$sel:workerBlocks:ListWorkerBlocksResponse' :: Maybe [WorkerBlock]
workerBlocks = Maybe [WorkerBlock]
a} :: ListWorkerBlocksResponse) ((Maybe [WorkerBlock] -> f (Maybe [WorkerBlock]))
 -> ListWorkerBlocksResponse -> f ListWorkerBlocksResponse)
-> ((Maybe [WorkerBlock] -> f (Maybe [WorkerBlock]))
    -> Maybe [WorkerBlock] -> f (Maybe [WorkerBlock]))
-> (Maybe [WorkerBlock] -> f (Maybe [WorkerBlock]))
-> ListWorkerBlocksResponse
-> f ListWorkerBlocksResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [WorkerBlock] [WorkerBlock] [WorkerBlock] [WorkerBlock]
-> Iso
     (Maybe [WorkerBlock])
     (Maybe [WorkerBlock])
     (Maybe [WorkerBlock])
     (Maybe [WorkerBlock])
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 [WorkerBlock] [WorkerBlock] [WorkerBlock] [WorkerBlock]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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

instance Prelude.NFData ListWorkerBlocksResponse