addContextChildren method

  1. @override
Future<AddContextChildrenResponse> addContextChildren(
  1. AddContextChildrenRequest request
)
override

Adds a set of Contexts as children to a parent Context. If any of the child Contexts have already been added to the parent Context, they are simply skipped. If this call would create a cycle or cause any Context to have more than 10 parents, the request will fail with an INVALID_ARGUMENT error.

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<AddContextChildrenResponse> addContextChildren(
  AddContextChildrenRequest request,
) async {
  if (isClosed) throw StateError('Service is closed');

  if (_addContextChildren case final addContextChildren?) {
    return addContextChildren(request);
  }
  throw UnsupportedError('addContextChildren');
}