{-# 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.Personalize.ListDatasetExportJobs
-- 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 a list of dataset export jobs that use the given dataset. When a
-- dataset is not specified, all the dataset export jobs associated with
-- the account are listed. The response provides the properties for each
-- dataset export job, including the Amazon Resource Name (ARN). For more
-- information on dataset export jobs, see CreateDatasetExportJob. For more
-- information on datasets, see CreateDataset.
--
-- This operation returns paginated results.
module Amazonka.Personalize.ListDatasetExportJobs
  ( -- * Creating a Request
    ListDatasetExportJobs (..),
    newListDatasetExportJobs,

    -- * Request Lenses
    listDatasetExportJobs_datasetArn,
    listDatasetExportJobs_nextToken,
    listDatasetExportJobs_maxResults,

    -- * Destructuring the Response
    ListDatasetExportJobsResponse (..),
    newListDatasetExportJobsResponse,

    -- * Response Lenses
    listDatasetExportJobsResponse_nextToken,
    listDatasetExportJobsResponse_datasetExportJobs,
    listDatasetExportJobsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListDatasetExportJobs' smart constructor.
data ListDatasetExportJobs = ListDatasetExportJobs'
  { -- | The Amazon Resource Name (ARN) of the dataset to list the dataset export
    -- jobs for.
    ListDatasetExportJobs -> Maybe Text
datasetArn :: Prelude.Maybe Prelude.Text,
    -- | A token returned from the previous call to @ListDatasetExportJobs@ for
    -- getting the next set of dataset export jobs (if they exist).
    ListDatasetExportJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of dataset export jobs to return.
    ListDatasetExportJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListDatasetExportJobs -> ListDatasetExportJobs -> Bool
(ListDatasetExportJobs -> ListDatasetExportJobs -> Bool)
-> (ListDatasetExportJobs -> ListDatasetExportJobs -> Bool)
-> Eq ListDatasetExportJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDatasetExportJobs -> ListDatasetExportJobs -> Bool
$c/= :: ListDatasetExportJobs -> ListDatasetExportJobs -> Bool
== :: ListDatasetExportJobs -> ListDatasetExportJobs -> Bool
$c== :: ListDatasetExportJobs -> ListDatasetExportJobs -> Bool
Prelude.Eq, ReadPrec [ListDatasetExportJobs]
ReadPrec ListDatasetExportJobs
Int -> ReadS ListDatasetExportJobs
ReadS [ListDatasetExportJobs]
(Int -> ReadS ListDatasetExportJobs)
-> ReadS [ListDatasetExportJobs]
-> ReadPrec ListDatasetExportJobs
-> ReadPrec [ListDatasetExportJobs]
-> Read ListDatasetExportJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDatasetExportJobs]
$creadListPrec :: ReadPrec [ListDatasetExportJobs]
readPrec :: ReadPrec ListDatasetExportJobs
$creadPrec :: ReadPrec ListDatasetExportJobs
readList :: ReadS [ListDatasetExportJobs]
$creadList :: ReadS [ListDatasetExportJobs]
readsPrec :: Int -> ReadS ListDatasetExportJobs
$creadsPrec :: Int -> ReadS ListDatasetExportJobs
Prelude.Read, Int -> ListDatasetExportJobs -> ShowS
[ListDatasetExportJobs] -> ShowS
ListDatasetExportJobs -> String
(Int -> ListDatasetExportJobs -> ShowS)
-> (ListDatasetExportJobs -> String)
-> ([ListDatasetExportJobs] -> ShowS)
-> Show ListDatasetExportJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDatasetExportJobs] -> ShowS
$cshowList :: [ListDatasetExportJobs] -> ShowS
show :: ListDatasetExportJobs -> String
$cshow :: ListDatasetExportJobs -> String
showsPrec :: Int -> ListDatasetExportJobs -> ShowS
$cshowsPrec :: Int -> ListDatasetExportJobs -> ShowS
Prelude.Show, (forall x. ListDatasetExportJobs -> Rep ListDatasetExportJobs x)
-> (forall x. Rep ListDatasetExportJobs x -> ListDatasetExportJobs)
-> Generic ListDatasetExportJobs
forall x. Rep ListDatasetExportJobs x -> ListDatasetExportJobs
forall x. ListDatasetExportJobs -> Rep ListDatasetExportJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDatasetExportJobs x -> ListDatasetExportJobs
$cfrom :: forall x. ListDatasetExportJobs -> Rep ListDatasetExportJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListDatasetExportJobs' 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:
--
-- 'datasetArn', 'listDatasetExportJobs_datasetArn' - The Amazon Resource Name (ARN) of the dataset to list the dataset export
-- jobs for.
--
-- 'nextToken', 'listDatasetExportJobs_nextToken' - A token returned from the previous call to @ListDatasetExportJobs@ for
-- getting the next set of dataset export jobs (if they exist).
--
-- 'maxResults', 'listDatasetExportJobs_maxResults' - The maximum number of dataset export jobs to return.
newListDatasetExportJobs ::
  ListDatasetExportJobs
newListDatasetExportJobs :: ListDatasetExportJobs
newListDatasetExportJobs =
  ListDatasetExportJobs' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListDatasetExportJobs
ListDatasetExportJobs'
    { $sel:datasetArn:ListDatasetExportJobs' :: Maybe Text
datasetArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDatasetExportJobs' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDatasetExportJobs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the dataset to list the dataset export
-- jobs for.
listDatasetExportJobs_datasetArn :: Lens.Lens' ListDatasetExportJobs (Prelude.Maybe Prelude.Text)
listDatasetExportJobs_datasetArn :: (Maybe Text -> f (Maybe Text))
-> ListDatasetExportJobs -> f ListDatasetExportJobs
listDatasetExportJobs_datasetArn = (ListDatasetExportJobs -> Maybe Text)
-> (ListDatasetExportJobs -> Maybe Text -> ListDatasetExportJobs)
-> Lens
     ListDatasetExportJobs
     ListDatasetExportJobs
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetExportJobs' {Maybe Text
datasetArn :: Maybe Text
$sel:datasetArn:ListDatasetExportJobs' :: ListDatasetExportJobs -> Maybe Text
datasetArn} -> Maybe Text
datasetArn) (\s :: ListDatasetExportJobs
s@ListDatasetExportJobs' {} Maybe Text
a -> ListDatasetExportJobs
s {$sel:datasetArn:ListDatasetExportJobs' :: Maybe Text
datasetArn = Maybe Text
a} :: ListDatasetExportJobs)

