Files
immich/mobile/openapi/lib/model/plugin_response_dto.dart
T
timonrieger 80367e2500 gen client
2026-06-02 09:51:07 +02:00

198 lines
7.0 KiB
Dart
Generated

//
// 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 openapi.api;
class PluginResponseDto {
/// Returns a new [PluginResponseDto] instance.
PluginResponseDto({
required this.author,
required this.createdAt,
required this.description,
required this.id,
this.methods = const [],
required this.name,
required this.title,
required this.updatedAt,
required this.version,
});
/// Plugin author
String author;
/// Creation date
String createdAt;
/// Plugin description
String description;
/// Plugin ID
String id;
/// Plugin methods
List<PluginMethodResponseDto> methods;
/// Plugin name
String name;
/// Plugin title
String title;
/// Last update date
String updatedAt;
/// Plugin version
String version;
@override
bool operator ==(Object other) => identical(this, other) || other is PluginResponseDto &&
other.author == author &&
other.createdAt == createdAt &&
other.description == description &&
other.id == id &&
_deepEquality.equals(other.methods, methods) &&
other.name == name &&
other.title == title &&
other.updatedAt == updatedAt &&
other.version == version;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(author.hashCode) +
(createdAt.hashCode) +
(description.hashCode) +
(id.hashCode) +
(methods.hashCode) +
(name.hashCode) +
(title.hashCode) +
(updatedAt.hashCode) +
(version.hashCode);
@override
String toString() => 'PluginResponseDto[author=$author, createdAt=$createdAt, description=$description, id=$id, methods=$methods, name=$name, title=$title, updatedAt=$updatedAt, version=$version]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'author'] = this.author;
json[r'createdAt'] = this.createdAt;
json[r'description'] = this.description;
json[r'id'] = this.id;
json[r'methods'] = this.methods;
json[r'name'] = this.name;
json[r'title'] = this.title;
json[r'updatedAt'] = this.updatedAt;
json[r'version'] = this.version;
return json;
}
/// Returns a new [PluginResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static PluginResponseDto? fromJson(dynamic value) {
upgradeDto(value, "PluginResponseDto");
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(() {
assert(json.containsKey(r'author'), 'Required key "PluginResponseDto[author]" is missing from JSON.');
assert(json[r'author'] != null, 'Required key "PluginResponseDto[author]" has a null value in JSON.');
assert(json.containsKey(r'createdAt'), 'Required key "PluginResponseDto[createdAt]" is missing from JSON.');
assert(json[r'createdAt'] != null, 'Required key "PluginResponseDto[createdAt]" has a null value in JSON.');
assert(json.containsKey(r'description'), 'Required key "PluginResponseDto[description]" is missing from JSON.');
assert(json[r'description'] != null, 'Required key "PluginResponseDto[description]" has a null value in JSON.');
assert(json.containsKey(r'id'), 'Required key "PluginResponseDto[id]" is missing from JSON.');
assert(json[r'id'] != null, 'Required key "PluginResponseDto[id]" has a null value in JSON.');
assert(json.containsKey(r'methods'), 'Required key "PluginResponseDto[methods]" is missing from JSON.');
assert(json[r'methods'] != null, 'Required key "PluginResponseDto[methods]" has a null value in JSON.');
assert(json.containsKey(r'name'), 'Required key "PluginResponseDto[name]" is missing from JSON.');
assert(json[r'name'] != null, 'Required key "PluginResponseDto[name]" has a null value in JSON.');
assert(json.containsKey(r'title'), 'Required key "PluginResponseDto[title]" is missing from JSON.');
assert(json[r'title'] != null, 'Required key "PluginResponseDto[title]" has a null value in JSON.');
assert(json.containsKey(r'updatedAt'), 'Required key "PluginResponseDto[updatedAt]" is missing from JSON.');
assert(json[r'updatedAt'] != null, 'Required key "PluginResponseDto[updatedAt]" has a null value in JSON.');
assert(json.containsKey(r'version'), 'Required key "PluginResponseDto[version]" is missing from JSON.');
assert(json[r'version'] != null, 'Required key "PluginResponseDto[version]" has a null value in JSON.');
return true;
}());
return PluginResponseDto(
author: mapValueOfType<String>(json, r'author')!,
createdAt: mapValueOfType<String>(json, r'createdAt')!,
description: mapValueOfType<String>(json, r'description')!,
id: mapValueOfType<String>(json, r'id')!,
methods: PluginMethodResponseDto.listFromJson(json[r'methods']),
name: mapValueOfType<String>(json, r'name')!,
title: mapValueOfType<String>(json, r'title')!,
updatedAt: mapValueOfType<String>(json, r'updatedAt')!,
version: mapValueOfType<String>(json, r'version')!,
);
}
return null;
}
static List<PluginResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <PluginResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = PluginResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, PluginResponseDto> mapFromJson(dynamic json) {
final map = <String, PluginResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = PluginResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of PluginResponseDto-objects as value to a dart map
static Map<String, List<PluginResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<PluginResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = PluginResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'author',
'createdAt',
'description',
'id',
'methods',
'name',
'title',
'updatedAt',
'version',
};
}