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:
+18
-3
@@ -64,12 +64,12 @@ class ActivityResponseDto {
|
||||
if (this.assetId != null) {
|
||||
json[r'assetId'] = this.assetId;
|
||||
} else {
|
||||
// json[r'assetId'] = null;
|
||||
json[r'assetId'] = null;
|
||||
}
|
||||
if (this.comment != null) {
|
||||
json[r'comment'] = this.comment;
|
||||
} else {
|
||||
// json[r'comment'] = null;
|
||||
json[r'comment'] = null;
|
||||
}
|
||||
json[r'createdAt'] = _isEpochMarker(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))$/')
|
||||
? this.createdAt.millisecondsSinceEpoch
|
||||
@@ -84,10 +84,25 @@ class ActivityResponseDto {
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static ActivityResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "ActivityResponseDto");
|
||||
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'assetId'), 'Required key "ActivityResponseDto[assetId]" is missing from JSON.');
|
||||
assert(json.containsKey(r'createdAt'), 'Required key "ActivityResponseDto[createdAt]" is missing from JSON.');
|
||||
assert(json[r'createdAt'] != null, 'Required key "ActivityResponseDto[createdAt]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'id'), 'Required key "ActivityResponseDto[id]" is missing from JSON.');
|
||||
assert(json[r'id'] != null, 'Required key "ActivityResponseDto[id]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'type'), 'Required key "ActivityResponseDto[type]" is missing from JSON.');
|
||||
assert(json[r'type'] != null, 'Required key "ActivityResponseDto[type]" has a null value in JSON.');
|
||||
assert(json.containsKey(r'user'), 'Required key "ActivityResponseDto[user]" is missing from JSON.');
|
||||
assert(json[r'user'] != null, 'Required key "ActivityResponseDto[user]" has a null value in JSON.');
|
||||
return true;
|
||||
}());
|
||||
|
||||
return ActivityResponseDto(
|
||||
assetId: mapValueOfType<String>(json, r'assetId'),
|
||||
comment: mapValueOfType<String>(json, r'comment'),
|
||||
|
||||
Reference in New Issue
Block a user