mirror of
https://github.com/immich-app/immich.git
synced 2026-06-04 13:55:19 -04:00
feat(mobile): add three-state field serialization (#27231)
* bump to v7.22.0 and update patching * gen client * migrate mobile call sites
This commit is contained in:
+6
-7
@@ -13,7 +13,7 @@ part of openapi.api;
|
||||
class StackUpdateDto {
|
||||
/// Returns a new [StackUpdateDto] instance.
|
||||
StackUpdateDto({
|
||||
this.primaryAssetId,
|
||||
this.primaryAssetId = const Optional.absent(),
|
||||
});
|
||||
|
||||
/// Primary asset ID
|
||||
@@ -23,7 +23,7 @@ class StackUpdateDto {
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
String? primaryAssetId;
|
||||
Optional<String?> primaryAssetId;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is StackUpdateDto &&
|
||||
@@ -39,10 +39,9 @@ class StackUpdateDto {
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.primaryAssetId != null) {
|
||||
json[r'primaryAssetId'] = this.primaryAssetId;
|
||||
} else {
|
||||
// json[r'primaryAssetId'] = null;
|
||||
if (this.primaryAssetId.isPresent) {
|
||||
final value = this.primaryAssetId.value;
|
||||
json[r'primaryAssetId'] = value;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
@@ -56,7 +55,7 @@ class StackUpdateDto {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return StackUpdateDto(
|
||||
primaryAssetId: mapValueOfType<String>(json, r'primaryAssetId'),
|
||||
primaryAssetId: json.containsKey(r'primaryAssetId') ? Optional.present(mapValueOfType<String>(json, r'primaryAssetId')) : const Optional.absent(),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user