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.
329 lines
12 KiB
Dart
329 lines
12 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 O11yMattermostAttachment {
|
|
/// Returns a new [O11yMattermostAttachment] instance.
|
|
O11yMattermostAttachment({
|
|
this.authorIcon,
|
|
this.authorLink,
|
|
this.authorName,
|
|
this.color,
|
|
this.fallback,
|
|
this.fields = const [],
|
|
this.footer,
|
|
this.footerIcon,
|
|
this.imageUrl,
|
|
this.pretext,
|
|
this.text,
|
|
this.thumbUrl,
|
|
this.title,
|
|
this.titleLink,
|
|
});
|
|
///
|
|
/// 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? authorIcon;
|
|
|
|
///
|
|
/// 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? authorLink;
|
|
|
|
///
|
|
/// 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? authorName;
|
|
|
|
///
|
|
/// 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? color;
|
|
|
|
///
|
|
/// 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? fallback;
|
|
|
|
List<O11yMattermostField> fields;
|
|
|
|
///
|
|
/// 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? footer;
|
|
|
|
///
|
|
/// 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? footerIcon;
|
|
|
|
///
|
|
/// 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? imageUrl;
|
|
|
|
///
|
|
/// 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? pretext;
|
|
|
|
///
|
|
/// 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? text;
|
|
|
|
///
|
|
/// 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? thumbUrl;
|
|
|
|
///
|
|
/// 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;
|
|
|
|
///
|
|
/// 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? titleLink;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is O11yMattermostAttachment &&
|
|
other.authorIcon == authorIcon &&
|
|
other.authorLink == authorLink &&
|
|
other.authorName == authorName &&
|
|
other.color == color &&
|
|
other.fallback == fallback &&
|
|
_deepEquality.equals(other.fields, fields) &&
|
|
other.footer == footer &&
|
|
other.footerIcon == footerIcon &&
|
|
other.imageUrl == imageUrl &&
|
|
other.pretext == pretext &&
|
|
other.text == text &&
|
|
other.thumbUrl == thumbUrl &&
|
|
other.title == title &&
|
|
other.titleLink == titleLink;
|
|
|
|
@override
|
|
int get hashCode =>
|
|
// ignore: unnecessary_parenthesis
|
|
(authorIcon == null ? 0 : authorIcon!.hashCode) +
|
|
(authorLink == null ? 0 : authorLink!.hashCode) +
|
|
(authorName == null ? 0 : authorName!.hashCode) +
|
|
(color == null ? 0 : color!.hashCode) +
|
|
(fallback == null ? 0 : fallback!.hashCode) +
|
|
(fields.hashCode) +
|
|
(footer == null ? 0 : footer!.hashCode) +
|
|
(footerIcon == null ? 0 : footerIcon!.hashCode) +
|
|
(imageUrl == null ? 0 : imageUrl!.hashCode) +
|
|
(pretext == null ? 0 : pretext!.hashCode) +
|
|
(text == null ? 0 : text!.hashCode) +
|
|
(thumbUrl == null ? 0 : thumbUrl!.hashCode) +
|
|
(title == null ? 0 : title!.hashCode) +
|
|
(titleLink == null ? 0 : titleLink!.hashCode);
|
|
|
|
@override
|
|
String toString() => 'O11yMattermostAttachment[authorIcon=$authorIcon, authorLink=$authorLink, authorName=$authorName, color=$color, fallback=$fallback, fields=$fields, footer=$footer, footerIcon=$footerIcon, imageUrl=$imageUrl, pretext=$pretext, text=$text, thumbUrl=$thumbUrl, title=$title, titleLink=$titleLink]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (this.authorIcon != null) {
|
|
json[r'author_icon'] = this.authorIcon;
|
|
} else {
|
|
json[r'author_icon'] = null;
|
|
}
|
|
if (this.authorLink != null) {
|
|
json[r'author_link'] = this.authorLink;
|
|
} else {
|
|
json[r'author_link'] = null;
|
|
}
|
|
if (this.authorName != null) {
|
|
json[r'author_name'] = this.authorName;
|
|
} else {
|
|
json[r'author_name'] = null;
|
|
}
|
|
if (this.color != null) {
|
|
json[r'color'] = this.color;
|
|
} else {
|
|
json[r'color'] = null;
|
|
}
|
|
if (this.fallback != null) {
|
|
json[r'fallback'] = this.fallback;
|
|
} else {
|
|
json[r'fallback'] = null;
|
|
}
|
|
json[r'fields'] = this.fields;
|
|
if (this.footer != null) {
|
|
json[r'footer'] = this.footer;
|
|
} else {
|
|
json[r'footer'] = null;
|
|
}
|
|
if (this.footerIcon != null) {
|
|
json[r'footer_icon'] = this.footerIcon;
|
|
} else {
|
|
json[r'footer_icon'] = null;
|
|
}
|
|
if (this.imageUrl != null) {
|
|
json[r'image_url'] = this.imageUrl;
|
|
} else {
|
|
json[r'image_url'] = null;
|
|
}
|
|
if (this.pretext != null) {
|
|
json[r'pretext'] = this.pretext;
|
|
} else {
|
|
json[r'pretext'] = null;
|
|
}
|
|
if (this.text != null) {
|
|
json[r'text'] = this.text;
|
|
} else {
|
|
json[r'text'] = null;
|
|
}
|
|
if (this.thumbUrl != null) {
|
|
json[r'thumb_url'] = this.thumbUrl;
|
|
} else {
|
|
json[r'thumb_url'] = null;
|
|
}
|
|
if (this.title != null) {
|
|
json[r'title'] = this.title;
|
|
} else {
|
|
json[r'title'] = null;
|
|
}
|
|
if (this.titleLink != null) {
|
|
json[r'title_link'] = this.titleLink;
|
|
} else {
|
|
json[r'title_link'] = null;
|
|
}
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [O11yMattermostAttachment] instance and imports its values from
|
|
/// [value] if it's a [Map], null otherwise.
|
|
// ignore: prefer_constructors_over_static_methods
|
|
static O11yMattermostAttachment? 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 "O11yMattermostAttachment[$key]" is missing from JSON.');
|
|
assert(json[key] != null, 'Required key "O11yMattermostAttachment[$key]" has a null value in JSON.');
|
|
});
|
|
return true;
|
|
}());
|
|
|
|
return O11yMattermostAttachment(
|
|
authorIcon: mapValueOfType<String>(json, r'author_icon'),
|
|
authorLink: mapValueOfType<String>(json, r'author_link'),
|
|
authorName: mapValueOfType<String>(json, r'author_name'),
|
|
color: mapValueOfType<String>(json, r'color'),
|
|
fallback: mapValueOfType<String>(json, r'fallback'),
|
|
fields: O11yMattermostField.listFromJson(json[r'fields']),
|
|
footer: mapValueOfType<String>(json, r'footer'),
|
|
footerIcon: mapValueOfType<String>(json, r'footer_icon'),
|
|
imageUrl: mapValueOfType<String>(json, r'image_url'),
|
|
pretext: mapValueOfType<String>(json, r'pretext'),
|
|
text: mapValueOfType<String>(json, r'text'),
|
|
thumbUrl: mapValueOfType<String>(json, r'thumb_url'),
|
|
title: mapValueOfType<String>(json, r'title'),
|
|
titleLink: mapValueOfType<String>(json, r'title_link'),
|
|
);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
static List<O11yMattermostAttachment> listFromJson(dynamic json, {bool growable = false,}) {
|
|
final result = <O11yMattermostAttachment>[];
|
|
if (json is List && json.isNotEmpty) {
|
|
for (final row in json) {
|
|
final value = O11yMattermostAttachment.fromJson(row);
|
|
if (value != null) {
|
|
result.add(value);
|
|
}
|
|
}
|
|
}
|
|
return result.toList(growable: growable);
|
|
}
|
|
|
|
static Map<String, O11yMattermostAttachment> mapFromJson(dynamic json) {
|
|
final map = <String, O11yMattermostAttachment>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
|
for (final entry in json.entries) {
|
|
final value = O11yMattermostAttachment.fromJson(entry.value);
|
|
if (value != null) {
|
|
map[entry.key] = value;
|
|
}
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of O11yMattermostAttachment-objects as value to a dart map
|
|
static Map<String, List<O11yMattermostAttachment>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
|
final map = <String, List<O11yMattermostAttachment>>{};
|
|
if (json is Map && json.isNotEmpty) {
|
|
// ignore: parameter_assignments
|
|
json = json.cast<String, dynamic>();
|
|
for (final entry in json.entries) {
|
|
map[entry.key] = O11yMattermostAttachment.listFromJson(entry.value, growable: growable,);
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/// The list of required keys that must be present in a JSON.
|
|
static const requiredKeys = <String>{
|
|
};
|
|
}
|
|
|