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.
213 lines
7.8 KiB
Dart
213 lines
7.8 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 Blueprint {
|
|
/// Returns a new [Blueprint] instance.
|
|
Blueprint({
|
|
this.brand,
|
|
this.enabled,
|
|
this.principles = const [],
|
|
this.sections = const [],
|
|
this.steps = const [],
|
|
this.strategies = const [],
|
|
this.templates = const [],
|
|
this.title,
|
|
this.version,
|
|
});
|
|
/// Brand is the white-label key this playbook serves. Empty is the shared default every unbranded deployment falls back to.
|
|
///
|
|
/// 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? brand;
|
|
|
|
/// Enabled is the whole-playbook lever. Absent reads as ON; an explicit false makes resolution skip this playbook entirely and fall through to the next tier, rather than serving an empty journey.
|
|
///
|
|
/// 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;
|
|
|
|
/// Principles are the fixed 64-archetype spine a tactic files under. It is authored data an operator organises the corpus by; nothing in the checklist engine reads it.
|
|
List<Principle> principles;
|
|
|
|
/// Sections are the journey's ordered phases.
|
|
List<Section> sections;
|
|
|
|
/// Steps are every checklist item, disabled ones included — this is the authored document, not the projection an org runs.
|
|
List<JourneyStep> steps;
|
|
|
|
/// Strategies are the tactics corpus the recommendation reads narrow.
|
|
List<Strategy> strategies;
|
|
|
|
/// Templates are the reusable prompts and snippets steps reference by id.
|
|
List<Page> templates;
|
|
|
|
/// Title is the playbook's name as a person reads 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? title;
|
|
|
|
/// Version is the playbook's own name for this edition of its content, chosen by whoever authored it. It travels onto every journey projected from it. The store's numeric revision is a separate value and lives 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.
|
|
///
|
|
String? version;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is Blueprint &&
|
|
other.brand == brand &&
|
|
other.enabled == enabled &&
|
|
_deepEquality.equals(other.principles, principles) &&
|
|
_deepEquality.equals(other.sections, sections) &&
|
|
_deepEquality.equals(other.steps, steps) &&
|
|
_deepEquality.equals(other.strategies, strategies) &&
|
|
_deepEquality.equals(other.templates, templates) &&
|
|
other.title == title &&
|
|
other.version == version;
|
|
|
|
@override
|
|
int get hashCode =>
|
|
// ignore: unnecessary_parenthesis
|
|
(brand == null ? 0 : brand!.hashCode) +
|
|
(enabled == null ? 0 : enabled!.hashCode) +
|
|
(principles.hashCode) +
|
|
(sections.hashCode) +
|
|
(steps.hashCode) +
|
|
(strategies.hashCode) +
|
|
(templates.hashCode) +
|
|
(title == null ? 0 : title!.hashCode) +
|
|
(version == null ? 0 : version!.hashCode);
|
|
|
|
@override
|
|
String toString() => 'Blueprint[brand=$brand, enabled=$enabled, principles=$principles, sections=$sections, steps=$steps, strategies=$strategies, templates=$templates, title=$title, version=$version]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (this.brand != null) {
|
|
json[r'brand'] = this.brand;
|
|
} else {
|
|
json[r'brand'] = null;
|
|
}
|
|
if (this.enabled != null) {
|
|
json[r'enabled'] = this.enabled;
|
|
} else {
|
|
json[r'enabled'] = null;
|
|
}
|
|
json[r'principles'] = this.principles;
|
|
json[r'sections'] = this.sections;
|
|
json[r'steps'] = this.steps;
|
|
json[r'strategies'] = this.strategies;
|
|
json[r'templates'] = this.templates;
|
|
if (this.title != null) {
|
|
json[r'title'] = this.title;
|
|
} else {
|
|
json[r'title'] = null;
|
|
}
|
|
if (this.version != null) {
|
|
json[r'version'] = this.version;
|
|
} else {
|
|
json[r'version'] = null;
|
|
}
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [Blueprint] instance and imports its values from
|
|
/// [value] if it's a [Map], null otherwise.
|
|
// ignore: prefer_constructors_over_static_methods
|
|
static Blueprint? 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 "Blueprint[$key]" is missing from JSON.');
|
|
assert(json[key] != null, 'Required key "Blueprint[$key]" has a null value in JSON.');
|
|
});
|
|
return true;
|
|
}());
|
|
|
|
return Blueprint(
|
|
brand: mapValueOfType<String>(json, r'brand'),
|
|
enabled: mapValueOfType<bool>(json, r'enabled'),
|
|
principles: Principle.listFromJson(json[r'principles']),
|
|
sections: Section.listFromJson(json[r'sections']),
|
|
steps: JourneyStep.listFromJson(json[r'steps']),
|
|
strategies: Strategy.listFromJson(json[r'strategies']),
|
|
templates: Page.listFromJson(json[r'templates']),
|
|
title: mapValueOfType<String>(json, r'title'),
|
|
version: mapValueOfType<String>(json, r'version'),
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
static List<Blueprint> listFromJson(dynamic json, {bool growable = false,}) {
|
|
final result = <Blueprint>[];
|
|
if (json is List && json.isNotEmpty) {
|
|
for (final row in json) {
|
|
final value = Blueprint.fromJson(row);
|
|
if (value != null) {
|
|
result.add(value);
|
|
}
|
|
}
|
|
}
|
|
return result.toList(growable: growable);
|
|
}
|
|
|
|
static Map<String, Blueprint> mapFromJson(dynamic json) {
|
|
final map = <String, Blueprint>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
|
for (final entry in json.entries) {
|
|
final value = Blueprint.fromJson(entry.value);
|
|
if (value != null) {
|
|
map[entry.key] = value;
|
|
}
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of Blueprint-objects as value to a dart map
|
|
static Map<String, List<Blueprint>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
|
final map = <String, List<Blueprint>>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
// ignore: parameter_assignments
|
|
json = json.cast<String, dynamic>();
|
|
for (final entry in json.entries) {
|
|
map[entry.key] = Blueprint.listFromJson(entry.value, growable: growable,);
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/// The list of required keys that must be present in a JSON.
|
|
static const requiredKeys = <String>{
|
|
};
|
|
}
|
|
|