createView method

Future<LogView> createView(
  1. CreateViewRequest request
)

Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.

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<LogView> createView(CreateViewRequest request) async {
  final url = Uri.https(_host, '/v2/${request.parent}/views', {
    if (request.viewId case final $1 when $1.isNotDefault) 'viewId': $1,
  });
  final response = await _client.post(url, body: request.view);
  return LogView.fromJson(response);
}