mirror of
https://github.com/hanzo-dart/sdk.git
synced 2026-10-30 19:32:47 +00:00
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.
245 lines
9.0 KiB
Dart
245 lines
9.0 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 PatchTargetIn {
|
|
/// Returns a new [PatchTargetIn] instance.
|
|
PatchTargetIn({
|
|
this.capacity,
|
|
this.host,
|
|
this.id,
|
|
this.kind,
|
|
this.label,
|
|
this.metrics,
|
|
this.spec,
|
|
this.status,
|
|
});
|
|
/// Capacity rewrites the human summary, up to 256 characters. \"\" clears 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? capacity;
|
|
|
|
/// Host re-points the hostname sessions are matched by. Moving it moves the load: the session counts follow the new name from the next read.
|
|
///
|
|
/// 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? host;
|
|
|
|
/// ID is the target to update, from the path.
|
|
///
|
|
/// 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? id;
|
|
|
|
/// Kind re-files it under laptop | cloud | gpu | cluster | machine.
|
|
///
|
|
/// 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;
|
|
|
|
/// Label renames the machine, up to 128 characters. Empty STRING is refused — a target with no name is a row nobody can pick out of a fleet.
|
|
///
|
|
/// 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? label;
|
|
|
|
/// Metrics replaces the live sample, and sending one IS A HEARTBEAT: the server stamps the time and appends the point to the fleet series. Sending an all-zero sample CLEARS the heartbeat — the machine goes back to having no liveness fact at all, and its stored status is taken at face value again.
|
|
///
|
|
/// 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.
|
|
///
|
|
Metrics? metrics;
|
|
|
|
/// Spec replaces the static capability whole, sanitized and clamped the same way a register's is.
|
|
///
|
|
/// 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.
|
|
///
|
|
Spec? spec;
|
|
|
|
/// Status sets operator INTENT: online | offline | draining. Draining is how a machine is taken out of dispatch without ending what is already on it. What comes back may still read offline, because the heartbeat outranks the intent.
|
|
///
|
|
/// 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;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is PatchTargetIn &&
|
|
other.capacity == capacity &&
|
|
other.host == host &&
|
|
other.id == id &&
|
|
other.kind == kind &&
|
|
other.label == label &&
|
|
other.metrics == metrics &&
|
|
other.spec == spec &&
|
|
other.status == status;
|
|
|
|
@override
|
|
int get hashCode =>
|
|
// ignore: unnecessary_parenthesis
|
|
(capacity == null ? 0 : capacity!.hashCode) +
|
|
(host == null ? 0 : host!.hashCode) +
|
|
(id == null ? 0 : id!.hashCode) +
|
|
(kind == null ? 0 : kind!.hashCode) +
|
|
(label == null ? 0 : label!.hashCode) +
|
|
(metrics == null ? 0 : metrics!.hashCode) +
|
|
(spec == null ? 0 : spec!.hashCode) +
|
|
(status == null ? 0 : status!.hashCode);
|
|
|
|
@override
|
|
String toString() => 'PatchTargetIn[capacity=$capacity, host=$host, id=$id, kind=$kind, label=$label, metrics=$metrics, spec=$spec, status=$status]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (this.capacity != null) {
|
|
json[r'capacity'] = this.capacity;
|
|
} else {
|
|
json[r'capacity'] = null;
|
|
}
|
|
if (this.host != null) {
|
|
json[r'host'] = this.host;
|
|
} else {
|
|
json[r'host'] = null;
|
|
}
|
|
if (this.id != null) {
|
|
json[r'id'] = this.id;
|
|
} else {
|
|
json[r'id'] = null;
|
|
}
|
|
if (this.kind != null) {
|
|
json[r'kind'] = this.kind;
|
|
} else {
|
|
json[r'kind'] = null;
|
|
}
|
|
if (this.label != null) {
|
|
json[r'label'] = this.label;
|
|
} else {
|
|
json[r'label'] = null;
|
|
}
|
|
if (this.metrics != null) {
|
|
json[r'metrics'] = this.metrics;
|
|
} else {
|
|
json[r'metrics'] = null;
|
|
}
|
|
if (this.spec != null) {
|
|
json[r'spec'] = this.spec;
|
|
} else {
|
|
json[r'spec'] = null;
|
|
}
|
|
if (this.status != null) {
|
|
json[r'status'] = this.status;
|
|
} else {
|
|
json[r'status'] = null;
|
|
}
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [PatchTargetIn] instance and imports its values from
|
|
/// [value] if it's a [Map], null otherwise.
|
|
// ignore: prefer_constructors_over_static_methods
|
|
static PatchTargetIn? 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 "PatchTargetIn[$key]" is missing from JSON.');
|
|
assert(json[key] != null, 'Required key "PatchTargetIn[$key]" has a null value in JSON.');
|
|
});
|
|
return true;
|
|
}());
|
|
|
|
return PatchTargetIn(
|
|
capacity: mapValueOfType<String>(json, r'capacity'),
|
|
host: mapValueOfType<String>(json, r'host'),
|
|
id: mapValueOfType<String>(json, r'id'),
|
|
kind: mapValueOfType<String>(json, r'kind'),
|
|
label: mapValueOfType<String>(json, r'label'),
|
|
metrics: Metrics.fromJson(json[r'metrics']),
|
|
spec: Spec.fromJson(json[r'spec']),
|
|
status: mapValueOfType<String>(json, r'status'),
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
static List<PatchTargetIn> listFromJson(dynamic json, {bool growable = false,}) {
|
|
final result = <PatchTargetIn>[];
|
|
if (json is List && json.isNotEmpty) {
|
|
for (final row in json) {
|
|
final value = PatchTargetIn.fromJson(row);
|
|
if (value != null) {
|
|
result.add(value);
|
|
}
|
|
}
|
|
}
|
|
return result.toList(growable: growable);
|
|
}
|
|
|
|
static Map<String, PatchTargetIn> mapFromJson(dynamic json) {
|
|
final map = <String, PatchTargetIn>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
|
for (final entry in json.entries) {
|
|
final value = PatchTargetIn.fromJson(entry.value);
|
|
if (value != null) {
|
|
map[entry.key] = value;
|
|
}
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of PatchTargetIn-objects as value to a dart map
|
|
static Map<String, List<PatchTargetIn>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
|
final map = <String, List<PatchTargetIn>>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
// ignore: parameter_assignments
|
|
json = json.cast<String, dynamic>();
|
|
for (final entry in json.entries) {
|
|
map[entry.key] = PatchTargetIn.listFromJson(entry.value, growable: growable,);
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/// The list of required keys that must be present in a JSON.
|
|
static const requiredKeys = <String>{
|
|
};
|
|
}
|
|
|