{-# 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.LookoutVision.ListDatasetEntries
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the JSON Lines within a dataset. An Amazon Lookout for Vision JSON
-- Line contains the anomaly information for a single image, including the
-- image location and the assigned label.
--
-- This operation requires permissions to perform the
-- @lookoutvision:ListDatasetEntries@ operation.
--
-- This operation returns paginated results.
module Amazonka.LookoutVision.ListDatasetEntries
  ( -- * Creating a Request
    ListDatasetEntries (..),
    newListDatasetEntries,

    -- * Request Lenses
    listDatasetEntries_afterCreationDate,
    listDatasetEntries_anomalyClass,
    listDatasetEntries_beforeCreationDate,
    listDatasetEntries_labeled,
    listDatasetEntries_maxResults,
    listDatasetEntries_nextToken,
    listDatasetEntries_sourceRefContains,
    listDatasetEntries_projectName,
    listDatasetEntries_datasetType,

    -- * Destructuring the Response
    ListDatasetEntriesResponse (..),
    newListDatasetEntriesResponse,

    -- * Response Lenses
    listDatasetEntriesResponse_datasetEntries,
    listDatasetEntriesResponse_nextToken,
    listDatasetEntriesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutVision.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListDatasetEntries' smart constructor.
data ListDatasetEntries = ListDatasetEntries'
  { -- | Only includes entries after the specified date in the response. For
    -- example, @2020-06-23T00:00:00@.
    ListDatasetEntries -> Maybe POSIX
afterCreationDate :: Prelude.Maybe Data.POSIX,
    -- | Specify @normal@ to include only normal images. Specify @anomaly@ to
    -- only include anomalous entries. If you don\'t specify a value, Amazon
    -- Lookout for Vision returns normal and anomalous images.
    ListDatasetEntries -> Maybe Text
anomalyClass :: Prelude.Maybe Prelude.Text,
    -- | Only includes entries before the specified date in the response. For
    -- example, @2020-06-23T00:00:00@.
    ListDatasetEntries -> Maybe POSIX
beforeCreationDate :: Prelude.Maybe Data.POSIX,
    -- | Specify @true@ to include labeled entries, otherwise specify @false@. If
    -- you don\'t specify a value, Lookout for Vision returns all entries.
    ListDatasetEntries -> Maybe Bool
labeled :: Prelude.Maybe Prelude.Bool,
    -- | 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.
    ListDatasetEntries -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | If the previous response was incomplete (because there is more data to
    -- retrieve), Amazon Lookout for Vision returns a pagination token in the
    -- response. You can use this pagination token to retrieve the next set of
    -- dataset entries.
    ListDatasetEntries -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Perform a \"contains\" search on the values of the @source-ref@ key
    -- within the dataset. For example a value of \"IMG_17\" returns all JSON
    -- Lines where the @source-ref@ key value matches /*IMG_17*/.
    ListDatasetEntries -> Maybe Text
sourceRefContains :: Prelude.Maybe Prelude.Text,
    -- | The name of the project that contains the dataset that you want to list.
    ListDatasetEntries -> Text
projectName :: Prelude.Text,
    -- | The type of the dataset that you want to list. Specify @train@ to list
    -- the training dataset. Specify @test@ to list the test dataset. If you
    -- have a single dataset project, specify @train@.
    ListDatasetEntries -> Text
datasetType :: Prelude.Text
  }
  deriving (ListDatasetEntries -> ListDatasetEntries -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDatasetEntries -> ListDatasetEntries -> Bool
$c/= :: ListDatasetEntries -> ListDatasetEntries -> Bool
== :: ListDatasetEntries -> ListDatasetEntries -> Bool
$c== :: ListDatasetEntries -> ListDatasetEntries -> Bool
Prelude.Eq, ReadPrec [ListDatasetEntries]
ReadPrec ListDatasetEntries
Int -> ReadS ListDatasetEntries
ReadS [ListDatasetEntries]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDatasetEntries]
$creadListPrec :: ReadPrec [ListDatasetEntries]
readPrec :: ReadPrec ListDatasetEntries
$creadPrec :: ReadPrec ListDatasetEntries
readList :: ReadS [ListDatasetEntries]
$creadList :: ReadS [ListDatasetEntries]
readsPrec :: Int -> ReadS ListDatasetEntries
$creadsPrec :: Int -> ReadS ListDatasetEntries
Prelude.Read, Int -> ListDatasetEntries -> ShowS
[ListDatasetEntries] -> ShowS
ListDatasetEntries -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDatasetEntries] -> ShowS
$cshowList :: [ListDatasetEntries] -> ShowS
show :: ListDatasetEntries -> String
$cshow :: ListDatasetEntries -> String
showsPrec :: Int -> ListDatasetEntries -> ShowS
$cshowsPrec :: Int -> ListDatasetEntries -> ShowS
Prelude.Show, forall x. Rep ListDatasetEntries x -> ListDatasetEntries
forall x. ListDatasetEntries -> Rep ListDatasetEntries x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDatasetEntries x -> ListDatasetEntries
$cfrom :: forall x. ListDatasetEntries -> Rep ListDatasetEntries x
Prelude.Generic)

