map<R> method

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

Implementation

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