Files
sdk/lib/model/build_view.dart
zeekay cd3d4e2ed2 Regenerate against the released document (v8.5.102)
Projected from hanzo-inc/cloud@59ec4deb4 openapi.yaml, sha256
e7e90d5445aeccfe332d942d0edd7a77df14336d97a445b71fb2f3047db65192.

This client had emitted NOTHING for four releases: openapi-generator 7.14.0,
the version the fleet pins, dies in AbstractDartCodegen.fromProperty with
`JsonSchema cannot be cast to ComposedSchema` on our polymorphic request
bodies. hanzoai/openapi now lets one language pin past the fleet, and dart is
pinned at 7.19.0, which emits it cleanly.
2026-08-22 07:26:03 -07:00

307 lines
12 KiB
Dart

//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of hanzoai.cloud;
class BuildView {
/// Returns a new [BuildView] instance.
BuildView({
this.agent,
this.endedAt,
this.model,
this.org,
this.project,
this.repo,
this.session,
this.startedAt,
this.status,
this.title,
this.turns = const [],
this.verify,
});
/// Agent is the label the surface that did the work calls itself by.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? agent;
/// EndedAt is when it finished, same format. Empty means it has not — the build is still going.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? endedAt;
/// Model is the model that did the work, taken from the FIRST turn whose body names one — a transcript states it, this route does not resolve it. Empty when no turn said.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? model;
/// Org is the org that published this build, echoed from the URL. It is part of the build's public ADDRESS and not a tenant key — this route is anonymous, and the only rows it can reach are ones an author explicitly published.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? org;
/// Project is the product's slug, the other half of that address.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? project;
/// Repo is the repository the work was done in, as the session reported it.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? repo;
/// Session is the id of the agent session this story IS — the same value a produced commit carries in its `Hanzo-Session:` trailer, which is what ties the repository's history to this page.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? session;
/// StartedAt is when the session opened, RFC 3339 in UTC.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? startedAt;
/// Status is the session's own: running, paused, done or error. A build can be read while it is still being written, so this is not always terminal — and an `error` build is still a readable story, not a missing page.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? status;
/// Title is the human line the session was opened or renamed with. Empty when nobody gave it one.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? title;
/// Turns is the whole transcript, oldest first, capped at 1000: a published build is a story to read down, not an archive to page.
List<BuildTurn> turns;
/// Verify is the exact command that re-derives every commit binding below straight from git, so nothing here has to be taken on trust.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? verify;
@override
bool operator ==(Object other) => identical(this, other) || other is BuildView &&
other.agent == agent &&
other.endedAt == endedAt &&
other.model == model &&
other.org == org &&
other.project == project &&
other.repo == repo &&
other.session == session &&
other.startedAt == startedAt &&
other.status == status &&
other.title == title &&
_deepEquality.equals(other.turns, turns) &&
other.verify == verify;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(agent == null ? 0 : agent!.hashCode) +
(endedAt == null ? 0 : endedAt!.hashCode) +
(model == null ? 0 : model!.hashCode) +
(org == null ? 0 : org!.hashCode) +
(project == null ? 0 : project!.hashCode) +
(repo == null ? 0 : repo!.hashCode) +
(session == null ? 0 : session!.hashCode) +
(startedAt == null ? 0 : startedAt!.hashCode) +
(status == null ? 0 : status!.hashCode) +
(title == null ? 0 : title!.hashCode) +
(turns.hashCode) +
(verify == null ? 0 : verify!.hashCode);
@override
String toString() => 'BuildView[agent=$agent, endedAt=$endedAt, model=$model, org=$org, project=$project, repo=$repo, session=$session, startedAt=$startedAt, status=$status, title=$title, turns=$turns, verify=$verify]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.agent != null) {
json[r'agent'] = this.agent;
} else {
json[r'agent'] = null;
}
if (this.endedAt != null) {
json[r'endedAt'] = this.endedAt;
} else {
json[r'endedAt'] = null;
}
if (this.model != null) {
json[r'model'] = this.model;
} else {
json[r'model'] = null;
}
if (this.org != null) {
json[r'org'] = this.org;
} else {
json[r'org'] = null;
}
if (this.project != null) {
json[r'project'] = this.project;
} else {
json[r'project'] = null;
}
if (this.repo != null) {
json[r'repo'] = this.repo;
} else {
json[r'repo'] = null;
}
if (this.session != null) {
json[r'session'] = this.session;
} else {
json[r'session'] = null;
}
if (this.startedAt != null) {
json[r'startedAt'] = this.startedAt;
} else {
json[r'startedAt'] = null;
}
if (this.status != null) {
json[r'status'] = this.status;
} else {
json[r'status'] = null;
}
if (this.title != null) {
json[r'title'] = this.title;
} else {
json[r'title'] = null;
}
json[r'turns'] = this.turns;
if (this.verify != null) {
json[r'verify'] = this.verify;
} else {
json[r'verify'] = null;
}
return json;
}
/// Returns a new [BuildView] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static BuildView? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "BuildView[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "BuildView[$key]" has a null value in JSON.');
});
return true;
}());
return BuildView(
agent: mapValueOfType<String>(json, r'agent'),
endedAt: mapValueOfType<String>(json, r'endedAt'),
model: mapValueOfType<String>(json, r'model'),
org: mapValueOfType<String>(json, r'org'),
project: mapValueOfType<String>(json, r'project'),
repo: mapValueOfType<String>(json, r'repo'),
session: mapValueOfType<String>(json, r'session'),
startedAt: mapValueOfType<String>(json, r'startedAt'),
status: mapValueOfType<String>(json, r'status'),
title: mapValueOfType<String>(json, r'title'),
turns: BuildTurn.listFromJson(json[r'turns']),
verify: mapValueOfType<String>(json, r'verify'),
);
}
return null;
}
static List<BuildView> listFromJson(dynamic json, {bool growable = false,}) {
final result = <BuildView>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = BuildView.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, BuildView> mapFromJson(dynamic json) {
final map = <String, BuildView>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = BuildView.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of BuildView-objects as value to a dart map
static Map<String, List<BuildView>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<BuildView>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = BuildView.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}