delete method

Future<Operation> delete(
  1. String project,
  2. String instance, {
  3. String? host,
  4. String? name,
  5. String? $fields,
})

Deletes a user from a Cloud SQL instance.

Request parameters:

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

instance - Database instance ID. This does not include the project ID.

host - Host of the user in the instance.

name - Name of the user in the instance.

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

Completes with a Operation.

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<Operation> delete(
  core.String project,
  core.String instance, {
  core.String? host,
  core.String? name,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (host != null) 'host': [host],
    if (name != null) 'name': [name],
    if ($fields != null) 'fields': [$fields],
  };

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

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