-- |
-- Create a value of 'ListDatasetEntries' 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:
--
-- 'afterCreationDate', 'listDatasetEntries_afterCreationDate' - Only includes entries after the specified date in the response. For
-- example, @2020-06-23T00:00:00@.
--
-- 'anomalyClass', 'listDatasetEntries_anomalyClass' - Specify @normal@ to include only normal images. Specify @anomaly@ to
-- only include anomalous entries. If you don\'t specify a value, Amazon
-- Lookout for Vision returns normal and anomalous images.
--
-- 'beforeCreationDate', 'listDatasetEntries_beforeCreationDate' - Only includes entries before the specified date in the response. For
-- example, @2020-06-23T00:00:00@.
--
-- 'labeled', 'listDatasetEntries_labeled' - Specify @true@ to include labeled entries, otherwise specify @false@. If
-- you don\'t specify a value, Lookout for Vision returns all entries.
--
-- 'maxResults', 'listDatasetEntries_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.
--
-- 'nextToken', 'listDatasetEntries_nextToken' - If the previous response was incomplete (because there is more data to
-- retrieve), Amazon Lookout for Vision returns a pagination token in the
-- response. You can use this pagination token to retrieve the next set of
-- dataset entries.
--
-- 'sourceRefContains', 'listDatasetEntries_sourceRefContains' - Perform a \"contains\" search on the values of the @source-ref@ key
-- within the dataset. For example a value of \"IMG_17\" returns all JSON
-- Lines where the @source-ref@ key value matches /*IMG_17*/.
--
-- 'projectName', 'listDatasetEntries_projectName' - The name of the project that contains the dataset that you want to list.
--
-- 'datasetType', 'listDatasetEntries_datasetType' - The type of the dataset that you want to list. Specify @train@ to list
-- the training dataset. Specify @test@ to list the test dataset. If you
-- have a single dataset project, specify @train@.
newListDatasetEntries ::
  -- | 'projectName'
  Prelude.Text ->
  -- | 'datasetType'
  Prelude.Text ->
  ListDatasetEntries
newListDatasetEntries :: Text -> Text -> ListDatasetEntries
newListDatasetEntries Text
pProjectName_ Text
pDatasetType_ =
  ListDatasetEntries'
    { $sel:afterCreationDate:ListDatasetEntries' :: Maybe POSIX
afterCreationDate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyClass:ListDatasetEntries' :: Maybe Text
anomalyClass = forall a. Maybe a
Prelude.Nothing,
      $sel:beforeCreationDate:ListDatasetEntries' :: Maybe POSIX
beforeCreationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:labeled:ListDatasetEntries' :: Maybe Bool
labeled = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDatasetEntries' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDatasetEntries' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sourceRefContains:ListDatasetEntries' :: Maybe Text
sourceRefContains = forall a. Maybe a
Prelude.Nothing,
      $sel:projectName:ListDatasetEntries' :: Text
projectName = Text
pProjectName_,
      $sel:datasetType:ListDatasetEntries' :: Text
datasetType = Text
pDatasetType_
    }

