Files
sdk/lib/model/model_route.dart
zeekay f06a939f82 Regenerate: the AI surface says what it answers
288 of hanzoai/ai's 294 operations now declare a response, against 1 before.
GET /v1/models, POST /v1/chat/completions, /v1/embeddings, /v1/messages —
every address a client actually calls — used to reach this client untyped,
because cloud's relay carried an operation's sentence and dropped the shapes
it named. It carries both now.

Fleet-wide the document goes from 69% to 81% of operations declaring what
comes back, which is where the ~208 new models here come from.
2026-08-28 15:52:12 -07:00

424 lines
16 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 ModelRoute {
/// Returns a new [ModelRoute] instance.
ModelRoute({
this.costInPerMillion,
this.costOutPerMillion,
this.createdTime,
this.enabled,
this.fallback1Provider,
this.fallback1Upstream,
this.fallback2Provider,
this.fallback2Upstream,
this.hidden,
this.inputPricePerMillion,
this.modelName,
this.outputPricePerMillion,
this.ownedBy,
this.owner,
this.premium,
this.priced,
this.provider,
this.updatedTime,
this.upstream,
});
///
/// 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.
///
num? costInPerMillion;
///
/// 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.
///
num? costOutPerMillion;
///
/// 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? createdTime;
///
/// 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.
///
bool? enabled;
///
/// 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? fallback1Provider;
///
/// 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? fallback1Upstream;
///
/// 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? fallback2Provider;
///
/// 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? fallback2Upstream;
///
/// 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.
///
bool? hidden;
///
/// 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.
///
num? inputPricePerMillion;
///
/// 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? modelName;
///
/// 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.
///
num? outputPricePerMillion;
///
/// 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? ownedBy;
///
/// 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? owner;
///
/// 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.
///
bool? premium;
///
/// 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.
///
bool? priced;
///
/// 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? provider;
///
/// 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? updatedTime;
///
/// 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? upstream;
@override
bool operator ==(Object other) => identical(this, other) || other is ModelRoute &&
other.costInPerMillion == costInPerMillion &&
other.costOutPerMillion == costOutPerMillion &&
other.createdTime == createdTime &&
other.enabled == enabled &&
other.fallback1Provider == fallback1Provider &&
other.fallback1Upstream == fallback1Upstream &&
other.fallback2Provider == fallback2Provider &&
other.fallback2Upstream == fallback2Upstream &&
other.hidden == hidden &&
other.inputPricePerMillion == inputPricePerMillion &&
other.modelName == modelName &&
other.outputPricePerMillion == outputPricePerMillion &&
other.ownedBy == ownedBy &&
other.owner == owner &&
other.premium == premium &&
other.priced == priced &&
other.provider == provider &&
other.updatedTime == updatedTime &&
other.upstream == upstream;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(costInPerMillion == null ? 0 : costInPerMillion!.hashCode) +
(costOutPerMillion == null ? 0 : costOutPerMillion!.hashCode) +
(createdTime == null ? 0 : createdTime!.hashCode) +
(enabled == null ? 0 : enabled!.hashCode) +
(fallback1Provider == null ? 0 : fallback1Provider!.hashCode) +
(fallback1Upstream == null ? 0 : fallback1Upstream!.hashCode) +
(fallback2Provider == null ? 0 : fallback2Provider!.hashCode) +
(fallback2Upstream == null ? 0 : fallback2Upstream!.hashCode) +
(hidden == null ? 0 : hidden!.hashCode) +
(inputPricePerMillion == null ? 0 : inputPricePerMillion!.hashCode) +
(modelName == null ? 0 : modelName!.hashCode) +
(outputPricePerMillion == null ? 0 : outputPricePerMillion!.hashCode) +
(ownedBy == null ? 0 : ownedBy!.hashCode) +
(owner == null ? 0 : owner!.hashCode) +
(premium == null ? 0 : premium!.hashCode) +
(priced == null ? 0 : priced!.hashCode) +
(provider == null ? 0 : provider!.hashCode) +
(updatedTime == null ? 0 : updatedTime!.hashCode) +
(upstream == null ? 0 : upstream!.hashCode);
@override
String toString() => 'ModelRoute[costInPerMillion=$costInPerMillion, costOutPerMillion=$costOutPerMillion, createdTime=$createdTime, enabled=$enabled, fallback1Provider=$fallback1Provider, fallback1Upstream=$fallback1Upstream, fallback2Provider=$fallback2Provider, fallback2Upstream=$fallback2Upstream, hidden=$hidden, inputPricePerMillion=$inputPricePerMillion, modelName=$modelName, outputPricePerMillion=$outputPricePerMillion, ownedBy=$ownedBy, owner=$owner, premium=$premium, priced=$priced, provider=$provider, updatedTime=$updatedTime, upstream=$upstream]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.costInPerMillion != null) {
json[r'costInPerMillion'] = this.costInPerMillion;
} else {
json[r'costInPerMillion'] = null;
}
if (this.costOutPerMillion != null) {
json[r'costOutPerMillion'] = this.costOutPerMillion;
} else {
json[r'costOutPerMillion'] = null;
}
if (this.createdTime != null) {
json[r'createdTime'] = this.createdTime;
} else {
json[r'createdTime'] = null;
}
if (this.enabled != null) {
json[r'enabled'] = this.enabled;
} else {
json[r'enabled'] = null;
}
if (this.fallback1Provider != null) {
json[r'fallback1Provider'] = this.fallback1Provider;
} else {
json[r'fallback1Provider'] = null;
}
if (this.fallback1Upstream != null) {
json[r'fallback1Upstream'] = this.fallback1Upstream;
} else {
json[r'fallback1Upstream'] = null;
}
if (this.fallback2Provider != null) {
json[r'fallback2Provider'] = this.fallback2Provider;
} else {
json[r'fallback2Provider'] = null;
}
if (this.fallback2Upstream != null) {
json[r'fallback2Upstream'] = this.fallback2Upstream;
} else {
json[r'fallback2Upstream'] = null;
}
if (this.hidden != null) {
json[r'hidden'] = this.hidden;
} else {
json[r'hidden'] = null;
}
if (this.inputPricePerMillion != null) {
json[r'inputPricePerMillion'] = this.inputPricePerMillion;
} else {
json[r'inputPricePerMillion'] = null;
}
if (this.modelName != null) {
json[r'modelName'] = this.modelName;
} else {
json[r'modelName'] = null;
}
if (this.outputPricePerMillion != null) {
json[r'outputPricePerMillion'] = this.outputPricePerMillion;
} else {
json[r'outputPricePerMillion'] = null;
}
if (this.ownedBy != null) {
json[r'ownedBy'] = this.ownedBy;
} else {
json[r'ownedBy'] = null;
}
if (this.owner != null) {
json[r'owner'] = this.owner;
} else {
json[r'owner'] = null;
}
if (this.premium != null) {
json[r'premium'] = this.premium;
} else {
json[r'premium'] = null;
}
if (this.priced != null) {
json[r'priced'] = this.priced;
} else {
json[r'priced'] = null;
}
if (this.provider != null) {
json[r'provider'] = this.provider;
} else {
json[r'provider'] = null;
}
if (this.updatedTime != null) {
json[r'updatedTime'] = this.updatedTime;
} else {
json[r'updatedTime'] = null;
}
if (this.upstream != null) {
json[r'upstream'] = this.upstream;
} else {
json[r'upstream'] = null;
}
return json;
}
/// Returns a new [ModelRoute] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ModelRoute? 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 "ModelRoute[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "ModelRoute[$key]" has a null value in JSON.');
});
return true;
}());
return ModelRoute(
costInPerMillion: num.parse('${json[r'costInPerMillion']}'),
costOutPerMillion: num.parse('${json[r'costOutPerMillion']}'),
createdTime: mapValueOfType<String>(json, r'createdTime'),
enabled: mapValueOfType<bool>(json, r'enabled'),
fallback1Provider: mapValueOfType<String>(json, r'fallback1Provider'),
fallback1Upstream: mapValueOfType<String>(json, r'fallback1Upstream'),
fallback2Provider: mapValueOfType<String>(json, r'fallback2Provider'),
fallback2Upstream: mapValueOfType<String>(json, r'fallback2Upstream'),
hidden: mapValueOfType<bool>(json, r'hidden'),
inputPricePerMillion: num.parse('${json[r'inputPricePerMillion']}'),
modelName: mapValueOfType<String>(json, r'modelName'),
outputPricePerMillion: num.parse('${json[r'outputPricePerMillion']}'),
ownedBy: mapValueOfType<String>(json, r'ownedBy'),
owner: mapValueOfType<String>(json, r'owner'),
premium: mapValueOfType<bool>(json, r'premium'),
priced: mapValueOfType<bool>(json, r'priced'),
provider: mapValueOfType<String>(json, r'provider'),
updatedTime: mapValueOfType<String>(json, r'updatedTime'),
upstream: mapValueOfType<String>(json, r'upstream'),
);
}
return null;
}
static List<ModelRoute> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ModelRoute>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ModelRoute.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ModelRoute> mapFromJson(dynamic json) {
final map = <String, ModelRoute>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ModelRoute.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ModelRoute-objects as value to a dart map
static Map<String, List<ModelRoute>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ModelRoute>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ModelRoute.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}