{-# 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.SageMaker.ListHumanTaskUis
-- 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 information about the human task user interfaces in your
-- account.
--
-- This operation returns paginated results.
module Amazonka.SageMaker.ListHumanTaskUis
  ( -- * Creating a Request
    ListHumanTaskUis (..),
    newListHumanTaskUis,

    -- * Request Lenses
    listHumanTaskUis_creationTimeAfter,
    listHumanTaskUis_nextToken,
    listHumanTaskUis_sortOrder,
    listHumanTaskUis_creationTimeBefore,
    listHumanTaskUis_maxResults,

    -- * Destructuring the Response
    ListHumanTaskUisResponse (..),
    newListHumanTaskUisResponse,

    -- * Response Lenses
    listHumanTaskUisResponse_nextToken,
    listHumanTaskUisResponse_httpStatus,
    listHumanTaskUisResponse_humanTaskUiSummaries,
  )
where

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

-- | /See:/ 'newListHumanTaskUis' smart constructor.
data ListHumanTaskUis = ListHumanTaskUis'
  { -- | A filter that returns only human task user interfaces with a creation
    -- time greater than or equal to the specified timestamp.
    ListHumanTaskUis -> Maybe POSIX
creationTimeAfter :: Prelude.Maybe Core.POSIX,
    -- | A token to resume pagination.
    ListHumanTaskUis -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An optional value that specifies whether you want the results sorted in
    -- @Ascending@ or @Descending@ order.
    ListHumanTaskUis -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
    -- | A filter that returns only human task user interfaces that were created
    -- before the specified timestamp.
    ListHumanTaskUis -> Maybe POSIX
creationTimeBefore :: Prelude.Maybe Core.POSIX,
    -- | The total number of items to return. If the total number of available
    -- items is more than the value specified in @MaxResults@, then a
    -- @NextToken@ will be provided in the output that you can use to resume
    -- pagination.
    ListHumanTaskUis -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListHumanTaskUis -> ListHumanTaskUis -> Bool
(ListHumanTaskUis -> ListHumanTaskUis -> Bool)
-> (ListHumanTaskUis -> ListHumanTaskUis -> Bool)
-> Eq ListHumanTaskUis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHumanTaskUis -> ListHumanTaskUis -> Bool
$c/= :: ListHumanTaskUis -> ListHumanTaskUis -> Bool
== :: ListHumanTaskUis -> ListHumanTaskUis -> Bool
$c== :: ListHumanTaskUis -> ListHumanTaskUis -> Bool
Prelude.Eq, ReadPrec [ListHumanTaskUis]
ReadPrec ListHumanTaskUis
Int -> ReadS ListHumanTaskUis
ReadS [ListHumanTaskUis]
(Int -> ReadS ListHumanTaskUis)
-> ReadS [ListHumanTaskUis]
-> ReadPrec ListHumanTaskUis
-> ReadPrec [ListHumanTaskUis]
-> Read ListHumanTaskUis
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHumanTaskUis]
$creadListPrec :: ReadPrec [ListHumanTaskUis]
readPrec :: ReadPrec ListHumanTaskUis
$creadPrec :: ReadPrec ListHumanTaskUis
readList :: ReadS [ListHumanTaskUis]
$creadList :: ReadS [ListHumanTaskUis]
readsPrec :: Int -> ReadS ListHumanTaskUis
$creadsPrec :: Int -> ReadS ListHumanTaskUis
Prelude.Read, Int -> ListHumanTaskUis -> ShowS
[ListHumanTaskUis] -> ShowS
ListHumanTaskUis -> String
(Int -> ListHumanTaskUis -> ShowS)
-> (ListHumanTaskUis -> String)
-> ([ListHumanTaskUis] -> ShowS)
-> Show ListHumanTaskUis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHumanTaskUis] -> ShowS
$cshowList :: [ListHumanTaskUis] -> ShowS
show :: ListHumanTaskUis -> String
$cshow :: ListHumanTaskUis -> String
showsPrec :: Int -> ListHumanTaskUis -> ShowS
$cshowsPrec :: Int -> ListHumanTaskUis -> ShowS
Prelude.Show, (forall x. ListHumanTaskUis -> Rep ListHumanTaskUis x)
-> (forall x. Rep ListHumanTaskUis x -> ListHumanTaskUis)
-> Generic ListHumanTaskUis
forall x. Rep ListHumanTaskUis x -> ListHumanTaskUis
forall x. ListHumanTaskUis -> Rep ListHumanTaskUis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListHumanTaskUis x -> ListHumanTaskUis
$cfrom :: forall x. ListHumanTaskUis -> Rep ListHumanTaskUis x
Prelude.Generic)