-- | Only includes entries after the specified date in the response. For
-- example, @2020-06-23T00:00:00@.
listDatasetEntries_afterCreationDate :: Lens.Lens' ListDatasetEntries (Prelude.Maybe Prelude.UTCTime)
listDatasetEntries_afterCreationDate :: Lens' ListDatasetEntries (Maybe UTCTime)
listDatasetEntries_afterCreationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntries' {Maybe POSIX
afterCreationDate :: Maybe POSIX
$sel:afterCreationDate:ListDatasetEntries' :: ListDatasetEntries -> Maybe POSIX
afterCreationDate} -> Maybe POSIX
afterCreationDate) (\s :: ListDatasetEntries
s@ListDatasetEntries' {} Maybe POSIX
a -> ListDatasetEntries
s {$sel:afterCreationDate:ListDatasetEntries' :: Maybe POSIX
afterCreationDate = Maybe POSIX
a} :: ListDatasetEntries) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Specify @normal@ to include only normal images. Specify @anomaly@ to
-- only include anomalous entries. If you don\'t specify a value, Amazon
-- Lookout for Vision returns normal and anomalous images.
listDatasetEntries_anomalyClass :: Lens.Lens' ListDatasetEntries (Prelude.Maybe Prelude.Text)
listDatasetEntries_anomalyClass :: Lens' ListDatasetEntries (Maybe Text)
listDatasetEntries_anomalyClass = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntries' {Maybe Text
anomalyClass :: Maybe Text
$sel:anomalyClass:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
anomalyClass} -> Maybe Text
anomalyClass) (\s :: ListDatasetEntries
s@ListDatasetEntries' {} Maybe Text
a -> ListDatasetEntries
s {$sel:anomalyClass:ListDatasetEntries' :: Maybe Text
anomalyClass = Maybe Text
a} :: ListDatasetEntries)

-- | Only includes entries before the specified date in the response. For
-- example, @2020-06-23T00:00:00@.
listDatasetEntries_beforeCreationDate :: Lens.Lens' ListDatasetEntries (Prelude.Maybe Prelude.UTCTime)
listDatasetEntries_beforeCreationDate :: Lens' ListDatasetEntries (Maybe UTCTime)
listDatasetEntries_beforeCreationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntries' {Maybe POSIX
beforeCreationDate :: Maybe POSIX
$sel:beforeCreationDate:ListDatasetEntries' :: ListDatasetEntries -> Maybe POSIX
beforeCreationDate} -> Maybe POSIX
beforeCreationDate) (\s :: ListDatasetEntries
s@ListDatasetEntries' {} Maybe POSIX
a -> ListDatasetEntries
s {$sel:beforeCreationDate:ListDatasetEntries' :: Maybe POSIX
beforeCreationDate = Maybe POSIX
a} :: ListDatasetEntries) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Specify @true@ to include labeled entries, otherwise specify @false@. If
-- you don\'t specify a value, Lookout for Vision returns all entries.
listDatasetEntries_labeled :: Lens.Lens' ListDatasetEntries (Prelude.Maybe Prelude.Bool)
listDatasetEntries_labeled :: Lens' ListDatasetEntries (Maybe Bool)
listDatasetEntries_labeled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntries' {Maybe Bool
labeled :: Maybe Bool
$sel:labeled:ListDatasetEntries' :: ListDatasetEntries -> Maybe Bool
labeled} -> Maybe Bool
labeled) (\s :: ListDatasetEntries
s@ListDatasetEntries' {} Maybe Bool
a -> ListDatasetEntries
s {$sel:labeled:ListDatasetEntries' :: Maybe Bool
labeled = Maybe Bool
a} :: ListDatasetEntries)

