compute method

Computes predictions for the events and risk tolerances specified.

request - The metadata request object.

Request parameters:

installation - Required. An identifier for an "installation" of an "app". Must have the format of "projects / * /apps / * /installations / * ", although the "app" and "installation" may have different formats for different sources. Value must have pattern ^projects/\[^/\]+/apps/\[^/\]+/installations/\[^/\]+$.

$fields - Selector specifying which fields to include in a partial response.

Completes with a GoogleFirebasePredictionsV1beta1ComputePredictionsResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<GoogleFirebasePredictionsV1beta1ComputePredictionsResponse>
    compute(
  GoogleFirebasePredictionsV1beta1ComputePredictionsRequest request,
  core.String installation, {
  core.String? $fields,
}) async {
  final _body = convert.json.encode(request);
  final _queryParams = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

  final _url = 'v1beta1/' +
      core.Uri.encodeFull('$installation') +
      '/predictions:compute';

  final _response = await _requester.request(
    _url,
    'POST',
    body: _body,
    queryParams: _queryParams,
  );
  return GoogleFirebasePredictionsV1beta1ComputePredictionsResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}