-- |
-- Create a value of 'ListHumanTaskUis' 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:
--
-- 'creationTimeAfter', 'listHumanTaskUis_creationTimeAfter' - A filter that returns only human task user interfaces with a creation
-- time greater than or equal to the specified timestamp.
--
-- 'nextToken', 'listHumanTaskUis_nextToken' - A token to resume pagination.
--
-- 'sortOrder', 'listHumanTaskUis_sortOrder' - An optional value that specifies whether you want the results sorted in
-- @Ascending@ or @Descending@ order.
--
-- 'creationTimeBefore', 'listHumanTaskUis_creationTimeBefore' - A filter that returns only human task user interfaces that were created
-- before the specified timestamp.
--
-- 'maxResults', 'listHumanTaskUis_maxResults' - The total number of items to return. If the total number of available
-- items is more than the value specified in @MaxResults@, then a
-- @NextToken@ will be provided in the output that you can use to resume
-- pagination.
newListHumanTaskUis ::
  ListHumanTaskUis
newListHumanTaskUis :: ListHumanTaskUis
newListHumanTaskUis =
  ListHumanTaskUis' :: Maybe POSIX
-> Maybe Text
-> Maybe SortOrder
-> Maybe POSIX
-> Maybe Natural
-> ListHumanTaskUis
ListHumanTaskUis'
    { $sel:creationTimeAfter:ListHumanTaskUis' :: Maybe POSIX
creationTimeAfter =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListHumanTaskUis' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sortOrder:ListHumanTaskUis' :: Maybe SortOrder
sortOrder = Maybe SortOrder
forall a. Maybe a
Prelude.Nothing,
      $sel:creationTimeBefore:ListHumanTaskUis' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListHumanTaskUis' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A filter that returns only human task user interfaces with a creation
-- time greater than or equal to the specified timestamp.
listHumanTaskUis_creationTimeAfter :: Lens.Lens' ListHumanTaskUis (Prelude.Maybe Prelude.UTCTime)
listHumanTaskUis_creationTimeAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListHumanTaskUis -> f ListHumanTaskUis
listHumanTaskUis_creationTimeAfter = (ListHumanTaskUis -> Maybe POSIX)
-> (ListHumanTaskUis -> Maybe POSIX -> ListHumanTaskUis)
-> Lens
     ListHumanTaskUis ListHumanTaskUis (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHumanTaskUis' {Maybe POSIX
creationTimeAfter :: Maybe POSIX
$sel:creationTimeAfter:ListHumanTaskUis' :: ListHumanTaskUis -> Maybe POSIX
creationTimeAfter} -> Maybe POSIX
creationTimeAfter) (\s :: ListHumanTaskUis
s@ListHumanTaskUis' {} Maybe POSIX
a -> ListHumanTaskUis
s {$sel:creationTimeAfter:ListHumanTaskUis' :: Maybe POSIX
creationTimeAfter = Maybe POSIX
a} :: ListHumanTaskUis) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListHumanTaskUis -> f ListHumanTaskUis)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListHumanTaskUis
-> f ListHumanTaskUis
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | A token to resume pagination.
listHumanTaskUis_nextToken :: Lens.Lens' ListHumanTaskUis (Prelude.Maybe Prelude.Text)
listHumanTaskUis_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListHumanTaskUis -> f ListHumanTaskUis
listHumanTaskUis_nextToken = (ListHumanTaskUis -> Maybe Text)
-> (ListHumanTaskUis -> Maybe Text -> ListHumanTaskUis)
-> Lens ListHumanTaskUis ListHumanTaskUis (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHumanTaskUis' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHumanTaskUis' :: ListHumanTaskUis -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHumanTaskUis
s@ListHumanTaskUis' {} Maybe Text
a -> ListHumanTaskUis
s {$sel:nextToken:ListHumanTaskUis' :: Maybe Text
nextToken = Maybe Text
a} :: ListHumanTaskUis)