-- | 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.
listDatasetEntries_maxResults :: Lens.Lens' ListDatasetEntries (Prelude.Maybe Prelude.Natural)
listDatasetEntries_maxResults :: Lens' ListDatasetEntries (Maybe Natural)
listDatasetEntries_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntries' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDatasetEntries' :: ListDatasetEntries -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDatasetEntries
s@ListDatasetEntries' {} Maybe Natural
a -> ListDatasetEntries
s {$sel:maxResults:ListDatasetEntries' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDatasetEntries)

-- | If the previous response was incomplete (because there is more data to
-- retrieve), Amazon Lookout for Vision returns a pagination token in the
-- response. You can use this pagination token to retrieve the next set of
-- dataset entries.
listDatasetEntries_nextToken :: Lens.Lens' ListDatasetEntries (Prelude.Maybe Prelude.Text)
listDatasetEntries_nextToken :: Lens' ListDatasetEntries (Maybe Text)
listDatasetEntries_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntries' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDatasetEntries
s@ListDatasetEntries' {} Maybe Text
a -> ListDatasetEntries
s {$sel:nextToken:ListDatasetEntries' :: Maybe Text
nextToken = Maybe Text
a} :: ListDatasetEntries)

-- | Perform a \"contains\" search on the values of the @source-ref@ key
-- within the dataset. For example a value of \"IMG_17\" returns all JSON
-- Lines where the @source-ref@ key value matches /*IMG_17*/.
listDatasetEntries_sourceRefContains :: Lens.Lens' ListDatasetEntries (Prelude.Maybe Prelude.Text)
listDatasetEntries_sourceRefContains :: Lens' ListDatasetEntries (Maybe Text)
listDatasetEntries_sourceRefContains = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntries' {Maybe Text
sourceRefContains :: Maybe Text
$sel:sourceRefContains:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
sourceRefContains} -> Maybe Text
sourceRefContains) (\s :: ListDatasetEntries
s@ListDatasetEntries' {} Maybe Text
a -> ListDatasetEntries
s {$sel:sourceRefContains:ListDatasetEntries' :: Maybe Text
sourceRefContains = Maybe Text
a} :: ListDatasetEntries)

-- | The name of the project that contains the dataset that you want to list.
listDatasetEntries_projectName :: Lens.Lens' ListDatasetEntries Prelude.Text
listDatasetEntries_projectName :: Lens' ListDatasetEntries Text
listDatasetEntries_projectName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntries' {Text
projectName :: Text
$sel:projectName:ListDatasetEntries' :: ListDatasetEntries -> Text
projectName} -> Text
projectName) (\s :: ListDatasetEntries
s@ListDatasetEntries' {} Text
a -> ListDatasetEntries
s {$sel:projectName:ListDatasetEntries' :: Text
projectName = Text
a} :: ListDatasetEntries)

-- | The type of the dataset that you want to list. Specify @train@ to list
-- the training dataset. Specify @test@ to list the test dataset. If you
-- have a single dataset project, specify @train@.
listDatasetEntries_datasetType :: Lens.Lens' ListDatasetEntries Prelude.Text
listDatasetEntries_datasetType :: Lens' ListDatasetEntries Text
listDatasetEntries_datasetType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntries' {Text
datasetType :: Text
$sel:datasetType:ListDatasetEntries' :: ListDatasetEntries -> Text
datasetType} -> Text
datasetType) (\s :: ListDatasetEntries
s@ListDatasetEntries' {} Text
a -> ListDatasetEntries
s {$sel:datasetType:ListDatasetEntries' :: Text
datasetType = Text
a} :: ListDatasetEntries)

instance Core.AWSPager ListDatasetEntries where
  page :: ListDatasetEntries
