simulateMaintenanceEvent method

Future<Operation> simulateMaintenanceEvent(
  1. SimulateMaintenanceEventInstanceRequest request
)

Simulates a host maintenance event on a VM. For more information, see Simulate a host maintenance event.

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<Operation> simulateMaintenanceEvent(
  SimulateMaintenanceEventInstanceRequest request,
) async {
  final url = _endPoint.replace(
    path:
        '/compute/v1/projects/${request.project}/zones/${request.zone}/instances/${request.instance}/simulateMaintenanceEvent',
    queryParameters: {
      'requestId': ?request.requestId,
      if (request.withExtendedNotifications case final $1?)
        'withExtendedNotifications': '${$1}',
    },
  );
  final response = await _client.post(url);
  return Operation.fromJson(response);
}