mirror of
https://github.com/immich-app/immich.git
synced 2025-12-17 01:11:13 +03:00
refactor: api validators (boolean and date) (#7709)
* refactor: api validators (boolean and date) * chore: open api * revert: time bucket change
This commit is contained in:
2
mobile/openapi/doc/PersonApi.md
generated
2
mobile/openapi/doc/PersonApi.md
generated
@@ -114,7 +114,7 @@ try {
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**withHidden** | **bool**| | [optional] [default to false]
|
||||
**withHidden** | **bool**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
2
mobile/openapi/doc/ScanLibraryDto.md
generated
2
mobile/openapi/doc/ScanLibraryDto.md
generated
@@ -8,7 +8,7 @@ import 'package:openapi/api.dart';
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**refreshAllFiles** | **bool** | | [optional] [default to false]
|
||||
**refreshAllFiles** | **bool** | | [optional]
|
||||
**refreshModifiedFiles** | **bool** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
2
mobile/openapi/doc/SharedLinkCreateDto.md
generated
2
mobile/openapi/doc/SharedLinkCreateDto.md
generated
@@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**albumId** | **String** | | [optional]
|
||||
**allowDownload** | **bool** | | [optional] [default to true]
|
||||
**allowUpload** | **bool** | | [optional] [default to false]
|
||||
**allowUpload** | **bool** | | [optional]
|
||||
**assetIds** | **List<String>** | | [optional] [default to const []]
|
||||
**description** | **String** | | [optional]
|
||||
**expiresAt** | [**DateTime**](DateTime.md) | | [optional]
|
||||
|
||||
18
mobile/openapi/lib/model/scan_library_dto.dart
generated
18
mobile/openapi/lib/model/scan_library_dto.dart
generated
@@ -13,11 +13,17 @@ part of openapi.api;
|
||||
class ScanLibraryDto {
|
||||
/// Returns a new [ScanLibraryDto] instance.
|
||||
ScanLibraryDto({
|
||||
this.refreshAllFiles = false,
|
||||
this.refreshAllFiles,
|
||||
this.refreshModifiedFiles,
|
||||
});
|
||||
|
||||
bool refreshAllFiles;
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
bool? refreshAllFiles;
|
||||
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
@@ -35,7 +41,7 @@ class ScanLibraryDto {
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(refreshAllFiles.hashCode) +
|
||||
(refreshAllFiles == null ? 0 : refreshAllFiles!.hashCode) +
|
||||
(refreshModifiedFiles == null ? 0 : refreshModifiedFiles!.hashCode);
|
||||
|
||||
@override
|
||||
@@ -43,7 +49,11 @@ class ScanLibraryDto {
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.refreshAllFiles != null) {
|
||||
json[r'refreshAllFiles'] = this.refreshAllFiles;
|
||||
} else {
|
||||
// json[r'refreshAllFiles'] = null;
|
||||
}
|
||||
if (this.refreshModifiedFiles != null) {
|
||||
json[r'refreshModifiedFiles'] = this.refreshModifiedFiles;
|
||||
} else {
|
||||
@@ -60,7 +70,7 @@ class ScanLibraryDto {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return ScanLibraryDto(
|
||||
refreshAllFiles: mapValueOfType<bool>(json, r'refreshAllFiles') ?? false,
|
||||
refreshAllFiles: mapValueOfType<bool>(json, r'refreshAllFiles'),
|
||||
refreshModifiedFiles: mapValueOfType<bool>(json, r'refreshModifiedFiles'),
|
||||
);
|
||||
}
|
||||
|
||||
18
mobile/openapi/lib/model/shared_link_create_dto.dart
generated
18
mobile/openapi/lib/model/shared_link_create_dto.dart
generated
@@ -15,7 +15,7 @@ class SharedLinkCreateDto {
|
||||
SharedLinkCreateDto({
|
||||
this.albumId,
|
||||
this.allowDownload = true,
|
||||
this.allowUpload = false,
|
||||
this.allowUpload,
|
||||
this.assetIds = const [],
|
||||
this.description,
|
||||
this.expiresAt,
|
||||
@@ -34,7 +34,13 @@ class SharedLinkCreateDto {
|
||||
|
||||
bool allowDownload;
|
||||
|
||||
bool allowUpload;
|
||||
///
|
||||
/// Please note: This property should have been non-nullable! Since the specification file
|
||||
/// does not include a default value (using the "default:" property), however, the generated
|
||||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
bool? allowUpload;
|
||||
|
||||
List<String> assetIds;
|
||||
|
||||
@@ -77,7 +83,7 @@ class SharedLinkCreateDto {
|
||||
// ignore: unnecessary_parenthesis
|
||||
(albumId == null ? 0 : albumId!.hashCode) +
|
||||
(allowDownload.hashCode) +
|
||||
(allowUpload.hashCode) +
|
||||
(allowUpload == null ? 0 : allowUpload!.hashCode) +
|
||||
(assetIds.hashCode) +
|
||||
(description == null ? 0 : description!.hashCode) +
|
||||
(expiresAt == null ? 0 : expiresAt!.hashCode) +
|
||||
@@ -96,7 +102,11 @@ class SharedLinkCreateDto {
|
||||
// json[r'albumId'] = null;
|
||||
}
|
||||
json[r'allowDownload'] = this.allowDownload;
|
||||
if (this.allowUpload != null) {
|
||||
json[r'allowUpload'] = this.allowUpload;
|
||||
} else {
|
||||
// json[r'allowUpload'] = null;
|
||||
}
|
||||
json[r'assetIds'] = this.assetIds;
|
||||
if (this.description != null) {
|
||||
json[r'description'] = this.description;
|
||||
@@ -128,7 +138,7 @@ class SharedLinkCreateDto {
|
||||
return SharedLinkCreateDto(
|
||||
albumId: mapValueOfType<String>(json, r'albumId'),
|
||||
allowDownload: mapValueOfType<bool>(json, r'allowDownload') ?? true,
|
||||
allowUpload: mapValueOfType<bool>(json, r'allowUpload') ?? false,
|
||||
allowUpload: mapValueOfType<bool>(json, r'allowUpload'),
|
||||
assetIds: json[r'assetIds'] is Iterable
|
||||
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
|
||||
: const [],
|
||||
|
||||
2
mobile/openapi/test/scan_library_dto_test.dart
generated
2
mobile/openapi/test/scan_library_dto_test.dart
generated
@@ -16,7 +16,7 @@ void main() {
|
||||
// final instance = ScanLibraryDto();
|
||||
|
||||
group('test ScanLibraryDto', () {
|
||||
// bool refreshAllFiles (default value: false)
|
||||
// bool refreshAllFiles
|
||||
test('to test the property `refreshAllFiles`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
@@ -26,7 +26,7 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// bool allowUpload (default value: false)
|
||||
// bool allowUpload
|
||||
test('to test the property `allowUpload`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user