-> AWSResponse ListDatasetEntries -> Maybe ListDatasetEntries
page ListDatasetEntries
rq AWSResponse ListDatasetEntries
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDatasetEntries
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDatasetEntriesResponse (Maybe Text)
listDatasetEntriesResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDatasetEntries
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDatasetEntriesResponse (Maybe [Text])
listDatasetEntriesResponse_datasetEntries
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListDatasetEntries
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListDatasetEntries (Maybe Text)
listDatasetEntries_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDatasetEntries
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListDatasetEntriesResponse (Maybe Text)
listDatasetEntriesResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListDatasetEntries where
  type
    AWSResponse ListDatasetEntries =
      ListDatasetEntriesResponse
  request :: (Service -> Service)
-> ListDatasetEntries -> Request ListDatasetEntries
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListDatasetEntries
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDatasetEntries)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [Text] -> Maybe Text -> Int -> ListDatasetEntriesResponse
ListDatasetEntriesResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DatasetEntries" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListDatasetEntries where
  hashWithSalt :: Int -> ListDatasetEntries -> Int
hashWithSalt Int
_salt ListDatasetEntries' {Maybe Bool
Maybe Natural
Maybe Text
Maybe POSIX
Text
datasetType :: Text
projectName :: Text
sourceRefContains :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
labeled :: Maybe Bool
beforeCreationDate :: Maybe POSIX
anomalyClass :: Maybe Text
afterCreationDate :: Maybe POSIX
$sel:datasetType:ListDatasetEntries' :: ListDatasetEntries -> Text
$sel:projectName:ListDatasetEntries' :: ListDatasetEntries -> Text
$sel:sourceRefContains:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:nextToken:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:maxResults:ListDatasetEntries' :: ListDatasetEntries -> Maybe Natural
$sel:labeled:ListDatasetEntries' :: ListDatasetEntries -> Maybe Bool
$sel:beforeCreationDate:ListDatasetEntries' :: ListDatasetEntries -> Maybe POSIX
$sel:anomalyClass:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:afterCreationDate:ListDatasetEntries' :: ListDatasetEntries -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
afterCreationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
anomalyClass
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
beforeCreationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
labeled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceRefContains
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
projectName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
datasetType

instance Prelude.NFData ListDatasetEntries where
  rnf :: ListDatasetEntries -> ()
rnf ListDatasetEntries' {Maybe Bool
Maybe Natural
Maybe Text
Maybe POSIX
Text
datasetType :: Text
projectName :: Text
sourceRefContains :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
labeled :: Maybe Bool
beforeCreationDate :: Maybe POSIX
anomalyClass :: Maybe Text
afterCreationDate :: Maybe POSIX
$sel:datasetType:ListDatasetEntries' :: ListDatasetEntries -> Text
$sel:projectName:ListDatasetEntries' :: ListDatasetEntries -> Text
$sel:sourceRefContains:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:nextToken:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:maxResults:ListDatasetEntries' :: ListDatasetEntries -> Maybe Natural
$sel:labeled:ListDatasetEntries' :: ListDatasetEntries -> Maybe Bool
$sel:beforeCreationDate:ListDatasetEntries' :: ListDatasetEntries -> Maybe POSIX
$sel:anomalyClass:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:afterCreationDate:ListDatasetEntries' :: ListDatasetEntries -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
afterCreationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
anomalyClass
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
beforeCreationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
labeled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceRefContains
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
projectName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
datasetType

instance Data.ToHeaders ListDatasetEntries where
  toHeaders :: ListDatasetEntries -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToPath ListDatasetEntries where
  toPath :: ListDatasetEntries -> ByteString
toPath ListDatasetEntries' {Maybe Bool
Maybe Natural
Maybe Text
Maybe POSIX
Text
datasetType :: Text
projectName :: Text
sourceRefContains :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
labeled :: Maybe Bool
beforeCreationDate :: Maybe POSIX
anomalyClass :: Maybe Text
afterCreationDate :: Maybe POSIX
$sel:datasetType:ListDatasetEntries' :: ListDatasetEntries -> Text
$sel:projectName:ListDatasetEntries' :: ListDatasetEntries -> Text
$sel:sourceRefContains:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:nextToken:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:maxResults:ListDatasetEntries' :: ListDatasetEntries -> Maybe Natural
$sel:labeled:ListDatasetEntries' :: ListDatasetEntries -> Maybe Bool
$sel:beforeCreationDate:ListDatasetEntries' :: ListDatasetEntries -> Maybe POSIX
$sel:anomalyClass:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:afterCreationDate:ListDatasetEntries' :: ListDatasetEntries -> Maybe POSIX
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/2020-11-20/projects/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
projectName,
        ByteString
