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

209 lines
7.3 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 AuthoredPlugin {
/// Returns a new [AuthoredPlugin] instance.
AuthoredPlugin({
this.createdAt,
this.id,
this.name,
this.org,
this.provider,
this.source_,
});
/// CreatedAt is when the plugin was last built, Unix seconds.
///
/// 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? createdAt;
/// ID is the plugin's id within the org, and the id a delete addresses.
///
/// 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;
/// Name is the plugin's name: one lowercase path segment, the id it runs 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? name;
/// Org is the org that built the plugin — the validated caller's.
///
/// 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;
/// Provider is the connectors provider whose credential this plugin uses at run time. Absent for a plugin that needs none. The credential itself is never here — it stays under KMS custody in the connectors plane.
///
/// 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;
/// Source is the TypeScript as authored (or as generated from a spec).
///
/// 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? source_;
@override
bool operator ==(Object other) => identical(this, other) || other is AuthoredPlugin &&
other.createdAt == createdAt &&
other.id == id &&
other.name == name &&
other.org == org &&
other.provider == provider &&
other.source_ == source_;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(createdAt == null ? 0 : createdAt!.hashCode) +
(id == null ? 0 : id!.hashCode) +
(name == null ? 0 : name!.hashCode) +
(org == null ? 0 : org!.hashCode) +
(provider == null ? 0 : provider!.hashCode) +
(source_ == null ? 0 : source_!.hashCode);
@override
String toString() => 'AuthoredPlugin[createdAt=$createdAt, id=$id, name=$name, org=$org, provider=$provider, source_=$source_]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.createdAt != null) {
json[r'createdAt'] = this.createdAt;
} else {
json[r'createdAt'] = null;
}
if (this.id != null) {
json[r'id'] = this.id;
} else {
json[r'id'] = null;
}
if (this.name != null) {
json[r'name'] = this.name;
} else {
json[r'name'] = null;
}
if (this.org != null) {
json[r'org'] = this.org;
} else {
json[r'org'] = null;
}
if (this.provider != null) {
json[r'provider'] = this.provider;
} else {
json[r'provider'] = null;
}
if (this.source_ != null) {
json[r'source'] = this.source_;
} else {
json[r'source'] = null;
}
return json;
}
/// Returns a new [AuthoredPlugin] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AuthoredPlugin? 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 "AuthoredPlugin[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AuthoredPlugin[$key]" has a null value in JSON.');
});
return true;
}());
return AuthoredPlugin(
createdAt: mapValueOfType<int>(json, r'createdAt'),
id: mapValueOfType<String>(json, r'id'),
name: mapValueOfType<String>(json, r'name'),
org: mapValueOfType<String>(json, r'org'),
provider: mapValueOfType<String>(json, r'provider'),
source_: mapValueOfType<String>(json, r'source'),
);
}
return null;
}
static List<AuthoredPlugin> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AuthoredPlugin>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AuthoredPlugin.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AuthoredPlugin> mapFromJson(dynamic json) {
final map = <String, AuthoredPlugin>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AuthoredPlugin.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AuthoredPlugin-objects as value to a dart map
static Map<String, List<AuthoredPlugin>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AuthoredPlugin>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AuthoredPlugin.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}