{-# 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.QuickSight.ListDataSets
-- 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)
--
-- Lists all of the datasets belonging to the current Amazon Web Services
-- account in an Amazon Web Services Region.
--
-- The permissions resource is
-- @arn:aws:quicksight:region:aws-account-id:dataset\/*@.
--
-- This operation returns paginated results.
module Amazonka.QuickSight.ListDataSets
  ( -- * Creating a Request
    ListDataSets (..),
    newListDataSets,

    -- * Request Lenses
    listDataSets_nextToken,
    listDataSets_maxResults,
    listDataSets_awsAccountId,

    -- * Destructuring the Response
    ListDataSetsResponse (..),
    newListDataSetsResponse,

    -- * Response Lenses
    listDataSetsResponse_requestId,
    listDataSetsResponse_nextToken,
    listDataSetsResponse_dataSetSummaries,
    listDataSetsResponse_status,
  )
where

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

-- | /See:/ 'newListDataSets' smart constructor.
data ListDataSets = ListDataSets'
  { -- | The token for the next set of results, or null if there are no more
    -- results.
    ListDataSets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per request.
    ListDataSets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Web Services account ID.
    ListDataSets -> Text
awsAccountId :: Prelude.Text
  }
  deriving (ListDataSets -> ListDataSets -> Bool
(ListDataSets -> ListDataSets -> Bool)
-> (ListDataSets -> ListDataSets -> Bool) -> Eq ListDataSets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDataSets -> ListDataSets -> Bool
$c/= :: ListDataSets -> ListDataSets -> Bool
== :: ListDataSets -> ListDataSets -> Bool
$c== :: ListDataSets -> ListDataSets -> Bool
Prelude.Eq, ReadPrec [ListDataSets]
ReadPrec ListDataSets
Int -> ReadS ListDataSets
ReadS [ListDataSets]
(Int -> ReadS ListDataSets)
-> ReadS [ListDataSets]
-> ReadPrec ListDataSets
-> ReadPrec [ListDataSets]
-> Read ListDataSets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDataSets]
$creadListPrec :: ReadPrec [ListDataSets]
readPrec :: ReadPrec ListDataSets
$creadPrec :: ReadPrec ListDataSets
readList :: ReadS [ListDataSets]
$creadList :: ReadS [ListDataSets]
readsPrec :: Int -> ReadS ListDataSets
$creadsPrec :: Int -> ReadS ListDataSets
Prelude.Read, Int -> ListDataSets -> ShowS
[ListDataSets] -> ShowS
ListDataSets -> String
(Int -> ListDataSets -> ShowS)
-> (ListDataSets -> String)
-> ([ListDataSets] -> ShowS)
-> Show ListDataSets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDataSets] -> ShowS
$cshowList :: [ListDataSets] -> ShowS
show :: ListDataSets -> String
$cshow :: ListDataSets -> String
showsPrec :: Int -> ListDataSets -> ShowS
$cshowsPrec :: Int -> ListDataSets -> ShowS
Prelude.Show, (forall x. ListDataSets -> Rep ListDataSets x)
-> (forall x. Rep ListDataSets x -> ListDataSets)
-> Generic ListDataSets
forall x. Rep ListDataSets x -> ListDataSets
forall x. ListDataSets -> Rep ListDataSets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDataSets x -> ListDataSets
$cfrom :: forall x. ListDataSets -> Rep ListDataSets x
Prelude.Generic)

-- |
-- Create a value of 'ListDataSets' 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', 'listDataSets_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'maxResults', 'listDataSets_maxResults' - The maximum number of results to be returned per request.
--
-- 'awsAccountId', 'listDataSets_awsAccountId' - The Amazon Web Services account ID.
newListDataSets ::
  -- | 'awsAccountId'
  Prelude.Text ->
  ListDataSets
newListDataSets :: Text -> ListDataSets
newListDataSets Text
pAwsAccountId_ =
  ListDataSets' :: Maybe Text -> Maybe Natural -> Text -> ListDataSets
ListDataSets'
    { $sel:nextToken:ListDataSets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDataSets' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:awsAccountId:ListDataSets' :: Text
awsAccountId = Text
pAwsAccountId_
    }

-- | The token for the next set of results, or null if there are no more
-- results.
listDataSets_nextToken :: Lens.Lens' ListDataSets (Prelude.Maybe Prelude.Text)
listDataSets_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListDataSets -> f ListDataSets
listDataSets_nextToken = (ListDataSets -> Maybe Text)
-> (ListDataSets -> Maybe Text -> ListDataSets)
-> Lens ListDataSets ListDataSets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDataSets' :: ListDataSets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDataSets
s@ListDataSets' {} Maybe Text
a -> ListDataSets
s {$sel:nextToken:ListDataSets' :: Maybe Text
nextToken = Maybe Text
a} :: ListDataSets)

-- | The maximum number of results to be returned per request.
listDataSets_maxResults :: Lens.Lens' ListDataSets (Prelude.Maybe Prelude.Natural)
listDataSets_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDataSets -> f ListDataSets
listDataSets_maxResults = (ListDataSets -> Maybe Natural)
-> (ListDataSets -> Maybe Natural -> ListDataSets)
-> Lens ListDataSets ListDataSets (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSets' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDataSets' :: ListDataSets -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDataSets
s@ListDataSets' {} Maybe Natural
a -> ListDataSets
s {$sel:maxResults:ListDataSets' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDataSets)

-- | The Amazon Web Services account ID.
listDataSets_awsAccountId :: Lens.Lens' ListDataSets Prelude.Text
listDataSets_awsAccountId :: (Text -> f Text) -> ListDataSets -> f ListDataSets
listDataSets_awsAccountId = (ListDataSets -> Text)
-> (ListDataSets -> Text -> ListDataSets)
-> Lens ListDataSets ListDataSets Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSets' {Text
awsAccountId :: Text
$sel:awsAccountId:ListDataSets' :: ListDataSets -> Text
awsAccountId} -> Text
awsAccountId) (\s :: ListDataSets
s@ListDataSets' {} Text
a -> ListDataSets
s {$sel:awsAccountId:ListDataSets' :: Text
awsAccountId = Text
a} :: ListDataSets)

instance Core.AWSPager ListDataSets where
  page :: ListDataSets -> AWSResponse ListDataSets -> Maybe ListDataSets
page ListDataSets
rq AWSResponse ListDataSets
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDataSets
ListDataSetsResponse
rs
            ListDataSetsResponse
-> Getting (First Text) ListDataSetsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDataSetsResponse -> Const (First Text) ListDataSetsResponse
Lens' ListDataSetsResponse (Maybe Text)
listDataSetsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDataSetsResponse -> Const (First Text) ListDataSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDataSetsResponse 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 ListDataSets
forall a. Maybe a
Prelude.Nothing
    | Maybe [DataSetSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDataSets
ListDataSetsResponse
rs
            ListDataSetsResponse
-> Getting
     (First [DataSetSummary]) ListDataSetsResponse [DataSetSummary]
-> Maybe [DataSetSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [DataSetSummary]
 -> Const (First [DataSetSummary]) (Maybe [DataSetSummary]))
-> ListDataSetsResponse
-> Const (First [DataSetSummary]) ListDataSetsResponse
Lens' ListDataSetsResponse (Maybe [DataSetSummary])
listDataSetsResponse_dataSetSummaries
              ((Maybe [DataSetSummary]
  -> Const (First [DataSetSummary]) (Maybe [DataSetSummary]))
 -> ListDataSetsResponse
 -> Const (First [DataSetSummary]) ListDataSetsResponse)
-> (([DataSetSummary]
     -> Const (First [DataSetSummary]) [DataSetSummary])
    -> Maybe [DataSetSummary]
    -> Const (First [DataSetSummary]) (Maybe [DataSetSummary]))
-> Getting
     (First [DataSetSummary]) ListDataSetsResponse [DataSetSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DataSetSummary]
 -> Const (First [DataSetSummary]) [DataSetSummary])
-> Maybe [DataSetSummary]
-> Const (First [DataSetSummary]) (Maybe [DataSetSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListDataSets
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListDataSets -> Maybe ListDataSets
forall a. a -> Maybe a
Prelude.Just (ListDataSets -> Maybe ListDataSets)
-> ListDataSets -> Maybe ListDataSets
forall a b. (a -> b) -> a -> b
Prelude.$
        ListDataSets
rq
          ListDataSets -> (ListDataSets -> ListDataSets) -> ListDataSets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDataSets -> Identity ListDataSets
Lens ListDataSets ListDataSets (Maybe Text) (Maybe Text)
listDataSets_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListDataSets -> Identity ListDataSets)
-> Maybe Text -> ListDataSets -> ListDataSets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDataSets
ListDataSetsResponse
rs
          ListDataSetsResponse
-> Getting (First Text) ListDataSetsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDataSetsResponse -> Const (First Text) ListDataSetsResponse
Lens' ListDataSetsResponse (Maybe Text)
listDataSetsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDataSetsResponse -> Const (First Text) ListDataSetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDataSetsResponse 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 ListDataSets where
  type AWSResponse ListDataSets = ListDataSetsResponse
  request :: ListDataSets -> Request ListDataSets
request = Service -> ListDataSets -> Request ListDataSets
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDataSets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDataSets)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDataSets))
-> Logger
-> Service
-> Proxy ListDataSets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListDataSets)))
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 Text
-> Maybe [DataSetSummary]
-> Int
-> ListDataSetsResponse
ListDataSetsResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe [DataSetSummary]
 -> Int
 -> ListDataSetsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe [DataSetSummary] -> Int -> ListDataSetsResponse)
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
"RequestId")
            Either
  String
  (Maybe Text
   -> Maybe [DataSetSummary] -> Int -> ListDataSetsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [DataSetSummary] -> Int -> ListDataSetsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String (Maybe [DataSetSummary] -> Int -> ListDataSetsResponse)
-> Either String (Maybe [DataSetSummary])
-> Either String (Int -> ListDataSetsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [DataSetSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DataSetSummaries"
                            Either String (Maybe (Maybe [DataSetSummary]))
-> Maybe [DataSetSummary] -> Either String (Maybe [DataSetSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DataSetSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListDataSetsResponse)
-> Either String Int -> Either String ListDataSetsResponse
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 ListDataSets

instance Prelude.NFData ListDataSets

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

instance Core.ToPath ListDataSets where
  toPath :: ListDataSets -> ByteString
toPath ListDataSets' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:awsAccountId:ListDataSets' :: ListDataSets -> Text
$sel:maxResults:ListDataSets' :: ListDataSets -> Maybe Natural
$sel:nextToken:ListDataSets' :: ListDataSets -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/accounts/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
awsAccountId, ByteString
"/data-sets"]

instance Core.ToQuery ListDataSets where
  toQuery :: ListDataSets -> QueryString
toQuery ListDataSets' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:awsAccountId:ListDataSets' :: ListDataSets -> Text
$sel:maxResults:ListDataSets' :: ListDataSets -> Maybe Natural
$sel:nextToken:ListDataSets' :: ListDataSets -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"next-token" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"max-results" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListDataSetsResponse' smart constructor.
data ListDataSetsResponse = ListDataSetsResponse'
  { -- | The Amazon Web Services request ID for this operation.
    ListDataSetsResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | The token for the next set of results, or null if there are no more
    -- results.
    ListDataSetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of dataset summaries.
    ListDataSetsResponse -> Maybe [DataSetSummary]
dataSetSummaries :: Prelude.Maybe [DataSetSummary],
    -- | The HTTP status of the request.
    ListDataSetsResponse -> Int
status :: Prelude.Int
  }
  deriving (ListDataSetsResponse -> ListDataSetsResponse -> Bool
(ListDataSetsResponse -> ListDataSetsResponse -> Bool)
-> (ListDataSetsResponse -> ListDataSetsResponse -> Bool)
-> Eq ListDataSetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDataSetsResponse -> ListDataSetsResponse -> Bool
$c/= :: ListDataSetsResponse -> ListDataSetsResponse -> Bool
== :: ListDataSetsResponse -> ListDataSetsResponse -> Bool
$c== :: ListDataSetsResponse -> ListDataSetsResponse -> Bool
Prelude.Eq, ReadPrec [ListDataSetsResponse]
ReadPrec ListDataSetsResponse
Int -> ReadS ListDataSetsResponse
ReadS [ListDataSetsResponse]
(Int -> ReadS ListDataSetsResponse)
-> ReadS [ListDataSetsResponse]
-> ReadPrec ListDataSetsResponse
-> ReadPrec [ListDataSetsResponse]
-> Read ListDataSetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDataSetsResponse]
$creadListPrec :: ReadPrec [ListDataSetsResponse]
readPrec :: ReadPrec ListDataSetsResponse
$creadPrec :: ReadPrec ListDataSetsResponse
readList :: ReadS [ListDataSetsResponse]
$creadList :: ReadS [ListDataSetsResponse]
readsPrec :: Int -> ReadS ListDataSetsResponse
$creadsPrec :: Int -> ReadS ListDataSetsResponse
Prelude.Read, Int -> ListDataSetsResponse -> ShowS
[ListDataSetsResponse] -> ShowS
ListDataSetsResponse -> String
(Int -> ListDataSetsResponse -> ShowS)
-> (ListDataSetsResponse -> String)
-> ([ListDataSetsResponse] -> ShowS)
-> Show ListDataSetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDataSetsResponse] -> ShowS
$cshowList :: [ListDataSetsResponse] -> ShowS
show :: ListDataSetsResponse -> String
$cshow :: ListDataSetsResponse -> String
showsPrec :: Int -> ListDataSetsResponse -> ShowS
$cshowsPrec :: Int -> ListDataSetsResponse -> ShowS
Prelude.Show, (forall x. ListDataSetsResponse -> Rep ListDataSetsResponse x)
-> (forall x. Rep ListDataSetsResponse x -> ListDataSetsResponse)
-> Generic ListDataSetsResponse
forall x. Rep ListDataSetsResponse x -> ListDataSetsResponse
forall x. ListDataSetsResponse -> Rep ListDataSetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDataSetsResponse x -> ListDataSetsResponse
$cfrom :: forall x. ListDataSetsResponse -> Rep ListDataSetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDataSetsResponse' 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:
--
-- 'requestId', 'listDataSetsResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'nextToken', 'listDataSetsResponse_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'dataSetSummaries', 'listDataSetsResponse_dataSetSummaries' - The list of dataset summaries.
--
-- 'status', 'listDataSetsResponse_status' - The HTTP status of the request.
newListDataSetsResponse ::
  -- | 'status'
  Prelude.Int ->
  ListDataSetsResponse
newListDataSetsResponse :: Int -> ListDataSetsResponse
newListDataSetsResponse Int
pStatus_ =
  ListDataSetsResponse' :: Maybe Text
-> Maybe Text
-> Maybe [DataSetSummary]
-> Int
-> ListDataSetsResponse
ListDataSetsResponse'
    { $sel:requestId:ListDataSetsResponse' :: Maybe Text
requestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDataSetsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSetSummaries:ListDataSetsResponse' :: Maybe [DataSetSummary]
dataSetSummaries = Maybe [DataSetSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListDataSetsResponse' :: Int
status = Int
pStatus_
    }

-- | The Amazon Web Services request ID for this operation.
listDataSetsResponse_requestId :: Lens.Lens' ListDataSetsResponse (Prelude.Maybe Prelude.Text)
listDataSetsResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> ListDataSetsResponse -> f ListDataSetsResponse
listDataSetsResponse_requestId = (ListDataSetsResponse -> Maybe Text)
-> (ListDataSetsResponse -> Maybe Text -> ListDataSetsResponse)
-> Lens' ListDataSetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetsResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:ListDataSetsResponse' :: ListDataSetsResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: ListDataSetsResponse
s@ListDataSetsResponse' {} Maybe Text
a -> ListDataSetsResponse
s {$sel:requestId:ListDataSetsResponse' :: Maybe Text
requestId = Maybe Text
a} :: ListDataSetsResponse)

-- | The token for the next set of results, or null if there are no more
-- results.
listDataSetsResponse_nextToken :: Lens.Lens' ListDataSetsResponse (Prelude.Maybe Prelude.Text)
listDataSetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDataSetsResponse -> f ListDataSetsResponse
listDataSetsResponse_nextToken = (ListDataSetsResponse -> Maybe Text)
-> (ListDataSetsResponse -> Maybe Text -> ListDataSetsResponse)
-> Lens' ListDataSetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDataSetsResponse' :: ListDataSetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDataSetsResponse
s@ListDataSetsResponse' {} Maybe Text
a -> ListDataSetsResponse
s {$sel:nextToken:ListDataSetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDataSetsResponse)

-- | The list of dataset summaries.
listDataSetsResponse_dataSetSummaries :: Lens.Lens' ListDataSetsResponse (Prelude.Maybe [DataSetSummary])
listDataSetsResponse_dataSetSummaries :: (Maybe [DataSetSummary] -> f (Maybe [DataSetSummary]))
-> ListDataSetsResponse -> f ListDataSetsResponse
listDataSetsResponse_dataSetSummaries = (ListDataSetsResponse -> Maybe [DataSetSummary])
-> (ListDataSetsResponse
    -> Maybe [DataSetSummary] -> ListDataSetsResponse)
-> Lens' ListDataSetsResponse (Maybe [DataSetSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetsResponse' {Maybe [DataSetSummary]
dataSetSummaries :: Maybe [DataSetSummary]
$sel:dataSetSummaries:ListDataSetsResponse' :: ListDataSetsResponse -> Maybe [DataSetSummary]
dataSetSummaries} -> Maybe [DataSetSummary]
dataSetSummaries) (\s :: ListDataSetsResponse
s@ListDataSetsResponse' {} Maybe [DataSetSummary]
a -> ListDataSetsResponse
s {$sel:dataSetSummaries:ListDataSetsResponse' :: Maybe [DataSetSummary]
dataSetSummaries = Maybe [DataSetSummary]
a} :: ListDataSetsResponse) ((Maybe [DataSetSummary] -> f (Maybe [DataSetSummary]))
 -> ListDataSetsResponse -> f ListDataSetsResponse)
-> ((Maybe [DataSetSummary] -> f (Maybe [DataSetSummary]))
    -> Maybe [DataSetSummary] -> f (Maybe [DataSetSummary]))
-> (Maybe [DataSetSummary] -> f (Maybe [DataSetSummary]))
-> ListDataSetsResponse
-> f ListDataSetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DataSetSummary] [DataSetSummary] [DataSetSummary] [DataSetSummary]
-> Iso
     (Maybe [DataSetSummary])
     (Maybe [DataSetSummary])
     (Maybe [DataSetSummary])
     (Maybe [DataSetSummary])
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
  [DataSetSummary] [DataSetSummary] [DataSetSummary] [DataSetSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The HTTP status of the request.
listDataSetsResponse_status :: Lens.Lens' ListDataSetsResponse Prelude.Int
listDataSetsResponse_status :: (Int -> f Int) -> ListDataSetsResponse -> f ListDataSetsResponse
listDataSetsResponse_status = (ListDataSetsResponse -> Int)
-> (ListDataSetsResponse -> Int -> ListDataSetsResponse)
-> Lens ListDataSetsResponse ListDataSetsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSetsResponse' {Int
status :: Int
$sel:status:ListDataSetsResponse' :: ListDataSetsResponse -> Int
status} -> Int
status) (\s :: ListDataSetsResponse
s@ListDataSetsResponse' {} Int
a -> ListDataSetsResponse
s {$sel:status:ListDataSetsResponse' :: Int
status = Int
a} :: ListDataSetsResponse)

instance Prelude.NFData ListDataSetsResponse