rotateSecret method

  1. @override
Future<SecretVersion> rotateSecret(
  1. RotateSecretRequest request
)
override

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

@override
Future<SecretVersion> rotateSecret(RotateSecretRequest request) async {
  if (isClosed) throw StateError('Service is closed');

  if (_rotateSecret case final rotateSecret?) {
    return rotateSecret(request);
  }
  throw UnsupportedError('rotateSecret');
}