getOperation method

Future<Operation<ProtoMessage, ProtoMessage>> getOperation(
  1. GetOperationRequest request
)

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Throws a http.ClientException if there were problems communicating with the API service. Throws a StatusException if the API failed with a Status message. Throws a ServiceException for any other failure.

Implementation

Future<Operation> getOperation(GetOperationRequest request) async {
  final url = Uri.https(_host, '/v1/${request.name}');
  final response = await _client.get(url);
  return Operation.fromJson(response);
}