{-# 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.ListDataSources
-- 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 data sources in current Amazon Web Services Region that belong to
-- this Amazon Web Services account.
--
-- This operation returns paginated results.
module Amazonka.QuickSight.ListDataSources
  ( -- * Creating a Request
    ListDataSources (..),
    newListDataSources,

    -- * Request Lenses
    listDataSources_nextToken,
    listDataSources_maxResults,
    listDataSources_awsAccountId,

    -- * Destructuring the Response
    ListDataSourcesResponse (..),
    newListDataSourcesResponse,

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

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

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

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

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

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

instance Prelude.NFData ListDataSources

instance Core.ToHeaders ListDataSources where
  toHeaders :: ListDataSources -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDataSources -> 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 ListDataSources where
  toPath :: ListDataSources -> ByteString
toPath ListDataSources' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:awsAccountId:ListDataSources' :: ListDataSources -> Text
$sel:maxResults:ListDataSources' :: ListDataSources -> Maybe Natural
$sel:nextToken:ListDataSources' :: ListDataSources -> 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-sources"
      ]

instance Core.ToQuery ListDataSources where
  toQuery :: ListDataSources -> QueryString
toQuery ListDataSources' {Maybe Natural
Maybe Text
Text
awsAccountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:awsAccountId:ListDataSources' :: ListDataSources -> Text
$sel:maxResults:ListDataSources' :: ListDataSources -> Maybe Natural
$sel:nextToken:ListDataSources' :: ListDataSources -> 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:/ 'newListDataSourcesResponse' smart constructor.
data ListDataSourcesResponse = ListDataSourcesResponse'
  { -- | The Amazon Web Services request ID for this operation.
    ListDataSourcesResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
    -- | A list of data sources.
    ListDataSourcesResponse -> Maybe [DataSource]
dataSources :: Prelude.Maybe [DataSource],
    -- | The token for the next set of results, or null if there are no more
    -- results.
    ListDataSourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The HTTP status of the request.
    ListDataSourcesResponse -> Int
status :: Prelude.Int
  }
  deriving (ListDataSourcesResponse -> ListDataSourcesResponse -> Bool
(ListDataSourcesResponse -> ListDataSourcesResponse -> Bool)
-> (ListDataSourcesResponse -> ListDataSourcesResponse -> Bool)
-> Eq ListDataSourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDataSourcesResponse -> ListDataSourcesResponse -> Bool
$c/= :: ListDataSourcesResponse -> ListDataSourcesResponse -> Bool
== :: ListDataSourcesResponse -> ListDataSourcesResponse -> Bool
$c== :: ListDataSourcesResponse -> ListDataSourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListDataSourcesResponse]
ReadPrec ListDataSourcesResponse
Int -> ReadS ListDataSourcesResponse
ReadS [ListDataSourcesResponse]
(Int -> ReadS ListDataSourcesResponse)
-> ReadS [ListDataSourcesResponse]
-> ReadPrec ListDataSourcesResponse
-> ReadPrec [ListDataSourcesResponse]
-> Read ListDataSourcesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDataSourcesResponse]
$creadListPrec :: ReadPrec [ListDataSourcesResponse]
readPrec :: ReadPrec ListDataSourcesResponse
$creadPrec :: ReadPrec ListDataSourcesResponse
readList :: ReadS [ListDataSourcesResponse]
$creadList :: ReadS [ListDataSourcesResponse]
readsPrec :: Int -> ReadS ListDataSourcesResponse
$creadsPrec :: Int -> ReadS ListDataSourcesResponse
Prelude.Read, Int -> ListDataSourcesResponse -> ShowS
[ListDataSourcesResponse] -> ShowS
ListDataSourcesResponse -> String
(Int -> ListDataSourcesResponse -> ShowS)
-> (ListDataSourcesResponse -> String)
-> ([ListDataSourcesResponse] -> ShowS)
-> Show ListDataSourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDataSourcesResponse] -> ShowS
$cshowList :: [ListDataSourcesResponse] -> ShowS
show :: ListDataSourcesResponse -> String
$cshow :: ListDataSourcesResponse -> String
showsPrec :: Int -> ListDataSourcesResponse -> ShowS
$cshowsPrec :: Int -> ListDataSourcesResponse -> ShowS
Prelude.Show, (forall x.
 ListDataSourcesResponse -> Rep ListDataSourcesResponse x)
