enableManagedRotation method

  1. @override
Future<SecretVersion> enableManagedRotation(
  1. EnableManagedRotationRequest request
)
override

Enables the managed rotation feature for a Secret. This method can only be triggered once for a secret. In order to do further rotations, RotateSecret should be used. 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> enableManagedRotation(
  EnableManagedRotationRequest request,
) async {
  if (isClosed) throw StateError('Service is closed');

  if (_enableManagedRotation case final enableManagedRotation?) {
    return enableManagedRotation(request);
  }
  throw UnsupportedError('enableManagedRotation');
}