list method

Future<ListDataSourcesResponse> list(
  1. String userId, {
  2. List<String>? dataTypeName,
  3. String? $fields,
})

Lists all data sources that are visible to the developer, using the OAuth scopes provided.

The list is not exhaustive; the user may have private data sources that are only visible to other developers, or calls using other scopes.

Request parameters:

userId - List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.

dataTypeName - The names of data types to include in the list. If not specified, all data sources will be returned.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListDataSourcesResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<ListDataSourcesResponse> list(
  core.String userId, {
  core.List<core.String>? dataTypeName,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (dataTypeName != null) 'dataTypeName': dataTypeName,
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = commons.escapeVariable('$userId') + '/dataSources';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ListDataSourcesResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}