list method

Future<BackupRunsListResponse> list(
  1. String project,
  2. String instance, {
  3. int? maxResults,
  4. String? pageToken,
  5. String? $fields,
})

Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.

Request parameters:

project - Project ID of the project that contains the instance.

instance - Cloud SQL instance ID, or "-" for all instances. This does not include the project ID.

maxResults - Maximum number of backup runs per response.

pageToken - A previously-returned page token representing part of the larger set of results to view.

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

Completes with a BackupRunsListResponse.

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<BackupRunsListResponse> list(
  core.String project,
  core.String instance, {
  core.int? maxResults,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (maxResults != null) 'maxResults': ['${maxResults}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'sql/v1beta4/projects/' +
      commons.escapeVariable('$project') +
      '/instances/' +
      commons.escapeVariable('$instance') +
      '/backupRuns';

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