-> (forall x.
    Rep ListDataSourcesResponse x -> ListDataSourcesResponse)
-> Generic ListDataSourcesResponse
forall x. Rep ListDataSourcesResponse x -> ListDataSourcesResponse
forall x. ListDataSourcesResponse -> Rep ListDataSourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDataSourcesResponse x -> ListDataSourcesResponse
$cfrom :: forall x. ListDataSourcesResponse -> Rep ListDataSourcesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDataSourcesResponse' 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', 'listDataSourcesResponse_requestId' - The Amazon Web Services request ID for this operation.
--
-- 'dataSources', 'listDataSourcesResponse_dataSources' - A list of data sources.
--
-- 'nextToken', 'listDataSourcesResponse_nextToken' - The token for the next set of results, or null if there are no more
-- results.
--
-- 'status', 'listDataSourcesResponse_status' - The HTTP status of the request.
newListDataSourcesResponse ::
  -- | 'status'
  Prelude.Int ->
  ListDataSourcesResponse
newListDataSourcesResponse :: Int -> ListDataSourcesResponse
newListDataSourcesResponse Int
pStatus_ =
  ListDataSourcesResponse' :: Maybe Text
-> Maybe [DataSource]
-> Maybe Text
-> Int
-> ListDataSourcesResponse
ListDataSourcesResponse'
    { $sel:requestId:ListDataSourcesResponse' :: Maybe Text
requestId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSources:ListDataSourcesResponse' :: Maybe [DataSource]
dataSources = Maybe [DataSource]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListDataSourcesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ListDataSourcesResponse' :: Int
status = Int
pStatus_
    }

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

-- | A list of data sources.
listDataSourcesResponse_dataSources :: Lens.Lens' ListDataSourcesResponse (Prelude.Maybe [DataSource])
listDataSourcesResponse_dataSources :: (Maybe [DataSource] -> f (Maybe [DataSource]))
-> ListDataSourcesResponse -> f ListDataSourcesResponse
listDataSourcesResponse_dataSources = (ListDataSourcesResponse -> Maybe [DataSource])
-> (ListDataSourcesResponse
    -> Maybe [DataSource] -> ListDataSourcesResponse)
-> Lens' ListDataSourcesResponse (Maybe [DataSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDataSourcesResponse' {Maybe [DataSource]
dataSources :: Maybe [DataSource]
$sel:dataSources:ListDataSourcesResponse' :: ListDataSourcesResponse -> Maybe [DataSource]
dataSources} -> Maybe [DataSource]
dataSources) (\s :: ListDataSourcesResponse
s@ListDataSourcesResponse' {} Maybe [DataSource]
a -> ListDataSourcesResponse
s {$sel:dataSources:ListDataSourcesResponse' :: Maybe [DataSource]
dataSources = Maybe [DataSource]
a} :: ListDataSourcesResponse) ((Maybe [DataSource] -> f (Maybe [DataSource]))
 -> ListDataSourcesResponse -> f ListDataSourcesResponse)
-> ((Maybe [DataSource] -> f (Maybe [DataSource]))
    -> Maybe [DataSource] -> f (Maybe [DataSource]))
-> (Maybe [DataSource] -> f (Maybe [DataSource]))
-> ListDataSourcesResponse
-> f ListDataSourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DataSource] [DataSource] [DataSource] [DataSource]
-> Iso
     (Maybe [DataSource])
     (Maybe [DataSource])
     (Maybe [DataSource])
     (Maybe [DataSource])
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 [DataSource] [DataSource] [DataSource] [DataSource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance Prelude.NFData ListDataSourcesResponse