report method

Future<ReportErrorEventResponse> report(
  1. ReportedErrorEvent request,
  2. String projectName, {
  3. String? $fields,
})

Report an individual error event and record the event to a log.

This endpoint accepts either an OAuth token, or an API key for authentication. To use an API key, append it to the URL as the value of a key parameter. For example: POST https://clouderrorreporting.googleapis.com/v1beta1/{projectName}/events:report?key=123ABC456 Note: Error Reporting is a global service built on Cloud Logging and doesn't analyze logs stored in regional log buckets or logs routed to other Google Cloud projects.

request - The metadata request object.

Request parameters:

projectName - Required. The resource name of the Google Cloud Platform project. Written as projects/{projectId}, where {projectId} is the Google Cloud Platform project ID. Example: // projects/my-project-123. Value must have pattern ^projects/\[^/\]+$.

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

Completes with a ReportErrorEventResponse.

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<ReportErrorEventResponse> report(
  ReportedErrorEvent request,
  core.String projectName, {
  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('$projectName') + '/events:report';

  final response_ = await _requester.request(
    url_,
    'POST',
    body: body_,
    queryParams: queryParams_,
  );
  return ReportErrorEventResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}