Files
sdk/lib/model/new_issue.dart

191 lines
6.5 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 NewIssue {
/// Returns a new [NewIssue] instance.
NewIssue({
this.description,
this.key,
this.priority,
this.status,
this.title,
});
/// Description becomes the issue body.
///
/// 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? description;
/// Key is the board — the repository name, 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? key;
/// Priority is one of none, urgent, high, medium or low.
///
/// 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? priority;
/// Status is the board column to open into: backlog, todo, in_progress, done or canceled. Empty opens into backlog.
///
/// 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;
/// Title is the one line the card is read by on the board. Blank or whitespace is refused — an untitled card cannot be told apart from any other.
///
/// 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;
@override
bool operator ==(Object other) => identical(this, other) || other is NewIssue &&
other.description == description &&
other.key == key &&
other.priority == priority &&
other.status == status &&
other.title == title;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(description == null ? 0 : description!.hashCode) +
(key == null ? 0 : key!.hashCode) +
(priority == null ? 0 : priority!.hashCode) +
(status == null ? 0 : status!.hashCode) +
(title == null ? 0 : title!.hashCode);
@override
String toString() => 'NewIssue[description=$description, key=$key, priority=$priority, status=$status, title=$title]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.description != null) {
json[r'description'] = this.description;
} else {
json[r'description'] = null;
}
if (this.key != null) {
json[r'key'] = this.key;
} else {
json[r'key'] = null;
}
if (this.priority != null) {
json[r'priority'] = this.priority;
} else {
json[r'priority'] = null;
}
if (this.status != null) {
json[r'status'] = this.status;
} else {
json[r'status'] = null;
}
if (this.title != null) {
json[r'title'] = this.title;
} else {
json[r'title'] = null;
}
return json;
}
/// Returns a new [NewIssue] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static NewIssue? 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 "NewIssue[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "NewIssue[$key]" has a null value in JSON.');
});
return true;
}());
return NewIssue(
description: mapValueOfType<String>(json, r'description'),
key: mapValueOfType<String>(json, r'key'),
priority: mapValueOfType<String>(json, r'priority'),
status: mapValueOfType<String>(json, r'status'),
title: mapValueOfType<String>(json, r'title'),
);
}
return null;
}
static List<NewIssue> listFromJson(dynamic json, {bool growable = false,}) {
final result = <NewIssue>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = NewIssue.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, NewIssue> mapFromJson(dynamic json) {
final map = <String, NewIssue>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = NewIssue.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of NewIssue-objects as value to a dart map
static Map<String, List<NewIssue>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<NewIssue>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = NewIssue.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
}