CodeRun class

Constructors

CodeRun({List<String> args = const [], required String code, List<CodeFile> files = const [], required String lang, String? runtimeSessionHint, String? sessionId, String? userId})
Returns a new CodeRun instance.

Properties

args ↔ List<String>
Args become the PROGRAM's argv, never the compiler's. For the compiled languages the toolchain builds first and these are passed to the binary it produced.
getter/setter pair
code ↔ String
Code is the WHOLE program, not a fragment: it is written to a single file and that file is what runs, so a compiled language needs its entry point and an interpreted one runs top to bottom.
getter/setter pair
files ↔ List<CodeFile>
Files are inputs the host already put in some session. Each names the session its bytes live in, which is usually — and ideally — the session this run wants.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
lang ↔ String
Lang selects the toolchain, and with it the filename the code is written to and the line that runs it: py, js, ts, bash, r, php, go, rs, c, cpp, java, d, f90. Anything else is refused rather than guessed at — a run in the wrong language fails somewhere deep in a compiler, which reads as an outage.
getter/setter pair
runtimeSessionHint ↔ String?
RuntimeSessionHint is the stateful-session hint. It is carried so a client that sends it is not silently misread, and it selects nothing here: every session in this implementation is already a warm sandbox, so there is no second kind of runtime for a hint to choose between.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sessionId ↔ String?
SessionID continues an EXISTING sandbox, which is what makes runs stateful: the same filesystem, so one run's output file is the next run's input. Empty leases a fresh sandbox and the id it got comes back on the result.
getter/setter pair
userId ↔ String?
UserID attributes the run inside the caller's org. It is a label, never a tenant: the org is resolved from the validated principal and a value here cannot widen what the run may reach.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(dynamic value) → CodeRun?
Returns a new CodeRun instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<CodeRun>
mapFromJson(dynamic json) → Map<String, CodeRun>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<CodeRun>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.