{-# 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.AppSync.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 the data sources for a given API.
--
-- This operation returns paginated results.
module Amazonka.AppSync.ListDataSources
  ( -- * Creating a Request
    ListDataSources (..),
    newListDataSources,

    -- * Request Lenses
    listDataSources_nextToken,
    listDataSources_maxResults,
    listDataSources_apiId,

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

    -- * Response Lenses
    listDataSourcesResponse_dataSources,
    listDataSourcesResponse_nextToken,
    listDataSourcesResponse_httpStatus,
  )
where

import Amazonka.AppSync.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

-- | /See:/ 'newListDataSources' smart constructor.
data ListDataSources = ListDataSources'
  { -- | An identifier that was returned from the previous call to this
    -- operation, which can be used to return the next set of items in the
    -- list.
    ListDataSources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results you want the request to return.
    ListDataSources -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The API ID.
    ListDataSources -> Text
apiId :: 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' - An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
--
-- 'maxResults', 'listDataSources_maxResults' - The maximum number of results you want the request to return.
--
-- 'apiId', 'listDataSources_apiId' - The API ID.
newListDataSources ::
  -- | 'apiId'
  Prelude.Text ->
  ListDataSources
newListDataSources :: Text -> ListDataSources
newListDataSources Text
pApiId_ =
  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:apiId:ListDataSources' :: Text
apiId = Text
pApiId_
    }

-- | An identifier that was returned from the previous call to this
-- operation, which can be used to return the next set of items in the
-- list.
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 you want the request to return.
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 API ID.
listDataSources_apiId :: Lens.Lens' ListDataSources Prelude.Text
listDataSources_apiId :: (Text -> f Text) -> ListDataSources -> f ListDataSources
listDataSources_apiId = (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
apiId :: Text
$sel:apiId:ListDataSources' :: ListDataSources -> Text
apiId} -> Text
apiId) (\s :: ListDataSources
s@ListDataSources' {} Text
a -> ListDataSources
s {$sel:apiId:ListDataSources' :: Text
apiId = 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 [DataSource] -> Maybe Text -> Int -> ListDataSourcesResponse
ListDataSourcesResponse'
            (Maybe [DataSource]
 -> Maybe Text -> Int -> ListDataSourcesResponse)
-> Either String (Maybe [DataSource])
-> Either String (Maybe Text -> Int -> ListDataSourcesResponse)
forall (f :: * -> *) a b. Functor 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.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListDataSources where
  toPath :: ListDataSources -> ByteString
toPath ListDataSources' {Maybe Natural
Maybe Text
Text
apiId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:apiId: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
"/v1/apis/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
apiId, ByteString
"/datasources"]

instance Core.ToQuery ListDataSources where
  toQuery :: ListDataSources -> QueryString
toQuery ListDataSources' {Maybe Natural
Maybe Text
Text
apiId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:apiId: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
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListDataSourcesResponse' smart constructor.
data ListDataSourcesResponse = ListDataSourcesResponse'
  { -- | The @DataSource@ objects.
    ListDataSourcesResponse -> Maybe [DataSource]
dataSources :: Prelude.Maybe [DataSource],
    -- | An identifier to be passed in the next request to this operation to
    -- return the next set of items in the list.
    ListDataSourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDataSourcesResponse -> Int
httpStatus :: 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:
--
-- 'dataSources', 'listDataSourcesResponse_dataSources' - The @DataSource@ objects.
--
-- 'nextToken', 'listDataSourcesResponse_nextToken' - An identifier to be passed in the next request to this operation to
-- return the next set of items in the list.
--
-- 'httpStatus', 'listDataSourcesResponse_httpStatus' - The response's http status code.
newListDataSourcesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDataSourcesResponse
newListDataSourcesResponse :: Int -> ListDataSourcesResponse
newListDataSourcesResponse Int
pHttpStatus_ =
  ListDataSourcesResponse' :: Maybe [DataSource] -> Maybe Text -> Int -> ListDataSourcesResponse
ListDataSourcesResponse'
    { $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:httpStatus:ListDataSourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The @DataSource@ objects.
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

-- | An identifier to be passed in the next request to this operation to
-- return the next set of items in the list.
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 response's http status code.
listDataSourcesResponse_httpStatus :: Lens.Lens' ListDataSourcesResponse Prelude.Int
listDataSourcesResponse_httpStatus :: (Int -> f Int)
-> ListDataSourcesResponse -> f ListDataSourcesResponse
listDataSourcesResponse_httpStatus = (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
httpStatus :: Int
$sel:httpStatus:ListDataSourcesResponse' :: ListDataSourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDataSourcesResponse
s@ListDataSourcesResponse' {} Int
a -> ListDataSourcesResponse
s {$sel:httpStatus:ListDataSourcesResponse' :: Int
httpStatus = Int
a} :: ListDataSourcesResponse)

instance Prelude.NFData ListDataSourcesResponse