"/datasets/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
datasetType,
        ByteString
"/entries"
      ]

instance Data.ToQuery ListDatasetEntries where
  toQuery :: ListDatasetEntries -> QueryString
toQuery ListDatasetEntries' {Maybe Bool
Maybe Natural
Maybe Text
Maybe POSIX
Text
datasetType :: Text
projectName :: Text
sourceRefContains :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
labeled :: Maybe Bool
beforeCreationDate :: Maybe POSIX
anomalyClass :: Maybe Text
afterCreationDate :: Maybe POSIX
$sel:datasetType:ListDatasetEntries' :: ListDatasetEntries -> Text
$sel:projectName:ListDatasetEntries' :: ListDatasetEntries -> Text
$sel:sourceRefContains:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:nextToken:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:maxResults:ListDatasetEntries' :: ListDatasetEntries -> Maybe Natural
$sel:labeled:ListDatasetEntries' :: ListDatasetEntries -> Maybe Bool
$sel:beforeCreationDate:ListDatasetEntries' :: ListDatasetEntries -> Maybe POSIX
$sel:anomalyClass:ListDatasetEntries' :: ListDatasetEntries -> Maybe Text
$sel:afterCreationDate:ListDatasetEntries' :: ListDatasetEntries -> Maybe POSIX
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"createdAfter" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe POSIX
afterCreationDate,
        ByteString
"anomalyClass" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
anomalyClass,
        ByteString
"createdBefore" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe POSIX
beforeCreationDate,
        ByteString
"labeled" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
labeled,
        ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
        ByteString
"sourceRefContains" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
sourceRefContains
      ]

