map<R> method

R map<R>({
  1. required ResponseMap<NodesIdChildrenGetResponse200, R> on200,
  2. ResponseMap<NodesIdChildrenGetResponse, R>? onElse,
})

Implementation

R map<R>({
  required ResponseMap<NodesIdChildrenGetResponse200, R> on200,
  ResponseMap<NodesIdChildrenGetResponse, R>? onElse,
}) {
  if (this is NodesIdChildrenGetResponse200) {
    return on200((this as NodesIdChildrenGetResponse200));
  } else if (onElse != null) {
    return onElse(this);
  } else {
    throw StateError('Invalid instance of type $this');
  }
}