list method

Future<ListDatabaseInstancesResponse> list(
  1. String parent, {
  2. int? pageSize,
  3. String? pageToken,
  4. bool? showDeleted,
  5. String? $fields,
})

Lists each DatabaseInstance associated with the specified parent project.

The list items are returned in no particular order, but will be a consistent view of the database instances when additional requests are made with a pageToken. The resulting list contains instances in any STATE. The list results may be stale by a few seconds. Use GetDatabaseInstance for consistent reads.

Request parameters:

parent - Required. The parent project for which to list database instances, in the form: projects/{project-number}/locations/{location-id} To list across all locations, use a parent in the form: projects/{project-number}/locations/- Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.

pageSize - The maximum number of database instances to return in the response. The server may return fewer than this at its discretion. If no value is specified (or too large a value is specified), then the server will impose its own limit.

pageToken - Token returned from a previous call to ListDatabaseInstances indicating where in the set of database instances to resume listing.

showDeleted - Indicate that DatabaseInstances in the DELETED state should also be returned.

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

Completes with a ListDatabaseInstancesResponse.

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<ListDatabaseInstancesResponse> list(
  core.String parent, {
  core.int? pageSize,
  core.String? pageToken,
  core.bool? showDeleted,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (showDeleted != null) 'showDeleted': ['${showDeleted}'],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1beta/' + core.Uri.encodeFull('$parent') + '/instances';

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