PlayUploadEvent class

One line of cux_ship play upload --json.

A stream, not a document, and the difference is a promise this format makes rather than a shortcut it takes. Every other kind here is written whole and once at the end, because a fail() partway through would leave half a document on stdout under an exit code saying to trust it. A line is not half of anything: it is complete when its newline arrives, it carries its own schema and kind, and a stream that stops early is a stream that stopped — which is the only shape that can report an upload while it is running, which is the whole point.

The three shapes are UploadEvent:

{"schema":1,"kind":"play.upload","event":"state","state":"transferring","bytesTotal":68123456}
{"schema":1,"kind":"play.upload","event":"progress","bytesSent":1048576,"bytesTotal":68123456}
{"schema":1,"kind":"play.upload","event":"result","result":{"packageName":"design.codeux.example","track":"internal","versionName":"1.4.0","versionCode":152,"committed":true}}

A field that does not apply to a line is absent rather than null. Null would say the field applies and had no value, which is the distinction the store vocabularies above are built on; here it is the difference between a progress line and a state line that lost its state.

No display, and that is deliberate rather than forgotten. The other kinds carry one because --json suppresses their rendering — a consumer with no display would have to re-render, and two renderings of one model drift. An upload suppresses nothing: every human-facing line it has always printed still goes to stderr, in full and in order, because that stream is a log somebody reads after a failure. Carrying those lines here as well would deliver each of them twice on two streams, and a consumer joining the two would print them twice.

Annotations
  • @JsonSerializable.new(explicitToJson: true, includeIfNull: false)

Constructors

PlayUploadEvent({required int schema, required DocumentKind kind, required UploadEvent event, UploadState? state, int? bytesSent, int? bytesTotal, PlayUploadResult? result})
const
PlayUploadEvent.fromJson(Map<String, dynamic> json)
factory

Properties

bytesSent → int?
Bytes the store has acknowledged. Present on UploadEvent.progress.
final
bytesTotal → int?
The artifact's size. Present on UploadEvent.progress and on the UploadState.transferring line.
final
event → UploadEvent
Which shape this line is. Dispatch on this.
final
hashCode → int
The hash code for this object.
no setterinherited
kind → DocumentKind
final
result → PlayUploadResult?
What the run did. Present on UploadEvent.result, which is the last line of a run that finished.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
schema → int
This kind's schema number. Refuse one you do not recognize.
final
state → UploadState?
The state the upload just moved into. Present on UploadEvent.state.
final

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.
inherited

Operators

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