-- | A token returned from the previous call to @ListDatasetExportJobs@ for
-- getting the next set of dataset export jobs (if they exist).
listDatasetExportJobs_nextToken :: Lens.Lens' ListDatasetExportJobs (Prelude.Maybe Prelude.Text)
listDatasetExportJobs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDatasetExportJobs -> f ListDatasetExportJobs
listDatasetExportJobs_nextToken = (ListDatasetExportJobs -> Maybe Text)
-> (ListDatasetExportJobs -> Maybe Text -> ListDatasetExportJobs)
-> Lens
     ListDatasetExportJobs
     ListDatasetExportJobs
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetExportJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDatasetExportJobs' :: ListDatasetExportJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDatasetExportJobs
s@ListDatasetExportJobs' {} Maybe Text
a -> ListDatasetExportJobs
s {$sel:nextToken:ListDatasetExportJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListDatasetExportJobs)

-- | The maximum number of dataset export jobs to return.
listDatasetExportJobs_maxResults :: Lens.Lens' ListDatasetExportJobs (Prelude.Maybe Prelude.Natural)
listDatasetExportJobs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDatasetExportJobs -> f ListDatasetExportJobs
listDatasetExportJobs_maxResults = (ListDatasetExportJobs -> Maybe Natural)
-> (ListDatasetExportJobs
    -> Maybe Natural -> ListDatasetExportJobs)
-> Lens
     ListDatasetExportJobs
     ListDatasetExportJobs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetExportJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDatasetExportJobs' :: ListDatasetExportJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDatasetExportJobs
s@ListDatasetExportJobs' {} Maybe Natural
a -> ListDatasetExportJobs
s {$sel:maxResults:ListDatasetExportJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDatasetExportJobs)

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

instance Prelude.NFData ListDatasetExportJobs

instance Core.ToHeaders ListDatasetExportJobs where
  toHeaders :: ListDatasetExportJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDatasetExportJobs -> 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
"AmazonPersonalize.ListDatasetExportJobs" ::
                          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 ListDatasetExportJobs where
  toJSON :: ListDatasetExportJobs -> Value
