{-# 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.CognitoSync.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 datasets for an identity. With Amazon Cognito Sync, each identity
-- has access only to its own data. Thus, the credentials used to make this
-- API call need to have access to the identity data.
--
-- ListDatasets can be called with temporary user credentials provided by
-- Cognito Identity or with developer credentials. You should use the
-- Cognito Identity credentials to make this API call.
module Amazonka.CognitoSync.ListDatasets
  ( -- * Creating a Request
    ListDatasets (..),
    newListDatasets,

    -- * Request Lenses
    listDatasets_nextToken,
    listDatasets_maxResults,
    listDatasets_identityId,
    listDatasets_identityPoolId,

    -- * Destructuring the Response
    ListDatasetsResponse (..),
    newListDatasetsResponse,

    -- * Response Lenses
    listDatasetsResponse_count,
    listDatasetsResponse_nextToken,
    listDatasetsResponse_datasets,
    listDatasetsResponse_httpStatus,
  )
where

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

-- | Request for a list of datasets for an identity.
--
-- /See:/ 'newListDatasets' smart constructor.
data ListDatasets = ListDatasets'
  { -- | A pagination token for obtaining the next page of results.
    ListDatasets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned.
    ListDatasets -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | A name-spaced GUID (for example,
    -- us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon
    -- Cognito. GUID generation is unique within a region.
    ListDatasets -> Text
identityId :: Prelude.Text,
    -- | A name-spaced GUID (for example,
    -- us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon
    -- Cognito. GUID generation is unique within a region.
    ListDatasets -> Text
identityPoolId :: 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' - A pagination token for obtaining the next page of results.
--
-- 'maxResults', 'listDatasets_maxResults' - The maximum number of results to be returned.
--
-- 'identityId', 'listDatasets_identityId' - A name-spaced GUID (for example,
-- us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon
-- Cognito. GUID generation is unique within a region.
--
-- 'identityPoolId', 'listDatasets_identityPoolId' - A name-spaced GUID (for example,
-- us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon
-- Cognito. GUID generation is unique within a region.
newListDatasets ::
  -- | 'identityId'
  Prelude.Text ->
  -- | 'identityPoolId'
  Prelude.Text ->
  ListDatasets
newListDatasets :: Text -> Text -> ListDatasets
newListDatasets Text
pIdentityId_ Text
pIdentityPoolId_ =
  ListDatasets' :: Maybe Text -> Maybe Int -> Text -> Text -> ListDatasets
ListDatasets'
    { $sel:nextToken:ListDatasets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDatasets' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:identityId:ListDatasets' :: Text
identityId = Text
pIdentityId_,
      $sel:identityPoolId:ListDatasets' :: Text
identityPoolId = Text
pIdentityPoolId_
    }

-- | A pagination token for obtaining the next page of 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.
listDatasets_maxResults :: Lens.Lens' ListDatasets (Prelude.Maybe Prelude.Int)
listDatasets_maxResults :: (Maybe Int -> f (Maybe Int)) -> ListDatasets -> f ListDatasets
listDatasets_maxResults = (ListDatasets -> Maybe Int)
-> (ListDatasets -> Maybe Int -> ListDatasets)
-> Lens ListDatasets ListDatasets (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasets' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListDatasets' :: ListDatasets -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListDatasets
s@ListDatasets' {} Maybe Int
a -> ListDatasets
s {$sel:maxResults:ListDatasets' :: Maybe Int
maxResults = Maybe Int
a} :: ListDatasets)

-- | A name-spaced GUID (for example,
-- us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon
-- Cognito. GUID generation is unique within a region.
listDatasets_identityId :: Lens.Lens' ListDatasets Prelude.Text
listDatasets_identityId :: (Text -> f Text) -> ListDatasets -> f ListDatasets
listDatasets_identityId = (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
identityId :: Text
$sel:identityId:ListDatasets' :: ListDatasets -> Text
identityId} -> Text
identityId) (\s :: ListDatasets
s@ListDatasets' {} Text
a -> ListDatasets
s {$sel:identityId:ListDatasets' :: Text
identityId = Text
a} :: ListDatasets)

-- | A name-spaced GUID (for example,
-- us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon
-- Cognito. GUID generation is unique within a region.
listDatasets_identityPoolId :: Lens.Lens' ListDatasets Prelude.Text
listDatasets_identityPoolId :: (Text -> f Text) -> ListDatasets -> f ListDatasets
listDatasets_identityPoolId = (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
identityPoolId :: Text
$sel:identityPoolId:ListDatasets' :: ListDatasets -> Text
identityPoolId} -> Text
identityPoolId) (\s :: ListDatasets
s@ListDatasets' {} Text
a -> ListDatasets
s {$sel:identityPoolId:ListDatasets' :: Text
identityPoolId = Text
a} :: ListDatasets)

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 Int
-> Maybe Text -> Maybe [Dataset] -> Int -> ListDatasetsResponse
ListDatasetsResponse'
            (Maybe Int
 -> Maybe Text -> Maybe [Dataset] -> Int -> ListDatasetsResponse)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text -> Maybe [Dataset] -> Int -> ListDatasetsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Int)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Count")
            Either
  String
  (Maybe Text -> Maybe [Dataset] -> Int -> ListDatasetsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Dataset] -> 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 [Dataset] -> Int -> ListDatasetsResponse)
-> Either String (Maybe [Dataset])
-> 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 [Dataset]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Datasets" Either String (Maybe (Maybe [Dataset]))
-> Maybe [Dataset] -> Either String (Maybe [Dataset])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Dataset]
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.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListDatasets where
  toPath :: ListDatasets -> ByteString
toPath ListDatasets' {Maybe Int
Maybe Text
Text
identityPoolId :: Text
identityId :: Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:identityPoolId:ListDatasets' :: ListDatasets -> Text
$sel:identityId:ListDatasets' :: ListDatasets -> Text
$sel:maxResults:ListDatasets' :: ListDatasets -> Maybe Int
$sel:nextToken:ListDatasets' :: ListDatasets -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/identitypools/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
identityPoolId,
        ByteString
"/identities/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
identityId,
        ByteString
"/datasets"
      ]

instance Core.ToQuery ListDatasets where
  toQuery :: ListDatasets -> QueryString
toQuery ListDatasets' {Maybe Int
Maybe Text
Text
identityPoolId :: Text
identityId :: Text
maxResults :: Maybe Int
nextToken :: Maybe Text
$sel:identityPoolId:ListDatasets' :: ListDatasets -> Text
$sel:identityId:ListDatasets' :: ListDatasets -> Text
$sel:maxResults:ListDatasets' :: ListDatasets -> Maybe Int
$sel:nextToken:ListDatasets' :: ListDatasets -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxResults
      ]

-- | Returned for a successful ListDatasets request.
--
-- /See:/ 'newListDatasetsResponse' smart constructor.
data ListDatasetsResponse = ListDatasetsResponse'
  { -- | Number of datasets returned.
    ListDatasetsResponse -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
    -- | A pagination token for obtaining the next page of results.
    ListDatasetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A set of datasets.
    ListDatasetsResponse -> Maybe [Dataset]
datasets :: Prelude.Maybe [Dataset],
    -- | The response's http status code.
    ListDatasetsResponse -> Int
httpStatus :: 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:
--
-- 'count', 'listDatasetsResponse_count' - Number of datasets returned.
--
-- 'nextToken', 'listDatasetsResponse_nextToken' - A pagination token for obtaining the next page of results.
--
-- 'datasets', 'listDatasetsResponse_datasets' - A set of datasets.
--
-- 'httpStatus', 'listDatasetsResponse_httpStatus' - The response's http status code.
newListDatasetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDatasetsResponse
newListDatasetsResponse :: Int -> ListDatasetsResponse
newListDatasetsResponse Int
pHttpStatus_ =
  ListDatasetsResponse' :: Maybe Int
-> Maybe Text -> Maybe [Dataset] -> Int -> ListDatasetsResponse
ListDatasetsResponse'
    { $sel:count:ListDatasetsResponse' :: Maybe Int
count = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDatasetsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:datasets:ListDatasetsResponse' :: Maybe [Dataset]
datasets = Maybe [Dataset]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDatasetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Number of datasets returned.
listDatasetsResponse_count :: Lens.Lens' ListDatasetsResponse (Prelude.Maybe Prelude.Int)
listDatasetsResponse_count :: (Maybe Int -> f (Maybe Int))
-> ListDatasetsResponse -> f ListDatasetsResponse
listDatasetsResponse_count = (ListDatasetsResponse -> Maybe Int)
-> (ListDatasetsResponse -> Maybe Int -> ListDatasetsResponse)
-> Lens
     ListDatasetsResponse ListDatasetsResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetsResponse' {Maybe Int
count :: Maybe Int
$sel:count:ListDatasetsResponse' :: ListDatasetsResponse -> Maybe Int
count} -> Maybe Int
count) (\s :: ListDatasetsResponse
s@ListDatasetsResponse' {} Maybe Int
a -> ListDatasetsResponse
s {$sel:count:ListDatasetsResponse' :: Maybe Int
count = Maybe Int
a} :: ListDatasetsResponse)

-- | A pagination token for obtaining the next page of 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 ListDatasetsResponse (Maybe Text) (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)

-- | A set of datasets.
listDatasetsResponse_datasets :: Lens.Lens' ListDatasetsResponse (Prelude.Maybe [Dataset])
listDatasetsResponse_datasets :: (Maybe [Dataset] -> f (Maybe [Dataset]))
-> ListDatasetsResponse -> f ListDatasetsResponse
listDatasetsResponse_datasets = (ListDatasetsResponse -> Maybe [Dataset])
-> (ListDatasetsResponse
    -> Maybe [Dataset] -> ListDatasetsResponse)
-> Lens
     ListDatasetsResponse
     ListDatasetsResponse
     (Maybe [Dataset])
     (Maybe [Dataset])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDatasetsResponse' {Maybe [Dataset]
datasets :: Maybe [Dataset]
$sel:datasets:ListDatasetsResponse' :: ListDatasetsResponse -> Maybe [Dataset]
datasets} -> Maybe [Dataset]
datasets) (\s :: ListDatasetsResponse
s@ListDatasetsResponse' {} Maybe [Dataset]
a -> ListDatasetsResponse
s {$sel:datasets:ListDatasetsResponse' :: Maybe [Dataset]
datasets = Maybe [Dataset]
a} :: ListDatasetsResponse) ((Maybe [Dataset] -> f (Maybe [Dataset]))
 -> ListDatasetsResponse -> f ListDatasetsResponse)
-> ((Maybe [Dataset] -> f (Maybe [Dataset]))
    -> Maybe [Dataset] -> f (Maybe [Dataset]))
-> (Maybe [Dataset] -> f (Maybe [Dataset]))
-> ListDatasetsResponse
-> f ListDatasetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Dataset] [Dataset] [Dataset] [Dataset]
-> Iso
     (Maybe [Dataset])
     (Maybe [Dataset])
     (Maybe [Dataset])
     (Maybe [Dataset])
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 [Dataset] [Dataset] [Dataset] [Dataset]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listDatasetsResponse_httpStatus :: Lens.Lens' ListDatasetsResponse Prelude.Int
listDatasetsResponse_httpStatus :: (Int -> f Int) -> ListDatasetsResponse -> f ListDatasetsResponse
listDatasetsResponse_httpStatus = (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
httpStatus :: Int
$sel:httpStatus:ListDatasetsResponse' :: ListDatasetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDatasetsResponse
s@ListDatasetsResponse' {} Int
a -> ListDatasetsResponse
s {$sel:httpStatus:ListDatasetsResponse' :: Int
httpStatus = Int
a} :: ListDatasetsResponse)

instance Prelude.NFData ListDatasetsResponse