classifyText method

  1. @override
Future<ClassifyTextResponse> classifyText(
  1. ClassifyTextRequest request
)
override

Classifies a document into categories.

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<ClassifyTextResponse> classifyText(ClassifyTextRequest request) async {
  if (isClosed) throw StateError('Service is closed');

  if (_classifyText case final classifyText?) {
    return classifyText(request);
  }
  throw UnsupportedError('classifyText');
}