toJSON ListDatasetExportJobs' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
datasetArn :: Maybe Text
$sel:maxResults:ListDatasetExportJobs' :: ListDatasetExportJobs -> Maybe Natural
$sel:nextToken:ListDatasetExportJobs' :: ListDatasetExportJobs -> Maybe Text
$sel:datasetArn:ListDatasetExportJobs' :: ListDatasetExportJobs -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"datasetArn" 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
datasetArn,
            (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 ListDatasetExportJobs where
  toPath :: ListDatasetExportJobs -> ByteString
toPath = ByteString -> ListDatasetExportJobs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListDatasetExportJobsResponse' smart constructor.
data ListDatasetExportJobsResponse = ListDatasetExportJobsResponse'
  { -- | A token for getting the next set of dataset export jobs (if they exist).
    ListDatasetExportJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of dataset export jobs.
    ListDatasetExportJobsResponse -> Maybe [DatasetExportJobSummary]
datasetExportJobs :: Prelude.Maybe [DatasetExportJobSummary],
    -- | The response's http status code.
    ListDatasetExportJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDatasetExportJobsResponse
-> ListDatasetExportJobsResponse -> Bool
(ListDatasetExportJobsResponse
 -> ListDatasetExportJobsResponse -> Bool)
-> (ListDatasetExportJobsResponse
    -> ListDatasetExportJobsResponse -> Bool)
-> Eq ListDatasetExportJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDatasetExportJobsResponse
-> ListDatasetExportJobsResponse -> Bool
$c/= :: ListDatasetExportJobsResponse
-> ListDatasetExportJobsResponse -> Bool
== :: ListDatasetExportJobsResponse
-> ListDatasetExportJobsResponse -> Bool
$c== :: ListDatasetExportJobsResponse
-> ListDatasetExportJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListDatasetExportJobsResponse]
ReadPrec ListDatasetExportJobsResponse
Int -> ReadS ListDatasetExportJobsResponse
ReadS [ListDatasetExportJobsResponse]
(Int -> ReadS ListDatasetExportJobsResponse)
-> ReadS [ListDatasetExportJobsResponse]
-> ReadPrec ListDatasetExportJobsResponse
-> ReadPrec [ListDatasetExportJobsResponse]
-> Read ListDatasetExportJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDatasetExportJobsResponse]
$creadListPrec :: ReadPrec [ListDatasetExportJobsResponse]
readPrec :: ReadPrec ListDatasetExportJobsResponse
$creadPrec :: ReadPrec ListDatasetExportJobsResponse
readList :: ReadS [ListDatasetExportJobsResponse]
$creadList :: ReadS [ListDatasetExportJobsResponse]
readsPrec :: Int -> ReadS ListDatasetExportJobsResponse
$creadsPrec :: Int -> ReadS ListDatasetExportJobsResponse
Prelude.Read, Int -> ListDatasetExportJobsResponse -> ShowS
[ListDatasetExportJobsResponse] -> ShowS
ListDatasetExportJobsResponse -> String
(Int -> ListDatasetExportJobsResponse -> ShowS)
-> (ListDatasetExportJobsResponse -> String)
-> ([ListDatasetExportJobsResponse] -> ShowS)
-> Show ListDatasetExportJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDatasetExportJobsResponse] -> ShowS
$cshowList :: [ListDatasetExportJobsResponse] -> ShowS
show :: ListDatasetExportJobsResponse -> String
$cshow :: ListDatasetExportJobsResponse -> String
showsPrec :: Int -> ListDatasetExportJobsResponse -> ShowS
$cshowsPrec :: Int -> ListDatasetExportJobsResponse -> ShowS
Prelude.Show, (forall x.
 ListDatasetExportJobsResponse
 -> Rep ListDatasetExportJobsResponse x)
-> (forall x.
    Rep ListDatasetExportJobsResponse x
    -> ListDatasetExportJobsResponse)
-> Generic ListDatasetExportJobsResponse
forall x.
Rep ListDatasetExportJobsResponse x
-> ListDatasetExportJobsResponse
forall x.
ListDatasetExportJobsResponse
-> Rep ListDatasetExportJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDatasetExportJobsResponse x
-> ListDatasetExportJobsResponse
$cfrom :: forall x.
ListDatasetExportJobsResponse
-> Rep ListDatasetExportJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDatasetExportJobsResponse' 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', 'listDatasetExportJobsResponse_nextToken' - A token for getting the next set of dataset export jobs (if they exist).
--
-- 'datasetExportJobs', 'listDatasetExportJobsResponse_datasetExportJobs' - The list of dataset export jobs.
--
-- 'httpStatus', 'listDatasetExportJobsResponse_httpStatus' - The response's http status code.
newListDatasetExportJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDatasetExportJobsResponse
newListDatasetExportJobsResponse :: Int -> ListDatasetExportJobsResponse
newListDatasetExportJobsResponse Int
pHttpStatus_ =
  ListDatasetExportJobsResponse' :: Maybe Text
