mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
gen client
This commit is contained in:
+19
-3
@@ -92,7 +92,7 @@ class NotificationDto {
|
||||
if (this.description != null) {
|
||||
json[r'description'] = this.description;
|
||||
} else {
|
||||
// json[r'description'] = null;
|
||||
json[r'description'] = null;
|
||||
}
|
||||
json[r'id'] = this.id;
|
||||
json[r'level'] = this.level;
|
||||
@@ -101,7 +101,7 @@ class NotificationDto {
|
||||
? this.readAt!.millisecondsSinceEpoch
|
||||
: this.readAt!.toUtc().toIso8601String();
|
||||
} else {
|
||||
// json[r'readAt'] = null;
|
||||
json[r'readAt'] = null;
|
||||
}
|
||||
json[r'title'] = this.title;
|
||||
json[r'type'] = this.type;
|
||||
@@ -112,10 +112,26 @@ class NotificationDto {
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static NotificationDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "NotificationDto");
|
||||
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'createdAt'), 'Required key "NotificationDto[createdAt]" is missing from JSON.');
|
||||
assert(json[r'createdAt'] != null, 'Required key "NotificationDto[createdAt]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'id'), 'Required key "NotificationDto[id]" is missing from JSON.');
|
||||
assert(json[r'id'] != null, 'Required key "NotificationDto[id]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'level'), 'Required key "NotificationDto[level]" is missing from JSON.');
|
||||
assert(json[r'level'] != null, 'Required key "NotificationDto[level]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'title'), 'Required key "NotificationDto[title]" is missing from JSON.');
|
||||
assert(json[r'title'] != null, 'Required key "NotificationDto[title]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'type'), 'Required key "NotificationDto[type]" is missing from JSON.');
|
||||
assert(json[r'type'] != null, 'Required key "NotificationDto[type]" has a null value in JSON.');
|
||||
return true;
|
||||
}());
|
||||
|
||||
return NotificationDto(
|
||||
createdAt: mapDateTime(json, r'createdAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')!,
|
||||
data: mapCastOfType<String, Object>(json, r'data') ?? const {},
|
||||
|
||||
Reference in New Issue
Block a user