insert method

  1. @override
Future<Operation> insert(
  1. InsertDiskRequest request
)
override

Creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, orsourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property.

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<Operation> insert(InsertDiskRequest request) async {
  if (isClosed) throw StateError('Service is closed');

  if (_insert case final insert?) {
    return insert(request);
  }
  throw UnsupportedError('insert');
}