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:
+24
-3
@@ -90,7 +90,7 @@ class SessionResponseDto {
|
||||
if (this.appVersion != null) {
|
||||
json[r'appVersion'] = this.appVersion;
|
||||
} else {
|
||||
// json[r'appVersion'] = null;
|
||||
json[r'appVersion'] = null;
|
||||
}
|
||||
json[r'createdAt'] = this.createdAt;
|
||||
json[r'current'] = this.current;
|
||||
@@ -99,7 +99,7 @@ class SessionResponseDto {
|
||||
if (this.expiresAt != null) {
|
||||
json[r'expiresAt'] = this.expiresAt;
|
||||
} else {
|
||||
// json[r'expiresAt'] = null;
|
||||
json[r'expiresAt'] = null;
|
||||
}
|
||||
json[r'id'] = this.id;
|
||||
json[r'isPendingSyncReset'] = this.isPendingSyncReset;
|
||||
@@ -111,10 +111,31 @@ class SessionResponseDto {
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static SessionResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "SessionResponseDto");
|
||||
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'appVersion'), 'Required key "SessionResponseDto[appVersion]" is missing from JSON.');
|
||||
assert(json.containsKey(r'createdAt'), 'Required key "SessionResponseDto[createdAt]" is missing from JSON.');
|
||||
assert(json[r'createdAt'] != null, 'Required key "SessionResponseDto[createdAt]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'current'), 'Required key "SessionResponseDto[current]" is missing from JSON.');
|
||||
assert(json[r'current'] != null, 'Required key "SessionResponseDto[current]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'deviceOS'), 'Required key "SessionResponseDto[deviceOS]" is missing from JSON.');
|
||||
assert(json[r'deviceOS'] != null, 'Required key "SessionResponseDto[deviceOS]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'deviceType'), 'Required key "SessionResponseDto[deviceType]" is missing from JSON.');
|
||||
assert(json[r'deviceType'] != null, 'Required key "SessionResponseDto[deviceType]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'id'), 'Required key "SessionResponseDto[id]" is missing from JSON.');
|
||||
assert(json[r'id'] != null, 'Required key "SessionResponseDto[id]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'isPendingSyncReset'), 'Required key "SessionResponseDto[isPendingSyncReset]" is missing from JSON.');
|
||||
assert(json[r'isPendingSyncReset'] != null, 'Required key "SessionResponseDto[isPendingSyncReset]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'updatedAt'), 'Required key "SessionResponseDto[updatedAt]" is missing from JSON.');
|
||||
assert(json[r'updatedAt'] != null, 'Required key "SessionResponseDto[updatedAt]" has a null value in JSON.');
|
||||
return true;
|
||||
}());
|
||||
|
||||
return SessionResponseDto(
|
||||
appVersion: mapValueOfType<String>(json, r'appVersion'),
|
||||
createdAt: mapValueOfType<String>(json, r'createdAt')!,
|
||||
|
||||
Reference in New Issue
Block a user