-> Maybe [DatasetExportJobSummary]
-> Int
-> ListDatasetExportJobsResponse
ListDatasetExportJobsResponse'
    { $sel:nextToken:ListDatasetExportJobsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasetExportJobs:ListDatasetExportJobsResponse' :: Maybe [DatasetExportJobSummary]
datasetExportJobs = Maybe [DatasetExportJobSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDatasetExportJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A token for getting the next set of dataset export jobs (if they exist).
listDatasetExportJobsResponse_nextToken :: Lens.Lens' ListDatasetExportJobsResponse (Prelude.Maybe Prelude.Text)
listDatasetExportJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDatasetExportJobsResponse -> f ListDatasetExportJobsResponse
listDatasetExportJobsResponse_nextToken = (ListDatasetExportJobsResponse -> Maybe Text)
-> (ListDatasetExportJobsResponse
    -> Maybe Text -> ListDatasetExportJobsResponse)
-> Lens' ListDatasetExportJobsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetExportJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDatasetExportJobsResponse' :: ListDatasetExportJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDatasetExportJobsResponse
s@ListDatasetExportJobsResponse' {} Maybe Text
a -> ListDatasetExportJobsResponse
s {$sel:nextToken:ListDatasetExportJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDatasetExportJobsResponse)

-- | The list of dataset export jobs.
listDatasetExportJobsResponse_datasetExportJobs :: Lens.Lens' ListDatasetExportJobsResponse (Prelude.Maybe [DatasetExportJobSummary])
listDatasetExportJobsResponse_datasetExportJobs :: (Maybe [DatasetExportJobSummary]
 -> f (Maybe [DatasetExportJobSummary]))
-> ListDatasetExportJobsResponse -> f ListDatasetExportJobsResponse
listDatasetExportJobsResponse_datasetExportJobs = (ListDatasetExportJobsResponse -> Maybe [DatasetExportJobSummary])
-> (ListDatasetExportJobsResponse
    -> Maybe [DatasetExportJobSummary]
    -> ListDatasetExportJobsResponse)
-> Lens'
     ListDatasetExportJobsResponse (Maybe [DatasetExportJobSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetExportJobsResponse' {Maybe [DatasetExportJobSummary]
datasetExportJobs :: Maybe [DatasetExportJobSummary]
$sel:datasetExportJobs:ListDatasetExportJobsResponse' :: ListDatasetExportJobsResponse -> Maybe [DatasetExportJobSummary]
datasetExportJobs} -> Maybe [DatasetExportJobSummary]
datasetExportJobs) (\s :: ListDatasetExportJobsResponse
s@ListDatasetExportJobsResponse' {} Maybe [DatasetExportJobSummary]
a -> ListDatasetExportJobsResponse
s {$sel:datasetExportJobs:ListDatasetExportJobsResponse' :: Maybe [DatasetExportJobSummary]
datasetExportJobs = Maybe [DatasetExportJobSummary]
a} :: ListDatasetExportJobsResponse) ((Maybe [DatasetExportJobSummary]
  -> f (Maybe [DatasetExportJobSummary]))
 -> ListDatasetExportJobsResponse
 -> f ListDatasetExportJobsResponse)
-> ((Maybe [DatasetExportJobSummary]
     -> f (Maybe [DatasetExportJobSummary]))
    -> Maybe [DatasetExportJobSummary]
    -> f (Maybe [DatasetExportJobSummary]))
-> (Maybe [DatasetExportJobSummary]
    -> f (Maybe [DatasetExportJobSummary]))
-> ListDatasetExportJobsResponse
-> f ListDatasetExportJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DatasetExportJobSummary]
  [DatasetExportJobSummary]
  [DatasetExportJobSummary]
  [DatasetExportJobSummary]
-> Iso
     (Maybe [DatasetExportJobSummary])
     (Maybe [DatasetExportJobSummary])
     (Maybe [DatasetExportJobSummary])
     (Maybe [DatasetExportJobSummary])
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
  [DatasetExportJobSummary]
  [DatasetExportJobSummary]
  [DatasetExportJobSummary]
  [DatasetExportJobSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListDatasetExportJobsResponse