list method
List custom data sources to which the user has access.
Request parameters:
accountId
- Account Id for the custom data sources to retrieve.
Value must have pattern "\d+".
webPropertyId
- Web property Id for the custom data sources to retrieve.
Value must have pattern "UA-(\d+)-(\d+)".
max_results
- The maximum number of custom data sources to include in
this response.
start_index
- A 1-based index of the first custom data source to
retrieve. Use this parameter as a pagination mechanism along with the
max-results parameter.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a CustomDataSources.
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<CustomDataSources> list(
core.String accountId, core.String webPropertyId,
{core.int max_results, core.int start_index, core.String $fields}) {
var _url;
var _queryParams = new core.Map<core.String, core.List<core.String>>();
var _uploadMedia;
var _uploadOptions;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body;
if (accountId == null) {
throw new core.ArgumentError("Parameter accountId is required.");
}
if (webPropertyId == null) {
throw new core.ArgumentError("Parameter webPropertyId is required.");
}
if (max_results != null) {
_queryParams["max-results"] = ["${max_results}"];
}
if (start_index != null) {
_queryParams["start-index"] = ["${start_index}"];
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'management/accounts/' +
commons.Escaper.ecapeVariable('$accountId') +
'/webproperties/' +
commons.Escaper.ecapeVariable('$webPropertyId') +
'/customDataSources';
var _response = _requester.request(_url, "GET",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new CustomDataSources.fromJson(data));
}