rotateSecret method

Future<SecretVersion> rotateSecret(
  1. RotateSecretRequest request
)

Do a managed rotation for a Secret. This can only be triggered after Managed rotation has been enabled. This method will add a secret version and update the password in Cloud SQL.

Throws a http.ClientException if there were problems communicating with the API service. Throws a ServiceException if the API method failed for any reason.

Implementation

Future<SecretVersion> rotateSecret(RotateSecretRequest request) async {
  final url = _endPoint.replace(path: '/v1/${request.parent}:rotateSecret');
  final response = await _client.post(url, body: request);
  return SecretVersion.fromJson(response);
}