-- | An optional value that specifies whether you want the results sorted in
-- @Ascending@ or @Descending@ order.
listHumanTaskUis_sortOrder :: Lens.Lens' ListHumanTaskUis (Prelude.Maybe SortOrder)
listHumanTaskUis_sortOrder :: (Maybe SortOrder -> f (Maybe SortOrder))
-> ListHumanTaskUis -> f ListHumanTaskUis
listHumanTaskUis_sortOrder = (ListHumanTaskUis -> Maybe SortOrder)
-> (ListHumanTaskUis -> Maybe SortOrder -> ListHumanTaskUis)
-> Lens
     ListHumanTaskUis
     ListHumanTaskUis
     (Maybe SortOrder)
     (Maybe SortOrder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHumanTaskUis' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListHumanTaskUis' :: ListHumanTaskUis -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListHumanTaskUis
s@ListHumanTaskUis' {} Maybe SortOrder
a -> ListHumanTaskUis
s {$sel:sortOrder:ListHumanTaskUis' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListHumanTaskUis)

-- | A filter that returns only human task user interfaces that were created
-- before the specified timestamp.
listHumanTaskUis_creationTimeBefore :: Lens.Lens' ListHumanTaskUis (Prelude.Maybe Prelude.UTCTime)
listHumanTaskUis_creationTimeBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListHumanTaskUis -> f ListHumanTaskUis
listHumanTaskUis_creationTimeBefore = (ListHumanTaskUis -> Maybe POSIX)
-> (ListHumanTaskUis -> Maybe POSIX -> ListHumanTaskUis)
-> Lens
     ListHumanTaskUis ListHumanTaskUis (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHumanTaskUis' {Maybe POSIX
creationTimeBefore :: Maybe POSIX
$sel:creationTimeBefore:ListHumanTaskUis' :: ListHumanTaskUis -> Maybe POSIX
creationTimeBefore} -> Maybe POSIX
creationTimeBefore) (\s :: ListHumanTaskUis
s@ListHumanTaskUis' {} Maybe POSIX
a -> ListHumanTaskUis
s {$sel:creationTimeBefore:ListHumanTaskUis' :: Maybe POSIX
creationTimeBefore = Maybe POSIX
a} :: ListHumanTaskUis) ((Maybe POSIX -> f (Maybe POSIX))
 -> ListHumanTaskUis -> f ListHumanTaskUis)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListHumanTaskUis
-> f ListHumanTaskUis
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The total number of items to return. If the total number of available
-- items is more than the value specified in @MaxResults@, then a
-- @NextToken@ will be provided in the output that you can use to resume
-- pagination.
listHumanTaskUis_maxResults :: Lens.Lens' ListHumanTaskUis (Prelude.Maybe Prelude.Natural)
listHumanTaskUis_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListHumanTaskUis -> f ListHumanTaskUis
listHumanTaskUis_maxResults = (ListHumanTaskUis -> Maybe Natural)
-> (ListHumanTaskUis -> Maybe Natural -> ListHumanTaskUis)
-> Lens
     ListHumanTaskUis ListHumanTaskUis (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHumanTaskUis' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListHumanTaskUis' :: ListHumanTaskUis -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListHumanTaskUis
s@ListHumanTaskUis' {} Maybe Natural
a -> ListHumanTaskUis
s {$sel:maxResults:ListHumanTaskUis' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListHumanTaskUis)

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

instance Prelude.Hashable ListHumanTaskUis

instance Prelude.NFData ListHumanTaskUis

instance Core.ToHeaders ListHumanTaskUis where
  toHeaders :: ListHumanTaskUis -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListHumanTaskUis -> 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
"SageMaker.ListHumanTaskUis" :: 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 ListHumanTaskUis where
  toJSON :: ListHumanTaskUis -> Value
toJSON ListHumanTaskUis' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe SortOrder
maxResults :: Maybe Natural
creationTimeBefore :: Maybe POSIX
sortOrder :: Maybe SortOrder
nextToken :: Maybe Text
creationTimeAfter :: Maybe POSIX
$sel:maxResults:ListHumanTaskUis' :: ListHumanTaskUis -> Maybe Natural
$sel:creationTimeBefore:ListHumanTaskUis' :: ListHumanTaskUis -> Maybe POSIX
$sel:sortOrder:ListHumanTaskUis' :: ListHumanTaskUis -> Maybe SortOrder
$sel:nextToken:ListHumanTaskUis' :: ListHumanTaskUis -> Maybe Text
$sel:creationTimeAfter:ListHumanTaskUis' :: ListHumanTaskUis -> Maybe POSIX
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CreationTimeAfter" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
creationTimeAfter,
            (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
"SortOrder" Text -> SortOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortOrder -> Pair) -> Maybe SortOrder -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrder
sortOrder,
            (Text
"CreationTimeBefore" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
creationTimeBefore,
            (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 ListHumanTaskUis where
  toPath :: ListHumanTaskUis -> ByteString
toPath = ByteString -> ListHumanTaskUis -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListHumanTaskUisResponse' smart constructor.
data ListHumanTaskUisResponse = ListHumanTaskUisResponse'
  { -- | A token to resume pagination.
    ListHumanTaskUisResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListHumanTaskUisResponse -> Int
httpStatus :: Prelude.Int,
    -- | An array of objects describing the human task user interfaces.
    ListHumanTaskUisResponse -> [HumanTaskUiSummary]
humanTaskUiSummaries :: [HumanTaskUiSummary]
  }
  deriving (ListHumanTaskUisResponse -> ListHumanTaskUisResponse -> Bool
(ListHumanTaskUisResponse -> ListHumanTaskUisResponse -> Bool)
-> (ListHumanTaskUisResponse -> ListHumanTaskUisResponse -> Bool)
-> Eq ListHumanTaskUisResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListHumanTaskUisResponse -> ListHumanTaskUisResponse -> Bool
$c/= :: ListHumanTaskUisResponse -> ListHumanTaskUisResponse -> Bool
== :: ListHumanTaskUisResponse -> ListHumanTaskUisResponse -> Bool
$c== :: ListHumanTaskUisResponse -> ListHumanTaskUisResponse -> Bool
Prelude.Eq, ReadPrec [ListHumanTaskUisResponse]
ReadPrec ListHumanTaskUisResponse
Int -> ReadS ListHumanTaskUisResponse
ReadS [ListHumanTaskUisResponse]
(Int -> ReadS ListHumanTaskUisResponse)
-> ReadS [ListHumanTaskUisResponse]
-> ReadPrec ListHumanTaskUisResponse
-> ReadPrec [ListHumanTaskUisResponse]
-> Read ListHumanTaskUisResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListHumanTaskUisResponse]
$creadListPrec :: ReadPrec [ListHumanTaskUisResponse]
readPrec :: ReadPrec ListHumanTaskUisResponse
$creadPrec :: ReadPrec ListHumanTaskUisResponse
readList :: ReadS [ListHumanTaskUisResponse]
$creadList :: ReadS [ListHumanTaskUisResponse]
readsPrec :: Int -> ReadS ListHumanTaskUisResponse
$creadsPrec :: Int -> ReadS ListHumanTaskUisResponse
Prelude.Read, Int -> ListHumanTaskUisResponse -> ShowS
[ListHumanTaskUisResponse] -> ShowS
ListHumanTaskUisResponse -> String
(Int -> ListHumanTaskUisResponse -> ShowS)
-> (ListHumanTaskUisResponse -> String)
-> ([ListHumanTaskUisResponse] -> ShowS)
-> Show ListHumanTaskUisResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListHumanTaskUisResponse] -> ShowS
$cshowList :: [ListHumanTaskUisResponse] -> ShowS
show :: ListHumanTaskUisResponse -> String
$cshow :: ListHumanTaskUisResponse -> String
showsPrec :: Int -> ListHumanTaskUisResponse -> ShowS
$cshowsPrec :: Int -> ListHumanTaskUisResponse -> ShowS
Prelude.Show, (forall x.
 ListHumanTaskUisResponse -> Rep ListHumanTaskUisResponse x)
-> (forall x.
    Rep ListHumanTaskUisResponse x -> ListHumanTaskUisResponse)
-> Generic ListHumanTaskUisResponse
forall x.
Rep ListHumanTaskUisResponse x -> ListHumanTaskUisResponse
forall x.
ListHumanTaskUisResponse -> Rep ListHumanTaskUisResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListHumanTaskUisResponse x -> ListHumanTaskUisResponse
$cfrom :: forall x.
ListHumanTaskUisResponse -> Rep ListHumanTaskUisResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListHumanTaskUisResponse' 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', 'listHumanTaskUisResponse_nextToken' - A token to resume pagination.
--
-- 'httpStatus', 'listHumanTaskUisResponse_httpStatus' - The response's http status code.
--
-- 'humanTaskUiSummaries', 'listHumanTaskUisResponse_humanTaskUiSummaries' - An array of objects describing the human task user interfaces.
newListHumanTaskUisResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListHumanTaskUisResponse
newListHumanTaskUisResponse :: Int -> ListHumanTaskUisResponse
newListHumanTaskUisResponse Int
pHttpStatus_ =
  ListHumanTaskUisResponse' :: Maybe Text
-> Int -> [HumanTaskUiSummary] -> ListHumanTaskUisResponse
ListHumanTaskUisResponse'
    { $sel:nextToken:ListHumanTaskUisResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListHumanTaskUisResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:humanTaskUiSummaries:ListHumanTaskUisResponse' :: [HumanTaskUiSummary]
humanTaskUiSummaries = [HumanTaskUiSummary]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A token to resume pagination.
listHumanTaskUisResponse_nextToken :: Lens.Lens' ListHumanTaskUisResponse (Prelude.Maybe Prelude.Text)
listHumanTaskUisResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListHumanTaskUisResponse -> f ListHumanTaskUisResponse
listHumanTaskUisResponse_nextToken = (ListHumanTaskUisResponse -> Maybe Text)
-> (ListHumanTaskUisResponse
    -> Maybe Text -> ListHumanTaskUisResponse)
-> Lens' ListHumanTaskUisResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHumanTaskUisResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListHumanTaskUisResponse' :: ListHumanTaskUisResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListHumanTaskUisResponse
s@ListHumanTaskUisResponse' {} Maybe Text
a -> ListHumanTaskUisResponse
s {$sel:nextToken:ListHumanTaskUisResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListHumanTaskUisResponse)

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

-- | An array of objects describing the human task user interfaces.
listHumanTaskUisResponse_humanTaskUiSummaries :: Lens.Lens' ListHumanTaskUisResponse [HumanTaskUiSummary]
listHumanTaskUisResponse_humanTaskUiSummaries :: ([HumanTaskUiSummary] -> f [HumanTaskUiSummary])
-> ListHumanTaskUisResponse -> f ListHumanTaskUisResponse
listHumanTaskUisResponse_humanTaskUiSummaries = (ListHumanTaskUisResponse -> [HumanTaskUiSummary])
-> (ListHumanTaskUisResponse
    -> [HumanTaskUiSummary] -> ListHumanTaskUisResponse)
-> Lens' ListHumanTaskUisResponse [HumanTaskUiSummary]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListHumanTaskUisResponse' {[HumanTaskUiSummary]
humanTaskUiSummaries :: [HumanTaskUiSummary]
$sel:humanTaskUiSummaries:ListHumanTaskUisResponse' :: ListHumanTaskUisResponse -> [HumanTaskUiSummary]
humanTaskUiSummaries} -> [HumanTaskUiSummary]
humanTaskUiSummaries) (\s :: ListHumanTaskUisResponse
s@ListHumanTaskUisResponse' {} [HumanTaskUiSummary]
a -> ListHumanTaskUisResponse
s {$sel:humanTaskUiSummaries:ListHumanTaskUisResponse' :: [HumanTaskUiSummary]
humanTaskUiSummaries = [HumanTaskUiSummary]
a} :: ListHumanTaskUisResponse) (([HumanTaskUiSummary] -> f [HumanTaskUiSummary])
 -> ListHumanTaskUisResponse -> f ListHumanTaskUisResponse)
-> (([HumanTaskUiSummary] -> f [HumanTaskUiSummary])
    -> [HumanTaskUiSummary] -> f [HumanTaskUiSummary])
-> ([HumanTaskUiSummary] -> f [HumanTaskUiSummary])
-> ListHumanTaskUisResponse
-> f ListHumanTaskUisResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([HumanTaskUiSummary] -> f [HumanTaskUiSummary])
-> [HumanTaskUiSummary] -> f [HumanTaskUiSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListHumanTaskUisResponse