mirror of
https://github.com/hanzo-dart/sdk.git
synced 2026-10-30 19:32:47 +00:00
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.
518 lines
19 KiB
Dart
518 lines
19 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 Chat {
|
|
/// Returns a new [Chat] instance.
|
|
Chat({
|
|
this.category,
|
|
this.clientIp,
|
|
this.clientIpDesc,
|
|
this.createdTime,
|
|
this.currency,
|
|
this.displayName,
|
|
this.isDeleted,
|
|
this.isHidden,
|
|
this.messageCount,
|
|
this.modelProvider,
|
|
this.name,
|
|
this.needTitle,
|
|
this.organization,
|
|
this.owner,
|
|
this.price,
|
|
this.store,
|
|
this.tokenCount,
|
|
this.type,
|
|
this.updatedTime,
|
|
this.user,
|
|
this.user1,
|
|
this.user2,
|
|
this.userAgent,
|
|
this.userAgentDesc,
|
|
this.users = const [],
|
|
});
|
|
///
|
|
/// 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? category;
|
|
|
|
///
|
|
/// 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? clientIp;
|
|
|
|
///
|
|
/// 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? clientIpDesc;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
String? currency;
|
|
|
|
///
|
|
/// 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? displayName;
|
|
|
|
///
|
|
/// 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? isDeleted;
|
|
|
|
///
|
|
/// 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? isHidden;
|
|
|
|
///
|
|
/// 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? messageCount;
|
|
|
|
///
|
|
/// 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? modelProvider;
|
|
|
|
///
|
|
/// 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? name;
|
|
|
|
///
|
|
/// 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? needTitle;
|
|
|
|
///
|
|
/// 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? organization;
|
|
|
|
///
|
|
/// 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.
|
|
///
|
|
num? price;
|
|
|
|
///
|
|
/// 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? store;
|
|
|
|
///
|
|
/// 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? tokenCount;
|
|
|
|
///
|
|
/// 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? type;
|
|
|
|
///
|
|
/// 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? user;
|
|
|
|
///
|
|
/// 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? user1;
|
|
|
|
///
|
|
/// 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? user2;
|
|
|
|
///
|
|
/// 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? userAgent;
|
|
|
|
///
|
|
/// 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? userAgentDesc;
|
|
|
|
List<String> users;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is Chat &&
|
|
other.category == category &&
|
|
other.clientIp == clientIp &&
|
|
other.clientIpDesc == clientIpDesc &&
|
|
other.createdTime == createdTime &&
|
|
other.currency == currency &&
|
|
other.displayName == displayName &&
|
|
other.isDeleted == isDeleted &&
|
|
other.isHidden == isHidden &&
|
|
other.messageCount == messageCount &&
|
|
other.modelProvider == modelProvider &&
|
|
other.name == name &&
|
|
other.needTitle == needTitle &&
|
|
other.organization == organization &&
|
|
other.owner == owner &&
|
|
other.price == price &&
|
|
other.store == store &&
|
|
other.tokenCount == tokenCount &&
|
|
other.type == type &&
|
|
other.updatedTime == updatedTime &&
|
|
other.user == user &&
|
|
other.user1 == user1 &&
|
|
other.user2 == user2 &&
|
|
other.userAgent == userAgent &&
|
|
other.userAgentDesc == userAgentDesc &&
|
|
_deepEquality.equals(other.users, users);
|
|
|
|
@override
|
|
int get hashCode =>
|
|
// ignore: unnecessary_parenthesis
|
|
(category == null ? 0 : category!.hashCode) +
|
|
(clientIp == null ? 0 : clientIp!.hashCode) +
|
|
(clientIpDesc == null ? 0 : clientIpDesc!.hashCode) +
|
|
(createdTime == null ? 0 : createdTime!.hashCode) +
|
|
(currency == null ? 0 : currency!.hashCode) +
|
|
(displayName == null ? 0 : displayName!.hashCode) +
|
|
(isDeleted == null ? 0 : isDeleted!.hashCode) +
|
|
(isHidden == null ? 0 : isHidden!.hashCode) +
|
|
(messageCount == null ? 0 : messageCount!.hashCode) +
|
|
(modelProvider == null ? 0 : modelProvider!.hashCode) +
|
|
(name == null ? 0 : name!.hashCode) +
|
|
(needTitle == null ? 0 : needTitle!.hashCode) +
|
|
(organization == null ? 0 : organization!.hashCode) +
|
|
(owner == null ? 0 : owner!.hashCode) +
|
|
(price == null ? 0 : price!.hashCode) +
|
|
(store == null ? 0 : store!.hashCode) +
|
|
(tokenCount == null ? 0 : tokenCount!.hashCode) +
|
|
(type == null ? 0 : type!.hashCode) +
|
|
(updatedTime == null ? 0 : updatedTime!.hashCode) +
|
|
(user == null ? 0 : user!.hashCode) +
|
|
(user1 == null ? 0 : user1!.hashCode) +
|
|
(user2 == null ? 0 : user2!.hashCode) +
|
|
(userAgent == null ? 0 : userAgent!.hashCode) +
|
|
(userAgentDesc == null ? 0 : userAgentDesc!.hashCode) +
|
|
(users.hashCode);
|
|
|
|
@override
|
|
String toString() => 'Chat[category=$category, clientIp=$clientIp, clientIpDesc=$clientIpDesc, createdTime=$createdTime, currency=$currency, displayName=$displayName, isDeleted=$isDeleted, isHidden=$isHidden, messageCount=$messageCount, modelProvider=$modelProvider, name=$name, needTitle=$needTitle, organization=$organization, owner=$owner, price=$price, store=$store, tokenCount=$tokenCount, type=$type, updatedTime=$updatedTime, user=$user, user1=$user1, user2=$user2, userAgent=$userAgent, userAgentDesc=$userAgentDesc, users=$users]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (this.category != null) {
|
|
json[r'category'] = this.category;
|
|
} else {
|
|
json[r'category'] = null;
|
|
}
|
|
if (this.clientIp != null) {
|
|
json[r'clientIp'] = this.clientIp;
|
|
} else {
|
|
json[r'clientIp'] = null;
|
|
}
|
|
if (this.clientIpDesc != null) {
|
|
json[r'clientIpDesc'] = this.clientIpDesc;
|
|
} else {
|
|
json[r'clientIpDesc'] = null;
|
|
}
|
|
if (this.createdTime != null) {
|
|
json[r'createdTime'] = this.createdTime;
|
|
} else {
|
|
json[r'createdTime'] = null;
|
|
}
|
|
if (this.currency != null) {
|
|
json[r'currency'] = this.currency;
|
|
} else {
|
|
json[r'currency'] = null;
|
|
}
|
|
if (this.displayName != null) {
|
|
json[r'displayName'] = this.displayName;
|
|
} else {
|
|
json[r'displayName'] = null;
|
|
}
|
|
if (this.isDeleted != null) {
|
|
json[r'isDeleted'] = this.isDeleted;
|
|
} else {
|
|
json[r'isDeleted'] = null;
|
|
}
|
|
if (this.isHidden != null) {
|
|
json[r'isHidden'] = this.isHidden;
|
|
} else {
|
|
json[r'isHidden'] = null;
|
|
}
|
|
if (this.messageCount != null) {
|
|
json[r'messageCount'] = this.messageCount;
|
|
} else {
|
|
json[r'messageCount'] = null;
|
|
}
|
|
if (this.modelProvider != null) {
|
|
json[r'modelProvider'] = this.modelProvider;
|
|
} else {
|
|
json[r'modelProvider'] = null;
|
|
}
|
|
if (this.name != null) {
|
|
json[r'name'] = this.name;
|
|
} else {
|
|
json[r'name'] = null;
|
|
}
|
|
if (this.needTitle != null) {
|
|
json[r'needTitle'] = this.needTitle;
|
|
} else {
|
|
json[r'needTitle'] = null;
|
|
}
|
|
if (this.organization != null) {
|
|
json[r'organization'] = this.organization;
|
|
} else {
|
|
json[r'organization'] = null;
|
|
}
|
|
if (this.owner != null) {
|
|
json[r'owner'] = this.owner;
|
|
} else {
|
|
json[r'owner'] = null;
|
|
}
|
|
if (this.price != null) {
|
|
json[r'price'] = this.price;
|
|
} else {
|
|
json[r'price'] = null;
|
|
}
|
|
if (this.store != null) {
|
|
json[r'store'] = this.store;
|
|
} else {
|
|
json[r'store'] = null;
|
|
}
|
|
if (this.tokenCount != null) {
|
|
json[r'tokenCount'] = this.tokenCount;
|
|
} else {
|
|
json[r'tokenCount'] = null;
|
|
}
|
|
if (this.type != null) {
|
|
json[r'type'] = this.type;
|
|
} else {
|
|
json[r'type'] = null;
|
|
}
|
|
if (this.updatedTime != null) {
|
|
json[r'updatedTime'] = this.updatedTime;
|
|
} else {
|
|
json[r'updatedTime'] = null;
|
|
}
|
|
if (this.user != null) {
|
|
json[r'user'] = this.user;
|
|
} else {
|
|
json[r'user'] = null;
|
|
}
|
|
if (this.user1 != null) {
|
|
json[r'user1'] = this.user1;
|
|
} else {
|
|
json[r'user1'] = null;
|
|
}
|
|
if (this.user2 != null) {
|
|
json[r'user2'] = this.user2;
|
|
} else {
|
|
json[r'user2'] = null;
|
|
}
|
|
if (this.userAgent != null) {
|
|
json[r'userAgent'] = this.userAgent;
|
|
} else {
|
|
json[r'userAgent'] = null;
|
|
}
|
|
if (this.userAgentDesc != null) {
|
|
json[r'userAgentDesc'] = this.userAgentDesc;
|
|
} else {
|
|
json[r'userAgentDesc'] = null;
|
|
}
|
|
json[r'users'] = this.users;
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [Chat] instance and imports its values from
|
|
/// [value] if it's a [Map], null otherwise.
|
|
// ignore: prefer_constructors_over_static_methods
|
|
static Chat? 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 "Chat[$key]" is missing from JSON.');
|
|
assert(json[key] != null, 'Required key "Chat[$key]" has a null value in JSON.');
|
|
});
|
|
return true;
|
|
}());
|
|
|
|
return Chat(
|
|
category: mapValueOfType<String>(json, r'category'),
|
|
clientIp: mapValueOfType<String>(json, r'clientIp'),
|
|
clientIpDesc: mapValueOfType<String>(json, r'clientIpDesc'),
|
|
createdTime: mapValueOfType<String>(json, r'createdTime'),
|
|
currency: mapValueOfType<String>(json, r'currency'),
|
|
displayName: mapValueOfType<String>(json, r'displayName'),
|
|
isDeleted: mapValueOfType<bool>(json, r'isDeleted'),
|
|
isHidden: mapValueOfType<bool>(json, r'isHidden'),
|
|
messageCount: mapValueOfType<int>(json, r'messageCount'),
|
|
modelProvider: mapValueOfType<String>(json, r'modelProvider'),
|
|
name: mapValueOfType<String>(json, r'name'),
|
|
needTitle: mapValueOfType<bool>(json, r'needTitle'),
|
|
organization: mapValueOfType<String>(json, r'organization'),
|
|
owner: mapValueOfType<String>(json, r'owner'),
|
|
price: num.parse('${json[r'price']}'),
|
|
store: mapValueOfType<String>(json, r'store'),
|
|
tokenCount: mapValueOfType<int>(json, r'tokenCount'),
|
|
type: mapValueOfType<String>(json, r'type'),
|
|
updatedTime: mapValueOfType<String>(json, r'updatedTime'),
|
|
user: mapValueOfType<String>(json, r'user'),
|
|
user1: mapValueOfType<String>(json, r'user1'),
|
|
user2: mapValueOfType<String>(json, r'user2'),
|
|
userAgent: mapValueOfType<String>(json, r'userAgent'),
|
|
userAgentDesc: mapValueOfType<String>(json, r'userAgentDesc'),
|
|
users: json[r'users'] is Iterable
|
|
? (json[r'users'] as Iterable).cast<String>().toList(growable: false)
|
|
: const [],
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
static List<Chat> listFromJson(dynamic json, {bool growable = false,}) {
|
|
final result = <Chat>[];
|
|
if (json is List && json.isNotEmpty) {
|
|
for (final row in json) {
|
|
final value = Chat.fromJson(row);
|
|
if (value != null) {
|
|
result.add(value);
|
|
}
|
|
}
|
|
}
|
|
return result.toList(growable: growable);
|
|
}
|
|
|
|
static Map<String, Chat> mapFromJson(dynamic json) {
|
|
final map = <String, Chat>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
|
for (final entry in json.entries) {
|
|
final value = Chat.fromJson(entry.value);
|
|
if (value != null) {
|
|
map[entry.key] = value;
|
|
}
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of Chat-objects as value to a dart map
|
|
static Map<String, List<Chat>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
|
final map = <String, List<Chat>>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
// ignore: parameter_assignments
|
|
json = json.cast<String, dynamic>();
|
|
for (final entry in json.entries) {
|
|
map[entry.key] = Chat.listFromJson(entry.value, growable: growable,);
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/// The list of required keys that must be present in a JSON.
|
|
static const requiredKeys = <String>{
|
|
};
|
|
}
|
|
|