Files
sdk/lib/model/build_turn.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

227 lines
8.4 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 BuildTurn {
/// Returns a new [BuildTurn] instance.
BuildTurn({
this.actor,
this.at,
this.body,
this.commit,
this.kind,
this.subject,
this.turn,
});
/// Actor is who took the turn. A deploy turn's actor is the literal \"deploy\", because nobody took 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? actor;
/// At is when the turn was recorded, RFC 3339 in UTC to the second.
///
/// 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? at;
/// Body is the readable text of the turn, taken from the stored event's `text`. Empty when the event carried a payload of some other shape — this route reads transcripts and does not invent prose for turns that are not 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? body;
/// Commit is the full sha this turn produced, empty when the turn changed nothing. It is ECHOED from the transcript, and the authority is the commit itself: it carries the `Hanzo-Session:`/`Hanzo-Turn:` trailer, or a note under refs/notes/hanzo-provenance saying the same, so the claim is checkable at source with the command in `verify`.
///
/// 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? commit;
/// Kind is what the turn was, from the log's closed six: message, tool-call, spawn, log, status, control. A deploy arrives as a `status` turn.
///
/// 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? kind;
/// Subject is that commit's subject line, from the same transcript, so a reader sees what the commit says without fetching the repository.
///
/// 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? subject;
/// Seq is this turn's POSITION in the session's log — monotonic from 1, per session — and it is what a commit's `Hanzo-Turn:` trailer names. It is not a count of anything: the count is `turns` on the summary beside 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.
///
int? turn;
@override
bool operator ==(Object other) => identical(this, other) || other is BuildTurn &&
other.actor == actor &&
other.at == at &&
other.body == body &&
other.commit == commit &&
other.kind == kind &&
other.subject == subject &&
other.turn == turn;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(actor == null ? 0 : actor!.hashCode) +
(at == null ? 0 : at!.hashCode) +
(body == null ? 0 : body!.hashCode) +
(commit == null ? 0 : commit!.hashCode) +
(kind == null ? 0 : kind!.hashCode) +
(subject == null ? 0 : subject!.hashCode) +
(turn == null ? 0 : turn!.hashCode);
@override
String toString() => 'BuildTurn[actor=$actor, at=$at, body=$body, commit=$commit, kind=$kind, subject=$subject, turn=$turn]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.actor != null) {
json[r'actor'] = this.actor;
} else {
json[r'actor'] = null;
}
if (this.at != null) {
json[r'at'] = this.at;
} else {
json[r'at'] = null;
}
if (this.body != null) {
json[r'body'] = this.body;
} else {
json[r'body'] = null;
}
if (this.commit != null) {
json[r'commit'] = this.commit;
} else {
json[r'commit'] = null;
}
if (this.kind != null) {
json[r'kind'] = this.kind;
} else {
json[r'kind'] = null;
}
if (this.subject != null) {
json[r'subject'] = this.subject;
} else {
json[r'subject'] = null;
}
if (this.turn != null) {
json[r'turn'] = this.turn;
} else {
json[r'turn'] = null;
}
return json;
}
/// Returns a new [BuildTurn] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static BuildTurn? 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 "BuildTurn[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "BuildTurn[$key]" has a null value in JSON.');
});
return true;
}());
return BuildTurn(
actor: mapValueOfType<String>(json, r'actor'),
at: mapValueOfType<String>(json, r'at'),
body: mapValueOfType<String>(json, r'body'),
commit: mapValueOfType<String>(json, r'commit'),
kind: mapValueOfType<String>(json, r'kind'),
subject: mapValueOfType<String>(json, r'subject'),
turn: mapValueOfType<int>(json, r'turn'),
);
}
return null;
}
static List<BuildTurn> listFromJson(dynamic json, {bool growable = false,}) {
final result = <BuildTurn>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = BuildTurn.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, BuildTurn> mapFromJson(dynamic json) {
final map = <String, BuildTurn>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = BuildTurn.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of BuildTurn-objects as value to a dart map
static Map<String, List<BuildTurn>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<BuildTurn>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = BuildTurn.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}