-- | /See:/ 'newListDatasetEntriesResponse' smart constructor.
data ListDatasetEntriesResponse = ListDatasetEntriesResponse'
  { -- | A list of the entries (JSON Lines) within the dataset.
    ListDatasetEntriesResponse -> Maybe [Text]
datasetEntries :: Prelude.Maybe [Prelude.Text],
    -- | If the response is truncated, Amazon Lookout for Vision returns this
    -- token that you can use in the subsequent request to retrieve the next
    -- set ofdataset entries.
    ListDatasetEntriesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDatasetEntriesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDatasetEntriesResponse -> ListDatasetEntriesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDatasetEntriesResponse -> ListDatasetEntriesResponse -> Bool
$c/= :: ListDatasetEntriesResponse -> ListDatasetEntriesResponse -> Bool
== :: ListDatasetEntriesResponse -> ListDatasetEntriesResponse -> Bool
$c== :: ListDatasetEntriesResponse -> ListDatasetEntriesResponse -> Bool
Prelude.Eq, ReadPrec [ListDatasetEntriesResponse]
ReadPrec ListDatasetEntriesResponse
Int -> ReadS ListDatasetEntriesResponse
ReadS [ListDatasetEntriesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDatasetEntriesResponse]
$creadListPrec :: ReadPrec [ListDatasetEntriesResponse]
readPrec :: ReadPrec ListDatasetEntriesResponse
$creadPrec :: ReadPrec ListDatasetEntriesResponse
readList :: ReadS [ListDatasetEntriesResponse]
$creadList :: ReadS [ListDatasetEntriesResponse]
readsPrec :: Int -> ReadS ListDatasetEntriesResponse
$creadsPrec :: Int -> ReadS ListDatasetEntriesResponse
Prelude.Read, Int -> ListDatasetEntriesResponse -> ShowS
[ListDatasetEntriesResponse] -> ShowS
ListDatasetEntriesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDatasetEntriesResponse] -> ShowS
$cshowList :: [ListDatasetEntriesResponse] -> ShowS
show :: ListDatasetEntriesResponse -> String
$cshow :: ListDatasetEntriesResponse -> String
showsPrec :: Int -> ListDatasetEntriesResponse -> ShowS
$cshowsPrec :: Int -> ListDatasetEntriesResponse -> ShowS
Prelude.Show, forall x.
Rep ListDatasetEntriesResponse x -> ListDatasetEntriesResponse
forall x.
ListDatasetEntriesResponse -> Rep ListDatasetEntriesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDatasetEntriesResponse x -> ListDatasetEntriesResponse
$cfrom :: forall x.
ListDatasetEntriesResponse -> Rep ListDatasetEntriesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDatasetEntriesResponse' 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:
--
-- 'datasetEntries', 'listDatasetEntriesResponse_datasetEntries' - A list of the entries (JSON Lines) within the dataset.
--
-- 'nextToken', 'listDatasetEntriesResponse_nextToken' - If the response is truncated, Amazon Lookout for Vision returns this
-- token that you can use in the subsequent request to retrieve the next
-- set ofdataset entries.
--
-- 'httpStatus', 'listDatasetEntriesResponse_httpStatus' - The response's http status code.
newListDatasetEntriesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDatasetEntriesResponse
newListDatasetEntriesResponse :: Int -> ListDatasetEntriesResponse
newListDatasetEntriesResponse Int
pHttpStatus_ =
  ListDatasetEntriesResponse'
    { $sel:datasetEntries:ListDatasetEntriesResponse' :: Maybe [Text]
datasetEntries =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDatasetEntriesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDatasetEntriesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of the entries (JSON Lines) within the dataset.
listDatasetEntriesResponse_datasetEntries :: Lens.Lens' ListDatasetEntriesResponse (Prelude.Maybe [Prelude.Text])
listDatasetEntriesResponse_datasetEntries :: Lens' ListDatasetEntriesResponse (Maybe [Text])
listDatasetEntriesResponse_datasetEntries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntriesResponse' {Maybe [Text]
datasetEntries :: Maybe [Text]
$sel:datasetEntries:ListDatasetEntriesResponse' :: ListDatasetEntriesResponse -> Maybe [Text]
datasetEntries} -> Maybe [Text]
datasetEntries) (\s :: ListDatasetEntriesResponse
s@ListDatasetEntriesResponse' {} Maybe [Text]
a -> ListDatasetEntriesResponse
s {$sel:datasetEntries:ListDatasetEntriesResponse' :: Maybe [Text]
datasetEntries = Maybe [Text]
a} :: ListDatasetEntriesResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | If the response is truncated, Amazon Lookout for Vision returns this
-- token that you can use in the subsequent request to retrieve the next
-- set ofdataset entries.
listDatasetEntriesResponse_nextToken :: Lens.Lens' ListDatasetEntriesResponse (Prelude.Maybe Prelude.Text)
listDatasetEntriesResponse_nextToken :: Lens' ListDatasetEntriesResponse (Maybe Text)
listDatasetEntriesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetEntriesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDatasetEntriesResponse' :: ListDatasetEntriesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDatasetEntriesResponse
s@ListDatasetEntriesResponse' {} Maybe Text
a -> ListDatasetEntriesResponse
s {$sel:nextToken:ListDatasetEntriesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDatasetEntriesResponse)

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

instance Prelude.NFData ListDatasetEntriesResponse where
  rnf :: ListDatasetEntriesResponse -> ()
rnf ListDatasetEntriesResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
datasetEntries :: Maybe [Text]
$sel:httpStatus:ListDatasetEntriesResponse' :: ListDatasetEntriesResponse -> Int
$sel:nextToken:ListDatasetEntriesResponse' :: ListDatasetEntriesResponse -> Maybe Text
$sel:datasetEntries:ListDatasetEntriesResponse' :: ListDatasetEntriesResponse -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
datasetEntries
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus