Compare commits

..

1 Commits

Author SHA1 Message Date
shenlong-tanwen 43e0cc7392 dart generator 2026-05-31 10:08:03 +05:30
563 changed files with 39323 additions and 54881 deletions
+4
View File
@@ -72,6 +72,10 @@ jobs:
run: flutter pub get
working-directory: ./mobile/packages/ui
- name: Install dependencies for UI Showcase
run: flutter pub get
working-directory: ./mobile/packages/ui/showcase
- name: Generate translation files
run: mise //mobile:codegen:translation
-18
View File
@@ -109,24 +109,6 @@ mise //mobile:translation
The mobile app asks you what backend to connect to. You can utilize the demo backend (https://demo.immich.app/) if you don't need to change server code or upload photos. Alternatively, you can run the server yourself per the instructions above.
#### UI components and widget previews
Shared design-system widgets (buttons, inputs, forms) live in the
[`immich_ui` package](https://github.com/immich-app/immich/tree/main/mobile/packages/ui/)
under `mobile/packages/ui/`. Components are defined in `lib/src/components/`
and have matching previews in `lib/src/previews/`.
To inspect a component in isolation with a light/dark toggle and hot reload,
launch [Flutter's Widget Previewer](https://docs.flutter.dev/tools/widget-previewer):
```bash
cd mobile/packages/ui
flutter widget-preview start
```
In VS Code or Android Studio with the Flutter plugin, the previewer
auto-starts when you open the **Flutter Widget Preview** tab in the sidebar.
## IDE setup
### Lint / format extensions
+5 -2
View File
@@ -66,8 +66,11 @@ run = [
]
[tasks.open-api-dart]
dir = "open-api"
run = "bash ./bin/generate-dart-sdk.sh"
dir = "open-api/dart-generator"
run = [
"dart pub get",
"dart run bin/generate.dart --spec ../immich-openapi-specs.json --out ../../mobile/openapi",
]
[tasks.open-api]
env = { SHARP_IGNORE_GLOBAL_LIBVIPS = true }
@@ -57,12 +57,8 @@ class SyncStreamService {
Future<bool> sync() async {
_logger.info("Remote sync request for user");
final serverVersion = await _api.serverInfoApi.getServerVersion();
if (serverVersion == null) {
_logger.severe("Cannot perform sync: unable to determine server version");
return false;
}
final serverSemVer = SemVer(major: serverVersion.major, minor: serverVersion.minor, patch: serverVersion.patch_);
final serverSemVer = SemVer(major: serverVersion.major, minor: serverVersion.minor, patch: serverVersion.patch);
final value = Store.get(StoreKey.syncMigrationStatus, "[]");
final migrations = (jsonDecode(value) as List).cast<String>();
+4 -4
View File
@@ -64,10 +64,10 @@ extension on api.AssetVisibility {
extension on api.AssetTypeEnum {
AssetType toAssetType() => switch (this) {
api.AssetTypeEnum.IMAGE => AssetType.image,
api.AssetTypeEnum.VIDEO => AssetType.video,
api.AssetTypeEnum.AUDIO => AssetType.audio,
api.AssetTypeEnum.OTHER => AssetType.other,
api.AssetTypeEnum.image => AssetType.image,
api.AssetTypeEnum.video => AssetType.video,
api.AssetTypeEnum.audio => AssetType.audio,
api.AssetTypeEnum.other => AssetType.other,
_ => throw Exception('Unknown AssetType value: $this'),
};
}
@@ -11,59 +11,60 @@ class SearchApiRepository extends ApiRepository {
Future<SearchResponseDto?> search(SearchFilter filter, int page) {
AssetTypeEnum? type;
if (filter.mediaType.index == AssetType.image.index) {
type = AssetTypeEnum.IMAGE;
type = AssetTypeEnum.image;
} else if (filter.mediaType.index == AssetType.video.index) {
type = AssetTypeEnum.VIDEO;
type = AssetTypeEnum.video;
}
if ((filter.context != null && filter.context!.isNotEmpty) ||
(filter.assetId != null && filter.assetId!.isNotEmpty)) {
return _api.searchSmart(
SmartSearchDto(
query: filter.context,
queryAssetId: filter.assetId,
language: filter.language,
country: filter.location.country,
state: filter.location.state,
city: filter.location.city,
make: filter.camera.make,
model: filter.camera.model,
takenAfter: filter.date.takenAfter,
takenBefore: filter.date.takenBefore,
visibility: filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline,
rating: filter.rating.rating,
isFavorite: filter.display.isFavorite ? true : null,
isNotInAlbum: filter.display.isNotInAlbum ? true : null,
personIds: filter.people.map((e) => e.id).toList(),
tagIds: filter.tagIds,
type: type,
page: page,
size: 100,
query: filter.context.toOptional(),
queryAssetId: filter.assetId.toOptional(),
language: filter.language.toOptional(),
country: filter.location.country.toOptional(),
state: filter.location.state.toOptional(),
city: filter.location.city.toOptional(),
make: filter.camera.make.toOptional(),
model: filter.camera.model.toOptional(),
takenAfter: filter.date.takenAfter.toOptional(),
takenBefore: filter.date.takenBefore.toOptional(),
visibility: (filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline).toOptional(),
rating: filter.rating.rating.toOptional(),
isFavorite: (filter.display.isFavorite ? true : null).toOptional(),
isNotInAlbum: (filter.display.isNotInAlbum ? true : null).toOptional(),
personIds: filter.people.map((e) => e.id).toList().toOptional(),
tagIds: filter.tagIds.toOptional(),
type: type.toOptional(),
page: page.toOptional(),
size: 100.toOptional(),
),
);
}
return _api.searchAssets(
MetadataSearchDto(
originalFileName: filter.filename != null && filter.filename!.isNotEmpty ? filter.filename : null,
country: filter.location.country,
description: filter.description != null && filter.description!.isNotEmpty ? filter.description : null,
ocr: filter.ocr != null && filter.ocr!.isNotEmpty ? filter.ocr : null,
state: filter.location.state,
city: filter.location.city,
make: filter.camera.make,
model: filter.camera.model,
takenAfter: filter.date.takenAfter,
takenBefore: filter.date.takenBefore,
visibility: filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline,
rating: filter.rating.rating,
isFavorite: filter.display.isFavorite ? true : null,
isNotInAlbum: filter.display.isNotInAlbum ? true : null,
personIds: filter.people.map((e) => e.id).toList(),
tagIds: filter.tagIds,
type: type,
page: page,
size: 1000,
originalFileName: (filter.filename != null && filter.filename!.isNotEmpty ? filter.filename : null).toOptional(),
country: filter.location.country.toOptional(),
description: (filter.description != null && filter.description!.isNotEmpty ? filter.description : null)
.toOptional(),
ocr: (filter.ocr != null && filter.ocr!.isNotEmpty ? filter.ocr : null).toOptional(),
state: filter.location.state.toOptional(),
city: filter.location.city.toOptional(),
make: filter.camera.make.toOptional(),
model: filter.camera.model.toOptional(),
takenAfter: filter.date.takenAfter.toOptional(),
takenBefore: filter.date.takenBefore.toOptional(),
visibility: (filter.display.isArchive ? AssetVisibility.archive : AssetVisibility.timeline).toOptional(),
rating: filter.rating.rating.toOptional(),
isFavorite: (filter.display.isFavorite ? true : null).toOptional(),
isNotInAlbum: (filter.display.isNotInAlbum ? true : null).toOptional(),
personIds: filter.people.map((e) => e.id).toList().toOptional(),
tagIds: filter.tagIds.toOptional(),
type: type.toOptional(),
page: page.toOptional(),
size: 1000.toOptional(),
),
);
}
@@ -74,5 +75,5 @@ class SearchApiRepository extends ApiRepository {
String? state,
String? make,
String? model,
}) => _api.getSearchSuggestions(type, country: country, state: state, make: make, model: model);
}) => _api.getSearchSuggestions(type: type, country: country, state: state, make: make, model: model);
}
@@ -20,7 +20,7 @@ class SyncApiRepository {
}
Future<void> deleteSyncAck(List<SyncEntityType> types) {
return _api.syncApi.deleteSyncAck(SyncAckDeleteDto(types: types));
return _api.syncApi.deleteSyncAck(SyncAckDeleteDto(types: types.toOptional()));
}
Future<void> streamChanges(
@@ -885,10 +885,10 @@ class SyncStreamRepository extends DriftDatabaseRepository {
extension on AssetTypeEnum {
AssetType toAssetType() => switch (this) {
AssetTypeEnum.IMAGE => AssetType.image,
AssetTypeEnum.VIDEO => AssetType.video,
AssetTypeEnum.AUDIO => AssetType.audio,
AssetTypeEnum.OTHER => AssetType.other,
AssetTypeEnum.image => AssetType.image,
AssetTypeEnum.video => AssetType.video,
AssetTypeEnum.audio => AssetType.audio,
AssetTypeEnum.other => AssetType.other,
_ => throw Exception('Unknown AssetType value: $this'),
};
}
@@ -17,7 +17,7 @@ class TagsApiRepository extends ApiRepository {
Future<int> bulkTagAssets(List<String> assetIds, List<String> tagIds) async {
final response = await _api.bulkTagAssets(TagBulkAssetsDto(assetIds: assetIds, tagIds: tagIds));
return response?.count ?? 0;
return response.count;
}
Future<List<TagResponseDto>?> upsertTags(List<String> tags) async {
@@ -12,9 +12,6 @@ class UserApiRepository extends ApiRepository {
Future<UserDto?> getMyUser() async {
final (adminDto, preferenceDto) = await (_api.getMyUser(), _api.getMyPreferences()).wait;
if (adminDto == null) {
return null;
}
return UserConverter.fromAdminDto(adminDto, preferenceDto);
}
+3
View File
@@ -40,6 +40,7 @@ import 'package:immich_mobile/utils/cache/widgets_binding.dart';
import 'package:immich_mobile/utils/debug_print.dart';
import 'package:immich_mobile/utils/licenses.dart';
import 'package:immich_mobile/utils/migration.dart';
import 'package:immich_mobile/utils/openapi_compat.dart';
import 'package:immich_mobile/wm_executor.dart';
import 'package:immich_ui/immich_ui.dart';
import 'package:intl/date_symbol_data_local.dart';
@@ -49,6 +50,8 @@ import 'package:timezone/data/latest.dart';
void main() async {
try {
ImmichWidgetsBinding();
// Register backward-compat back-fills before any API response is parsed.
configureOpenApiCompat();
unawaited(BackgroundWorkerLockService(BackgroundWorkerLockApi()).lock());
await EasyLocalization.ensureInitialized();
final (drift, _) = await Bootstrap.initDomain();
@@ -9,7 +9,7 @@ class ServerVersion extends SemVer {
return 'ServerVersion(major: $major, minor: $minor, patch: $patch)';
}
ServerVersion.fromDto(ServerVersionResponseDto dto) : super(major: dto.major, minor: dto.minor, patch: dto.patch_);
ServerVersion.fromDto(ServerVersionResponseDto dto) : super(major: dto.major, minor: dto.minor, patch: dto.patch);
bool isAtLeast({int major = 0, int minor = 0, int patch = 0}) {
return this >= SemVer(major: major, minor: minor, patch: patch);
@@ -71,11 +71,11 @@ class SharedLink {
key = dto.key,
showMetadata = dto.showMetadata,
slug = dto.slug,
type = dto.type == SharedLinkType.ALBUM ? SharedLinkSource.album : SharedLinkSource.individual,
title = dto.type == SharedLinkType.ALBUM
type = dto.type == SharedLinkType.album ? SharedLinkSource.album : SharedLinkSource.individual,
title = dto.type == SharedLinkType.album
? dto.album?.albumName.toUpperCase() ?? "UNKNOWN SHARE"
: "INDIVIDUAL SHARE",
thumbAssetId = dto.type == SharedLinkType.ALBUM
thumbAssetId = dto.type == SharedLinkType.album
? dto.album?.albumThumbnailAssetId
: dto.assets.isNotEmpty
? dto.assets[0].id
@@ -45,16 +45,16 @@ class _DriftEditImagePageState extends ConsumerState<DriftEditImagePage> with Ti
}
if (editorState.flipHorizontal) {
edits.add(MirrorEdit(MirrorParameters(axis: MirrorAxis.horizontal)));
edits.add(const MirrorEdit(MirrorParameters(axis: MirrorAxis.horizontal)));
}
if (editorState.flipVertical) {
edits.add(MirrorEdit(MirrorParameters(axis: MirrorAxis.vertical)));
edits.add(const MirrorEdit(MirrorParameters(axis: MirrorAxis.vertical)));
}
final normalizedRotation = (editorState.rotationAngle % 360 + 360) % 360;
if (normalizedRotation != 0) {
edits.add(RotateEdit(RotateParameters(angle: normalizedRotation)));
edits.add(RotateEdit(RotateParameters(angle: normalizedRotation.toDouble())));
}
try {
@@ -15,7 +15,7 @@ class ActivityApiRepository extends ApiRepository {
ActivityApiRepository(this._api);
Future<List<Activity>> getAll(String albumId, {String? assetId}) async {
final response = await checkNull(_api.getActivities(albumId, assetId: assetId));
final response = await checkNull(_api.getActivities(albumId: albumId, assetId: assetId));
return response.map(_toActivity).toList();
}
@@ -23,8 +23,8 @@ class ActivityApiRepository extends ApiRepository {
final dto = ActivityCreateDto(
albumId: albumId,
type: type == ActivityType.comment ? ReactionType.comment : ReactionType.like,
assetId: assetId,
comment: comment,
assetId: assetId.toOptional(),
comment: comment.toOptional(),
);
final response = await checkNull(_api.createActivity(dto));
return _toActivity(response);
@@ -35,7 +35,7 @@ class ActivityApiRepository extends ApiRepository {
}
Future<ActivityStats> getStats(String albumId, {String? assetId}) async {
final response = await checkNull(_api.getActivityStatistics(albumId, assetId: assetId));
final response = await checkNull(_api.getActivityStatistics(albumId: albumId, assetId: assetId));
return ActivityStats(comments: response.comments);
}
@@ -24,7 +24,7 @@ class AssetApiRepository extends ApiRepository {
AssetApiRepository(this._api, this._stacksApi, this._trashApi);
Future<void> delete(List<String> ids, bool force) async {
return _api.deleteAssets(AssetBulkDeleteDto(ids: ids, force: force));
return _api.deleteAssets(AssetBulkDeleteDto(ids: ids, force: force.toOptional()));
}
Future<void> restoreTrash(List<String> ids) async {
@@ -33,12 +33,12 @@ class AssetApiRepository extends ApiRepository {
Future<int> emptyTrash() async {
final response = await _trashApi.emptyTrash();
return response?.count ?? 0;
return response.count;
}
Future<int> restoreAllTrash() async {
final response = await _trashApi.restoreTrash();
return response?.count ?? 0;
return response.count;
}
Future<void> updateVisibility(List<String> ids, AssetVisibilityEnum visibility) async {
@@ -46,15 +46,17 @@ class AssetApiRepository extends ApiRepository {
}
Future<void> updateFavorite(List<String> ids, bool isFavorite) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, isFavorite: isFavorite));
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, isFavorite: isFavorite.toOptional()));
}
Future<void> updateLocation(List<String> ids, LatLng location) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, latitude: location.latitude, longitude: location.longitude));
return _api.updateAssets(
AssetBulkUpdateDto(ids: ids, latitude: location.latitude.toOptional(), longitude: location.longitude.toOptional()),
);
}
Future<void> updateDateTime(List<String> ids, DateTime dateTime) async {
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, dateTimeOriginal: dateTime.toIso8601String()));
return _api.updateAssets(AssetBulkUpdateDto(ids: ids, dateTimeOriginal: dateTime.toIso8601String().toOptional()));
}
Future<StackResponse> stack(List<String> ids) async {
@@ -86,11 +88,11 @@ class AssetApiRepository extends ApiRepository {
}
Future<void> updateDescription(String assetId, String description) {
return _api.updateAsset(assetId, UpdateAssetDto(description: description));
return _api.updateAsset(assetId, UpdateAssetDto(description: description.toOptional()));
}
Future<void> updateRating(String assetId, int rating) {
return _api.updateAsset(assetId, UpdateAssetDto(rating: rating));
return _api.updateAsset(assetId, UpdateAssetDto(rating: rating.toOptional()));
}
Future<AssetEditsResponseDto?> editAsset(String assetId, List<AssetEdit> edits) {
@@ -13,7 +13,7 @@ class AuthApiRepository extends ApiRepository {
AuthApiRepository(this._apiService);
Future<void> changePassword(String newPassword) async {
await _apiService.usersApi.updateMyUser(UserUpdateMeDto(password: newPassword));
await _apiService.usersApi.updateMyUser(UserUpdateMeDto(password: newPassword.toOptional()));
}
Future<LoginResponse> login(String email, String password) async {
@@ -46,7 +46,7 @@ class AuthApiRepository extends ApiRepository {
Future<bool> unlockPinCode(String pinCode) async {
try {
await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: pinCode));
await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: pinCode.toOptional()));
return true;
} catch (_) {
return false;
@@ -22,7 +22,9 @@ class DriftAlbumApiRepository extends ApiRepository {
String? description,
}) async {
final responseDto = await checkNull(
_api.createAlbum(CreateAlbumDto(albumName: name, description: description, assetIds: assetIds.toList())),
_api.createAlbum(
CreateAlbumDto(albumName: name, description: description.toOptional(), assetIds: assetIds.toList().toOptional()),
),
);
return responseDto.toRemoteAlbum(owner);
@@ -73,11 +75,11 @@ class DriftAlbumApiRepository extends ApiRepository {
_api.updateAlbumInfo(
albumId,
UpdateAlbumDto(
albumName: name,
description: description,
albumThumbnailAssetId: thumbnailAssetId,
isActivityEnabled: isActivityEnabled,
order: apiOrder,
albumName: name.toOptional(),
description: description.toOptional(),
albumThumbnailAssetId: thumbnailAssetId.toOptional(),
isActivityEnabled: isActivityEnabled.toOptional(),
order: apiOrder.toOptional(),
),
),
);
@@ -99,7 +101,9 @@ class DriftAlbumApiRepository extends ApiRepository {
}
Future<bool> setActivityStatus(String albumId, bool isEnabled) async {
final response = await checkNull(_api.updateAlbumInfo(albumId, UpdateAlbumDto(isActivityEnabled: isEnabled)));
final response = await checkNull(
_api.updateAlbumInfo(albumId, UpdateAlbumDto(isActivityEnabled: isEnabled.toOptional())),
);
return response.isActivityEnabled;
}
}
@@ -17,7 +17,7 @@ class FolderApiRepository extends ApiRepository {
Future<List<String>> getAllUniquePaths() async {
try {
final list = await _api.getUniqueOriginalPaths();
return list ?? [];
return list;
} catch (e, stack) {
_log.severe("Failed to fetch unique original links", e, stack);
return [];
@@ -26,8 +26,8 @@ class FolderApiRepository extends ApiRepository {
Future<List<RemoteAssetExif>> getAssetsForPath(String? path) async {
try {
final list = await _api.getAssetsByOriginalPath(path ?? '/');
return list != null ? list.map((e) => e.toDtoWithExif()).toList() : [];
final list = await _api.getAssetsByOriginalPath(path: path ?? '/');
return list.map((e) => e.toDtoWithExif()).toList();
} catch (e, stack) {
_log.severe("Failed to fetch Assets by original path", e, stack);
return [];
@@ -16,7 +16,9 @@ class PartnerApiRepository extends ApiRepository {
Future<List<UserDto>> getAll(Direction direction) async {
final response = await checkNull(
_api.getPartners(direction == Direction.sharedByMe ? PartnerDirection.by : PartnerDirection.with_),
_api.getPartners(
direction: direction == Direction.sharedByMe ? PartnerDirection.sharedBy : PartnerDirection.sharedWith,
),
);
return response.map(UserConverter.fromPartnerDto).toList();
}
@@ -18,7 +18,7 @@ class PersonApiRepository extends ApiRepository {
Future<PersonDto> update(String id, {String? name, DateTime? birthday}) async {
final birthdayUtc = birthday == null ? null : DateTime.utc(birthday.year, birthday.month, birthday.day);
final dto = PersonUpdateDto(name: name, birthDate: birthdayUtc);
final dto = PersonUpdateDto(name: name.toOptional(), birthDate: birthdayUtc.toOptional());
final response = await checkNull(_api.updatePerson(id, dto));
return _toPerson(response);
}
@@ -15,7 +15,13 @@ class SessionsAPIRepository extends ApiRepository {
Future<SessionCreateResponse> createSession(String deviceType, String deviceOS, {int? duration}) async {
final dto = await checkNull(
_api.createSession(SessionCreateDto(deviceType: deviceType, deviceOS: deviceOS, duration: duration)),
_api.createSession(
SessionCreateDto(
deviceType: deviceType.toOptional(),
deviceOs: deviceOS.toOptional(),
duration: duration.toOptional(),
),
),
);
return SessionCreateResponse(
+1 -1
View File
@@ -47,7 +47,7 @@ class AuthGuard extends AutoRouteGuard {
_validateInFlight = true;
try {
final res = await _apiService.authenticationApi.validateAccessToken();
if (res == null || res.authStatus != true) {
if (res.authStatus != true) {
// Token may have changed during validation (user logged out + logged in
// again); only act if it still applies to the current session.
if (Store.tryGet(StoreKey.accessToken) != token) {
+1 -6
View File
@@ -24,11 +24,6 @@ class LockedGuard extends AutoRouteGuard {
void onNavigation(NavigationResolver resolver, StackRouter router) async {
final authStatus = await _apiService.authenticationApi.getAuthStatus();
if (authStatus == null) {
resolver.next(false);
return;
}
/// Check if a pincode has been created but this user. Show the form to create if not exist
if (!authStatus.pinCode) {
unawaited(router.push(PinAuthRoute(createPinCode: true)));
@@ -55,7 +50,7 @@ class LockedGuard extends AutoRouteGuard {
return;
}
await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: securePinCode));
await _apiService.authenticationApi.unlockAuthSession(SessionUnlockDto(pinCode: securePinCode.toOptional()));
resolver.next(true);
} on PlatformException catch (error) {
+1 -1
View File
@@ -36,7 +36,7 @@ class MapService with ErrorLoggerMixin {
fileCreatedBefore: fileCreatedBefore,
);
return markers?.map(MapMarker.fromDto) ?? [];
return markers.map(MapMarker.fromDto);
},
defaultValue: [],
errorMessage: "Failed to get map markers",
+3 -3
View File
@@ -18,10 +18,10 @@ class OAuthService {
log.info("Starting OAuth flow with redirect URI: $redirectUri");
final dto = await _apiService.oAuthApi.startOAuth(
OAuthConfigDto(redirectUri: redirectUri, state: state, codeChallenge: codeChallenge),
OAuthConfigDto(redirectUri: redirectUri, state: state.toOptional(), codeChallenge: codeChallenge.toOptional()),
);
final authUrl = dto?.url;
final authUrl = dto.url;
log.info('Received Authorization URL: $authUrl');
return authUrl;
@@ -37,7 +37,7 @@ class OAuthService {
}
return await _apiService.oAuthApi.finishOAuth(
OAuthCallbackDto(url: result, state: state, codeVerifier: codeVerifier),
OAuthCallbackDto(url: result, state: state.toOptional(), codeVerifier: codeVerifier.toOptional()),
);
}
}
+4 -12
View File
@@ -17,9 +17,7 @@ class ServerInfoService {
Future<ServerDiskInfo?> getDiskInfo() async {
try {
final dto = await _apiService.serverInfoApi.getStorage();
if (dto != null) {
return ServerDiskInfo.fromDto(dto);
}
return ServerDiskInfo.fromDto(dto);
} catch (e) {
dPrint(() => "Error [getDiskInfo] ${e.toString()}");
}
@@ -29,9 +27,7 @@ class ServerInfoService {
Future<ServerVersion?> getServerVersion() async {
try {
final dto = await _apiService.serverInfoApi.getServerVersion();
if (dto != null) {
return ServerVersion.fromDto(dto);
}
return ServerVersion.fromDto(dto);
} catch (e) {
dPrint(() => "Error [getServerVersion] ${e.toString()}");
}
@@ -41,9 +37,7 @@ class ServerInfoService {
Future<ServerFeatures?> getServerFeatures() async {
try {
final dto = await _apiService.serverInfoApi.getServerFeatures();
if (dto != null) {
return ServerFeatures.fromDto(dto);
}
return ServerFeatures.fromDto(dto);
} catch (e) {
dPrint(() => "Error [getServerFeatures] ${e.toString()}");
}
@@ -53,9 +47,7 @@ class ServerInfoService {
Future<ServerConfig?> getServerConfig() async {
try {
final dto = await _apiService.serverInfoApi.getServerConfig();
if (dto != null) {
return ServerConfig.fromDto(dto);
}
return ServerConfig.fromDto(dto);
} catch (e) {
dPrint(() => "Error [getServerConfig] ${e.toString()}");
}
+29 -33
View File
@@ -16,7 +16,7 @@ class SharedLinkService {
Future<AsyncValue<List<SharedLink>>> getAllSharedLinks() async {
try {
final list = await _apiService.sharedLinksApi.getAllSharedLinks();
return list != null ? AsyncData(list.map(SharedLink.fromDto).toList()) : const AsyncData([]);
return AsyncData(list.map(SharedLink.fromDto).toList());
} catch (e, stack) {
_log.severe("Failed to fetch shared links", e, stack);
return AsyncError(e, stack);
@@ -43,39 +43,37 @@ class SharedLinkService {
DateTime? expiresAt,
}) async {
try {
final type = albumId != null ? SharedLinkType.ALBUM : SharedLinkType.INDIVIDUAL;
final type = albumId != null ? SharedLinkType.album : SharedLinkType.individual;
SharedLinkCreateDto? dto;
if (type == SharedLinkType.ALBUM) {
if (type == SharedLinkType.album) {
dto = SharedLinkCreateDto(
type: type,
albumId: albumId,
showMetadata: showMeta,
allowDownload: allowDownload,
allowUpload: allowUpload,
expiresAt: expiresAt,
description: description,
password: password,
slug: slug,
albumId: albumId.toOptional(),
showMetadata: showMeta.toOptional(),
allowDownload: allowDownload.toOptional(),
allowUpload: allowUpload.toOptional(),
expiresAt: expiresAt.toOptional(),
description: description.toOptional(),
password: password.toOptional(),
slug: slug.toOptional(),
);
} else if (assetIds != null) {
dto = SharedLinkCreateDto(
type: type,
showMetadata: showMeta,
allowDownload: allowDownload,
allowUpload: allowUpload,
expiresAt: expiresAt,
description: description,
password: password,
slug: slug,
assetIds: assetIds,
showMetadata: showMeta.toOptional(),
allowDownload: allowDownload.toOptional(),
allowUpload: allowUpload.toOptional(),
expiresAt: expiresAt.toOptional(),
description: description.toOptional(),
password: password.toOptional(),
slug: slug.toOptional(),
assetIds: assetIds.toOptional(),
);
}
if (dto != null) {
final responseDto = await _apiService.sharedLinksApi.createSharedLink(dto);
if (responseDto != null) {
return SharedLink.fromDto(responseDto);
}
return SharedLink.fromDto(responseDto);
}
} catch (e) {
_log.severe("Failed to create shared link", e);
@@ -98,19 +96,17 @@ class SharedLinkService {
final responseDto = await _apiService.sharedLinksApi.updateSharedLink(
id,
SharedLinkEditDto(
showMetadata: showMeta,
allowDownload: allowDownload,
allowUpload: allowUpload,
expiresAt: expiresAt,
description: description,
password: password,
slug: slug,
changeExpiryTime: changeExpiry,
showMetadata: showMeta.toOptional(),
allowDownload: allowDownload.toOptional(),
allowUpload: allowUpload.toOptional(),
expiresAt: expiresAt.toOptional(),
description: description.toOptional(),
password: password.toOptional(),
slug: slug.toOptional(),
changeExpiryTime: changeExpiry.toOptional(),
),
);
if (responseDto != null) {
return SharedLink.fromDto(responseDto);
}
return SharedLink.fromDto(responseDto);
} catch (e) {
_log.severe("Failed to update shared link id - $id", e);
}
+42
View File
@@ -0,0 +1,42 @@
import 'package:openapi/api.dart';
/// Registers backward-compatibility back-fills so the generated client tolerates
/// responses from older Immich servers (fields newer DTOs expect but older
/// servers omit). Call once at startup, before any API request.
///
/// The mechanism ([ApiCompat]) lives in the generated client; the rules live
/// here because the defaults are app/server-version knowledge. Keyed by DTO
/// type, so a renamed or removed DTO is a compile error. Static-only rule lists
/// are `const`; lists using a DTO's `toJson()` or `DateTime.now()` are built at
/// startup.
void configureOpenApiCompat() {
ApiCompat.configure({
UserPreferencesResponseDto: [
const .new('download.includeEmbeddedVideos', false),
.new('folders', const FoldersResponse(enabled: false, sidebarWeb: false).toJson()),
.new('memories', const MemoriesResponse(enabled: true, duration: 5).toJson()),
.new('ratings', const RatingsResponse(enabled: false).toJson()),
.new('people', const PeopleResponse(enabled: true, sidebarWeb: false).toJson()),
.new('tags', const TagsResponse(enabled: false, sidebarWeb: false).toJson()),
.new('sharedLinks', const SharedLinksResponse(enabled: true, sidebarWeb: false).toJson()),
.new('cast', const CastResponse(gCastEnabled: false).toJson()),
const .new('albums', {'defaultAssetOrder': 'desc'}),
],
ServerConfigDto: const [
.new('mapLightStyleUrl', 'https://tiles.immich.cloud/v1/style/light.json'),
.new('mapDarkStyleUrl', 'https://tiles.immich.cloud/v1/style/dark.json'),
],
UserResponseDto: [.new('profileChangedAt', DateTime.now().toIso8601String())],
AssetResponseDto: [
const .new('visibility', 'timeline'),
.new('createdAt', DateTime.now().toIso8601String()),
const .new('isEdited', false),
],
UserAdminResponseDto: [.new('profileChangedAt', DateTime.now().toIso8601String())],
LoginResponseDto: const [.new('isOnboarded', false)],
SyncUserV1: [.new('profileChangedAt', DateTime.now().toIso8601String()), const .new('hasProfileImage', false)],
SyncAssetV1: const [.new('isEdited', false)],
ServerFeaturesDto: const [.new('ocr', false)],
MemoriesResponse: const [.new('duration', 5)],
});
}
-82
View File
@@ -1,82 +0,0 @@
import 'package:openapi/api.dart';
dynamic upgradeDto(dynamic value, String targetType) {
switch (targetType) {
case 'UserPreferencesResponseDto':
if (value is Map) {
addDefault(value, 'download.includeEmbeddedVideos', false);
addDefault(value, 'folders', FoldersResponse(enabled: false, sidebarWeb: false).toJson());
addDefault(value, 'memories', MemoriesResponse(enabled: true, duration: 5).toJson());
addDefault(value, 'ratings', RatingsResponse(enabled: false).toJson());
addDefault(value, 'people', PeopleResponse(enabled: true, sidebarWeb: false).toJson());
addDefault(value, 'tags', TagsResponse(enabled: false, sidebarWeb: false).toJson());
addDefault(value, 'sharedLinks', SharedLinksResponse(enabled: true, sidebarWeb: false).toJson());
addDefault(value, 'cast', CastResponse(gCastEnabled: false).toJson());
addDefault(value, 'albums', {'defaultAssetOrder': 'desc'});
}
break;
case 'ServerConfigDto':
if (value is Map) {
addDefault(value, 'mapLightStyleUrl', 'https://tiles.immich.cloud/v1/style/light.json');
addDefault(value, 'mapDarkStyleUrl', 'https://tiles.immich.cloud/v1/style/dark.json');
}
case 'UserResponseDto':
if (value is Map) {
addDefault(value, 'profileChangedAt', DateTime.now().toIso8601String());
}
break;
case 'AssetResponseDto':
if (value is Map) {
addDefault(value, 'visibility', 'timeline');
addDefault(value, 'createdAt', DateTime.now().toIso8601String());
addDefault(value, 'isEdited', false);
}
break;
case 'UserAdminResponseDto':
if (value is Map) {
addDefault(value, 'profileChangedAt', DateTime.now().toIso8601String());
}
break;
case 'LoginResponseDto':
if (value is Map) {
addDefault(value, 'isOnboarded', false);
}
break;
case 'SyncUserV1':
if (value is Map) {
addDefault(value, 'profileChangedAt', DateTime.now().toIso8601String());
addDefault(value, 'hasProfileImage', false);
}
case 'SyncAssetV1':
if (value is Map) {
addDefault(value, 'isEdited', false);
}
case 'ServerFeaturesDto':
if (value is Map) {
addDefault(value, 'ocr', false);
}
break;
case 'MemoriesResponse':
if (value is Map) {
addDefault(value, 'duration', 5);
}
break;
}
}
addDefault(dynamic value, String keys, dynamic defaultValue) {
// Loop through the keys and assign the default value if the key is not present
List<String> keyList = keys.split('.');
dynamic current = value;
for (int i = 0; i < keyList.length - 1; i++) {
if (current[keyList[i]] == null) {
current[keyList[i]] = {};
}
current = current[keyList[i]];
}
if (current[keyList.last] == null) {
current[keyList.last] = defaultValue;
}
}
-19
View File
@@ -1,19 +0,0 @@
# See https://dart.dev/guides/libraries/private-files
.dart_tool/
.packages
build/
# Except for application packages
pubspec.lock
doc/api/
# IntelliJ
*.iml
*.ipr
*.iws
.idea/
# Mac
.DS_Store
-23
View File
@@ -1,23 +0,0 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
@@ -1 +0,0 @@
7.8.0
-14
View File
@@ -1,14 +0,0 @@
#
# AUTO-GENERATED FILE, DO NOT MODIFY!
#
# https://docs.travis-ci.com/user/languages/dart/
#
language: dart
dart:
# Install a specific stable release
- "2.12"
install:
- pub get
script:
- pub run test
-704
View File
@@ -1,704 +0,0 @@
# openapi
Immich API
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 3.0.0
- Generator version: 7.8.0
- Build package: org.openapitools.codegen.languages.DartClientCodegen
## Requirements
Dart 2.12 or later
## Installation & Usage
### Github
If this Dart package is published to Github, add the following dependency to your pubspec.yaml
```
dependencies:
openapi:
git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
### Local
To use the package in your local drive, add the following dependency to your pubspec.yaml
```
dependencies:
openapi:
path: /path/to/openapi
```
## Tests
TODO
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```dart
import 'package:openapi/api.dart';
// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = APIKeysApi();
final apiKeyCreateDto = ApiKeyCreateDto(); // ApiKeyCreateDto |
try {
final result = api_instance.createApiKey(apiKeyCreateDto);
print(result);
} catch (e) {
print('Exception when calling APIKeysApi->createApiKey: $e\n');
}
```
## Documentation for API Endpoints
All URIs are relative to */api*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*APIKeysApi* | [**createApiKey**](doc//APIKeysApi.md#createapikey) | **POST** /api-keys | Create an API key
*APIKeysApi* | [**deleteApiKey**](doc//APIKeysApi.md#deleteapikey) | **DELETE** /api-keys/{id} | Delete an API key
*APIKeysApi* | [**getApiKey**](doc//APIKeysApi.md#getapikey) | **GET** /api-keys/{id} | Retrieve an API key
*APIKeysApi* | [**getApiKeys**](doc//APIKeysApi.md#getapikeys) | **GET** /api-keys | List all API keys
*APIKeysApi* | [**getMyApiKey**](doc//APIKeysApi.md#getmyapikey) | **GET** /api-keys/me | Retrieve the current API key
*APIKeysApi* | [**updateApiKey**](doc//APIKeysApi.md#updateapikey) | **PUT** /api-keys/{id} | Update an API key
*ActivitiesApi* | [**createActivity**](doc//ActivitiesApi.md#createactivity) | **POST** /activities | Create an activity
*ActivitiesApi* | [**deleteActivity**](doc//ActivitiesApi.md#deleteactivity) | **DELETE** /activities/{id} | Delete an activity
*ActivitiesApi* | [**getActivities**](doc//ActivitiesApi.md#getactivities) | **GET** /activities | List all activities
*ActivitiesApi* | [**getActivityStatistics**](doc//ActivitiesApi.md#getactivitystatistics) | **GET** /activities/statistics | Retrieve activity statistics
*AlbumsApi* | [**addAssetsToAlbum**](doc//AlbumsApi.md#addassetstoalbum) | **PUT** /albums/{id}/assets | Add assets to an album
*AlbumsApi* | [**addAssetsToAlbums**](doc//AlbumsApi.md#addassetstoalbums) | **PUT** /albums/assets | Add assets to albums
*AlbumsApi* | [**addUsersToAlbum**](doc//AlbumsApi.md#adduserstoalbum) | **PUT** /albums/{id}/users | Share album with users
*AlbumsApi* | [**createAlbum**](doc//AlbumsApi.md#createalbum) | **POST** /albums | Create an album
*AlbumsApi* | [**deleteAlbum**](doc//AlbumsApi.md#deletealbum) | **DELETE** /albums/{id} | Delete an album
*AlbumsApi* | [**getAlbumInfo**](doc//AlbumsApi.md#getalbuminfo) | **GET** /albums/{id} | Retrieve an album
*AlbumsApi* | [**getAlbumMapMarkers**](doc//AlbumsApi.md#getalbummapmarkers) | **GET** /albums/{id}/map-markers | Retrieve album map markers
*AlbumsApi* | [**getAlbumStatistics**](doc//AlbumsApi.md#getalbumstatistics) | **GET** /albums/statistics | Retrieve album statistics
*AlbumsApi* | [**getAllAlbums**](doc//AlbumsApi.md#getallalbums) | **GET** /albums | List all albums
*AlbumsApi* | [**removeAssetFromAlbum**](doc//AlbumsApi.md#removeassetfromalbum) | **DELETE** /albums/{id}/assets | Remove assets from an album
*AlbumsApi* | [**removeUserFromAlbum**](doc//AlbumsApi.md#removeuserfromalbum) | **DELETE** /albums/{id}/user/{userId} | Remove user from album
*AlbumsApi* | [**updateAlbumInfo**](doc//AlbumsApi.md#updatealbuminfo) | **PATCH** /albums/{id} | Update an album
*AlbumsApi* | [**updateAlbumUser**](doc//AlbumsApi.md#updatealbumuser) | **PUT** /albums/{id}/user/{userId} | Update user role
*AssetsApi* | [**checkBulkUpload**](doc//AssetsApi.md#checkbulkupload) | **POST** /assets/bulk-upload-check | Check bulk upload
*AssetsApi* | [**copyAsset**](doc//AssetsApi.md#copyasset) | **PUT** /assets/copy | Copy asset
*AssetsApi* | [**deleteAssetMetadata**](doc//AssetsApi.md#deleteassetmetadata) | **DELETE** /assets/{id}/metadata/{key} | Delete asset metadata by key
*AssetsApi* | [**deleteAssets**](doc//AssetsApi.md#deleteassets) | **DELETE** /assets | Delete assets
*AssetsApi* | [**deleteBulkAssetMetadata**](doc//AssetsApi.md#deletebulkassetmetadata) | **DELETE** /assets/metadata | Delete asset metadata
*AssetsApi* | [**downloadAsset**](doc//AssetsApi.md#downloadasset) | **GET** /assets/{id}/original | Download original asset
*AssetsApi* | [**editAsset**](doc//AssetsApi.md#editasset) | **PUT** /assets/{id}/edits | Apply edits to an existing asset
*AssetsApi* | [**getAssetEdits**](doc//AssetsApi.md#getassetedits) | **GET** /assets/{id}/edits | Retrieve edits for an existing asset
*AssetsApi* | [**getAssetInfo**](doc//AssetsApi.md#getassetinfo) | **GET** /assets/{id} | Retrieve an asset
*AssetsApi* | [**getAssetMetadata**](doc//AssetsApi.md#getassetmetadata) | **GET** /assets/{id}/metadata | Get asset metadata
*AssetsApi* | [**getAssetMetadataByKey**](doc//AssetsApi.md#getassetmetadatabykey) | **GET** /assets/{id}/metadata/{key} | Retrieve asset metadata by key
*AssetsApi* | [**getAssetOcr**](doc//AssetsApi.md#getassetocr) | **GET** /assets/{id}/ocr | Retrieve asset OCR data
*AssetsApi* | [**getAssetStatistics**](doc//AssetsApi.md#getassetstatistics) | **GET** /assets/statistics | Get asset statistics
*AssetsApi* | [**playAssetVideo**](doc//AssetsApi.md#playassetvideo) | **GET** /assets/{id}/video/playback | Play asset video
*AssetsApi* | [**removeAssetEdits**](doc//AssetsApi.md#removeassetedits) | **DELETE** /assets/{id}/edits | Remove edits from an existing asset
*AssetsApi* | [**runAssetJobs**](doc//AssetsApi.md#runassetjobs) | **POST** /assets/jobs | Run an asset job
*AssetsApi* | [**updateAsset**](doc//AssetsApi.md#updateasset) | **PUT** /assets/{id} | Update an asset
*AssetsApi* | [**updateAssetMetadata**](doc//AssetsApi.md#updateassetmetadata) | **PUT** /assets/{id}/metadata | Update asset metadata
*AssetsApi* | [**updateAssets**](doc//AssetsApi.md#updateassets) | **PUT** /assets | Update assets
*AssetsApi* | [**updateBulkAssetMetadata**](doc//AssetsApi.md#updatebulkassetmetadata) | **PUT** /assets/metadata | Upsert asset metadata
*AssetsApi* | [**uploadAsset**](doc//AssetsApi.md#uploadasset) | **POST** /assets | Upload asset
*AssetsApi* | [**viewAsset**](doc//AssetsApi.md#viewasset) | **GET** /assets/{id}/thumbnail | View asset thumbnail
*AuthenticationApi* | [**changePassword**](doc//AuthenticationApi.md#changepassword) | **POST** /auth/change-password | Change password
*AuthenticationApi* | [**changePinCode**](doc//AuthenticationApi.md#changepincode) | **PUT** /auth/pin-code | Change pin code
*AuthenticationApi* | [**finishOAuth**](doc//AuthenticationApi.md#finishoauth) | **POST** /oauth/callback | Finish OAuth
*AuthenticationApi* | [**getAuthStatus**](doc//AuthenticationApi.md#getauthstatus) | **GET** /auth/status | Retrieve auth status
*AuthenticationApi* | [**linkOAuthAccount**](doc//AuthenticationApi.md#linkoauthaccount) | **POST** /oauth/link | Link OAuth account
*AuthenticationApi* | [**lockAuthSession**](doc//AuthenticationApi.md#lockauthsession) | **POST** /auth/session/lock | Lock auth session
*AuthenticationApi* | [**login**](doc//AuthenticationApi.md#login) | **POST** /auth/login | Login
*AuthenticationApi* | [**logout**](doc//AuthenticationApi.md#logout) | **POST** /auth/logout | Logout
*AuthenticationApi* | [**logoutOAuth**](doc//AuthenticationApi.md#logoutoauth) | **POST** /oauth/backchannel-logout | Backchannel OAuth logout
*AuthenticationApi* | [**redirectOAuthToMobile**](doc//AuthenticationApi.md#redirectoauthtomobile) | **GET** /oauth/mobile-redirect | Redirect OAuth to mobile
*AuthenticationApi* | [**resetPinCode**](doc//AuthenticationApi.md#resetpincode) | **DELETE** /auth/pin-code | Reset pin code
*AuthenticationApi* | [**setupPinCode**](doc//AuthenticationApi.md#setuppincode) | **POST** /auth/pin-code | Setup pin code
*AuthenticationApi* | [**signUpAdmin**](doc//AuthenticationApi.md#signupadmin) | **POST** /auth/admin-sign-up | Register admin
*AuthenticationApi* | [**startOAuth**](doc//AuthenticationApi.md#startoauth) | **POST** /oauth/authorize | Start OAuth
*AuthenticationApi* | [**unlinkOAuthAccount**](doc//AuthenticationApi.md#unlinkoauthaccount) | **POST** /oauth/unlink | Unlink OAuth account
*AuthenticationApi* | [**unlockAuthSession**](doc//AuthenticationApi.md#unlockauthsession) | **POST** /auth/session/unlock | Unlock auth session
*AuthenticationApi* | [**validateAccessToken**](doc//AuthenticationApi.md#validateaccesstoken) | **POST** /auth/validateToken | Validate access token
*AuthenticationAdminApi* | [**unlinkAllOAuthAccountsAdmin**](doc//AuthenticationAdminApi.md#unlinkalloauthaccountsadmin) | **POST** /admin/auth/unlink-all | Unlink all OAuth accounts
*DatabaseBackupsAdminApi* | [**deleteDatabaseBackup**](doc//DatabaseBackupsAdminApi.md#deletedatabasebackup) | **DELETE** /admin/database-backups | Delete database backup
*DatabaseBackupsAdminApi* | [**downloadDatabaseBackup**](doc//DatabaseBackupsAdminApi.md#downloaddatabasebackup) | **GET** /admin/database-backups/{filename} | Download database backup
*DatabaseBackupsAdminApi* | [**listDatabaseBackups**](doc//DatabaseBackupsAdminApi.md#listdatabasebackups) | **GET** /admin/database-backups | List database backups
*DatabaseBackupsAdminApi* | [**startDatabaseRestoreFlow**](doc//DatabaseBackupsAdminApi.md#startdatabaserestoreflow) | **POST** /admin/database-backups/start-restore | Start database backup restore flow
*DatabaseBackupsAdminApi* | [**uploadDatabaseBackup**](doc//DatabaseBackupsAdminApi.md#uploaddatabasebackup) | **POST** /admin/database-backups/upload | Upload database backup
*DeprecatedApi* | [**createPartnerDeprecated**](doc//DeprecatedApi.md#createpartnerdeprecated) | **POST** /partners/{id} | Create a partner
*DeprecatedApi* | [**getQueuesLegacy**](doc//DeprecatedApi.md#getqueueslegacy) | **GET** /jobs | Retrieve queue counts and status
*DeprecatedApi* | [**runQueueCommandLegacy**](doc//DeprecatedApi.md#runqueuecommandlegacy) | **PUT** /jobs/{name} | Run jobs
*DownloadApi* | [**downloadArchive**](doc//DownloadApi.md#downloadarchive) | **POST** /download/archive | Download asset archive
*DownloadApi* | [**getDownloadInfo**](doc//DownloadApi.md#getdownloadinfo) | **POST** /download/info | Retrieve download information
*DuplicatesApi* | [**deleteDuplicate**](doc//DuplicatesApi.md#deleteduplicate) | **DELETE** /duplicates/{id} | Dismiss a duplicate group
*DuplicatesApi* | [**deleteDuplicates**](doc//DuplicatesApi.md#deleteduplicates) | **DELETE** /duplicates | Delete duplicates
*DuplicatesApi* | [**getAssetDuplicates**](doc//DuplicatesApi.md#getassetduplicates) | **GET** /duplicates | Retrieve duplicates
*DuplicatesApi* | [**resolveDuplicates**](doc//DuplicatesApi.md#resolveduplicates) | **POST** /duplicates/resolve | Resolve duplicate groups
*FacesApi* | [**createFace**](doc//FacesApi.md#createface) | **POST** /faces | Create a face
*FacesApi* | [**deleteFace**](doc//FacesApi.md#deleteface) | **DELETE** /faces/{id} | Delete a face
*FacesApi* | [**getFaces**](doc//FacesApi.md#getfaces) | **GET** /faces | Retrieve faces for asset
*FacesApi* | [**reassignFacesById**](doc//FacesApi.md#reassignfacesbyid) | **PUT** /faces/{id} | Re-assign a face to another person
*JobsApi* | [**createJob**](doc//JobsApi.md#createjob) | **POST** /jobs | Create a manual job
*JobsApi* | [**getQueuesLegacy**](doc//JobsApi.md#getqueueslegacy) | **GET** /jobs | Retrieve queue counts and status
*JobsApi* | [**runQueueCommandLegacy**](doc//JobsApi.md#runqueuecommandlegacy) | **PUT** /jobs/{name} | Run jobs
*LibrariesApi* | [**createLibrary**](doc//LibrariesApi.md#createlibrary) | **POST** /libraries | Create a library
*LibrariesApi* | [**deleteLibrary**](doc//LibrariesApi.md#deletelibrary) | **DELETE** /libraries/{id} | Delete a library
*LibrariesApi* | [**getAllLibraries**](doc//LibrariesApi.md#getalllibraries) | **GET** /libraries | Retrieve libraries
*LibrariesApi* | [**getLibrary**](doc//LibrariesApi.md#getlibrary) | **GET** /libraries/{id} | Retrieve a library
*LibrariesApi* | [**getLibraryStatistics**](doc//LibrariesApi.md#getlibrarystatistics) | **GET** /libraries/{id}/statistics | Retrieve library statistics
*LibrariesApi* | [**scanLibrary**](doc//LibrariesApi.md#scanlibrary) | **POST** /libraries/{id}/scan | Scan a library
*LibrariesApi* | [**updateLibrary**](doc//LibrariesApi.md#updatelibrary) | **PUT** /libraries/{id} | Update a library
*LibrariesApi* | [**validate**](doc//LibrariesApi.md#validate) | **POST** /libraries/{id}/validate | Validate library settings
*MaintenanceAdminApi* | [**detectPriorInstall**](doc//MaintenanceAdminApi.md#detectpriorinstall) | **GET** /admin/maintenance/detect-install | Detect existing install
*MaintenanceAdminApi* | [**getMaintenanceStatus**](doc//MaintenanceAdminApi.md#getmaintenancestatus) | **GET** /admin/maintenance/status | Get maintenance mode status
*MaintenanceAdminApi* | [**maintenanceLogin**](doc//MaintenanceAdminApi.md#maintenancelogin) | **POST** /admin/maintenance/login | Log into maintenance mode
*MaintenanceAdminApi* | [**setMaintenanceMode**](doc//MaintenanceAdminApi.md#setmaintenancemode) | **POST** /admin/maintenance | Set maintenance mode
*MapApi* | [**getMapMarkers**](doc//MapApi.md#getmapmarkers) | **GET** /map/markers | Retrieve map markers
*MapApi* | [**reverseGeocode**](doc//MapApi.md#reversegeocode) | **GET** /map/reverse-geocode | Reverse geocode coordinates
*MemoriesApi* | [**addMemoryAssets**](doc//MemoriesApi.md#addmemoryassets) | **PUT** /memories/{id}/assets | Add assets to a memory
*MemoriesApi* | [**createMemory**](doc//MemoriesApi.md#creatememory) | **POST** /memories | Create a memory
*MemoriesApi* | [**deleteMemory**](doc//MemoriesApi.md#deletememory) | **DELETE** /memories/{id} | Delete a memory
*MemoriesApi* | [**getMemory**](doc//MemoriesApi.md#getmemory) | **GET** /memories/{id} | Retrieve a memory
*MemoriesApi* | [**memoriesStatistics**](doc//MemoriesApi.md#memoriesstatistics) | **GET** /memories/statistics | Retrieve memories statistics
*MemoriesApi* | [**removeMemoryAssets**](doc//MemoriesApi.md#removememoryassets) | **DELETE** /memories/{id}/assets | Remove assets from a memory
*MemoriesApi* | [**searchMemories**](doc//MemoriesApi.md#searchmemories) | **GET** /memories | Retrieve memories
*MemoriesApi* | [**updateMemory**](doc//MemoriesApi.md#updatememory) | **PUT** /memories/{id} | Update a memory
*NotificationsApi* | [**deleteNotification**](doc//NotificationsApi.md#deletenotification) | **DELETE** /notifications/{id} | Delete a notification
*NotificationsApi* | [**deleteNotifications**](doc//NotificationsApi.md#deletenotifications) | **DELETE** /notifications | Delete notifications
*NotificationsApi* | [**getNotification**](doc//NotificationsApi.md#getnotification) | **GET** /notifications/{id} | Get a notification
*NotificationsApi* | [**getNotifications**](doc//NotificationsApi.md#getnotifications) | **GET** /notifications | Retrieve notifications
*NotificationsApi* | [**updateNotification**](doc//NotificationsApi.md#updatenotification) | **PUT** /notifications/{id} | Update a notification
*NotificationsApi* | [**updateNotifications**](doc//NotificationsApi.md#updatenotifications) | **PUT** /notifications | Update notifications
*NotificationsAdminApi* | [**createNotification**](doc//NotificationsAdminApi.md#createnotification) | **POST** /admin/notifications | Create a notification
*NotificationsAdminApi* | [**getNotificationTemplateAdmin**](doc//NotificationsAdminApi.md#getnotificationtemplateadmin) | **POST** /admin/notifications/templates/{name} | Render email template
*NotificationsAdminApi* | [**sendTestEmailAdmin**](doc//NotificationsAdminApi.md#sendtestemailadmin) | **POST** /admin/notifications/test-email | Send test email
*PartnersApi* | [**createPartner**](doc//PartnersApi.md#createpartner) | **POST** /partners | Create a partner
*PartnersApi* | [**createPartnerDeprecated**](doc//PartnersApi.md#createpartnerdeprecated) | **POST** /partners/{id} | Create a partner
*PartnersApi* | [**getPartners**](doc//PartnersApi.md#getpartners) | **GET** /partners | Retrieve partners
*PartnersApi* | [**removePartner**](doc//PartnersApi.md#removepartner) | **DELETE** /partners/{id} | Remove a partner
*PartnersApi* | [**updatePartner**](doc//PartnersApi.md#updatepartner) | **PUT** /partners/{id} | Update a partner
*PeopleApi* | [**createPerson**](doc//PeopleApi.md#createperson) | **POST** /people | Create a person
*PeopleApi* | [**deletePeople**](doc//PeopleApi.md#deletepeople) | **DELETE** /people | Delete people
*PeopleApi* | [**deletePerson**](doc//PeopleApi.md#deleteperson) | **DELETE** /people/{id} | Delete person
*PeopleApi* | [**getAllPeople**](doc//PeopleApi.md#getallpeople) | **GET** /people | Get all people
*PeopleApi* | [**getPerson**](doc//PeopleApi.md#getperson) | **GET** /people/{id} | Get a person
*PeopleApi* | [**getPersonStatistics**](doc//PeopleApi.md#getpersonstatistics) | **GET** /people/{id}/statistics | Get person statistics
*PeopleApi* | [**getPersonThumbnail**](doc//PeopleApi.md#getpersonthumbnail) | **GET** /people/{id}/thumbnail | Get person thumbnail
*PeopleApi* | [**mergePerson**](doc//PeopleApi.md#mergeperson) | **POST** /people/{id}/merge | Merge people
*PeopleApi* | [**reassignFaces**](doc//PeopleApi.md#reassignfaces) | **PUT** /people/{id}/reassign | Reassign faces
*PeopleApi* | [**updatePeople**](doc//PeopleApi.md#updatepeople) | **PUT** /people | Update people
*PeopleApi* | [**updatePerson**](doc//PeopleApi.md#updateperson) | **PUT** /people/{id} | Update person
*PluginsApi* | [**getPlugin**](doc//PluginsApi.md#getplugin) | **GET** /plugins/{id} | Retrieve a plugin
*PluginsApi* | [**searchPluginMethods**](doc//PluginsApi.md#searchpluginmethods) | **GET** /plugins/methods | Retrieve plugin methods
*PluginsApi* | [**searchPluginTemplates**](doc//PluginsApi.md#searchplugintemplates) | **GET** /plugins/templates | Retrieve workflow templates
*PluginsApi* | [**searchPlugins**](doc//PluginsApi.md#searchplugins) | **GET** /plugins | List all plugins
*QueuesApi* | [**emptyQueue**](doc//QueuesApi.md#emptyqueue) | **DELETE** /queues/{name}/jobs | Empty a queue
*QueuesApi* | [**getQueue**](doc//QueuesApi.md#getqueue) | **GET** /queues/{name} | Retrieve a queue
*QueuesApi* | [**getQueueJobs**](doc//QueuesApi.md#getqueuejobs) | **GET** /queues/{name}/jobs | Retrieve queue jobs
*QueuesApi* | [**getQueues**](doc//QueuesApi.md#getqueues) | **GET** /queues | List all queues
*QueuesApi* | [**updateQueue**](doc//QueuesApi.md#updatequeue) | **PUT** /queues/{name} | Update a queue
*SearchApi* | [**getAssetsByCity**](doc//SearchApi.md#getassetsbycity) | **GET** /search/cities | Retrieve assets by city
*SearchApi* | [**getExploreData**](doc//SearchApi.md#getexploredata) | **GET** /search/explore | Retrieve explore data
*SearchApi* | [**getSearchSuggestions**](doc//SearchApi.md#getsearchsuggestions) | **GET** /search/suggestions | Retrieve search suggestions
*SearchApi* | [**searchAssetStatistics**](doc//SearchApi.md#searchassetstatistics) | **POST** /search/statistics | Search asset statistics
*SearchApi* | [**searchAssets**](doc//SearchApi.md#searchassets) | **POST** /search/metadata | Search assets by metadata
*SearchApi* | [**searchLargeAssets**](doc//SearchApi.md#searchlargeassets) | **POST** /search/large-assets | Search large assets
*SearchApi* | [**searchPerson**](doc//SearchApi.md#searchperson) | **GET** /search/person | Search people
*SearchApi* | [**searchPlaces**](doc//SearchApi.md#searchplaces) | **GET** /search/places | Search places
*SearchApi* | [**searchRandom**](doc//SearchApi.md#searchrandom) | **POST** /search/random | Search random assets
*SearchApi* | [**searchSmart**](doc//SearchApi.md#searchsmart) | **POST** /search/smart | Smart asset search
*ServerApi* | [**deleteServerLicense**](doc//ServerApi.md#deleteserverlicense) | **DELETE** /server/license | Delete server product key
*ServerApi* | [**getAboutInfo**](doc//ServerApi.md#getaboutinfo) | **GET** /server/about | Get server information
*ServerApi* | [**getApkLinks**](doc//ServerApi.md#getapklinks) | **GET** /server/apk-links | Get APK links
*ServerApi* | [**getServerConfig**](doc//ServerApi.md#getserverconfig) | **GET** /server/config | Get config
*ServerApi* | [**getServerFeatures**](doc//ServerApi.md#getserverfeatures) | **GET** /server/features | Get features
*ServerApi* | [**getServerLicense**](doc//ServerApi.md#getserverlicense) | **GET** /server/license | Get product key
*ServerApi* | [**getServerStatistics**](doc//ServerApi.md#getserverstatistics) | **GET** /server/statistics | Get statistics
*ServerApi* | [**getServerVersion**](doc//ServerApi.md#getserverversion) | **GET** /server/version | Get server version
*ServerApi* | [**getStorage**](doc//ServerApi.md#getstorage) | **GET** /server/storage | Get storage
*ServerApi* | [**getSupportedMediaTypes**](doc//ServerApi.md#getsupportedmediatypes) | **GET** /server/media-types | Get supported media types
*ServerApi* | [**getVersionCheck**](doc//ServerApi.md#getversioncheck) | **GET** /server/version-check | Get version check status
*ServerApi* | [**getVersionHistory**](doc//ServerApi.md#getversionhistory) | **GET** /server/version-history | Get version history
*ServerApi* | [**pingServer**](doc//ServerApi.md#pingserver) | **GET** /server/ping | Ping
*ServerApi* | [**setServerLicense**](doc//ServerApi.md#setserverlicense) | **PUT** /server/license | Set server product key
*SessionsApi* | [**createSession**](doc//SessionsApi.md#createsession) | **POST** /sessions | Create a session
*SessionsApi* | [**deleteAllSessions**](doc//SessionsApi.md#deleteallsessions) | **DELETE** /sessions | Delete all sessions
*SessionsApi* | [**deleteSession**](doc//SessionsApi.md#deletesession) | **DELETE** /sessions/{id} | Delete a session
*SessionsApi* | [**getSessions**](doc//SessionsApi.md#getsessions) | **GET** /sessions | Retrieve sessions
*SessionsApi* | [**lockSession**](doc//SessionsApi.md#locksession) | **POST** /sessions/{id}/lock | Lock a session
*SessionsApi* | [**updateSession**](doc//SessionsApi.md#updatesession) | **PUT** /sessions/{id} | Update a session
*SharedLinksApi* | [**addSharedLinkAssets**](doc//SharedLinksApi.md#addsharedlinkassets) | **PUT** /shared-links/{id}/assets | Add assets to a shared link
*SharedLinksApi* | [**createSharedLink**](doc//SharedLinksApi.md#createsharedlink) | **POST** /shared-links | Create a shared link
*SharedLinksApi* | [**getAllSharedLinks**](doc//SharedLinksApi.md#getallsharedlinks) | **GET** /shared-links | Retrieve all shared links
*SharedLinksApi* | [**getMySharedLink**](doc//SharedLinksApi.md#getmysharedlink) | **GET** /shared-links/me | Retrieve current shared link
*SharedLinksApi* | [**getSharedLinkById**](doc//SharedLinksApi.md#getsharedlinkbyid) | **GET** /shared-links/{id} | Retrieve a shared link
*SharedLinksApi* | [**removeSharedLink**](doc//SharedLinksApi.md#removesharedlink) | **DELETE** /shared-links/{id} | Delete a shared link
*SharedLinksApi* | [**removeSharedLinkAssets**](doc//SharedLinksApi.md#removesharedlinkassets) | **DELETE** /shared-links/{id}/assets | Remove assets from a shared link
*SharedLinksApi* | [**sharedLinkLogin**](doc//SharedLinksApi.md#sharedlinklogin) | **POST** /shared-links/login | Shared link login
*SharedLinksApi* | [**updateSharedLink**](doc//SharedLinksApi.md#updatesharedlink) | **PATCH** /shared-links/{id} | Update a shared link
*StacksApi* | [**createStack**](doc//StacksApi.md#createstack) | **POST** /stacks | Create a stack
*StacksApi* | [**deleteStack**](doc//StacksApi.md#deletestack) | **DELETE** /stacks/{id} | Delete a stack
*StacksApi* | [**deleteStacks**](doc//StacksApi.md#deletestacks) | **DELETE** /stacks | Delete stacks
*StacksApi* | [**getStack**](doc//StacksApi.md#getstack) | **GET** /stacks/{id} | Retrieve a stack
*StacksApi* | [**removeAssetFromStack**](doc//StacksApi.md#removeassetfromstack) | **DELETE** /stacks/{id}/assets/{assetId} | Remove an asset from a stack
*StacksApi* | [**searchStacks**](doc//StacksApi.md#searchstacks) | **GET** /stacks | Retrieve stacks
*StacksApi* | [**updateStack**](doc//StacksApi.md#updatestack) | **PUT** /stacks/{id} | Update a stack
*SyncApi* | [**deleteSyncAck**](doc//SyncApi.md#deletesyncack) | **DELETE** /sync/ack | Delete acknowledgements
*SyncApi* | [**getSyncAck**](doc//SyncApi.md#getsyncack) | **GET** /sync/ack | Retrieve acknowledgements
*SyncApi* | [**getSyncStream**](doc//SyncApi.md#getsyncstream) | **POST** /sync/stream | Stream sync changes
*SyncApi* | [**sendSyncAck**](doc//SyncApi.md#sendsyncack) | **POST** /sync/ack | Acknowledge changes
*SystemConfigApi* | [**getConfig**](doc//SystemConfigApi.md#getconfig) | **GET** /system-config | Get system configuration
*SystemConfigApi* | [**getConfigDefaults**](doc//SystemConfigApi.md#getconfigdefaults) | **GET** /system-config/defaults | Get system configuration defaults
*SystemConfigApi* | [**getStorageTemplateOptions**](doc//SystemConfigApi.md#getstoragetemplateoptions) | **GET** /system-config/storage-template-options | Get storage template options
*SystemConfigApi* | [**updateConfig**](doc//SystemConfigApi.md#updateconfig) | **PUT** /system-config | Update system configuration
*SystemMetadataApi* | [**getAdminOnboarding**](doc//SystemMetadataApi.md#getadminonboarding) | **GET** /system-metadata/admin-onboarding | Retrieve admin onboarding
*SystemMetadataApi* | [**getReverseGeocodingState**](doc//SystemMetadataApi.md#getreversegeocodingstate) | **GET** /system-metadata/reverse-geocoding-state | Retrieve reverse geocoding state
*SystemMetadataApi* | [**getVersionCheckState**](doc//SystemMetadataApi.md#getversioncheckstate) | **GET** /system-metadata/version-check-state | Retrieve version check state
*SystemMetadataApi* | [**updateAdminOnboarding**](doc//SystemMetadataApi.md#updateadminonboarding) | **POST** /system-metadata/admin-onboarding | Update admin onboarding
*TagsApi* | [**bulkTagAssets**](doc//TagsApi.md#bulktagassets) | **PUT** /tags/assets | Tag assets
*TagsApi* | [**createTag**](doc//TagsApi.md#createtag) | **POST** /tags | Create a tag
*TagsApi* | [**deleteTag**](doc//TagsApi.md#deletetag) | **DELETE** /tags/{id} | Delete a tag
*TagsApi* | [**getAllTags**](doc//TagsApi.md#getalltags) | **GET** /tags | Retrieve tags
*TagsApi* | [**getTagById**](doc//TagsApi.md#gettagbyid) | **GET** /tags/{id} | Retrieve a tag
*TagsApi* | [**tagAssets**](doc//TagsApi.md#tagassets) | **PUT** /tags/{id}/assets | Tag assets
*TagsApi* | [**untagAssets**](doc//TagsApi.md#untagassets) | **DELETE** /tags/{id}/assets | Untag assets
*TagsApi* | [**updateTag**](doc//TagsApi.md#updatetag) | **PUT** /tags/{id} | Update a tag
*TagsApi* | [**upsertTags**](doc//TagsApi.md#upserttags) | **PUT** /tags | Upsert tags
*TimelineApi* | [**getTimeBucket**](doc//TimelineApi.md#gettimebucket) | **GET** /timeline/bucket | Get time bucket
*TimelineApi* | [**getTimeBuckets**](doc//TimelineApi.md#gettimebuckets) | **GET** /timeline/buckets | Get time buckets
*TrashApi* | [**emptyTrash**](doc//TrashApi.md#emptytrash) | **POST** /trash/empty | Empty trash
*TrashApi* | [**restoreAssets**](doc//TrashApi.md#restoreassets) | **POST** /trash/restore/assets | Restore assets
*TrashApi* | [**restoreTrash**](doc//TrashApi.md#restoretrash) | **POST** /trash/restore | Restore trash
*UsersApi* | [**createProfileImage**](doc//UsersApi.md#createprofileimage) | **POST** /users/profile-image | Create user profile image
*UsersApi* | [**deleteProfileImage**](doc//UsersApi.md#deleteprofileimage) | **DELETE** /users/profile-image | Delete user profile image
*UsersApi* | [**deleteUserLicense**](doc//UsersApi.md#deleteuserlicense) | **DELETE** /users/me/license | Delete user product key
*UsersApi* | [**deleteUserOnboarding**](doc//UsersApi.md#deleteuseronboarding) | **DELETE** /users/me/onboarding | Delete user onboarding
*UsersApi* | [**getMyPreferences**](doc//UsersApi.md#getmypreferences) | **GET** /users/me/preferences | Get my preferences
*UsersApi* | [**getMyUser**](doc//UsersApi.md#getmyuser) | **GET** /users/me | Get current user
*UsersApi* | [**getProfileImage**](doc//UsersApi.md#getprofileimage) | **GET** /users/{id}/profile-image | Retrieve user profile image
*UsersApi* | [**getUser**](doc//UsersApi.md#getuser) | **GET** /users/{id} | Retrieve a user
*UsersApi* | [**getUserLicense**](doc//UsersApi.md#getuserlicense) | **GET** /users/me/license | Retrieve user product key
*UsersApi* | [**getUserOnboarding**](doc//UsersApi.md#getuseronboarding) | **GET** /users/me/onboarding | Retrieve user onboarding
*UsersApi* | [**searchUsers**](doc//UsersApi.md#searchusers) | **GET** /users | Get all users
*UsersApi* | [**setUserLicense**](doc//UsersApi.md#setuserlicense) | **PUT** /users/me/license | Set user product key
*UsersApi* | [**setUserOnboarding**](doc//UsersApi.md#setuseronboarding) | **PUT** /users/me/onboarding | Update user onboarding
*UsersApi* | [**updateMyPreferences**](doc//UsersApi.md#updatemypreferences) | **PUT** /users/me/preferences | Update my preferences
*UsersApi* | [**updateMyUser**](doc//UsersApi.md#updatemyuser) | **PUT** /users/me | Update current user
*UsersAdminApi* | [**createUserAdmin**](doc//UsersAdminApi.md#createuseradmin) | **POST** /admin/users | Create a user
*UsersAdminApi* | [**deleteUserAdmin**](doc//UsersAdminApi.md#deleteuseradmin) | **DELETE** /admin/users/{id} | Delete a user
*UsersAdminApi* | [**getUserAdmin**](doc//UsersAdminApi.md#getuseradmin) | **GET** /admin/users/{id} | Retrieve a user
*UsersAdminApi* | [**getUserPreferencesAdmin**](doc//UsersAdminApi.md#getuserpreferencesadmin) | **GET** /admin/users/{id}/preferences | Retrieve user preferences
*UsersAdminApi* | [**getUserSessionsAdmin**](doc//UsersAdminApi.md#getusersessionsadmin) | **GET** /admin/users/{id}/sessions | Retrieve user sessions
*UsersAdminApi* | [**getUserStatisticsAdmin**](doc//UsersAdminApi.md#getuserstatisticsadmin) | **GET** /admin/users/{id}/statistics | Retrieve user statistics
*UsersAdminApi* | [**restoreUserAdmin**](doc//UsersAdminApi.md#restoreuseradmin) | **POST** /admin/users/{id}/restore | Restore a deleted user
*UsersAdminApi* | [**searchUsersAdmin**](doc//UsersAdminApi.md#searchusersadmin) | **GET** /admin/users | Search users
*UsersAdminApi* | [**updateUserAdmin**](doc//UsersAdminApi.md#updateuseradmin) | **PUT** /admin/users/{id} | Update a user
*UsersAdminApi* | [**updateUserPreferencesAdmin**](doc//UsersAdminApi.md#updateuserpreferencesadmin) | **PUT** /admin/users/{id}/preferences | Update user preferences
*ViewsApi* | [**getAssetsByOriginalPath**](doc//ViewsApi.md#getassetsbyoriginalpath) | **GET** /view/folder | Retrieve assets by original path
*ViewsApi* | [**getUniqueOriginalPaths**](doc//ViewsApi.md#getuniqueoriginalpaths) | **GET** /view/folder/unique-paths | Retrieve unique paths
*WorkflowsApi* | [**createWorkflow**](doc//WorkflowsApi.md#createworkflow) | **POST** /workflows | Create a workflow
*WorkflowsApi* | [**deleteWorkflow**](doc//WorkflowsApi.md#deleteworkflow) | **DELETE** /workflows/{id} | Delete a workflow
*WorkflowsApi* | [**getWorkflow**](doc//WorkflowsApi.md#getworkflow) | **GET** /workflows/{id} | Retrieve a workflow
*WorkflowsApi* | [**getWorkflowForShare**](doc//WorkflowsApi.md#getworkflowforshare) | **GET** /workflows/{id}/share | Retrieve a workflow
*WorkflowsApi* | [**getWorkflowTriggers**](doc//WorkflowsApi.md#getworkflowtriggers) | **GET** /workflows/triggers | List all workflow triggers
*WorkflowsApi* | [**searchWorkflows**](doc//WorkflowsApi.md#searchworkflows) | **GET** /workflows | List all workflows
*WorkflowsApi* | [**updateWorkflow**](doc//WorkflowsApi.md#updateworkflow) | **PUT** /workflows/{id} | Update a workflow
## Documentation For Models
- [ActivityCreateDto](doc//ActivityCreateDto.md)
- [ActivityResponseDto](doc//ActivityResponseDto.md)
- [ActivityStatisticsResponseDto](doc//ActivityStatisticsResponseDto.md)
- [AddUsersDto](doc//AddUsersDto.md)
- [AdminOnboardingUpdateDto](doc//AdminOnboardingUpdateDto.md)
- [AlbumResponseDto](doc//AlbumResponseDto.md)
- [AlbumStatisticsResponseDto](doc//AlbumStatisticsResponseDto.md)
- [AlbumUserAddDto](doc//AlbumUserAddDto.md)
- [AlbumUserCreateDto](doc//AlbumUserCreateDto.md)
- [AlbumUserResponseDto](doc//AlbumUserResponseDto.md)
- [AlbumUserRole](doc//AlbumUserRole.md)
- [AlbumsAddAssetsDto](doc//AlbumsAddAssetsDto.md)
- [AlbumsAddAssetsResponseDto](doc//AlbumsAddAssetsResponseDto.md)
- [AlbumsResponse](doc//AlbumsResponse.md)
- [AlbumsUpdate](doc//AlbumsUpdate.md)
- [ApiKeyCreateDto](doc//ApiKeyCreateDto.md)
- [ApiKeyCreateResponseDto](doc//ApiKeyCreateResponseDto.md)
- [ApiKeyResponseDto](doc//ApiKeyResponseDto.md)
- [ApiKeyUpdateDto](doc//ApiKeyUpdateDto.md)
- [AssetBulkDeleteDto](doc//AssetBulkDeleteDto.md)
- [AssetBulkUpdateDto](doc//AssetBulkUpdateDto.md)
- [AssetBulkUploadCheckDto](doc//AssetBulkUploadCheckDto.md)
- [AssetBulkUploadCheckItem](doc//AssetBulkUploadCheckItem.md)
- [AssetBulkUploadCheckResponseDto](doc//AssetBulkUploadCheckResponseDto.md)
- [AssetBulkUploadCheckResult](doc//AssetBulkUploadCheckResult.md)
- [AssetCopyDto](doc//AssetCopyDto.md)
- [AssetEditAction](doc//AssetEditAction.md)
- [AssetEditActionItemDto](doc//AssetEditActionItemDto.md)
- [AssetEditActionItemDtoParameters](doc//AssetEditActionItemDtoParameters.md)
- [AssetEditActionItemResponseDto](doc//AssetEditActionItemResponseDto.md)
- [AssetEditsCreateDto](doc//AssetEditsCreateDto.md)
- [AssetEditsResponseDto](doc//AssetEditsResponseDto.md)
- [AssetFaceCreateDto](doc//AssetFaceCreateDto.md)
- [AssetFaceDeleteDto](doc//AssetFaceDeleteDto.md)
- [AssetFaceResponseDto](doc//AssetFaceResponseDto.md)
- [AssetFaceUpdateDto](doc//AssetFaceUpdateDto.md)
- [AssetFaceUpdateItem](doc//AssetFaceUpdateItem.md)
- [AssetIdErrorReason](doc//AssetIdErrorReason.md)
- [AssetIdsDto](doc//AssetIdsDto.md)
- [AssetIdsResponseDto](doc//AssetIdsResponseDto.md)
- [AssetJobName](doc//AssetJobName.md)
- [AssetJobsDto](doc//AssetJobsDto.md)
- [AssetMediaResponseDto](doc//AssetMediaResponseDto.md)
- [AssetMediaSize](doc//AssetMediaSize.md)
- [AssetMediaStatus](doc//AssetMediaStatus.md)
- [AssetMetadataBulkDeleteDto](doc//AssetMetadataBulkDeleteDto.md)
- [AssetMetadataBulkDeleteItemDto](doc//AssetMetadataBulkDeleteItemDto.md)
- [AssetMetadataBulkResponseDto](doc//AssetMetadataBulkResponseDto.md)
- [AssetMetadataBulkUpsertDto](doc//AssetMetadataBulkUpsertDto.md)
- [AssetMetadataBulkUpsertItemDto](doc//AssetMetadataBulkUpsertItemDto.md)
- [AssetMetadataResponseDto](doc//AssetMetadataResponseDto.md)
- [AssetMetadataUpsertDto](doc//AssetMetadataUpsertDto.md)
- [AssetMetadataUpsertItemDto](doc//AssetMetadataUpsertItemDto.md)
- [AssetOcrResponseDto](doc//AssetOcrResponseDto.md)
- [AssetOrder](doc//AssetOrder.md)
- [AssetOrderBy](doc//AssetOrderBy.md)
- [AssetRejectReason](doc//AssetRejectReason.md)
- [AssetResponseDto](doc//AssetResponseDto.md)
- [AssetStackResponseDto](doc//AssetStackResponseDto.md)
- [AssetStatsResponseDto](doc//AssetStatsResponseDto.md)
- [AssetTypeEnum](doc//AssetTypeEnum.md)
- [AssetUploadAction](doc//AssetUploadAction.md)
- [AssetVisibility](doc//AssetVisibility.md)
- [AudioCodec](doc//AudioCodec.md)
- [AuthStatusResponseDto](doc//AuthStatusResponseDto.md)
- [AvatarUpdate](doc//AvatarUpdate.md)
- [BulkIdErrorReason](doc//BulkIdErrorReason.md)
- [BulkIdResponseDto](doc//BulkIdResponseDto.md)
- [BulkIdsDto](doc//BulkIdsDto.md)
- [CLIPConfig](doc//CLIPConfig.md)
- [CQMode](doc//CQMode.md)
- [CastResponse](doc//CastResponse.md)
- [CastUpdate](doc//CastUpdate.md)
- [ChangePasswordDto](doc//ChangePasswordDto.md)
- [Colorspace](doc//Colorspace.md)
- [ContributorCountResponseDto](doc//ContributorCountResponseDto.md)
- [CreateAlbumDto](doc//CreateAlbumDto.md)
- [CreateLibraryDto](doc//CreateLibraryDto.md)
- [CreateProfileImageResponseDto](doc//CreateProfileImageResponseDto.md)
- [CropParameters](doc//CropParameters.md)
- [DatabaseBackupConfig](doc//DatabaseBackupConfig.md)
- [DatabaseBackupDeleteDto](doc//DatabaseBackupDeleteDto.md)
- [DatabaseBackupDto](doc//DatabaseBackupDto.md)
- [DatabaseBackupListResponseDto](doc//DatabaseBackupListResponseDto.md)
- [DownloadArchiveDto](doc//DownloadArchiveDto.md)
- [DownloadArchiveInfo](doc//DownloadArchiveInfo.md)
- [DownloadInfoDto](doc//DownloadInfoDto.md)
- [DownloadResponse](doc//DownloadResponse.md)
- [DownloadResponseDto](doc//DownloadResponseDto.md)
- [DownloadUpdate](doc//DownloadUpdate.md)
- [DuplicateDetectionConfig](doc//DuplicateDetectionConfig.md)
- [DuplicateResolveDto](doc//DuplicateResolveDto.md)
- [DuplicateResolveGroupDto](doc//DuplicateResolveGroupDto.md)
- [DuplicateResponseDto](doc//DuplicateResponseDto.md)
- [EmailNotificationsResponse](doc//EmailNotificationsResponse.md)
- [EmailNotificationsUpdate](doc//EmailNotificationsUpdate.md)
- [ExifResponseDto](doc//ExifResponseDto.md)
- [FaceDto](doc//FaceDto.md)
- [FacialRecognitionConfig](doc//FacialRecognitionConfig.md)
- [FoldersResponse](doc//FoldersResponse.md)
- [FoldersUpdate](doc//FoldersUpdate.md)
- [ImageFormat](doc//ImageFormat.md)
- [JobCreateDto](doc//JobCreateDto.md)
- [JobName](doc//JobName.md)
- [JobSettingsDto](doc//JobSettingsDto.md)
- [LibraryResponseDto](doc//LibraryResponseDto.md)
- [LibraryStatsResponseDto](doc//LibraryStatsResponseDto.md)
- [LicenseKeyDto](doc//LicenseKeyDto.md)
- [LogLevel](doc//LogLevel.md)
- [LoginCredentialDto](doc//LoginCredentialDto.md)
- [LoginResponseDto](doc//LoginResponseDto.md)
- [LogoutResponseDto](doc//LogoutResponseDto.md)
- [MachineLearningAvailabilityChecksDto](doc//MachineLearningAvailabilityChecksDto.md)
- [MaintenanceAction](doc//MaintenanceAction.md)
- [MaintenanceAuthDto](doc//MaintenanceAuthDto.md)
- [MaintenanceDetectInstallResponseDto](doc//MaintenanceDetectInstallResponseDto.md)
- [MaintenanceDetectInstallStorageFolderDto](doc//MaintenanceDetectInstallStorageFolderDto.md)
- [MaintenanceLoginDto](doc//MaintenanceLoginDto.md)
- [MaintenanceStatusResponseDto](doc//MaintenanceStatusResponseDto.md)
- [ManualJobName](doc//ManualJobName.md)
- [MapMarkerResponseDto](doc//MapMarkerResponseDto.md)
- [MapReverseGeocodeResponseDto](doc//MapReverseGeocodeResponseDto.md)
- [MemoriesResponse](doc//MemoriesResponse.md)
- [MemoriesUpdate](doc//MemoriesUpdate.md)
- [MemoryCreateDto](doc//MemoryCreateDto.md)
- [MemoryResponseDto](doc//MemoryResponseDto.md)
- [MemorySearchOrder](doc//MemorySearchOrder.md)
- [MemoryStatisticsResponseDto](doc//MemoryStatisticsResponseDto.md)
- [MemoryType](doc//MemoryType.md)
- [MemoryUpdateDto](doc//MemoryUpdateDto.md)
- [MergePersonDto](doc//MergePersonDto.md)
- [MetadataSearchDto](doc//MetadataSearchDto.md)
- [MirrorAxis](doc//MirrorAxis.md)
- [MirrorParameters](doc//MirrorParameters.md)
- [NotificationCreateDto](doc//NotificationCreateDto.md)
- [NotificationDeleteAllDto](doc//NotificationDeleteAllDto.md)
- [NotificationDto](doc//NotificationDto.md)
- [NotificationLevel](doc//NotificationLevel.md)
- [NotificationType](doc//NotificationType.md)
- [NotificationUpdateAllDto](doc//NotificationUpdateAllDto.md)
- [NotificationUpdateDto](doc//NotificationUpdateDto.md)
- [OAuthAuthorizeResponseDto](doc//OAuthAuthorizeResponseDto.md)
- [OAuthCallbackDto](doc//OAuthCallbackDto.md)
- [OAuthConfigDto](doc//OAuthConfigDto.md)
- [OAuthTokenEndpointAuthMethod](doc//OAuthTokenEndpointAuthMethod.md)
- [OcrConfig](doc//OcrConfig.md)
- [OnThisDayDto](doc//OnThisDayDto.md)
- [OnboardingDto](doc//OnboardingDto.md)
- [OnboardingResponseDto](doc//OnboardingResponseDto.md)
- [PartnerCreateDto](doc//PartnerCreateDto.md)
- [PartnerDirection](doc//PartnerDirection.md)
- [PartnerResponseDto](doc//PartnerResponseDto.md)
- [PartnerUpdateDto](doc//PartnerUpdateDto.md)
- [PeopleResponse](doc//PeopleResponse.md)
- [PeopleResponseDto](doc//PeopleResponseDto.md)
- [PeopleUpdate](doc//PeopleUpdate.md)
- [PeopleUpdateDto](doc//PeopleUpdateDto.md)
- [PeopleUpdateItem](doc//PeopleUpdateItem.md)
- [Permission](doc//Permission.md)
- [PersonCreateDto](doc//PersonCreateDto.md)
- [PersonResponseDto](doc//PersonResponseDto.md)
- [PersonStatisticsResponseDto](doc//PersonStatisticsResponseDto.md)
- [PersonUpdateDto](doc//PersonUpdateDto.md)
- [PinCodeChangeDto](doc//PinCodeChangeDto.md)
- [PinCodeResetDto](doc//PinCodeResetDto.md)
- [PinCodeSetupDto](doc//PinCodeSetupDto.md)
- [PlacesResponseDto](doc//PlacesResponseDto.md)
- [PluginMethodResponseDto](doc//PluginMethodResponseDto.md)
- [PluginResponseDto](doc//PluginResponseDto.md)
- [PluginTemplateResponseDto](doc//PluginTemplateResponseDto.md)
- [PluginTemplateStepResponseDto](doc//PluginTemplateStepResponseDto.md)
- [PurchaseResponse](doc//PurchaseResponse.md)
- [PurchaseUpdate](doc//PurchaseUpdate.md)
- [QueueCommand](doc//QueueCommand.md)
- [QueueCommandDto](doc//QueueCommandDto.md)
- [QueueDeleteDto](doc//QueueDeleteDto.md)
- [QueueJobResponseDto](doc//QueueJobResponseDto.md)
- [QueueJobStatus](doc//QueueJobStatus.md)
- [QueueName](doc//QueueName.md)
- [QueueResponseDto](doc//QueueResponseDto.md)
- [QueueResponseLegacyDto](doc//QueueResponseLegacyDto.md)
- [QueueStatisticsDto](doc//QueueStatisticsDto.md)
- [QueueStatusLegacyDto](doc//QueueStatusLegacyDto.md)
- [QueueUpdateDto](doc//QueueUpdateDto.md)
- [QueuesResponseLegacyDto](doc//QueuesResponseLegacyDto.md)
- [RandomSearchDto](doc//RandomSearchDto.md)
- [RatingsResponse](doc//RatingsResponse.md)
- [RatingsUpdate](doc//RatingsUpdate.md)
- [ReactionLevel](doc//ReactionLevel.md)
- [ReactionType](doc//ReactionType.md)
- [ReverseGeocodingStateResponseDto](doc//ReverseGeocodingStateResponseDto.md)
- [RotateParameters](doc//RotateParameters.md)
- [SearchAlbumResponseDto](doc//SearchAlbumResponseDto.md)
- [SearchAssetResponseDto](doc//SearchAssetResponseDto.md)
- [SearchExploreItem](doc//SearchExploreItem.md)
- [SearchExploreResponseDto](doc//SearchExploreResponseDto.md)
- [SearchFacetCountResponseDto](doc//SearchFacetCountResponseDto.md)
- [SearchFacetResponseDto](doc//SearchFacetResponseDto.md)
- [SearchResponseDto](doc//SearchResponseDto.md)
- [SearchStatisticsResponseDto](doc//SearchStatisticsResponseDto.md)
- [SearchSuggestionType](doc//SearchSuggestionType.md)
- [ServerAboutResponseDto](doc//ServerAboutResponseDto.md)
- [ServerApkLinksDto](doc//ServerApkLinksDto.md)
- [ServerConfigDto](doc//ServerConfigDto.md)
- [ServerFeaturesDto](doc//ServerFeaturesDto.md)
- [ServerMediaTypesResponseDto](doc//ServerMediaTypesResponseDto.md)
- [ServerPingResponse](doc//ServerPingResponse.md)
- [ServerStatsResponseDto](doc//ServerStatsResponseDto.md)
- [ServerStorageResponseDto](doc//ServerStorageResponseDto.md)
- [ServerVersionHistoryResponseDto](doc//ServerVersionHistoryResponseDto.md)
- [ServerVersionResponseDto](doc//ServerVersionResponseDto.md)
- [SessionCreateDto](doc//SessionCreateDto.md)
- [SessionCreateResponseDto](doc//SessionCreateResponseDto.md)
- [SessionResponseDto](doc//SessionResponseDto.md)
- [SessionUnlockDto](doc//SessionUnlockDto.md)
- [SessionUpdateDto](doc//SessionUpdateDto.md)
- [SetMaintenanceModeDto](doc//SetMaintenanceModeDto.md)
- [SharedLinkCreateDto](doc//SharedLinkCreateDto.md)
- [SharedLinkEditDto](doc//SharedLinkEditDto.md)
- [SharedLinkLoginDto](doc//SharedLinkLoginDto.md)
- [SharedLinkResponseDto](doc//SharedLinkResponseDto.md)
- [SharedLinkType](doc//SharedLinkType.md)
- [SharedLinksResponse](doc//SharedLinksResponse.md)
- [SharedLinksUpdate](doc//SharedLinksUpdate.md)
- [SignUpDto](doc//SignUpDto.md)
- [SmartSearchDto](doc//SmartSearchDto.md)
- [SourceType](doc//SourceType.md)
- [StackCreateDto](doc//StackCreateDto.md)
- [StackResponseDto](doc//StackResponseDto.md)
- [StackUpdateDto](doc//StackUpdateDto.md)
- [StatisticsSearchDto](doc//StatisticsSearchDto.md)
- [StorageFolder](doc//StorageFolder.md)
- [SyncAckDeleteDto](doc//SyncAckDeleteDto.md)
- [SyncAckDto](doc//SyncAckDto.md)
- [SyncAckSetDto](doc//SyncAckSetDto.md)
- [SyncAlbumDeleteV1](doc//SyncAlbumDeleteV1.md)
- [SyncAlbumToAssetDeleteV1](doc//SyncAlbumToAssetDeleteV1.md)
- [SyncAlbumToAssetV1](doc//SyncAlbumToAssetV1.md)
- [SyncAlbumUserDeleteV1](doc//SyncAlbumUserDeleteV1.md)
- [SyncAlbumUserV1](doc//SyncAlbumUserV1.md)
- [SyncAlbumV1](doc//SyncAlbumV1.md)
- [SyncAlbumV2](doc//SyncAlbumV2.md)
- [SyncAssetDeleteV1](doc//SyncAssetDeleteV1.md)
- [SyncAssetEditDeleteV1](doc//SyncAssetEditDeleteV1.md)
- [SyncAssetEditV1](doc//SyncAssetEditV1.md)
- [SyncAssetExifV1](doc//SyncAssetExifV1.md)
- [SyncAssetFaceDeleteV1](doc//SyncAssetFaceDeleteV1.md)
- [SyncAssetFaceV1](doc//SyncAssetFaceV1.md)
- [SyncAssetFaceV2](doc//SyncAssetFaceV2.md)
- [SyncAssetMetadataDeleteV1](doc//SyncAssetMetadataDeleteV1.md)
- [SyncAssetMetadataV1](doc//SyncAssetMetadataV1.md)
- [SyncAssetV1](doc//SyncAssetV1.md)
- [SyncAssetV2](doc//SyncAssetV2.md)
- [SyncAuthUserV1](doc//SyncAuthUserV1.md)
- [SyncEntityType](doc//SyncEntityType.md)
- [SyncMemoryAssetDeleteV1](doc//SyncMemoryAssetDeleteV1.md)
- [SyncMemoryAssetV1](doc//SyncMemoryAssetV1.md)
- [SyncMemoryDeleteV1](doc//SyncMemoryDeleteV1.md)
- [SyncMemoryV1](doc//SyncMemoryV1.md)
- [SyncPartnerDeleteV1](doc//SyncPartnerDeleteV1.md)
- [SyncPartnerV1](doc//SyncPartnerV1.md)
- [SyncPersonDeleteV1](doc//SyncPersonDeleteV1.md)
- [SyncPersonV1](doc//SyncPersonV1.md)
- [SyncRequestType](doc//SyncRequestType.md)
- [SyncStackDeleteV1](doc//SyncStackDeleteV1.md)
- [SyncStackV1](doc//SyncStackV1.md)
- [SyncStreamDto](doc//SyncStreamDto.md)
- [SyncUserDeleteV1](doc//SyncUserDeleteV1.md)
- [SyncUserMetadataDeleteV1](doc//SyncUserMetadataDeleteV1.md)
- [SyncUserMetadataV1](doc//SyncUserMetadataV1.md)
- [SyncUserV1](doc//SyncUserV1.md)
- [SystemConfigBackupsDto](doc//SystemConfigBackupsDto.md)
- [SystemConfigDto](doc//SystemConfigDto.md)
- [SystemConfigFFmpegDto](doc//SystemConfigFFmpegDto.md)
- [SystemConfigFacesDto](doc//SystemConfigFacesDto.md)
- [SystemConfigGeneratedFullsizeImageDto](doc//SystemConfigGeneratedFullsizeImageDto.md)
- [SystemConfigGeneratedImageDto](doc//SystemConfigGeneratedImageDto.md)
- [SystemConfigImageDto](doc//SystemConfigImageDto.md)
- [SystemConfigJobDto](doc//SystemConfigJobDto.md)
- [SystemConfigLibraryDto](doc//SystemConfigLibraryDto.md)
- [SystemConfigLibraryScanDto](doc//SystemConfigLibraryScanDto.md)
- [SystemConfigLibraryWatchDto](doc//SystemConfigLibraryWatchDto.md)
- [SystemConfigLoggingDto](doc//SystemConfigLoggingDto.md)
- [SystemConfigMachineLearningDto](doc//SystemConfigMachineLearningDto.md)
- [SystemConfigMapDto](doc//SystemConfigMapDto.md)
- [SystemConfigMetadataDto](doc//SystemConfigMetadataDto.md)
- [SystemConfigNewVersionCheckDto](doc//SystemConfigNewVersionCheckDto.md)
- [SystemConfigNightlyTasksDto](doc//SystemConfigNightlyTasksDto.md)
- [SystemConfigNotificationsDto](doc//SystemConfigNotificationsDto.md)
- [SystemConfigOAuthDto](doc//SystemConfigOAuthDto.md)
- [SystemConfigPasswordLoginDto](doc//SystemConfigPasswordLoginDto.md)
- [SystemConfigReverseGeocodingDto](doc//SystemConfigReverseGeocodingDto.md)
- [SystemConfigServerDto](doc//SystemConfigServerDto.md)
- [SystemConfigSmtpDto](doc//SystemConfigSmtpDto.md)
- [SystemConfigSmtpTransportDto](doc//SystemConfigSmtpTransportDto.md)
- [SystemConfigStorageTemplateDto](doc//SystemConfigStorageTemplateDto.md)
- [SystemConfigTemplateEmailsDto](doc//SystemConfigTemplateEmailsDto.md)
- [SystemConfigTemplateStorageOptionDto](doc//SystemConfigTemplateStorageOptionDto.md)
- [SystemConfigTemplatesDto](doc//SystemConfigTemplatesDto.md)
- [SystemConfigThemeDto](doc//SystemConfigThemeDto.md)
- [SystemConfigTrashDto](doc//SystemConfigTrashDto.md)
- [SystemConfigUserDto](doc//SystemConfigUserDto.md)
- [TagBulkAssetsDto](doc//TagBulkAssetsDto.md)
- [TagBulkAssetsResponseDto](doc//TagBulkAssetsResponseDto.md)
- [TagCreateDto](doc//TagCreateDto.md)
- [TagResponseDto](doc//TagResponseDto.md)
- [TagUpdateDto](doc//TagUpdateDto.md)
- [TagUpsertDto](doc//TagUpsertDto.md)
- [TagsResponse](doc//TagsResponse.md)
- [TagsUpdate](doc//TagsUpdate.md)
- [TemplateDto](doc//TemplateDto.md)
- [TemplateResponseDto](doc//TemplateResponseDto.md)
- [TestEmailResponseDto](doc//TestEmailResponseDto.md)
- [TimeBucketAssetResponseDto](doc//TimeBucketAssetResponseDto.md)
- [TimeBucketsResponseDto](doc//TimeBucketsResponseDto.md)
- [ToneMapping](doc//ToneMapping.md)
- [TranscodeHWAccel](doc//TranscodeHWAccel.md)
- [TranscodePolicy](doc//TranscodePolicy.md)
- [TrashResponseDto](doc//TrashResponseDto.md)
- [UpdateAlbumDto](doc//UpdateAlbumDto.md)
- [UpdateAlbumUserDto](doc//UpdateAlbumUserDto.md)
- [UpdateAssetDto](doc//UpdateAssetDto.md)
- [UpdateLibraryDto](doc//UpdateLibraryDto.md)
- [UsageByUserDto](doc//UsageByUserDto.md)
- [UserAdminCreateDto](doc//UserAdminCreateDto.md)
- [UserAdminDeleteDto](doc//UserAdminDeleteDto.md)
- [UserAdminResponseDto](doc//UserAdminResponseDto.md)
- [UserAdminUpdateDto](doc//UserAdminUpdateDto.md)
- [UserAvatarColor](doc//UserAvatarColor.md)
- [UserLicense](doc//UserLicense.md)
- [UserMetadataKey](doc//UserMetadataKey.md)
- [UserPreferencesResponseDto](doc//UserPreferencesResponseDto.md)
- [UserPreferencesUpdateDto](doc//UserPreferencesUpdateDto.md)
- [UserResponseDto](doc//UserResponseDto.md)
- [UserStatus](doc//UserStatus.md)
- [UserUpdateMeDto](doc//UserUpdateMeDto.md)
- [ValidateAccessTokenResponseDto](doc//ValidateAccessTokenResponseDto.md)
- [ValidateLibraryDto](doc//ValidateLibraryDto.md)
- [ValidateLibraryImportPathResponseDto](doc//ValidateLibraryImportPathResponseDto.md)
- [ValidateLibraryResponseDto](doc//ValidateLibraryResponseDto.md)
- [VersionCheckStateResponseDto](doc//VersionCheckStateResponseDto.md)
- [VideoCodec](doc//VideoCodec.md)
- [VideoContainer](doc//VideoContainer.md)
- [WorkflowCreateDto](doc//WorkflowCreateDto.md)
- [WorkflowResponseDto](doc//WorkflowResponseDto.md)
- [WorkflowShareResponseDto](doc//WorkflowShareResponseDto.md)
- [WorkflowShareStepDto](doc//WorkflowShareStepDto.md)
- [WorkflowStepDto](doc//WorkflowStepDto.md)
- [WorkflowTrigger](doc//WorkflowTrigger.md)
- [WorkflowTriggerResponseDto](doc//WorkflowTriggerResponseDto.md)
- [WorkflowType](doc//WorkflowType.md)
- [WorkflowUpdateDto](doc//WorkflowUpdateDto.md)
## Documentation For Authorization
Authentication schemes defined for the API:
### bearer
- **Type**: HTTP Bearer authentication
### cookie
- **Type**: API key
- **API key parameter name**: immich_access_token
- **Location**:
### api_key
- **Type**: API key
- **API key parameter name**: x-api-key
- **Location**: HTTP header
## Author
-57
View File
@@ -1,57 +0,0 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
+57 -66
View File
@@ -1,8 +1,5 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
@@ -13,61 +10,23 @@ library openapi.api;
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart';
import 'package:immich_mobile/utils/openapi_patching.dart';
import 'package:http/http.dart';
import 'package:intl/intl.dart';
import 'package:meta/meta.dart';
part 'api_client.dart';
part 'api_helper.dart';
part 'api_compat.dart';
part 'api_exception.dart';
part 'auth/authentication.dart';
part 'api_helper.dart';
part 'api_state.dart';
part 'api_version.dart';
part 'optional.dart';
part 'auth/api_key_auth.dart';
part 'auth/oauth.dart';
part 'auth/http_basic_auth.dart';
part 'auth/authentication.dart';
part 'auth/http_bearer_auth.dart';
part 'api/api_keys_api.dart';
part 'api/activities_api.dart';
part 'api/albums_api.dart';
part 'api/assets_api.dart';
part 'api/authentication_api.dart';
part 'api/authentication_admin_api.dart';
part 'api/database_backups_admin_api.dart';
part 'api/deprecated_api.dart';
part 'api/download_api.dart';
part 'api/duplicates_api.dart';
part 'api/faces_api.dart';
part 'api/jobs_api.dart';
part 'api/libraries_api.dart';
part 'api/maintenance_admin_api.dart';
part 'api/map_api.dart';
part 'api/memories_api.dart';
part 'api/notifications_api.dart';
part 'api/notifications_admin_api.dart';
part 'api/partners_api.dart';
part 'api/people_api.dart';
part 'api/plugins_api.dart';
part 'api/queues_api.dart';
part 'api/search_api.dart';
part 'api/server_api.dart';
part 'api/sessions_api.dart';
part 'api/shared_links_api.dart';
part 'api/stacks_api.dart';
part 'api/sync_api.dart';
part 'api/system_config_api.dart';
part 'api/system_metadata_api.dart';
part 'api/tags_api.dart';
part 'api/timeline_api.dart';
part 'api/trash_api.dart';
part 'api/users_api.dart';
part 'api/users_admin_api.dart';
part 'api/views_api.dart';
part 'api/workflows_api.dart';
part 'auth/oauth.dart';
part 'model/activity_create_dto.dart';
part 'model/activity_response_dto.dart';
part 'model/activity_statistics_response_dto.dart';
@@ -96,7 +55,6 @@ part 'model/asset_bulk_upload_check_result.dart';
part 'model/asset_copy_dto.dart';
part 'model/asset_edit_action.dart';
part 'model/asset_edit_action_item_dto.dart';
part 'model/asset_edit_action_item_dto_parameters.dart';
part 'model/asset_edit_action_item_response_dto.dart';
part 'model/asset_edits_create_dto.dart';
part 'model/asset_edits_response_dto.dart';
@@ -110,6 +68,7 @@ part 'model/asset_ids_dto.dart';
part 'model/asset_ids_response_dto.dart';
part 'model/asset_job_name.dart';
part 'model/asset_jobs_dto.dart';
part 'model/asset_media_create_dto.dart';
part 'model/asset_media_response_dto.dart';
part 'model/asset_media_size.dart';
part 'model/asset_media_status.dart';
@@ -137,21 +96,23 @@ part 'model/avatar_update.dart';
part 'model/bulk_id_error_reason.dart';
part 'model/bulk_id_response_dto.dart';
part 'model/bulk_ids_dto.dart';
part 'model/clip_config.dart';
part 'model/cq_mode.dart';
part 'model/cast_response.dart';
part 'model/cast_update.dart';
part 'model/change_password_dto.dart';
part 'model/clip_config.dart';
part 'model/colorspace.dart';
part 'model/contributor_count_response_dto.dart';
part 'model/cq_mode.dart';
part 'model/create_album_dto.dart';
part 'model/create_library_dto.dart';
part 'model/create_profile_image_dto.dart';
part 'model/create_profile_image_response_dto.dart';
part 'model/crop_parameters.dart';
part 'model/database_backup_config.dart';
part 'model/database_backup_delete_dto.dart';
part 'model/database_backup_dto.dart';
part 'model/database_backup_list_response_dto.dart';
part 'model/database_backup_upload_dto.dart';
part 'model/download_archive_dto.dart';
part 'model/download_archive_info.dart';
part 'model/download_info_dto.dart';
@@ -176,6 +137,7 @@ part 'model/job_settings_dto.dart';
part 'model/library_response_dto.dart';
part 'model/library_stats_response_dto.dart';
part 'model/license_key_dto.dart';
part 'model/license_response_dto.dart';
part 'model/log_level.dart';
part 'model/login_credential_dto.dart';
part 'model/login_response_dto.dart';
@@ -210,6 +172,7 @@ part 'model/notification_type.dart';
part 'model/notification_update_all_dto.dart';
part 'model/notification_update_dto.dart';
part 'model/o_auth_authorize_response_dto.dart';
part 'model/o_auth_backchannel_logout_dto.dart';
part 'model/o_auth_callback_dto.dart';
part 'model/o_auth_config_dto.dart';
part 'model/o_auth_token_endpoint_auth_method.dart';
@@ -303,6 +266,7 @@ part 'model/storage_folder.dart';
part 'model/sync_ack_delete_dto.dart';
part 'model/sync_ack_dto.dart';
part 'model/sync_ack_set_dto.dart';
part 'model/sync_ack_v1.dart';
part 'model/sync_album_delete_v1.dart';
part 'model/sync_album_to_asset_delete_v1.dart';
part 'model/sync_album_to_asset_v1.dart';
@@ -322,6 +286,7 @@ part 'model/sync_asset_metadata_v1.dart';
part 'model/sync_asset_v1.dart';
part 'model/sync_asset_v2.dart';
part 'model/sync_auth_user_v1.dart';
part 'model/sync_complete_v1.dart';
part 'model/sync_entity_type.dart';
part 'model/sync_memory_asset_delete_v1.dart';
part 'model/sync_memory_asset_v1.dart';
@@ -332,6 +297,7 @@ part 'model/sync_partner_v1.dart';
part 'model/sync_person_delete_v1.dart';
part 'model/sync_person_v1.dart';
part 'model/sync_request_type.dart';
part 'model/sync_reset_v1.dart';
part 'model/sync_stack_delete_v1.dart';
part 'model/sync_stack_v1.dart';
part 'model/sync_stream_dto.dart';
@@ -420,18 +386,43 @@ part 'model/workflow_trigger.dart';
part 'model/workflow_trigger_response_dto.dart';
part 'model/workflow_type.dart';
part 'model/workflow_update_dto.dart';
part 'api/activities_api.dart';
part 'api/albums_api.dart';
part 'api/api_keys_api.dart';
part 'api/assets_api.dart';
part 'api/authentication_admin_api.dart';
part 'api/authentication_api.dart';
part 'api/database_backups_admin_api.dart';
part 'api/download_api.dart';
part 'api/duplicates_api.dart';
part 'api/faces_api.dart';
part 'api/jobs_api.dart';
part 'api/libraries_api.dart';
part 'api/maintenance_admin_api.dart';
part 'api/map_api.dart';
part 'api/memories_api.dart';
part 'api/notifications_admin_api.dart';
part 'api/notifications_api.dart';
part 'api/partners_api.dart';
part 'api/people_api.dart';
part 'api/plugins_api.dart';
part 'api/queues_api.dart';
part 'api/search_api.dart';
part 'api/server_api.dart';
part 'api/sessions_api.dart';
part 'api/shared_links_api.dart';
part 'api/stacks_api.dart';
part 'api/sync_api.dart';
part 'api/system_config_api.dart';
part 'api/system_metadata_api.dart';
part 'api/tags_api.dart';
part 'api/timeline_api.dart';
part 'api/trash_api.dart';
part 'api/users_admin_api.dart';
part 'api/users_api.dart';
part 'api/views_api.dart';
part 'api/workflows_api.dart';
/// An [ApiClient] instance that uses the default values obtained from
/// the OpenAPI specification file.
var defaultApiClient = ApiClient();
const _delimiters = {'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};
const _dateEpochMarker = 'epoch';
const _deepEquality = DeepCollectionEquality();
final _dateFormatter = DateFormat('yyyy-MM-dd');
final _regList = RegExp(r'^List<(.*)>$');
final _regSet = RegExp(r'^Set<(.*)>$');
final _regMap = RegExp(r'^Map<String,(.*)>$');
bool _isEpochMarker(String? pattern) => pattern == _dateEpochMarker || pattern == '/$_dateEpochMarker/';
/// The process-wide default [ApiClient]; every `XxxApi()` uses it when
/// constructed without an explicit client.
final defaultApiClient = ApiClient();
+155 -180
View File
@@ -1,158 +1,52 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ActivitiesApi {
ActivitiesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Create an activity
///
/// Create a like or a comment for an album, or an asset in an album.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [ActivityCreateDto] activityCreateDto (required):
Future<Response> createActivityWithHttpInfo(ActivityCreateDto activityCreateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/activities';
static const ApiVersion getActivitiesAddedIn = .new(1, 0, 0);
// ignore: prefer_final_locals
Object? postBody = activityCreateDto;
static const ApiState getActivitiesState = .stable;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiVersion createActivityAddedIn = .new(1, 0, 0);
const contentTypes = <String>['application/json'];
static const ApiState createActivityState = .stable;
static const ApiVersion getActivityStatisticsAddedIn = .new(1, 0, 0);
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiState getActivityStatisticsState = .stable;
/// Create an activity
///
/// Create a like or a comment for an album, or an asset in an album.
///
/// Parameters:
///
/// * [ActivityCreateDto] activityCreateDto (required):
Future<ActivityResponseDto?> createActivity(ActivityCreateDto activityCreateDto,) async {
final response = await createActivityWithHttpInfo(activityCreateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ActivityResponseDto',) as ActivityResponseDto;
}
return null;
}
static const ApiVersion deleteActivityAddedIn = .new(1, 0, 0);
/// Delete an activity
///
/// Removes a like or comment from a given album or asset in an album.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteActivityWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/activities/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Delete an activity
///
/// Removes a like or comment from a given album or asset in an album.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteActivity(String id,) async {
final response = await deleteActivityWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
static const ApiState deleteActivityState = .stable;
/// List all activities
///
/// Returns a list of activities for the selected asset or album. The activities are returned in sorted order, with the oldest activities appearing first.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] albumId (required):
/// Album ID
///
/// * [String] assetId:
/// Asset ID (if activity is for an asset)
///
/// * [ReactionLevel] level:
///
/// * [ReactionType] type:
///
/// * [String] userId:
/// Filter by user ID
Future<Response> getActivitiesWithHttpInfo(String albumId, { String? assetId, ReactionLevel? level, ReactionType? type, String? userId, }) async {
// ignore: prefer_const_declarations
Future<Response> getActivitiesWithHttpInfo({
required String albumId,
String? assetId,
ReactionLevel? level,
ReactionType? type,
String? userId,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/activities';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'albumId', albumId));
queryParams.addAll(_queryParams('', 'albumId', albumId));
if (assetId != null) {
queryParams.addAll(_queryParams('', 'assetId', assetId));
}
@@ -168,15 +62,15 @@ class ActivitiesApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -184,78 +78,118 @@ class ActivitiesApi {
///
/// Returns a list of activities for the selected asset or album. The activities are returned in sorted order, with the oldest activities appearing first.
///
/// Parameters:
///
/// * [String] albumId (required):
/// Album ID
///
/// * [String] assetId:
/// Asset ID (if activity is for an asset)
///
/// * [ReactionLevel] level:
///
/// * [ReactionType] type:
///
/// * [String] userId:
/// Filter by user ID
Future<List<ActivityResponseDto>?> getActivities(String albumId, { String? assetId, ReactionLevel? level, ReactionType? type, String? userId, }) async {
final response = await getActivitiesWithHttpInfo(albumId, assetId: assetId, level: level, type: type, userId: userId, );
/// Available since server v1.0.0.
Future<List<ActivityResponseDto>> getActivities({
required String albumId,
String? assetId,
ReactionLevel? level,
ReactionType? type,
String? userId,
Future<void>? abortTrigger,
}) async {
final response = await getActivitiesWithHttpInfo(
albumId: albumId,
assetId: assetId,
level: level,
type: type,
userId: userId,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<ActivityResponseDto>') as List)
.cast<ActivityResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<ActivityResponseDto>') as List)
.cast<ActivityResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create an activity
///
/// Create a like or a comment for an album, or an asset in an album.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> createActivityWithHttpInfo(ActivityCreateDto activityCreateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/activities';
Object? postBody = activityCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Create an activity
///
/// Create a like or a comment for an album, or an asset in an album.
///
/// Available since server v1.0.0.
Future<ActivityResponseDto> createActivity(ActivityCreateDto activityCreateDto, {Future<void>? abortTrigger}) async {
final response = await createActivityWithHttpInfo(activityCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'ActivityResponseDto')
as ActivityResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve activity statistics
///
/// Returns the number of likes and comments for a given album or asset in an album.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] albumId (required):
/// Album ID
///
/// * [String] assetId:
/// Asset ID (if activity is for an asset)
Future<Response> getActivityStatisticsWithHttpInfo(String albumId, { String? assetId, }) async {
// ignore: prefer_const_declarations
Future<Response> getActivityStatisticsWithHttpInfo({
required String albumId,
String? assetId,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/activities/statistics';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'albumId', albumId));
queryParams.addAll(_queryParams('', 'albumId', albumId));
if (assetId != null) {
queryParams.addAll(_queryParams('', 'assetId', assetId));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -263,25 +197,66 @@ class ActivitiesApi {
///
/// Returns the number of likes and comments for a given album or asset in an album.
///
/// Parameters:
///
/// * [String] albumId (required):
/// Album ID
///
/// * [String] assetId:
/// Asset ID (if activity is for an asset)
Future<ActivityStatisticsResponseDto?> getActivityStatistics(String albumId, { String? assetId, }) async {
final response = await getActivityStatisticsWithHttpInfo(albumId, assetId: assetId, );
/// Available since server v1.0.0.
Future<ActivityStatisticsResponseDto> getActivityStatistics({
required String albumId,
String? assetId,
Future<void>? abortTrigger,
}) async {
final response = await getActivityStatisticsWithHttpInfo(
albumId: albumId,
assetId: assetId,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ActivityStatisticsResponseDto',) as ActivityStatisticsResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'ActivityStatisticsResponseDto')
as ActivityStatisticsResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Delete an activity
///
/// Removes a like or comment from a given album or asset in an album.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> deleteActivityWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/activities/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Delete an activity
///
/// Removes a like or comment from a given album or asset in an album.
///
/// Available since server v1.0.0.
Future<void> deleteActivity(String id, {Future<void>? abortTrigger}) async {
final response = await deleteActivityWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
return null;
}
}
+550 -625
View File
File diff suppressed because it is too large Load Diff
+209 -229
View File
@@ -1,52 +1,112 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class APIKeysApi {
APIKeysApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
class ApiKeysApi {
ApiKeysApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion getApiKeysAddedIn = .new(1, 0, 0);
static const ApiState getApiKeysState = .stable;
static const ApiVersion createApiKeyAddedIn = .new(1, 0, 0);
static const ApiState createApiKeyState = .stable;
static const ApiVersion getMyApiKeyAddedIn = .new(1, 0, 0);
static const ApiState getMyApiKeyState = .stable;
static const ApiVersion deleteApiKeyAddedIn = .new(1, 0, 0);
static const ApiState deleteApiKeyState = .stable;
static const ApiVersion getApiKeyAddedIn = .new(1, 0, 0);
static const ApiState getApiKeyState = .stable;
static const ApiVersion updateApiKeyAddedIn = .new(1, 0, 0);
static const ApiState updateApiKeyState = .stable;
/// List all API keys
///
/// Retrieve all API keys of the current user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getApiKeysWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/api-keys';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// List all API keys
///
/// Retrieve all API keys of the current user.
///
/// Available since server v1.0.0.
Future<List<ApiKeyResponseDto>> getApiKeys({Future<void>? abortTrigger}) async {
final response = await getApiKeysWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<ApiKeyResponseDto>') as List)
.cast<ApiKeyResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create an API key
///
/// Creates a new API key. It will be limited to the permissions specified.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [ApiKeyCreateDto] apiKeyCreateDto (required):
Future<Response> createApiKeyWithHttpInfo(ApiKeyCreateDto apiKeyCreateDto,) async {
// ignore: prefer_const_declarations
Future<Response> createApiKeyWithHttpInfo(ApiKeyCreateDto apiKeyCreateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/api-keys';
// ignore: prefer_final_locals
Object? postBody = apiKeyCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -54,191 +114,29 @@ class APIKeysApi {
///
/// Creates a new API key. It will be limited to the permissions specified.
///
/// Parameters:
///
/// * [ApiKeyCreateDto] apiKeyCreateDto (required):
Future<ApiKeyCreateResponseDto?> createApiKey(ApiKeyCreateDto apiKeyCreateDto,) async {
final response = await createApiKeyWithHttpInfo(apiKeyCreateDto,);
/// Available since server v1.0.0.
Future<ApiKeyCreateResponseDto> createApiKey(ApiKeyCreateDto apiKeyCreateDto, {Future<void>? abortTrigger}) async {
final response = await createApiKeyWithHttpInfo(apiKeyCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiKeyCreateResponseDto',) as ApiKeyCreateResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'ApiKeyCreateResponseDto')
as ApiKeyCreateResponseDto;
}
return null;
}
/// Delete an API key
///
/// Deletes an API key identified by its ID. The current user must own this API key.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteApiKeyWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/api-keys/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Delete an API key
///
/// Deletes an API key identified by its ID. The current user must own this API key.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteApiKey(String id,) async {
final response = await deleteApiKeyWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve an API key
///
/// Retrieve an API key by its ID. The current user must own this API key.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getApiKeyWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/api-keys/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve an API key
///
/// Retrieve an API key by its ID. The current user must own this API key.
///
/// Parameters:
///
/// * [String] id (required):
Future<ApiKeyResponseDto?> getApiKey(String id,) async {
final response = await getApiKeyWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiKeyResponseDto',) as ApiKeyResponseDto;
}
return null;
}
/// List all API keys
///
/// Retrieve all API keys of the current user.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getApiKeysWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/api-keys';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// List all API keys
///
/// Retrieve all API keys of the current user.
Future<List<ApiKeyResponseDto>?> getApiKeys() async {
final response = await getApiKeysWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<ApiKeyResponseDto>') as List)
.cast<ApiKeyResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve the current API key
///
/// Retrieve the API key that is used to access this endpoint.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getMyApiKeyWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> getMyApiKeyWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/api-keys/me';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -247,70 +145,155 @@ class APIKeysApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve the current API key
///
/// Retrieve the API key that is used to access this endpoint.
Future<ApiKeyResponseDto?> getMyApiKey() async {
final response = await getMyApiKeyWithHttpInfo();
///
/// Available since server v1.0.0.
Future<ApiKeyResponseDto> getMyApiKey({Future<void>? abortTrigger}) async {
final response = await getMyApiKeyWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiKeyResponseDto',) as ApiKeyResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'ApiKeyResponseDto')
as ApiKeyResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Delete an API key
///
/// Deletes an API key identified by its ID. The current user must own this API key.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> deleteApiKeyWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/api-keys/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Delete an API key
///
/// Deletes an API key identified by its ID. The current user must own this API key.
///
/// Available since server v1.0.0.
Future<void> deleteApiKey(String id, {Future<void>? abortTrigger}) async {
final response = await deleteApiKeyWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve an API key
///
/// Retrieve an API key by its ID. The current user must own this API key.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getApiKeyWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/api-keys/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve an API key
///
/// Retrieve an API key by its ID. The current user must own this API key.
///
/// Available since server v1.0.0.
Future<ApiKeyResponseDto> getApiKey(String id, {Future<void>? abortTrigger}) async {
final response = await getApiKeyWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'ApiKeyResponseDto')
as ApiKeyResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update an API key
///
/// Updates the name and permissions of an API key by its ID. The current user must own this API key.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [ApiKeyUpdateDto] apiKeyUpdateDto (required):
Future<Response> updateApiKeyWithHttpInfo(String id, ApiKeyUpdateDto apiKeyUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/api-keys/{id}'
.replaceAll('{id}', id);
Future<Response> updateApiKeyWithHttpInfo(
String id,
ApiKeyUpdateDto apiKeyUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/api-keys/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = apiKeyUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -318,23 +301,20 @@ class APIKeysApi {
///
/// Updates the name and permissions of an API key by its ID. The current user must own this API key.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [ApiKeyUpdateDto] apiKeyUpdateDto (required):
Future<ApiKeyResponseDto?> updateApiKey(String id, ApiKeyUpdateDto apiKeyUpdateDto,) async {
final response = await updateApiKeyWithHttpInfo(id, apiKeyUpdateDto,);
/// Available since server v1.0.0.
Future<ApiKeyResponseDto> updateApiKey(
String id,
ApiKeyUpdateDto apiKeyUpdateDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateApiKeyWithHttpInfo(id, apiKeyUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ApiKeyResponseDto',) as ApiKeyResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'ApiKeyResponseDto')
as ApiKeyResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+1143 -1291
View File
File diff suppressed because it is too large Load Diff
+13 -16
View File
@@ -1,31 +1,26 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AuthenticationAdminApi {
AuthenticationAdminApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion unlinkAllOAuthAccountsAdminAddedIn = .new(1, 0, 0);
static const ApiState unlinkAllOAuthAccountsAdminState = .stable;
/// Unlink all OAuth accounts
///
/// Unlinks all OAuth accounts associated with user accounts in the system.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> unlinkAllOAuthAccountsAdminWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> unlinkAllOAuthAccountsAdminWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/admin/auth/unlink-all';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -34,23 +29,25 @@ class AuthenticationAdminApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Unlink all OAuth accounts
///
/// Unlinks all OAuth accounts associated with user accounts in the system.
Future<void> unlinkAllOAuthAccountsAdmin() async {
final response = await unlinkAllOAuthAccountsAdminWithHttpInfo();
///
/// Available since server v1.0.0.
Future<void> unlinkAllOAuthAccountsAdmin({Future<void>? abortTrigger}) async {
final response = await unlinkAllOAuthAccountsAdminWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
File diff suppressed because it is too large Load Diff
+108 -117
View File
@@ -1,52 +1,62 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class DatabaseBackupsAdminApi {
DatabaseBackupsAdminApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion deleteDatabaseBackupAddedIn = .new(2, 5, 0);
static const ApiState deleteDatabaseBackupState = .alpha;
static const ApiVersion listDatabaseBackupsAddedIn = .new(2, 5, 0);
static const ApiState listDatabaseBackupsState = .alpha;
static const ApiVersion startDatabaseRestoreFlowAddedIn = .new(2, 5, 0);
static const ApiState startDatabaseRestoreFlowState = .alpha;
static const ApiVersion uploadDatabaseBackupAddedIn = .new(2, 5, 0);
static const ApiState uploadDatabaseBackupState = .alpha;
static const ApiVersion downloadDatabaseBackupAddedIn = .new(2, 5, 0);
static const ApiState downloadDatabaseBackupState = .alpha;
/// Delete database backup
///
/// Delete a backup by its filename
///
/// Available since server v2.5.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [DatabaseBackupDeleteDto] databaseBackupDeleteDto (required):
Future<Response> deleteDatabaseBackupWithHttpInfo(DatabaseBackupDeleteDto databaseBackupDeleteDto,) async {
// ignore: prefer_const_declarations
Future<Response> deleteDatabaseBackupWithHttpInfo(
DatabaseBackupDeleteDto databaseBackupDeleteDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/database-backups';
// ignore: prefer_final_locals
Object? postBody = databaseBackupDeleteDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -54,83 +64,27 @@ class DatabaseBackupsAdminApi {
///
/// Delete a backup by its filename
///
/// Parameters:
///
/// * [DatabaseBackupDeleteDto] databaseBackupDeleteDto (required):
Future<void> deleteDatabaseBackup(DatabaseBackupDeleteDto databaseBackupDeleteDto,) async {
final response = await deleteDatabaseBackupWithHttpInfo(databaseBackupDeleteDto,);
/// Available since server v2.5.0.
Future<void> deleteDatabaseBackup(
DatabaseBackupDeleteDto databaseBackupDeleteDto, {
Future<void>? abortTrigger,
}) async {
final response = await deleteDatabaseBackupWithHttpInfo(databaseBackupDeleteDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Download database backup
///
/// Downloads the database backup file
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] filename (required):
Future<Response> downloadDatabaseBackupWithHttpInfo(String filename,) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/database-backups/{filename}'
.replaceAll('{filename}', filename);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Download database backup
///
/// Downloads the database backup file
///
/// Parameters:
///
/// * [String] filename (required):
Future<MultipartFile?> downloadDatabaseBackup(String filename,) async {
final response = await downloadDatabaseBackupWithHttpInfo(filename,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
}
return null;
}
/// List database backups
///
/// Get the list of the successful and failed backups
///
/// Available since server v2.5.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> listDatabaseBackupsWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> listDatabaseBackupsWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/admin/database-backups';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -139,46 +93,45 @@ class DatabaseBackupsAdminApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// List database backups
///
/// Get the list of the successful and failed backups
Future<DatabaseBackupListResponseDto?> listDatabaseBackups() async {
final response = await listDatabaseBackupsWithHttpInfo();
///
/// Available since server v2.5.0.
Future<DatabaseBackupListResponseDto> listDatabaseBackups({Future<void>? abortTrigger}) async {
final response = await listDatabaseBackupsWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DatabaseBackupListResponseDto',) as DatabaseBackupListResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'DatabaseBackupListResponseDto')
as DatabaseBackupListResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Start database backup restore flow
///
/// Put Immich into maintenance mode to restore a backup (Immich must not be configured)
///
/// Available since server v2.5.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> startDatabaseRestoreFlowWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> startDatabaseRestoreFlowWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/admin/database-backups/start-restore';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -187,23 +140,25 @@ class DatabaseBackupsAdminApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Start database backup restore flow
///
/// Put Immich into maintenance mode to restore a backup (Immich must not be configured)
Future<void> startDatabaseRestoreFlow() async {
final response = await startDatabaseRestoreFlowWithHttpInfo();
///
/// Available since server v2.5.0.
Future<void> startDatabaseRestoreFlow({Future<void>? abortTrigger}) async {
final response = await startDatabaseRestoreFlowWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -213,24 +168,19 @@ class DatabaseBackupsAdminApi {
///
/// Uploads .sql/.sql.gz file to restore backup from
///
/// Available since server v2.5.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [MultipartFile] file:
/// Database backup file
Future<Response> uploadDatabaseBackupWithHttpInfo({ MultipartFile? file, }) async {
// ignore: prefer_const_declarations
Future<Response> uploadDatabaseBackupWithHttpInfo({MultipartFile? file, Future<void>? abortTrigger}) async {
final apiPath = r'/admin/database-backups/upload';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['multipart/form-data'];
const contentTypes = <String>[r'multipart/form-data'];
bool hasFields = false;
final mp = MultipartRequest('POST', Uri.parse(apiPath));
@@ -245,12 +195,13 @@ class DatabaseBackupsAdminApi {
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -258,14 +209,54 @@ class DatabaseBackupsAdminApi {
///
/// Uploads .sql/.sql.gz file to restore backup from
///
/// Parameters:
///
/// * [MultipartFile] file:
/// Database backup file
Future<void> uploadDatabaseBackup({ MultipartFile? file, }) async {
final response = await uploadDatabaseBackupWithHttpInfo( file: file, );
/// Available since server v2.5.0.
Future<void> uploadDatabaseBackup({MultipartFile? file, Future<void>? abortTrigger}) async {
final response = await uploadDatabaseBackupWithHttpInfo(file: file, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Download database backup
///
/// Downloads the database backup file
///
/// Available since server v2.5.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> downloadDatabaseBackupWithHttpInfo(String filename, {Future<void>? abortTrigger}) async {
final apiPath = r'/admin/database-backups/{filename}'.replaceAll('{filename}', filename);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Download database backup
///
/// Downloads the database backup file
///
/// Available since server v2.5.0.
Future<Uint8List> downloadDatabaseBackup(String filename, {Future<void>? abortTrigger}) async {
final response = await downloadDatabaseBackupWithHttpInfo(filename, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
return response.bodyBytes;
}
}
-184
View File
@@ -1,184 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class DeprecatedApi {
DeprecatedApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Create a partner
///
/// Create a new partner to share assets with.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> createPartnerDeprecatedWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/partners/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Create a partner
///
/// Create a new partner to share assets with.
///
/// Parameters:
///
/// * [String] id (required):
Future<PartnerResponseDto?> createPartnerDeprecated(String id,) async {
final response = await createPartnerDeprecatedWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PartnerResponseDto',) as PartnerResponseDto;
}
return null;
}
/// Retrieve queue counts and status
///
/// Retrieve the counts of the current queue, as well as the current status.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getQueuesLegacyWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/jobs';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve queue counts and status
///
/// Retrieve the counts of the current queue, as well as the current status.
Future<QueuesResponseLegacyDto?> getQueuesLegacy() async {
final response = await getQueuesLegacyWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'QueuesResponseLegacyDto',) as QueuesResponseLegacyDto;
}
return null;
}
/// Run jobs
///
/// Queue all assets for a specific job type. Defaults to only queueing assets that have not yet been processed, but the force command can be used to re-process all assets.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [QueueName] name (required):
///
/// * [QueueCommandDto] queueCommandDto (required):
Future<Response> runQueueCommandLegacyWithHttpInfo(QueueName name, QueueCommandDto queueCommandDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/jobs/{name}'
.replaceAll('{name}', name.toString());
// ignore: prefer_final_locals
Object? postBody = queueCommandDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Run jobs
///
/// Queue all assets for a specific job type. Defaults to only queueing assets that have not yet been processed, but the force command can be used to re-process all assets.
///
/// Parameters:
///
/// * [QueueName] name (required):
///
/// * [QueueCommandDto] queueCommandDto (required):
Future<QueueResponseLegacyDto?> runQueueCommandLegacy(QueueName name, QueueCommandDto queueCommandDto,) async {
final response = await runQueueCommandLegacyWithHttpInfo(name, queueCommandDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'QueueResponseLegacyDto',) as QueueResponseLegacyDto;
}
return null;
}
}
+62 -71
View File
@@ -1,39 +1,35 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class DownloadApi {
DownloadApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion downloadArchiveAddedIn = .new(1, 0, 0);
static const ApiState downloadArchiveState = .stable;
static const ApiVersion getDownloadInfoAddedIn = .new(1, 0, 0);
static const ApiState getDownloadInfoState = .stable;
/// Download asset archive
///
/// Download a ZIP archive containing the specified assets. The assets must have been previously requested via the \"getDownloadInfo\" endpoint.
/// Download a ZIP archive containing the specified assets. The assets must have been previously requested via the "getDownloadInfo" endpoint.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [DownloadArchiveDto] downloadArchiveDto (required):
///
/// * [String] key:
///
/// * [String] slug:
Future<Response> downloadArchiveWithHttpInfo(DownloadArchiveDto downloadArchiveDto, { String? key, String? slug, }) async {
// ignore: prefer_const_declarations
Future<Response> downloadArchiveWithHttpInfo(
DownloadArchiveDto downloadArchiveDto, {
String? key,
String? slug,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/download/archive';
// ignore: prefer_final_locals
Object? postBody = downloadArchiveDto;
final queryParams = <QueryParam>[];
@@ -47,64 +43,58 @@ class DownloadApi {
queryParams.addAll(_queryParams('', 'slug', slug));
}
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Download asset archive
///
/// Download a ZIP archive containing the specified assets. The assets must have been previously requested via the \"getDownloadInfo\" endpoint.
/// Download a ZIP archive containing the specified assets. The assets must have been previously requested via the "getDownloadInfo" endpoint.
///
/// Parameters:
///
/// * [DownloadArchiveDto] downloadArchiveDto (required):
///
/// * [String] key:
///
/// * [String] slug:
Future<MultipartFile?> downloadArchive(DownloadArchiveDto downloadArchiveDto, { String? key, String? slug, }) async {
final response = await downloadArchiveWithHttpInfo(downloadArchiveDto, key: key, slug: slug, );
/// Available since server v1.0.0.
Future<Uint8List> downloadArchive(
DownloadArchiveDto downloadArchiveDto, {
String? key,
String? slug,
Future<void>? abortTrigger,
}) async {
final response = await downloadArchiveWithHttpInfo(
downloadArchiveDto,
key: key,
slug: slug,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MultipartFile',) as MultipartFile;
}
return null;
return response.bodyBytes;
}
/// Retrieve download information
///
/// Retrieve information about how to request a download for the specified assets or album. The response includes groups of assets that can be downloaded together.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [DownloadInfoDto] downloadInfoDto (required):
///
/// * [String] key:
///
/// * [String] slug:
Future<Response> getDownloadInfoWithHttpInfo(DownloadInfoDto downloadInfoDto, { String? key, String? slug, }) async {
// ignore: prefer_const_declarations
Future<Response> getDownloadInfoWithHttpInfo(
DownloadInfoDto downloadInfoDto, {
String? key,
String? slug,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/download/info';
// ignore: prefer_final_locals
Object? postBody = downloadInfoDto;
final queryParams = <QueryParam>[];
@@ -118,17 +108,17 @@ class DownloadApi {
queryParams.addAll(_queryParams('', 'slug', slug));
}
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -136,25 +126,26 @@ class DownloadApi {
///
/// Retrieve information about how to request a download for the specified assets or album. The response includes groups of assets that can be downloaded together.
///
/// Parameters:
///
/// * [DownloadInfoDto] downloadInfoDto (required):
///
/// * [String] key:
///
/// * [String] slug:
Future<DownloadResponseDto?> getDownloadInfo(DownloadInfoDto downloadInfoDto, { String? key, String? slug, }) async {
final response = await getDownloadInfoWithHttpInfo(downloadInfoDto, key: key, slug: slug, );
/// Available since server v1.0.0.
Future<DownloadResponseDto> getDownloadInfo(
DownloadInfoDto downloadInfoDto, {
String? key,
String? slug,
Future<void>? abortTrigger,
}) async {
final response = await getDownloadInfoWithHttpInfo(
downloadInfoDto,
key: key,
slug: slug,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DownloadResponseDto',) as DownloadResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'DownloadResponseDto')
as DownloadResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+92 -104
View File
@@ -1,101 +1,55 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class DuplicatesApi {
DuplicatesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Dismiss a duplicate group
///
/// Dismiss a duplicate group by its ID, unlinking all assets in the group without deleting them.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteDuplicateWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/duplicates/{id}'
.replaceAll('{id}', id);
static const ApiVersion deleteDuplicatesAddedIn = .new(1, 0, 0);
// ignore: prefer_final_locals
Object? postBody;
static const ApiState deleteDuplicatesState = .stable;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiVersion getAssetDuplicatesAddedIn = .new(1, 0, 0);
const contentTypes = <String>[];
static const ApiState getAssetDuplicatesState = .stable;
static const ApiVersion resolveDuplicatesAddedIn = .new(3, 0, 0);
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiState resolveDuplicatesState = .alpha;
/// Dismiss a duplicate group
///
/// Dismiss a duplicate group by its ID, unlinking all assets in the group without deleting them.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteDuplicate(String id,) async {
final response = await deleteDuplicateWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
static const ApiVersion deleteDuplicateAddedIn = .new(1, 0, 0);
static const ApiState deleteDuplicateState = .stable;
/// Delete duplicates
///
/// Delete multiple duplicate assets specified by their IDs.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<Response> deleteDuplicatesWithHttpInfo(BulkIdsDto bulkIdsDto,) async {
// ignore: prefer_const_declarations
Future<Response> deleteDuplicatesWithHttpInfo(BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/duplicates';
// ignore: prefer_final_locals
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -103,11 +57,9 @@ class DuplicatesApi {
///
/// Delete multiple duplicate assets specified by their IDs.
///
/// Parameters:
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<void> deleteDuplicates(BulkIdsDto bulkIdsDto,) async {
final response = await deleteDuplicatesWithHttpInfo(bulkIdsDto,);
/// Available since server v1.0.0.
Future<void> deleteDuplicates(BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final response = await deleteDuplicatesWithHttpInfo(bulkIdsDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -117,12 +69,12 @@ class DuplicatesApi {
///
/// Retrieve a list of duplicate assets available to the authenticated user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getAssetDuplicatesWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> getAssetDuplicatesWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/duplicates';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -131,70 +83,67 @@ class DuplicatesApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve duplicates
///
/// Retrieve a list of duplicate assets available to the authenticated user.
Future<List<DuplicateResponseDto>?> getAssetDuplicates() async {
final response = await getAssetDuplicatesWithHttpInfo();
///
/// Available since server v1.0.0.
Future<List<DuplicateResponseDto>> getAssetDuplicates({Future<void>? abortTrigger}) async {
final response = await getAssetDuplicatesWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<DuplicateResponseDto>') as List)
.cast<DuplicateResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<DuplicateResponseDto>') as List)
.cast<DuplicateResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Resolve duplicate groups
///
/// Resolve duplicate groups by synchronizing metadata across assets and deleting/trashing duplicates.
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [DuplicateResolveDto] duplicateResolveDto (required):
Future<Response> resolveDuplicatesWithHttpInfo(DuplicateResolveDto duplicateResolveDto,) async {
// ignore: prefer_const_declarations
Future<Response> resolveDuplicatesWithHttpInfo(
DuplicateResolveDto duplicateResolveDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/duplicates/resolve';
// ignore: prefer_final_locals
Object? postBody = duplicateResolveDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -202,24 +151,63 @@ class DuplicatesApi {
///
/// Resolve duplicate groups by synchronizing metadata across assets and deleting/trashing duplicates.
///
/// Parameters:
///
/// * [DuplicateResolveDto] duplicateResolveDto (required):
Future<List<BulkIdResponseDto>?> resolveDuplicates(DuplicateResolveDto duplicateResolveDto,) async {
final response = await resolveDuplicatesWithHttpInfo(duplicateResolveDto,);
/// Available since server v3.0.0.
Future<List<BulkIdResponseDto>> resolveDuplicates(
DuplicateResolveDto duplicateResolveDto, {
Future<void>? abortTrigger,
}) async {
final response = await resolveDuplicatesWithHttpInfo(duplicateResolveDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Dismiss a duplicate group
///
/// Dismiss a duplicate group by its ID, unlinking all assets in the group without deleting them.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> deleteDuplicateWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/duplicates/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Dismiss a duplicate group
///
/// Dismiss a duplicate group by its ID, unlinking all assets in the group without deleting them.
///
/// Available since server v1.0.0.
Future<void> deleteDuplicate(String id, {Future<void>? abortTrigger}) async {
final response = await deleteDuplicateWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
return null;
}
}
+122 -154
View File
@@ -1,156 +1,57 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class FacesApi {
FacesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Create a face
///
/// Create a new face that has not been discovered by facial recognition. The content of the bounding box is considered a face.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetFaceCreateDto] assetFaceCreateDto (required):
Future<Response> createFaceWithHttpInfo(AssetFaceCreateDto assetFaceCreateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/faces';
static const ApiVersion getFacesAddedIn = .new(1, 0, 0);
// ignore: prefer_final_locals
Object? postBody = assetFaceCreateDto;
static const ApiState getFacesState = .stable;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiVersion createFaceAddedIn = .new(1, 0, 0);
const contentTypes = <String>['application/json'];
static const ApiState createFaceState = .stable;
static const ApiVersion deleteFaceAddedIn = .new(1, 0, 0);
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiState deleteFaceState = .stable;
/// Create a face
///
/// Create a new face that has not been discovered by facial recognition. The content of the bounding box is considered a face.
///
/// Parameters:
///
/// * [AssetFaceCreateDto] assetFaceCreateDto (required):
Future<void> createFace(AssetFaceCreateDto assetFaceCreateDto,) async {
final response = await createFaceWithHttpInfo(assetFaceCreateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
static const ApiVersion reassignFacesByIdAddedIn = .new(1, 0, 0);
/// Delete a face
///
/// Delete a face identified by the id. Optionally can be force deleted.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [AssetFaceDeleteDto] assetFaceDeleteDto (required):
Future<Response> deleteFaceWithHttpInfo(String id, AssetFaceDeleteDto assetFaceDeleteDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/faces/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = assetFaceDeleteDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Delete a face
///
/// Delete a face identified by the id. Optionally can be force deleted.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [AssetFaceDeleteDto] assetFaceDeleteDto (required):
Future<void> deleteFace(String id, AssetFaceDeleteDto assetFaceDeleteDto,) async {
final response = await deleteFaceWithHttpInfo(id, assetFaceDeleteDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
static const ApiState reassignFacesByIdState = .stable;
/// Retrieve faces for asset
///
/// Retrieve all faces belonging to an asset.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
/// Face ID
Future<Response> getFacesWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
Future<Response> getFacesWithHttpInfo({required String id, Future<void>? abortTrigger}) async {
final apiPath = r'/faces';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'id', id));
queryParams.addAll(_queryParams('', 'id', id));
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -158,62 +59,136 @@ class FacesApi {
///
/// Retrieve all faces belonging to an asset.
///
/// Parameters:
///
/// * [String] id (required):
/// Face ID
Future<List<AssetFaceResponseDto>?> getFaces(String id,) async {
final response = await getFacesWithHttpInfo(id,);
/// Available since server v1.0.0.
Future<List<AssetFaceResponseDto>> getFaces({required String id, Future<void>? abortTrigger}) async {
final response = await getFacesWithHttpInfo(id: id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<AssetFaceResponseDto>') as List)
.cast<AssetFaceResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<AssetFaceResponseDto>') as List)
.cast<AssetFaceResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create a face
///
/// Create a new face that has not been discovered by facial recognition. The content of the bounding box is considered a face.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> createFaceWithHttpInfo(AssetFaceCreateDto assetFaceCreateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/faces';
Object? postBody = assetFaceCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Create a face
///
/// Create a new face that has not been discovered by facial recognition. The content of the bounding box is considered a face.
///
/// Available since server v1.0.0.
Future<void> createFace(AssetFaceCreateDto assetFaceCreateDto, {Future<void>? abortTrigger}) async {
final response = await createFaceWithHttpInfo(assetFaceCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Delete a face
///
/// Delete a face identified by the id. Optionally can be force deleted.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> deleteFaceWithHttpInfo(
String id,
AssetFaceDeleteDto assetFaceDeleteDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/faces/{id}'.replaceAll('{id}', id);
Object? postBody = assetFaceDeleteDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Delete a face
///
/// Delete a face identified by the id. Optionally can be force deleted.
///
/// Available since server v1.0.0.
Future<void> deleteFace(String id, AssetFaceDeleteDto assetFaceDeleteDto, {Future<void>? abortTrigger}) async {
final response = await deleteFaceWithHttpInfo(id, assetFaceDeleteDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
return null;
}
/// Re-assign a face to another person
///
/// Re-assign the face provided in the body to the person identified by the id in the path parameter.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [FaceDto] faceDto (required):
Future<Response> reassignFacesByIdWithHttpInfo(String id, FaceDto faceDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/faces/{id}'
.replaceAll('{id}', id);
Future<Response> reassignFacesByIdWithHttpInfo(String id, FaceDto faceDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/faces/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = faceDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -221,23 +196,16 @@ class FacesApi {
///
/// Re-assign the face provided in the body to the person identified by the id in the path parameter.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [FaceDto] faceDto (required):
Future<PersonResponseDto?> reassignFacesById(String id, FaceDto faceDto,) async {
final response = await reassignFacesByIdWithHttpInfo(id, faceDto,);
/// Available since server v1.0.0.
Future<PersonResponseDto> reassignFacesById(String id, FaceDto faceDto, {Future<void>? abortTrigger}) async {
final response = await reassignFacesByIdWithHttpInfo(id, faceDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PersonResponseDto',) as PersonResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'PersonResponseDto')
as PersonResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+88 -90
View File
@@ -1,79 +1,39 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class JobsApi {
JobsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Create a manual job
///
/// Run a specific job. Most jobs are queued automatically, but this endpoint allows for manual creation of a handful of jobs, including various cleanup tasks, as well as creating a new database backup.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [JobCreateDto] jobCreateDto (required):
Future<Response> createJobWithHttpInfo(JobCreateDto jobCreateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/jobs';
static const ApiVersion getQueuesLegacyAddedIn = .new(1, 0, 0);
// ignore: prefer_final_locals
Object? postBody = jobCreateDto;
static const ApiVersion getQueuesLegacyDeprecatedIn = .new(2, 4, 0);
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiState getQueuesLegacyState = .deprecated;
const contentTypes = <String>['application/json'];
static const ApiVersion createJobAddedIn = .new(1, 0, 0);
static const ApiState createJobState = .stable;
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiVersion runQueueCommandLegacyAddedIn = .new(1, 0, 0);
/// Create a manual job
///
/// Run a specific job. Most jobs are queued automatically, but this endpoint allows for manual creation of a handful of jobs, including various cleanup tasks, as well as creating a new database backup.
///
/// Parameters:
///
/// * [JobCreateDto] jobCreateDto (required):
Future<void> createJob(JobCreateDto jobCreateDto,) async {
final response = await createJobWithHttpInfo(jobCreateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
static const ApiVersion runQueueCommandLegacyDeprecatedIn = .new(2, 4, 0);
static const ApiState runQueueCommandLegacyState = .deprecated;
/// Retrieve queue counts and status
///
/// Retrieve the counts of the current queue, as well as the current status.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getQueuesLegacyWithHttpInfo() async {
// ignore: prefer_const_declarations
@Deprecated('Deprecated by the Immich server API since v2.4.0.')
Future<Response> getQueuesLegacyWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/jobs';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -82,70 +42,110 @@ class JobsApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve queue counts and status
///
/// Retrieve the counts of the current queue, as well as the current status.
Future<QueuesResponseLegacyDto?> getQueuesLegacy() async {
final response = await getQueuesLegacyWithHttpInfo();
///
/// Available since server v1.0.0.
@Deprecated('Deprecated by the Immich server API since v2.4.0.')
Future<QueuesResponseLegacyDto> getQueuesLegacy({Future<void>? abortTrigger}) async {
final response = await getQueuesLegacyWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'QueuesResponseLegacyDto',) as QueuesResponseLegacyDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'QueuesResponseLegacyDto')
as QueuesResponseLegacyDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create a manual job
///
/// Run a specific job. Most jobs are queued automatically, but this endpoint allows for manual creation of a handful of jobs, including various cleanup tasks, as well as creating a new database backup.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> createJobWithHttpInfo(JobCreateDto jobCreateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/jobs';
Object? postBody = jobCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Create a manual job
///
/// Run a specific job. Most jobs are queued automatically, but this endpoint allows for manual creation of a handful of jobs, including various cleanup tasks, as well as creating a new database backup.
///
/// Available since server v1.0.0.
Future<void> createJob(JobCreateDto jobCreateDto, {Future<void>? abortTrigger}) async {
final response = await createJobWithHttpInfo(jobCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
return null;
}
/// Run jobs
///
/// Queue all assets for a specific job type. Defaults to only queueing assets that have not yet been processed, but the force command can be used to re-process all assets.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [QueueName] name (required):
///
/// * [QueueCommandDto] queueCommandDto (required):
Future<Response> runQueueCommandLegacyWithHttpInfo(QueueName name, QueueCommandDto queueCommandDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/jobs/{name}'
.replaceAll('{name}', name.toString());
@Deprecated('Deprecated by the Immich server API since v2.4.0.')
Future<Response> runQueueCommandLegacyWithHttpInfo(
QueueName name,
QueueCommandDto queueCommandDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/jobs/{name}'.replaceAll('{name}', parameterToString(name));
// ignore: prefer_final_locals
Object? postBody = queueCommandDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -153,23 +153,21 @@ class JobsApi {
///
/// Queue all assets for a specific job type. Defaults to only queueing assets that have not yet been processed, but the force command can be used to re-process all assets.
///
/// Parameters:
///
/// * [QueueName] name (required):
///
/// * [QueueCommandDto] queueCommandDto (required):
Future<QueueResponseLegacyDto?> runQueueCommandLegacy(QueueName name, QueueCommandDto queueCommandDto,) async {
final response = await runQueueCommandLegacyWithHttpInfo(name, queueCommandDto,);
/// Available since server v1.0.0.
@Deprecated('Deprecated by the Immich server API since v2.4.0.')
Future<QueueResponseLegacyDto> runQueueCommandLegacy(
QueueName name,
QueueCommandDto queueCommandDto, {
Future<void>? abortTrigger,
}) async {
final response = await runQueueCommandLegacyWithHttpInfo(name, queueCommandDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'QueueResponseLegacyDto',) as QueueResponseLegacyDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'QueueResponseLegacyDto')
as QueueResponseLegacyDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+245 -279
View File
@@ -1,52 +1,120 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class LibrariesApi {
LibrariesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion getAllLibrariesAddedIn = .new(1, 0, 0);
static const ApiState getAllLibrariesState = .stable;
static const ApiVersion createLibraryAddedIn = .new(1, 0, 0);
static const ApiState createLibraryState = .stable;
static const ApiVersion deleteLibraryAddedIn = .new(1, 0, 0);
static const ApiState deleteLibraryState = .stable;
static const ApiVersion getLibraryAddedIn = .new(1, 0, 0);
static const ApiState getLibraryState = .stable;
static const ApiVersion updateLibraryAddedIn = .new(1, 0, 0);
static const ApiState updateLibraryState = .stable;
static const ApiVersion scanLibraryAddedIn = .new(1, 0, 0);
static const ApiState scanLibraryState = .stable;
static const ApiVersion getLibraryStatisticsAddedIn = .new(1, 0, 0);
static const ApiState getLibraryStatisticsState = .stable;
static const ApiVersion validateAddedIn = .new(1, 0, 0);
static const ApiState validateState = .stable;
/// Retrieve libraries
///
/// Retrieve a list of external libraries.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getAllLibrariesWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/libraries';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve libraries
///
/// Retrieve a list of external libraries.
///
/// Available since server v1.0.0.
Future<List<LibraryResponseDto>> getAllLibraries({Future<void>? abortTrigger}) async {
final response = await getAllLibrariesWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<LibraryResponseDto>') as List)
.cast<LibraryResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create a library
///
/// Create a new external library.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [CreateLibraryDto] createLibraryDto (required):
Future<Response> createLibraryWithHttpInfo(CreateLibraryDto createLibraryDto,) async {
// ignore: prefer_const_declarations
Future<Response> createLibraryWithHttpInfo(CreateLibraryDto createLibraryDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/libraries';
// ignore: prefer_final_locals
Object? postBody = createLibraryDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -54,39 +122,29 @@ class LibrariesApi {
///
/// Create a new external library.
///
/// Parameters:
///
/// * [CreateLibraryDto] createLibraryDto (required):
Future<LibraryResponseDto?> createLibrary(CreateLibraryDto createLibraryDto,) async {
final response = await createLibraryWithHttpInfo(createLibraryDto,);
/// Available since server v1.0.0.
Future<LibraryResponseDto> createLibrary(CreateLibraryDto createLibraryDto, {Future<void>? abortTrigger}) async {
final response = await createLibraryWithHttpInfo(createLibraryDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'LibraryResponseDto',) as LibraryResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'LibraryResponseDto')
as LibraryResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Delete a library
///
/// Delete an external library by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteLibraryWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/libraries/{id}'
.replaceAll('{id}', id);
Future<Response> deleteLibraryWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/libraries/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -95,15 +153,15 @@ class LibrariesApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -111,82 +169,24 @@ class LibrariesApi {
///
/// Delete an external library by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteLibrary(String id,) async {
final response = await deleteLibraryWithHttpInfo(id,);
/// Available since server v1.0.0.
Future<void> deleteLibrary(String id, {Future<void>? abortTrigger}) async {
final response = await deleteLibraryWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve libraries
///
/// Retrieve a list of external libraries.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getAllLibrariesWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/libraries';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve libraries
///
/// Retrieve a list of external libraries.
Future<List<LibraryResponseDto>?> getAllLibraries() async {
final response = await getAllLibrariesWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<LibraryResponseDto>') as List)
.cast<LibraryResponseDto>()
.toList(growable: false);
}
return null;
}
/// Retrieve a library
///
/// Retrieve an external library by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getLibraryWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/libraries/{id}'
.replaceAll('{id}', id);
Future<Response> getLibraryWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/libraries/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -195,15 +195,15 @@ class LibrariesApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -211,164 +211,50 @@ class LibrariesApi {
///
/// Retrieve an external library by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<LibraryResponseDto?> getLibrary(String id,) async {
final response = await getLibraryWithHttpInfo(id,);
/// Available since server v1.0.0.
Future<LibraryResponseDto> getLibrary(String id, {Future<void>? abortTrigger}) async {
final response = await getLibraryWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'LibraryResponseDto',) as LibraryResponseDto;
}
return null;
}
/// Retrieve library statistics
///
/// Retrieve statistics for a specific external library, including number of videos, images, and storage usage.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getLibraryStatisticsWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/libraries/{id}/statistics'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve library statistics
///
/// Retrieve statistics for a specific external library, including number of videos, images, and storage usage.
///
/// Parameters:
///
/// * [String] id (required):
Future<LibraryStatsResponseDto?> getLibraryStatistics(String id,) async {
final response = await getLibraryStatisticsWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'LibraryStatsResponseDto',) as LibraryStatsResponseDto;
}
return null;
}
/// Scan a library
///
/// Queue a scan for the external library to find and import new assets.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> scanLibraryWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/libraries/{id}/scan'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Scan a library
///
/// Queue a scan for the external library to find and import new assets.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> scanLibrary(String id,) async {
final response = await scanLibraryWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'LibraryResponseDto')
as LibraryResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update a library
///
/// Update an existing external library.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateLibraryDto] updateLibraryDto (required):
Future<Response> updateLibraryWithHttpInfo(String id, UpdateLibraryDto updateLibraryDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/libraries/{id}'
.replaceAll('{id}', id);
Future<Response> updateLibraryWithHttpInfo(
String id,
UpdateLibraryDto updateLibraryDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/libraries/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = updateLibraryDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -376,60 +262,143 @@ class LibrariesApi {
///
/// Update an existing external library.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateLibraryDto] updateLibraryDto (required):
Future<LibraryResponseDto?> updateLibrary(String id, UpdateLibraryDto updateLibraryDto,) async {
final response = await updateLibraryWithHttpInfo(id, updateLibraryDto,);
/// Available since server v1.0.0.
Future<LibraryResponseDto> updateLibrary(
String id,
UpdateLibraryDto updateLibraryDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateLibraryWithHttpInfo(id, updateLibraryDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'LibraryResponseDto',) as LibraryResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'LibraryResponseDto')
as LibraryResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Scan a library
///
/// Queue a scan for the external library to find and import new assets.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> scanLibraryWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/libraries/{id}/scan'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Scan a library
///
/// Queue a scan for the external library to find and import new assets.
///
/// Available since server v1.0.0.
Future<void> scanLibrary(String id, {Future<void>? abortTrigger}) async {
final response = await scanLibraryWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve library statistics
///
/// Retrieve statistics for a specific external library, including number of videos, images, and storage usage.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getLibraryStatisticsWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/libraries/{id}/statistics'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve library statistics
///
/// Retrieve statistics for a specific external library, including number of videos, images, and storage usage.
///
/// Available since server v1.0.0.
Future<LibraryStatsResponseDto> getLibraryStatistics(String id, {Future<void>? abortTrigger}) async {
final response = await getLibraryStatisticsWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'LibraryStatsResponseDto')
as LibraryStatsResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Validate library settings
///
/// Validate the settings of an external library.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [ValidateLibraryDto] validateLibraryDto (required):
Future<Response> validateWithHttpInfo(String id, ValidateLibraryDto validateLibraryDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/libraries/{id}/validate'
.replaceAll('{id}', id);
Future<Response> validateWithHttpInfo(
String id,
ValidateLibraryDto validateLibraryDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/libraries/{id}/validate'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = validateLibraryDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -437,23 +406,20 @@ class LibrariesApi {
///
/// Validate the settings of an external library.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [ValidateLibraryDto] validateLibraryDto (required):
Future<ValidateLibraryResponseDto?> validate(String id, ValidateLibraryDto validateLibraryDto,) async {
final response = await validateWithHttpInfo(id, validateLibraryDto,);
/// Available since server v1.0.0.
Future<ValidateLibraryResponseDto> validate(
String id,
ValidateLibraryDto validateLibraryDto, {
Future<void>? abortTrigger,
}) async {
final response = await validateWithHttpInfo(id, validateLibraryDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ValidateLibraryResponseDto',) as ValidateLibraryResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'ValidateLibraryResponseDto')
as ValidateLibraryResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+167 -168
View File
@@ -1,204 +1,58 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class MaintenanceAdminApi {
MaintenanceAdminApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Detect existing install
///
/// Collect integrity checks and other heuristics about local data.
///
/// Note: This method returns the HTTP [Response].
Future<Response> detectPriorInstallWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/maintenance/detect-install';
static const ApiVersion setMaintenanceModeAddedIn = .new(2, 3, 0);
// ignore: prefer_final_locals
Object? postBody;
static const ApiState setMaintenanceModeState = .alpha;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiVersion detectPriorInstallAddedIn = .new(2, 5, 0);
const contentTypes = <String>[];
static const ApiState detectPriorInstallState = .alpha;
static const ApiVersion maintenanceLoginAddedIn = .new(2, 3, 0);
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiState maintenanceLoginState = .alpha;
/// Detect existing install
///
/// Collect integrity checks and other heuristics about local data.
Future<MaintenanceDetectInstallResponseDto?> detectPriorInstall() async {
final response = await detectPriorInstallWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MaintenanceDetectInstallResponseDto',) as MaintenanceDetectInstallResponseDto;
}
return null;
}
static const ApiVersion getMaintenanceStatusAddedIn = .new(2, 5, 0);
/// Get maintenance mode status
///
/// Fetch information about the currently running maintenance action.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getMaintenanceStatusWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/maintenance/status';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Get maintenance mode status
///
/// Fetch information about the currently running maintenance action.
Future<MaintenanceStatusResponseDto?> getMaintenanceStatus() async {
final response = await getMaintenanceStatusWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MaintenanceStatusResponseDto',) as MaintenanceStatusResponseDto;
}
return null;
}
/// Log into maintenance mode
///
/// Login with maintenance token or cookie to receive current information and perform further actions.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [MaintenanceLoginDto] maintenanceLoginDto (required):
Future<Response> maintenanceLoginWithHttpInfo(MaintenanceLoginDto maintenanceLoginDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/maintenance/login';
// ignore: prefer_final_locals
Object? postBody = maintenanceLoginDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Log into maintenance mode
///
/// Login with maintenance token or cookie to receive current information and perform further actions.
///
/// Parameters:
///
/// * [MaintenanceLoginDto] maintenanceLoginDto (required):
Future<MaintenanceAuthDto?> maintenanceLogin(MaintenanceLoginDto maintenanceLoginDto,) async {
final response = await maintenanceLoginWithHttpInfo(maintenanceLoginDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MaintenanceAuthDto',) as MaintenanceAuthDto;
}
return null;
}
static const ApiState getMaintenanceStatusState = .alpha;
/// Set maintenance mode
///
/// Put Immich into or take it out of maintenance mode
///
/// Available since server v2.3.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [SetMaintenanceModeDto] setMaintenanceModeDto (required):
Future<Response> setMaintenanceModeWithHttpInfo(SetMaintenanceModeDto setMaintenanceModeDto,) async {
// ignore: prefer_const_declarations
Future<Response> setMaintenanceModeWithHttpInfo(
SetMaintenanceModeDto setMaintenanceModeDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/maintenance';
// ignore: prefer_final_locals
Object? postBody = setMaintenanceModeDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -206,13 +60,158 @@ class MaintenanceAdminApi {
///
/// Put Immich into or take it out of maintenance mode
///
/// Parameters:
///
/// * [SetMaintenanceModeDto] setMaintenanceModeDto (required):
Future<void> setMaintenanceMode(SetMaintenanceModeDto setMaintenanceModeDto,) async {
final response = await setMaintenanceModeWithHttpInfo(setMaintenanceModeDto,);
/// Available since server v2.3.0.
Future<void> setMaintenanceMode(SetMaintenanceModeDto setMaintenanceModeDto, {Future<void>? abortTrigger}) async {
final response = await setMaintenanceModeWithHttpInfo(setMaintenanceModeDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Detect existing install
///
/// Collect integrity checks and other heuristics about local data.
///
/// Available since server v2.5.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> detectPriorInstallWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/admin/maintenance/detect-install';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Detect existing install
///
/// Collect integrity checks and other heuristics about local data.
///
/// Available since server v2.5.0.
Future<MaintenanceDetectInstallResponseDto> detectPriorInstall({Future<void>? abortTrigger}) async {
final response = await detectPriorInstallWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'MaintenanceDetectInstallResponseDto')
as MaintenanceDetectInstallResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Log into maintenance mode
///
/// Login with maintenance token or cookie to receive current information and perform further actions.
///
/// Available since server v2.3.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> maintenanceLoginWithHttpInfo(
MaintenanceLoginDto maintenanceLoginDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/maintenance/login';
Object? postBody = maintenanceLoginDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Log into maintenance mode
///
/// Login with maintenance token or cookie to receive current information and perform further actions.
///
/// Available since server v2.3.0.
Future<MaintenanceAuthDto> maintenanceLogin(
MaintenanceLoginDto maintenanceLoginDto, {
Future<void>? abortTrigger,
}) async {
final response = await maintenanceLoginWithHttpInfo(maintenanceLoginDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'MaintenanceAuthDto')
as MaintenanceAuthDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Get maintenance mode status
///
/// Fetch information about the currently running maintenance action.
///
/// Available since server v2.5.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getMaintenanceStatusWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/admin/maintenance/status';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Get maintenance mode status
///
/// Fetch information about the currently running maintenance action.
///
/// Available since server v2.5.0.
Future<MaintenanceStatusResponseDto> getMaintenanceStatus({Future<void>? abortTrigger}) async {
final response = await getMaintenanceStatusWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'MaintenanceStatusResponseDto')
as MaintenanceStatusResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+66 -95
View File
@@ -1,51 +1,38 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class MapApi {
MapApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion getMapMarkersAddedIn = .new(1, 0, 0);
static const ApiState getMapMarkersState = .stable;
static const ApiVersion reverseGeocodeAddedIn = .new(1, 0, 0);
static const ApiState reverseGeocodeState = .stable;
/// Retrieve map markers
///
/// Retrieve a list of latitude and longitude coordinates for every asset with location data.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [DateTime] fileCreatedAfter:
/// Filter assets created after this date
///
/// * [DateTime] fileCreatedBefore:
/// Filter assets created before this date
///
/// * [bool] isArchived:
/// Filter by archived status
///
/// * [bool] isFavorite:
/// Filter by favorite status
///
/// * [bool] withPartners:
/// Include partner assets
///
/// * [bool] withSharedAlbums:
/// Include shared album assets
Future<Response> getMapMarkersWithHttpInfo({ DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, bool? isArchived, bool? isFavorite, bool? withPartners, bool? withSharedAlbums, }) async {
// ignore: prefer_const_declarations
Future<Response> getMapMarkersWithHttpInfo({
DateTime? fileCreatedAfter,
DateTime? fileCreatedBefore,
bool? isArchived,
bool? isFavorite,
bool? withPartners,
bool? withSharedAlbums,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/map/markers';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -73,15 +60,15 @@ class MapApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -89,81 +76,71 @@ class MapApi {
///
/// Retrieve a list of latitude and longitude coordinates for every asset with location data.
///
/// Parameters:
///
/// * [DateTime] fileCreatedAfter:
/// Filter assets created after this date
///
/// * [DateTime] fileCreatedBefore:
/// Filter assets created before this date
///
/// * [bool] isArchived:
/// Filter by archived status
///
/// * [bool] isFavorite:
/// Filter by favorite status
///
/// * [bool] withPartners:
/// Include partner assets
///
/// * [bool] withSharedAlbums:
/// Include shared album assets
Future<List<MapMarkerResponseDto>?> getMapMarkers({ DateTime? fileCreatedAfter, DateTime? fileCreatedBefore, bool? isArchived, bool? isFavorite, bool? withPartners, bool? withSharedAlbums, }) async {
final response = await getMapMarkersWithHttpInfo( fileCreatedAfter: fileCreatedAfter, fileCreatedBefore: fileCreatedBefore, isArchived: isArchived, isFavorite: isFavorite, withPartners: withPartners, withSharedAlbums: withSharedAlbums, );
/// Available since server v1.0.0.
Future<List<MapMarkerResponseDto>> getMapMarkers({
DateTime? fileCreatedAfter,
DateTime? fileCreatedBefore,
bool? isArchived,
bool? isFavorite,
bool? withPartners,
bool? withSharedAlbums,
Future<void>? abortTrigger,
}) async {
final response = await getMapMarkersWithHttpInfo(
fileCreatedAfter: fileCreatedAfter,
fileCreatedBefore: fileCreatedBefore,
isArchived: isArchived,
isFavorite: isFavorite,
withPartners: withPartners,
withSharedAlbums: withSharedAlbums,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<MapMarkerResponseDto>') as List)
.cast<MapMarkerResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<MapMarkerResponseDto>') as List)
.cast<MapMarkerResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Reverse geocode coordinates
///
/// Retrieve location information (e.g., city, country) for given latitude and longitude coordinates.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [double] lat (required):
/// Latitude (-90 to 90)
///
/// * [double] lon (required):
/// Longitude (-180 to 180)
Future<Response> reverseGeocodeWithHttpInfo(double lat, double lon,) async {
// ignore: prefer_const_declarations
Future<Response> reverseGeocodeWithHttpInfo({
required double lat,
required double lon,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/map/reverse-geocode';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'lat', lat));
queryParams.addAll(_queryParams('', 'lon', lon));
queryParams.addAll(_queryParams('', 'lat', lat));
queryParams.addAll(_queryParams('', 'lon', lon));
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -171,28 +148,22 @@ class MapApi {
///
/// Retrieve location information (e.g., city, country) for given latitude and longitude coordinates.
///
/// Parameters:
///
/// * [double] lat (required):
/// Latitude (-90 to 90)
///
/// * [double] lon (required):
/// Longitude (-180 to 180)
Future<List<MapReverseGeocodeResponseDto>?> reverseGeocode(double lat, double lon,) async {
final response = await reverseGeocodeWithHttpInfo(lat, lon,);
/// Available since server v1.0.0.
Future<List<MapReverseGeocodeResponseDto>> reverseGeocode({
required double lat,
required double lon,
Future<void>? abortTrigger,
}) async {
final response = await reverseGeocodeWithHttpInfo(lat: lat, lon: lon, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<MapReverseGeocodeResponseDto>') as List)
.cast<MapReverseGeocodeResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<MapReverseGeocodeResponseDto>') as List)
.cast<MapReverseGeocodeResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+330 -384
View File
@@ -1,116 +1,163 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class MemoriesApi {
MemoriesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Add assets to a memory
static const ApiVersion searchMemoriesAddedIn = .new(1, 0, 0);
static const ApiState searchMemoriesState = .stable;
static const ApiVersion createMemoryAddedIn = .new(1, 0, 0);
static const ApiState createMemoryState = .stable;
static const ApiVersion memoriesStatisticsAddedIn = .new(1, 0, 0);
static const ApiState memoriesStatisticsState = .stable;
static const ApiVersion deleteMemoryAddedIn = .new(1, 0, 0);
static const ApiState deleteMemoryState = .stable;
static const ApiVersion getMemoryAddedIn = .new(1, 0, 0);
static const ApiState getMemoryState = .stable;
static const ApiVersion updateMemoryAddedIn = .new(1, 0, 0);
static const ApiState updateMemoryState = .stable;
static const ApiVersion removeMemoryAssetsAddedIn = .new(1, 0, 0);
static const ApiState removeMemoryAssetsState = .stable;
static const ApiVersion addMemoryAssetsAddedIn = .new(1, 0, 0);
static const ApiState addMemoryAssetsState = .stable;
/// Retrieve memories
///
/// Add a list of asset IDs to a specific memory.
/// Retrieve a list of memories. Memories are sorted descending by creation date by default, although they can also be sorted in ascending order, or randomly.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<Response> addMemoryAssetsWithHttpInfo(String id, BulkIdsDto bulkIdsDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/memories/{id}/assets'
.replaceAll('{id}', id);
Future<Response> searchMemoriesWithHttpInfo({
DateTime? for$,
bool? isSaved,
bool? isTrashed,
MemorySearchOrder? order,
int? size,
MemoryType? type,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/memories';
// ignore: prefer_final_locals
Object? postBody = bulkIdsDto;
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
if (for$ != null) {
queryParams.addAll(_queryParams('', 'for', for$));
}
if (isSaved != null) {
queryParams.addAll(_queryParams('', 'isSaved', isSaved));
}
if (isTrashed != null) {
queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
}
if (order != null) {
queryParams.addAll(_queryParams('', 'order', order));
}
if (size != null) {
queryParams.addAll(_queryParams('', 'size', size));
}
if (type != null) {
queryParams.addAll(_queryParams('', 'type', type));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Add assets to a memory
/// Retrieve memories
///
/// Add a list of asset IDs to a specific memory.
/// Retrieve a list of memories. Memories are sorted descending by creation date by default, although they can also be sorted in ascending order, or randomly.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<List<BulkIdResponseDto>?> addMemoryAssets(String id, BulkIdsDto bulkIdsDto,) async {
final response = await addMemoryAssetsWithHttpInfo(id, bulkIdsDto,);
/// Available since server v1.0.0.
Future<List<MemoryResponseDto>> searchMemories({
DateTime? for$,
bool? isSaved,
bool? isTrashed,
MemorySearchOrder? order,
int? size,
MemoryType? type,
Future<void>? abortTrigger,
}) async {
final response = await searchMemoriesWithHttpInfo(
for$: for$,
isSaved: isSaved,
isTrashed: isTrashed,
order: order,
size: size,
type: type,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<MemoryResponseDto>') as List)
.cast<MemoryResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create a memory
///
/// Create a new memory by providing a name, description, and a list of asset IDs to include in the memory.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [MemoryCreateDto] memoryCreateDto (required):
Future<Response> createMemoryWithHttpInfo(MemoryCreateDto memoryCreateDto,) async {
// ignore: prefer_const_declarations
Future<Response> createMemoryWithHttpInfo(MemoryCreateDto memoryCreateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/memories';
// ignore: prefer_final_locals
Object? postBody = memoryCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -118,166 +165,45 @@ class MemoriesApi {
///
/// Create a new memory by providing a name, description, and a list of asset IDs to include in the memory.
///
/// Parameters:
///
/// * [MemoryCreateDto] memoryCreateDto (required):
Future<MemoryResponseDto?> createMemory(MemoryCreateDto memoryCreateDto,) async {
final response = await createMemoryWithHttpInfo(memoryCreateDto,);
/// Available since server v1.0.0.
Future<MemoryResponseDto> createMemory(MemoryCreateDto memoryCreateDto, {Future<void>? abortTrigger}) async {
final response = await createMemoryWithHttpInfo(memoryCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MemoryResponseDto',) as MemoryResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'MemoryResponseDto')
as MemoryResponseDto;
}
return null;
}
/// Delete a memory
///
/// Delete a specific memory by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteMemoryWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/memories/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Delete a memory
///
/// Delete a specific memory by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteMemory(String id,) async {
final response = await deleteMemoryWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve a memory
///
/// Retrieve a specific memory by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getMemoryWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/memories/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve a memory
///
/// Retrieve a specific memory by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<MemoryResponseDto?> getMemory(String id,) async {
final response = await getMemoryWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MemoryResponseDto',) as MemoryResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve memories statistics
///
/// Retrieve statistics about memories, such as total count and other relevant metrics.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [DateTime] for_:
/// Filter by date
///
/// * [bool] isSaved:
/// Filter by saved status
///
/// * [bool] isTrashed:
/// Include trashed memories
///
/// * [MemorySearchOrder] order:
///
/// * [int] size:
/// Number of memories to return
///
/// * [MemoryType] type:
Future<Response> memoriesStatisticsWithHttpInfo({ DateTime? for_, bool? isSaved, bool? isTrashed, MemorySearchOrder? order, int? size, MemoryType? type, }) async {
// ignore: prefer_const_declarations
Future<Response> memoriesStatisticsWithHttpInfo({
DateTime? for$,
bool? isSaved,
bool? isTrashed,
MemorySearchOrder? order,
int? size,
MemoryType? type,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/memories/statistics';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (for_ != null) {
queryParams.addAll(_queryParams('', 'for', for_));
if (for$ != null) {
queryParams.addAll(_queryParams('', 'for', for$));
}
if (isSaved != null) {
queryParams.addAll(_queryParams('', 'isSaved', isSaved));
@@ -297,15 +223,15 @@ class MemoriesApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -313,242 +239,155 @@ class MemoriesApi {
///
/// Retrieve statistics about memories, such as total count and other relevant metrics.
///
/// Parameters:
///
/// * [DateTime] for_:
/// Filter by date
///
/// * [bool] isSaved:
/// Filter by saved status
///
/// * [bool] isTrashed:
/// Include trashed memories
///
/// * [MemorySearchOrder] order:
///
/// * [int] size:
/// Number of memories to return
///
/// * [MemoryType] type:
Future<MemoryStatisticsResponseDto?> memoriesStatistics({ DateTime? for_, bool? isSaved, bool? isTrashed, MemorySearchOrder? order, int? size, MemoryType? type, }) async {
final response = await memoriesStatisticsWithHttpInfo( for_: for_, isSaved: isSaved, isTrashed: isTrashed, order: order, size: size, type: type, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MemoryStatisticsResponseDto',) as MemoryStatisticsResponseDto;
}
return null;
}
/// Remove assets from a memory
///
/// Remove a list of asset IDs from a specific memory.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<Response> removeMemoryAssetsWithHttpInfo(String id, BulkIdsDto bulkIdsDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/memories/{id}/assets'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
/// Available since server v1.0.0.
Future<MemoryStatisticsResponseDto> memoriesStatistics({
DateTime? for$,
bool? isSaved,
bool? isTrashed,
MemorySearchOrder? order,
int? size,
MemoryType? type,
Future<void>? abortTrigger,
}) async {
final response = await memoriesStatisticsWithHttpInfo(
for$: for$,
isSaved: isSaved,
isTrashed: isTrashed,
order: order,
size: size,
type: type,
abortTrigger: abortTrigger,
);
}
/// Remove assets from a memory
///
/// Remove a list of asset IDs from a specific memory.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<List<BulkIdResponseDto>?> removeMemoryAssets(String id, BulkIdsDto bulkIdsDto,) async {
final response = await removeMemoryAssetsWithHttpInfo(id, bulkIdsDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList(growable: false);
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'MemoryStatisticsResponseDto')
as MemoryStatisticsResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve memories
/// Delete a memory
///
/// Retrieve a list of memories. Memories are sorted descending by creation date by default, although they can also be sorted in ascending order, or randomly.
/// Delete a specific memory by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [DateTime] for_:
/// Filter by date
///
/// * [bool] isSaved:
/// Filter by saved status
///
/// * [bool] isTrashed:
/// Include trashed memories
///
/// * [MemorySearchOrder] order:
///
/// * [int] size:
/// Number of memories to return
///
/// * [MemoryType] type:
Future<Response> searchMemoriesWithHttpInfo({ DateTime? for_, bool? isSaved, bool? isTrashed, MemorySearchOrder? order, int? size, MemoryType? type, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/memories';
Future<Response> deleteMemoryWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/memories/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (for_ != null) {
queryParams.addAll(_queryParams('', 'for', for_));
}
if (isSaved != null) {
queryParams.addAll(_queryParams('', 'isSaved', isSaved));
}
if (isTrashed != null) {
queryParams.addAll(_queryParams('', 'isTrashed', isTrashed));
}
if (order != null) {
queryParams.addAll(_queryParams('', 'order', order));
}
if (size != null) {
queryParams.addAll(_queryParams('', 'size', size));
}
if (type != null) {
queryParams.addAll(_queryParams('', 'type', type));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve memories
/// Delete a memory
///
/// Retrieve a list of memories. Memories are sorted descending by creation date by default, although they can also be sorted in ascending order, or randomly.
/// Delete a specific memory by its ID.
///
/// Parameters:
///
/// * [DateTime] for_:
/// Filter by date
///
/// * [bool] isSaved:
/// Filter by saved status
///
/// * [bool] isTrashed:
/// Include trashed memories
///
/// * [MemorySearchOrder] order:
///
/// * [int] size:
/// Number of memories to return
///
/// * [MemoryType] type:
Future<List<MemoryResponseDto>?> searchMemories({ DateTime? for_, bool? isSaved, bool? isTrashed, MemorySearchOrder? order, int? size, MemoryType? type, }) async {
final response = await searchMemoriesWithHttpInfo( for_: for_, isSaved: isSaved, isTrashed: isTrashed, order: order, size: size, type: type, );
/// Available since server v1.0.0.
Future<void> deleteMemory(String id, {Future<void>? abortTrigger}) async {
final response = await deleteMemoryWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<MemoryResponseDto>') as List)
.cast<MemoryResponseDto>()
.toList(growable: false);
}
/// Retrieve a memory
///
/// Retrieve a specific memory by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getMemoryWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/memories/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve a memory
///
/// Retrieve a specific memory by its ID.
///
/// Available since server v1.0.0.
Future<MemoryResponseDto> getMemory(String id, {Future<void>? abortTrigger}) async {
final response = await getMemoryWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
return null;
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'MemoryResponseDto')
as MemoryResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update a memory
///
/// Update an existing memory by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [MemoryUpdateDto] memoryUpdateDto (required):
Future<Response> updateMemoryWithHttpInfo(String id, MemoryUpdateDto memoryUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/memories/{id}'
.replaceAll('{id}', id);
Future<Response> updateMemoryWithHttpInfo(
String id,
MemoryUpdateDto memoryUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/memories/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = memoryUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -556,23 +395,130 @@ class MemoriesApi {
///
/// Update an existing memory by its ID.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [MemoryUpdateDto] memoryUpdateDto (required):
Future<MemoryResponseDto?> updateMemory(String id, MemoryUpdateDto memoryUpdateDto,) async {
final response = await updateMemoryWithHttpInfo(id, memoryUpdateDto,);
/// Available since server v1.0.0.
Future<MemoryResponseDto> updateMemory(
String id,
MemoryUpdateDto memoryUpdateDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateMemoryWithHttpInfo(id, memoryUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'MemoryResponseDto',) as MemoryResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'MemoryResponseDto')
as MemoryResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Remove assets from a memory
///
/// Remove a list of asset IDs from a specific memory.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> removeMemoryAssetsWithHttpInfo(
String id,
BulkIdsDto bulkIdsDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/memories/{id}/assets'.replaceAll('{id}', id);
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Remove assets from a memory
///
/// Remove a list of asset IDs from a specific memory.
///
/// Available since server v1.0.0.
Future<List<BulkIdResponseDto>> removeMemoryAssets(
String id,
BulkIdsDto bulkIdsDto, {
Future<void>? abortTrigger,
}) async {
final response = await removeMemoryAssetsWithHttpInfo(id, bulkIdsDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Add assets to a memory
///
/// Add a list of asset IDs to a specific memory.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> addMemoryAssetsWithHttpInfo(String id, BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/memories/{id}/assets'.replaceAll('{id}', id);
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Add assets to a memory
///
/// Add a list of asset IDs to a specific memory.
///
/// Available since server v1.0.0.
Future<List<BulkIdResponseDto>> addMemoryAssets(
String id,
BulkIdsDto bulkIdsDto, {
Future<void>? abortTrigger,
}) async {
final response = await addMemoryAssetsWithHttpInfo(id, bulkIdsDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+68 -78
View File
@@ -1,52 +1,54 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class NotificationsAdminApi {
NotificationsAdminApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion createNotificationAddedIn = .new(1, 0, 0);
static const ApiState createNotificationState = .stable;
static const ApiVersion getNotificationTemplateAdminAddedIn = .new(1, 0, 0);
static const ApiState getNotificationTemplateAdminState = .stable;
static const ApiVersion sendTestEmailAdminAddedIn = .new(1, 0, 0);
static const ApiState sendTestEmailAdminState = .stable;
/// Create a notification
///
/// Create a new notification for a specific user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [NotificationCreateDto] notificationCreateDto (required):
Future<Response> createNotificationWithHttpInfo(NotificationCreateDto notificationCreateDto,) async {
// ignore: prefer_const_declarations
Future<Response> createNotificationWithHttpInfo(
NotificationCreateDto notificationCreateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/notifications';
// ignore: prefer_final_locals
Object? postBody = notificationCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -54,58 +56,52 @@ class NotificationsAdminApi {
///
/// Create a new notification for a specific user.
///
/// Parameters:
///
/// * [NotificationCreateDto] notificationCreateDto (required):
Future<NotificationDto?> createNotification(NotificationCreateDto notificationCreateDto,) async {
final response = await createNotificationWithHttpInfo(notificationCreateDto,);
/// Available since server v1.0.0.
Future<NotificationDto> createNotification(
NotificationCreateDto notificationCreateDto, {
Future<void>? abortTrigger,
}) async {
final response = await createNotificationWithHttpInfo(notificationCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'NotificationDto',) as NotificationDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'NotificationDto') as NotificationDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Render email template
///
/// Retrieve a preview of the provided email template.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] name (required):
///
/// * [TemplateDto] templateDto (required):
Future<Response> getNotificationTemplateAdminWithHttpInfo(String name, TemplateDto templateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/notifications/templates/{name}'
.replaceAll('{name}', name);
Future<Response> getNotificationTemplateAdminWithHttpInfo(
String name,
TemplateDto templateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/notifications/templates/{name}'.replaceAll('{name}', name);
// ignore: prefer_final_locals
Object? postBody = templateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -113,57 +109,53 @@ class NotificationsAdminApi {
///
/// Retrieve a preview of the provided email template.
///
/// Parameters:
///
/// * [String] name (required):
///
/// * [TemplateDto] templateDto (required):
Future<TemplateResponseDto?> getNotificationTemplateAdmin(String name, TemplateDto templateDto,) async {
final response = await getNotificationTemplateAdminWithHttpInfo(name, templateDto,);
/// Available since server v1.0.0.
Future<TemplateResponseDto> getNotificationTemplateAdmin(
String name,
TemplateDto templateDto, {
Future<void>? abortTrigger,
}) async {
final response = await getNotificationTemplateAdminWithHttpInfo(name, templateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TemplateResponseDto',) as TemplateResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'TemplateResponseDto')
as TemplateResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Send test email
///
/// Send a test email using the provided SMTP configuration.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [SystemConfigSmtpDto] systemConfigSmtpDto (required):
Future<Response> sendTestEmailAdminWithHttpInfo(SystemConfigSmtpDto systemConfigSmtpDto,) async {
// ignore: prefer_const_declarations
Future<Response> sendTestEmailAdminWithHttpInfo(
SystemConfigSmtpDto systemConfigSmtpDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/notifications/test-email';
// ignore: prefer_final_locals
Object? postBody = systemConfigSmtpDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -171,21 +163,19 @@ class NotificationsAdminApi {
///
/// Send a test email using the provided SMTP configuration.
///
/// Parameters:
///
/// * [SystemConfigSmtpDto] systemConfigSmtpDto (required):
Future<TestEmailResponseDto?> sendTestEmailAdmin(SystemConfigSmtpDto systemConfigSmtpDto,) async {
final response = await sendTestEmailAdminWithHttpInfo(systemConfigSmtpDto,);
/// Available since server v1.0.0.
Future<TestEmailResponseDto> sendTestEmailAdmin(
SystemConfigSmtpDto systemConfigSmtpDto, {
Future<void>? abortTrigger,
}) async {
final response = await sendTestEmailAdminWithHttpInfo(systemConfigSmtpDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TestEmailResponseDto',) as TestEmailResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'TestEmailResponseDto')
as TestEmailResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+219 -237
View File
@@ -1,101 +1,66 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class NotificationsApi {
NotificationsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Delete a notification
///
/// Delete a specific notification.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteNotificationWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/notifications/{id}'
.replaceAll('{id}', id);
static const ApiVersion deleteNotificationsAddedIn = .new(1, 0, 0);
// ignore: prefer_final_locals
Object? postBody;
static const ApiState deleteNotificationsState = .stable;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiVersion getNotificationsAddedIn = .new(1, 0, 0);
const contentTypes = <String>[];
static const ApiState getNotificationsState = .stable;
static const ApiVersion updateNotificationsAddedIn = .new(1, 0, 0);
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiState updateNotificationsState = .stable;
/// Delete a notification
///
/// Delete a specific notification.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteNotification(String id,) async {
final response = await deleteNotificationWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
static const ApiVersion deleteNotificationAddedIn = .new(1, 0, 0);
static const ApiState deleteNotificationState = .stable;
static const ApiVersion getNotificationAddedIn = .new(1, 0, 0);
static const ApiState getNotificationState = .stable;
static const ApiVersion updateNotificationAddedIn = .new(1, 0, 0);
static const ApiState updateNotificationState = .stable;
/// Delete notifications
///
/// Delete a list of notifications at once.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [NotificationDeleteAllDto] notificationDeleteAllDto (required):
Future<Response> deleteNotificationsWithHttpInfo(NotificationDeleteAllDto notificationDeleteAllDto,) async {
// ignore: prefer_const_declarations
Future<Response> deleteNotificationsWithHttpInfo(
NotificationDeleteAllDto notificationDeleteAllDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/notifications';
// ignore: prefer_final_locals
Object? postBody = notificationDeleteAllDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -103,95 +68,33 @@ class NotificationsApi {
///
/// Delete a list of notifications at once.
///
/// Parameters:
///
/// * [NotificationDeleteAllDto] notificationDeleteAllDto (required):
Future<void> deleteNotifications(NotificationDeleteAllDto notificationDeleteAllDto,) async {
final response = await deleteNotificationsWithHttpInfo(notificationDeleteAllDto,);
/// Available since server v1.0.0.
Future<void> deleteNotifications(
NotificationDeleteAllDto notificationDeleteAllDto, {
Future<void>? abortTrigger,
}) async {
final response = await deleteNotificationsWithHttpInfo(notificationDeleteAllDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Get a notification
///
/// Retrieve a specific notification identified by id.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getNotificationWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/notifications/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Get a notification
///
/// Retrieve a specific notification identified by id.
///
/// Parameters:
///
/// * [String] id (required):
Future<NotificationDto?> getNotification(String id,) async {
final response = await getNotificationWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'NotificationDto',) as NotificationDto;
}
return null;
}
/// Retrieve notifications
///
/// Retrieve a list of notifications.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id:
/// Filter by notification ID
///
/// * [NotificationLevel] level:
///
/// * [NotificationType] type:
///
/// * [bool] unread:
/// Filter by unread status
Future<Response> getNotificationsWithHttpInfo({ String? id, NotificationLevel? level, NotificationType? type, bool? unread, }) async {
// ignore: prefer_const_declarations
Future<Response> getNotificationsWithHttpInfo({
String? id,
NotificationLevel? level,
NotificationType? type,
bool? unread,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/notifications';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -213,15 +116,15 @@ class NotificationsApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -229,127 +132,63 @@ class NotificationsApi {
///
/// Retrieve a list of notifications.
///
/// Parameters:
///
/// * [String] id:
/// Filter by notification ID
///
/// * [NotificationLevel] level:
///
/// * [NotificationType] type:
///
/// * [bool] unread:
/// Filter by unread status
Future<List<NotificationDto>?> getNotifications({ String? id, NotificationLevel? level, NotificationType? type, bool? unread, }) async {
final response = await getNotificationsWithHttpInfo( id: id, level: level, type: type, unread: unread, );
/// Available since server v1.0.0.
Future<List<NotificationDto>> getNotifications({
String? id,
NotificationLevel? level,
NotificationType? type,
bool? unread,
Future<void>? abortTrigger,
}) async {
final response = await getNotificationsWithHttpInfo(
id: id,
level: level,
type: type,
unread: unread,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<NotificationDto>') as List)
.cast<NotificationDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<NotificationDto>') as List)
.cast<NotificationDto>()
.toList(growable: false);
}
return null;
}
/// Update a notification
///
/// Update a specific notification to set its read status.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [NotificationUpdateDto] notificationUpdateDto (required):
Future<Response> updateNotificationWithHttpInfo(String id, NotificationUpdateDto notificationUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/notifications/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = notificationUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Update a notification
///
/// Update a specific notification to set its read status.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [NotificationUpdateDto] notificationUpdateDto (required):
Future<NotificationDto?> updateNotification(String id, NotificationUpdateDto notificationUpdateDto,) async {
final response = await updateNotificationWithHttpInfo(id, notificationUpdateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'NotificationDto',) as NotificationDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update notifications
///
/// Update a list of notifications. Allows to bulk-set the read status of notifications.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [NotificationUpdateAllDto] notificationUpdateAllDto (required):
Future<Response> updateNotificationsWithHttpInfo(NotificationUpdateAllDto notificationUpdateAllDto,) async {
// ignore: prefer_const_declarations
Future<Response> updateNotificationsWithHttpInfo(
NotificationUpdateAllDto notificationUpdateAllDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/notifications';
// ignore: prefer_final_locals
Object? postBody = notificationUpdateAllDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -357,13 +196,156 @@ class NotificationsApi {
///
/// Update a list of notifications. Allows to bulk-set the read status of notifications.
///
/// Parameters:
///
/// * [NotificationUpdateAllDto] notificationUpdateAllDto (required):
Future<void> updateNotifications(NotificationUpdateAllDto notificationUpdateAllDto,) async {
final response = await updateNotificationsWithHttpInfo(notificationUpdateAllDto,);
/// Available since server v1.0.0.
Future<void> updateNotifications(
NotificationUpdateAllDto notificationUpdateAllDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateNotificationsWithHttpInfo(notificationUpdateAllDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Delete a notification
///
/// Delete a specific notification.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> deleteNotificationWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/notifications/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Delete a notification
///
/// Delete a specific notification.
///
/// Available since server v1.0.0.
Future<void> deleteNotification(String id, {Future<void>? abortTrigger}) async {
final response = await deleteNotificationWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Get a notification
///
/// Retrieve a specific notification identified by id.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getNotificationWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/notifications/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Get a notification
///
/// Retrieve a specific notification identified by id.
///
/// Available since server v1.0.0.
Future<NotificationDto> getNotification(String id, {Future<void>? abortTrigger}) async {
final response = await getNotificationWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'NotificationDto') as NotificationDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update a notification
///
/// Update a specific notification to set its read status.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> updateNotificationWithHttpInfo(
String id,
NotificationUpdateDto notificationUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/notifications/{id}'.replaceAll('{id}', id);
Object? postBody = notificationUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a notification
///
/// Update a specific notification to set its read status.
///
/// Available since server v1.0.0.
Future<NotificationDto> updateNotification(
String id,
NotificationUpdateDto notificationUpdateDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateNotificationWithHttpInfo(id, notificationUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'NotificationDto') as NotificationDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+167 -191
View File
@@ -1,52 +1,115 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class PartnersApi {
PartnersApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion getPartnersAddedIn = .new(1, 0, 0);
static const ApiState getPartnersState = .stable;
static const ApiVersion createPartnerAddedIn = .new(1, 0, 0);
static const ApiState createPartnerState = .stable;
static const ApiVersion removePartnerAddedIn = .new(1, 0, 0);
static const ApiState removePartnerState = .stable;
static const ApiVersion createPartnerDeprecatedAddedIn = .new(1, 0, 0);
static const ApiVersion createPartnerDeprecatedDeprecatedIn = .new(1, 0, 0);
static const ApiState createPartnerDeprecatedState = .deprecated;
static const ApiVersion updatePartnerAddedIn = .new(1, 0, 0);
static const ApiState updatePartnerState = .stable;
/// Retrieve partners
///
/// Retrieve a list of partners with whom assets are shared.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getPartnersWithHttpInfo({required PartnerDirection direction, Future<void>? abortTrigger}) async {
final apiPath = r'/partners';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'direction', direction));
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve partners
///
/// Retrieve a list of partners with whom assets are shared.
///
/// Available since server v1.0.0.
Future<List<PartnerResponseDto>> getPartners({
required PartnerDirection direction,
Future<void>? abortTrigger,
}) async {
final response = await getPartnersWithHttpInfo(direction: direction, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<PartnerResponseDto>') as List)
.cast<PartnerResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create a partner
///
/// Create a new partner to share assets with.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [PartnerCreateDto] partnerCreateDto (required):
Future<Response> createPartnerWithHttpInfo(PartnerCreateDto partnerCreateDto,) async {
// ignore: prefer_const_declarations
Future<Response> createPartnerWithHttpInfo(PartnerCreateDto partnerCreateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/partners';
// ignore: prefer_final_locals
Object? postBody = partnerCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -54,157 +117,29 @@ class PartnersApi {
///
/// Create a new partner to share assets with.
///
/// Parameters:
///
/// * [PartnerCreateDto] partnerCreateDto (required):
Future<PartnerResponseDto?> createPartner(PartnerCreateDto partnerCreateDto,) async {
final response = await createPartnerWithHttpInfo(partnerCreateDto,);
/// Available since server v1.0.0.
Future<PartnerResponseDto> createPartner(PartnerCreateDto partnerCreateDto, {Future<void>? abortTrigger}) async {
final response = await createPartnerWithHttpInfo(partnerCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PartnerResponseDto',) as PartnerResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'PartnerResponseDto')
as PartnerResponseDto;
}
return null;
}
/// Create a partner
///
/// Create a new partner to share assets with.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> createPartnerDeprecatedWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/partners/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Create a partner
///
/// Create a new partner to share assets with.
///
/// Parameters:
///
/// * [String] id (required):
Future<PartnerResponseDto?> createPartnerDeprecated(String id,) async {
final response = await createPartnerDeprecatedWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PartnerResponseDto',) as PartnerResponseDto;
}
return null;
}
/// Retrieve partners
///
/// Retrieve a list of partners with whom assets are shared.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [PartnerDirection] direction (required):
Future<Response> getPartnersWithHttpInfo(PartnerDirection direction,) async {
// ignore: prefer_const_declarations
final apiPath = r'/partners';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'direction', direction));
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve partners
///
/// Retrieve a list of partners with whom assets are shared.
///
/// Parameters:
///
/// * [PartnerDirection] direction (required):
Future<List<PartnerResponseDto>?> getPartners(PartnerDirection direction,) async {
final response = await getPartnersWithHttpInfo(direction,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<PartnerResponseDto>') as List)
.cast<PartnerResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Remove a partner
///
/// Stop sharing assets with a partner.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> removePartnerWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/partners/{id}'
.replaceAll('{id}', id);
Future<Response> removePartnerWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/partners/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -213,15 +148,15 @@ class PartnersApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -229,50 +164,94 @@ class PartnersApi {
///
/// Stop sharing assets with a partner.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> removePartner(String id,) async {
final response = await removePartnerWithHttpInfo(id,);
/// Available since server v1.0.0.
Future<void> removePartner(String id, {Future<void>? abortTrigger}) async {
final response = await removePartnerWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Create a partner
///
/// Create a new partner to share assets with.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
@Deprecated('Deprecated by the Immich server API since v1.0.0.')
Future<Response> createPartnerDeprecatedWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/partners/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Create a partner
///
/// Create a new partner to share assets with.
///
/// Available since server v1.0.0.
@Deprecated('Deprecated by the Immich server API since v1.0.0.')
Future<PartnerResponseDto> createPartnerDeprecated(String id, {Future<void>? abortTrigger}) async {
final response = await createPartnerDeprecatedWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'PartnerResponseDto')
as PartnerResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update a partner
///
/// Specify whether a partner's assets should appear in the user's timeline.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [PartnerUpdateDto] partnerUpdateDto (required):
Future<Response> updatePartnerWithHttpInfo(String id, PartnerUpdateDto partnerUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/partners/{id}'
.replaceAll('{id}', id);
Future<Response> updatePartnerWithHttpInfo(
String id,
PartnerUpdateDto partnerUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/partners/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = partnerUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -280,23 +259,20 @@ class PartnersApi {
///
/// Specify whether a partner's assets should appear in the user's timeline.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [PartnerUpdateDto] partnerUpdateDto (required):
Future<PartnerResponseDto?> updatePartner(String id, PartnerUpdateDto partnerUpdateDto,) async {
final response = await updatePartnerWithHttpInfo(id, partnerUpdateDto,);
/// Available since server v1.0.0.
Future<PartnerResponseDto> updatePartner(
String id,
PartnerUpdateDto partnerUpdateDto, {
Future<void>? abortTrigger,
}) async {
final response = await updatePartnerWithHttpInfo(id, partnerUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PartnerResponseDto',) as PartnerResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'PartnerResponseDto')
as PartnerResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+423 -488
View File
File diff suppressed because it is too large Load Diff
+151 -187
View File
@@ -1,114 +1,141 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class PluginsApi {
PluginsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Retrieve a plugin
static const ApiVersion searchPluginsAddedIn = .new(3, 0, 0);
static const ApiState searchPluginsState = .added;
static const ApiVersion searchPluginMethodsAddedIn = .new(3, 0, 0);
static const ApiState searchPluginMethodsState = .added;
static const ApiVersion searchPluginTemplatesAddedIn = .new(3, 0, 0);
static const ApiState searchPluginTemplatesState = .added;
static const ApiVersion getPluginAddedIn = .new(3, 0, 0);
static const ApiState getPluginState = .added;
/// List all plugins
///
/// Retrieve information about a specific plugin by its ID.
/// Retrieve a list of plugins available to the authenticated user.
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getPluginWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/plugins/{id}'
.replaceAll('{id}', id);
Future<Response> searchPluginsWithHttpInfo({
String? description,
bool? enabled,
String? id,
String? name,
String? title,
String? version,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/plugins';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
if (description != null) {
queryParams.addAll(_queryParams('', 'description', description));
}
if (enabled != null) {
queryParams.addAll(_queryParams('', 'enabled', enabled));
}
if (id != null) {
queryParams.addAll(_queryParams('', 'id', id));
}
if (name != null) {
queryParams.addAll(_queryParams('', 'name', name));
}
if (title != null) {
queryParams.addAll(_queryParams('', 'title', title));
}
if (version != null) {
queryParams.addAll(_queryParams('', 'version', version));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve a plugin
/// List all plugins
///
/// Retrieve information about a specific plugin by its ID.
/// Retrieve a list of plugins available to the authenticated user.
///
/// Parameters:
///
/// * [String] id (required):
Future<PluginResponseDto?> getPlugin(String id,) async {
final response = await getPluginWithHttpInfo(id,);
/// Available since server v3.0.0.
Future<List<PluginResponseDto>> searchPlugins({
String? description,
bool? enabled,
String? id,
String? name,
String? title,
String? version,
Future<void>? abortTrigger,
}) async {
final response = await searchPluginsWithHttpInfo(
description: description,
enabled: enabled,
id: id,
name: name,
title: title,
version: version,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PluginResponseDto',) as PluginResponseDto;
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<PluginResponseDto>') as List)
.cast<PluginResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve plugin methods
///
/// Retrieve a list of plugin methods
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] description:
///
/// * [bool] enabled:
/// Whether the plugin method is enabled
///
/// * [String] id:
/// Plugin method ID
///
/// * [String] name:
///
/// * [String] pluginName:
/// Plugin name
///
/// * [String] pluginVersion:
/// Plugin version
///
/// * [String] title:
///
/// * [WorkflowTrigger] trigger:
/// Workflow trigger
///
/// * [WorkflowType] type:
/// Workflow types
Future<Response> searchPluginMethodsWithHttpInfo({ String? description, bool? enabled, String? id, String? name, String? pluginName, String? pluginVersion, String? title, WorkflowTrigger? trigger, WorkflowType? type, }) async {
// ignore: prefer_const_declarations
Future<Response> searchPluginMethodsWithHttpInfo({
String? description,
bool? enabled,
String? id,
String? name,
String? pluginName,
String? pluginVersion,
String? title,
WorkflowTrigger? trigger,
WorkflowType? type,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/plugins/methods';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -145,15 +172,15 @@ class PluginsApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -161,59 +188,53 @@ class PluginsApi {
///
/// Retrieve a list of plugin methods
///
/// Parameters:
///
/// * [String] description:
///
/// * [bool] enabled:
/// Whether the plugin method is enabled
///
/// * [String] id:
/// Plugin method ID
///
/// * [String] name:
///
/// * [String] pluginName:
/// Plugin name
///
/// * [String] pluginVersion:
/// Plugin version
///
/// * [String] title:
///
/// * [WorkflowTrigger] trigger:
/// Workflow trigger
///
/// * [WorkflowType] type:
/// Workflow types
Future<List<PluginMethodResponseDto>?> searchPluginMethods({ String? description, bool? enabled, String? id, String? name, String? pluginName, String? pluginVersion, String? title, WorkflowTrigger? trigger, WorkflowType? type, }) async {
final response = await searchPluginMethodsWithHttpInfo( description: description, enabled: enabled, id: id, name: name, pluginName: pluginName, pluginVersion: pluginVersion, title: title, trigger: trigger, type: type, );
/// Available since server v3.0.0.
Future<List<PluginMethodResponseDto>> searchPluginMethods({
String? description,
bool? enabled,
String? id,
String? name,
String? pluginName,
String? pluginVersion,
String? title,
WorkflowTrigger? trigger,
WorkflowType? type,
Future<void>? abortTrigger,
}) async {
final response = await searchPluginMethodsWithHttpInfo(
description: description,
enabled: enabled,
id: id,
name: name,
pluginName: pluginName,
pluginVersion: pluginVersion,
title: title,
trigger: trigger,
type: type,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<PluginMethodResponseDto>') as List)
.cast<PluginMethodResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<PluginMethodResponseDto>') as List)
.cast<PluginMethodResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve workflow templates
///
/// Retrieve workflow templates provided by installed plugins
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> searchPluginTemplatesWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> searchPluginTemplatesWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/plugins/templates';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -222,138 +243,81 @@ class PluginsApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve workflow templates
///
/// Retrieve workflow templates provided by installed plugins
Future<List<PluginTemplateResponseDto>?> searchPluginTemplates() async {
final response = await searchPluginTemplatesWithHttpInfo();
///
/// Available since server v3.0.0.
Future<List<PluginTemplateResponseDto>> searchPluginTemplates({Future<void>? abortTrigger}) async {
final response = await searchPluginTemplatesWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<PluginTemplateResponseDto>') as List)
.cast<PluginTemplateResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<PluginTemplateResponseDto>') as List)
.cast<PluginTemplateResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// List all plugins
/// Retrieve a plugin
///
/// Retrieve a list of plugins available to the authenticated user.
/// Retrieve information about a specific plugin by its ID.
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] description:
///
/// * [bool] enabled:
/// Whether the plugin is enabled
///
/// * [String] id:
/// Plugin ID
///
/// * [String] name:
///
/// * [String] title:
///
/// * [String] version:
Future<Response> searchPluginsWithHttpInfo({ String? description, bool? enabled, String? id, String? name, String? title, String? version, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/plugins';
Future<Response> getPluginWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/plugins/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (description != null) {
queryParams.addAll(_queryParams('', 'description', description));
}
if (enabled != null) {
queryParams.addAll(_queryParams('', 'enabled', enabled));
}
if (id != null) {
queryParams.addAll(_queryParams('', 'id', id));
}
if (name != null) {
queryParams.addAll(_queryParams('', 'name', name));
}
if (title != null) {
queryParams.addAll(_queryParams('', 'title', title));
}
if (version != null) {
queryParams.addAll(_queryParams('', 'version', version));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// List all plugins
/// Retrieve a plugin
///
/// Retrieve a list of plugins available to the authenticated user.
/// Retrieve information about a specific plugin by its ID.
///
/// Parameters:
///
/// * [String] description:
///
/// * [bool] enabled:
/// Whether the plugin is enabled
///
/// * [String] id:
/// Plugin ID
///
/// * [String] name:
///
/// * [String] title:
///
/// * [String] version:
Future<List<PluginResponseDto>?> searchPlugins({ String? description, bool? enabled, String? id, String? name, String? title, String? version, }) async {
final response = await searchPluginsWithHttpInfo( description: description, enabled: enabled, id: id, name: name, title: title, version: version, );
/// Available since server v3.0.0.
Future<PluginResponseDto> getPlugin(String id, {Future<void>? abortTrigger}) async {
final response = await getPluginWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<PluginResponseDto>') as List)
.cast<PluginResponseDto>()
.toList(growable: false);
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'PluginResponseDto')
as PluginResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+205 -228
View File
@@ -1,89 +1,42 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class QueuesApi {
QueuesApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Empty a queue
static const ApiVersion getQueuesAddedIn = .new(2, 4, 0);
static const ApiState getQueuesState = .alpha;
static const ApiVersion getQueueAddedIn = .new(2, 4, 0);
static const ApiState getQueueState = .alpha;
static const ApiVersion updateQueueAddedIn = .new(2, 4, 0);
static const ApiState updateQueueState = .alpha;
static const ApiVersion emptyQueueAddedIn = .new(2, 4, 0);
static const ApiState emptyQueueState = .alpha;
static const ApiVersion getQueueJobsAddedIn = .new(2, 4, 0);
static const ApiState getQueueJobsState = .alpha;
/// List all queues
///
/// Removes all jobs from the specified queue.
/// Retrieves a list of queues.
///
/// Available since server v2.4.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [QueueName] name (required):
///
/// * [QueueDeleteDto] queueDeleteDto (required):
Future<Response> emptyQueueWithHttpInfo(QueueName name, QueueDeleteDto queueDeleteDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/queues/{name}/jobs'
.replaceAll('{name}', name.toString());
Future<Response> getQueuesWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/queues';
// ignore: prefer_final_locals
Object? postBody = queueDeleteDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Empty a queue
///
/// Removes all jobs from the specified queue.
///
/// Parameters:
///
/// * [QueueName] name (required):
///
/// * [QueueDeleteDto] queueDeleteDto (required):
Future<void> emptyQueue(QueueName name, QueueDeleteDto queueDeleteDto,) async {
final response = await emptyQueueWithHttpInfo(name, queueDeleteDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve a queue
///
/// Retrieves a specific queue by its name.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [QueueName] name (required):
Future<Response> getQueueWithHttpInfo(QueueName name,) async {
// ignore: prefer_const_declarations
final apiPath = r'/queues/{name}'
.replaceAll('{name}', name.toString());
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -92,15 +45,64 @@ class QueuesApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// List all queues
///
/// Retrieves a list of queues.
///
/// Available since server v2.4.0.
Future<List<QueueResponseDto>> getQueues({Future<void>? abortTrigger}) async {
final response = await getQueuesWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<QueueResponseDto>') as List)
.cast<QueueResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve a queue
///
/// Retrieves a specific queue by its name.
///
/// Available since server v2.4.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getQueueWithHttpInfo(QueueName name, {Future<void>? abortTrigger}) async {
final apiPath = r'/queues/{name}'.replaceAll('{name}', parameterToString(name));
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -108,42 +110,134 @@ class QueuesApi {
///
/// Retrieves a specific queue by its name.
///
/// Parameters:
///
/// * [QueueName] name (required):
Future<QueueResponseDto?> getQueue(QueueName name,) async {
final response = await getQueueWithHttpInfo(name,);
/// Available since server v2.4.0.
Future<QueueResponseDto> getQueue(QueueName name, {Future<void>? abortTrigger}) async {
final response = await getQueueWithHttpInfo(name, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'QueueResponseDto',) as QueueResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'QueueResponseDto')
as QueueResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update a queue
///
/// Change the paused status of a specific queue.
///
/// Available since server v2.4.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> updateQueueWithHttpInfo(
QueueName name,
QueueUpdateDto queueUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/queues/{name}'.replaceAll('{name}', parameterToString(name));
Object? postBody = queueUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a queue
///
/// Change the paused status of a specific queue.
///
/// Available since server v2.4.0.
Future<QueueResponseDto> updateQueue(
QueueName name,
QueueUpdateDto queueUpdateDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateQueueWithHttpInfo(name, queueUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'QueueResponseDto')
as QueueResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Empty a queue
///
/// Removes all jobs from the specified queue.
///
/// Available since server v2.4.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> emptyQueueWithHttpInfo(
QueueName name,
QueueDeleteDto queueDeleteDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/queues/{name}/jobs'.replaceAll('{name}', parameterToString(name));
Object? postBody = queueDeleteDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Empty a queue
///
/// Removes all jobs from the specified queue.
///
/// Available since server v2.4.0.
Future<void> emptyQueue(QueueName name, QueueDeleteDto queueDeleteDto, {Future<void>? abortTrigger}) async {
final response = await emptyQueueWithHttpInfo(name, queueDeleteDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
return null;
}
/// Retrieve queue jobs
///
/// Retrieves a list of queue jobs from the specified queue.
///
/// Available since server v2.4.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [QueueName] name (required):
///
/// * [List<QueueJobStatus>] status:
/// Filter jobs by status
Future<Response> getQueueJobsWithHttpInfo(QueueName name, { List<QueueJobStatus>? status, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/queues/{name}/jobs'
.replaceAll('{name}', name.toString());
Future<Response> getQueueJobsWithHttpInfo(
QueueName name, {
List<QueueJobStatus>? status,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/queues/{name}/jobs'.replaceAll('{name}', parameterToString(name));
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -156,15 +250,15 @@ class QueuesApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -172,139 +266,22 @@ class QueuesApi {
///
/// Retrieves a list of queue jobs from the specified queue.
///
/// Parameters:
///
/// * [QueueName] name (required):
///
/// * [List<QueueJobStatus>] status:
/// Filter jobs by status
Future<List<QueueJobResponseDto>?> getQueueJobs(QueueName name, { List<QueueJobStatus>? status, }) async {
final response = await getQueueJobsWithHttpInfo(name, status: status, );
/// Available since server v2.4.0.
Future<List<QueueJobResponseDto>> getQueueJobs(
QueueName name, {
List<QueueJobStatus>? status,
Future<void>? abortTrigger,
}) async {
final response = await getQueueJobsWithHttpInfo(name, status: status, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<QueueJobResponseDto>') as List)
.cast<QueueJobResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<QueueJobResponseDto>') as List)
.cast<QueueJobResponseDto>()
.toList(growable: false);
}
return null;
}
/// List all queues
///
/// Retrieves a list of queues.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getQueuesWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/queues';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// List all queues
///
/// Retrieves a list of queues.
Future<List<QueueResponseDto>?> getQueues() async {
final response = await getQueuesWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<QueueResponseDto>') as List)
.cast<QueueResponseDto>()
.toList(growable: false);
}
return null;
}
/// Update a queue
///
/// Change the paused status of a specific queue.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [QueueName] name (required):
///
/// * [QueueUpdateDto] queueUpdateDto (required):
Future<Response> updateQueueWithHttpInfo(QueueName name, QueueUpdateDto queueUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/queues/{name}'
.replaceAll('{name}', name.toString());
// ignore: prefer_final_locals
Object? postBody = queueUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Update a queue
///
/// Change the paused status of a specific queue.
///
/// Parameters:
///
/// * [QueueName] name (required):
///
/// * [QueueUpdateDto] queueUpdateDto (required):
Future<QueueResponseDto?> updateQueue(QueueName name, QueueUpdateDto queueUpdateDto,) async {
final response = await updateQueueWithHttpInfo(name, queueUpdateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'QueueResponseDto',) as QueueResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+432 -566
View File
File diff suppressed because it is too large Load Diff
+495 -469
View File
File diff suppressed because it is too large Load Diff
+202 -213
View File
@@ -1,52 +1,154 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class SessionsApi {
SessionsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion deleteAllSessionsAddedIn = .new(1, 0, 0);
static const ApiState deleteAllSessionsState = .stable;
static const ApiVersion getSessionsAddedIn = .new(1, 0, 0);
static const ApiState getSessionsState = .stable;
static const ApiVersion createSessionAddedIn = .new(1, 0, 0);
static const ApiState createSessionState = .stable;
static const ApiVersion deleteSessionAddedIn = .new(1, 0, 0);
static const ApiState deleteSessionState = .stable;
static const ApiVersion updateSessionAddedIn = .new(1, 0, 0);
static const ApiState updateSessionState = .stable;
static const ApiVersion lockSessionAddedIn = .new(1, 0, 0);
static const ApiState lockSessionState = .stable;
/// Delete all sessions
///
/// Delete all sessions for the user. This will not delete the current session.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> deleteAllSessionsWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/sessions';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Delete all sessions
///
/// Delete all sessions for the user. This will not delete the current session.
///
/// Available since server v1.0.0.
Future<void> deleteAllSessions({Future<void>? abortTrigger}) async {
final response = await deleteAllSessionsWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve sessions
///
/// Retrieve a list of sessions for the user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getSessionsWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/sessions';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve sessions
///
/// Retrieve a list of sessions for the user.
///
/// Available since server v1.0.0.
Future<List<SessionResponseDto>> getSessions({Future<void>? abortTrigger}) async {
final response = await getSessionsWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<SessionResponseDto>') as List)
.cast<SessionResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create a session
///
/// Create a session as a child to the current session. This endpoint is used for casting.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [SessionCreateDto] sessionCreateDto (required):
Future<Response> createSessionWithHttpInfo(SessionCreateDto sessionCreateDto,) async {
// ignore: prefer_const_declarations
Future<Response> createSessionWithHttpInfo(SessionCreateDto sessionCreateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/sessions';
// ignore: prefer_final_locals
Object? postBody = sessionCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -54,79 +156,32 @@ class SessionsApi {
///
/// Create a session as a child to the current session. This endpoint is used for casting.
///
/// Parameters:
///
/// * [SessionCreateDto] sessionCreateDto (required):
Future<SessionCreateResponseDto?> createSession(SessionCreateDto sessionCreateDto,) async {
final response = await createSessionWithHttpInfo(sessionCreateDto,);
/// Available since server v1.0.0.
Future<SessionCreateResponseDto> createSession(
SessionCreateDto sessionCreateDto, {
Future<void>? abortTrigger,
}) async {
final response = await createSessionWithHttpInfo(sessionCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SessionCreateResponseDto',) as SessionCreateResponseDto;
}
return null;
}
/// Delete all sessions
///
/// Delete all sessions for the user. This will not delete the current session.
///
/// Note: This method returns the HTTP [Response].
Future<Response> deleteAllSessionsWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/sessions';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Delete all sessions
///
/// Delete all sessions for the user. This will not delete the current session.
Future<void> deleteAllSessions() async {
final response = await deleteAllSessionsWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SessionCreateResponseDto')
as SessionCreateResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Delete a session
///
/// Delete a specific session by id.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteSessionWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/sessions/{id}'
.replaceAll('{id}', id);
Future<Response> deleteSessionWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/sessions/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -135,15 +190,15 @@ class SessionsApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -151,111 +206,9 @@ class SessionsApi {
///
/// Delete a specific session by id.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteSession(String id,) async {
final response = await deleteSessionWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve sessions
///
/// Retrieve a list of sessions for the user.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getSessionsWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/sessions';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve sessions
///
/// Retrieve a list of sessions for the user.
Future<List<SessionResponseDto>?> getSessions() async {
final response = await getSessionsWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<SessionResponseDto>') as List)
.cast<SessionResponseDto>()
.toList(growable: false);
}
return null;
}
/// Lock a session
///
/// Lock a specific session by id.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> lockSessionWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/sessions/{id}/lock'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Lock a session
///
/// Lock a specific session by id.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> lockSession(String id,) async {
final response = await lockSessionWithHttpInfo(id,);
/// Available since server v1.0.0.
Future<void> deleteSession(String id, {Future<void>? abortTrigger}) async {
final response = await deleteSessionWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -265,36 +218,33 @@ class SessionsApi {
///
/// Update a specific session identified by id.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [SessionUpdateDto] sessionUpdateDto (required):
Future<Response> updateSessionWithHttpInfo(String id, SessionUpdateDto sessionUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/sessions/{id}'
.replaceAll('{id}', id);
Future<Response> updateSessionWithHttpInfo(
String id,
SessionUpdateDto sessionUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/sessions/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = sessionUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -302,23 +252,62 @@ class SessionsApi {
///
/// Update a specific session identified by id.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [SessionUpdateDto] sessionUpdateDto (required):
Future<SessionResponseDto?> updateSession(String id, SessionUpdateDto sessionUpdateDto,) async {
final response = await updateSessionWithHttpInfo(id, sessionUpdateDto,);
/// Available since server v1.0.0.
Future<SessionResponseDto> updateSession(
String id,
SessionUpdateDto sessionUpdateDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateSessionWithHttpInfo(id, sessionUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SessionResponseDto',) as SessionResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SessionResponseDto')
as SessionResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Lock a session
///
/// Lock a specific session by id.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> lockSessionWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/sessions/{id}/lock'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Lock a session
///
/// Lock a specific session by id.
///
/// Available since server v1.0.0.
Future<void> lockSession(String id, {Future<void>? abortTrigger}) async {
final response = await lockSessionWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
return null;
}
}
+366 -408
View File
@@ -1,159 +1,58 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class SharedLinksApi {
SharedLinksApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Add assets to a shared link
///
/// Add assets to a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [AssetIdsDto] assetIdsDto (required):
Future<Response> addSharedLinkAssetsWithHttpInfo(String id, AssetIdsDto assetIdsDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/shared-links/{id}/assets'
.replaceAll('{id}', id);
static const ApiVersion getAllSharedLinksAddedIn = .new(1, 0, 0);
// ignore: prefer_final_locals
Object? postBody = assetIdsDto;
static const ApiState getAllSharedLinksState = .stable;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiVersion createSharedLinkAddedIn = .new(1, 0, 0);
const contentTypes = <String>['application/json'];
static const ApiState createSharedLinkState = .stable;
static const ApiVersion sharedLinkLoginAddedIn = .new(2, 6, 0);
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiState sharedLinkLoginState = .beta;
/// Add assets to a shared link
///
/// Add assets to a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [AssetIdsDto] assetIdsDto (required):
Future<List<AssetIdsResponseDto>?> addSharedLinkAssets(String id, AssetIdsDto assetIdsDto,) async {
final response = await addSharedLinkAssetsWithHttpInfo(id, assetIdsDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<AssetIdsResponseDto>') as List)
.cast<AssetIdsResponseDto>()
.toList(growable: false);
static const ApiVersion getMySharedLinkAddedIn = .new(1, 0, 0);
}
return null;
}
static const ApiState getMySharedLinkState = .stable;
/// Create a shared link
///
/// Create a new shared link.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [SharedLinkCreateDto] sharedLinkCreateDto (required):
Future<Response> createSharedLinkWithHttpInfo(SharedLinkCreateDto sharedLinkCreateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/shared-links';
static const ApiVersion removeSharedLinkAddedIn = .new(1, 0, 0);
// ignore: prefer_final_locals
Object? postBody = sharedLinkCreateDto;
static const ApiState removeSharedLinkState = .stable;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiVersion getSharedLinkByIdAddedIn = .new(1, 0, 0);
const contentTypes = <String>['application/json'];
static const ApiState getSharedLinkByIdState = .stable;
static const ApiVersion updateSharedLinkAddedIn = .new(1, 0, 0);
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiState updateSharedLinkState = .stable;
/// Create a shared link
///
/// Create a new shared link.
///
/// Parameters:
///
/// * [SharedLinkCreateDto] sharedLinkCreateDto (required):
Future<SharedLinkResponseDto?> createSharedLink(SharedLinkCreateDto sharedLinkCreateDto,) async {
final response = await createSharedLinkWithHttpInfo(sharedLinkCreateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
}
return null;
}
static const ApiVersion removeSharedLinkAssetsAddedIn = .new(1, 0, 0);
static const ApiState removeSharedLinkAssetsState = .stable;
static const ApiVersion addSharedLinkAssetsAddedIn = .new(1, 0, 0);
static const ApiState addSharedLinkAssetsState = .stable;
/// Retrieve all shared links
///
/// Retrieve a list of all shared links.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] albumId:
/// Filter by album ID
///
/// * [String] id:
/// Filter by shared link ID
Future<Response> getAllSharedLinksWithHttpInfo({ String? albumId, String? id, }) async {
// ignore: prefer_const_declarations
Future<Response> getAllSharedLinksWithHttpInfo({String? albumId, String? id, Future<void>? abortTrigger}) async {
final apiPath = r'/shared-links';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -169,15 +68,15 @@ class SharedLinksApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -185,286 +84,93 @@ class SharedLinksApi {
///
/// Retrieve a list of all shared links.
///
/// Parameters:
///
/// * [String] albumId:
/// Filter by album ID
///
/// * [String] id:
/// Filter by shared link ID
Future<List<SharedLinkResponseDto>?> getAllSharedLinks({ String? albumId, String? id, }) async {
final response = await getAllSharedLinksWithHttpInfo( albumId: albumId, id: id, );
/// Available since server v1.0.0.
Future<List<SharedLinkResponseDto>> getAllSharedLinks({
String? albumId,
String? id,
Future<void>? abortTrigger,
}) async {
final response = await getAllSharedLinksWithHttpInfo(albumId: albumId, id: id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<SharedLinkResponseDto>') as List)
.cast<SharedLinkResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<SharedLinkResponseDto>') as List)
.cast<SharedLinkResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve current shared link
/// Create a shared link
///
/// Retrieve the current shared link associated with authentication method.
/// Create a new shared link.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] key:
///
/// * [String] slug:
Future<Response> getMySharedLinkWithHttpInfo({ String? key, String? slug, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/shared-links/me';
Future<Response> createSharedLinkWithHttpInfo(
SharedLinkCreateDto sharedLinkCreateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/shared-links';
// ignore: prefer_final_locals
Object? postBody;
Object? postBody = sharedLinkCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (key != null) {
queryParams.addAll(_queryParams('', 'key', key));
}
if (slug != null) {
queryParams.addAll(_queryParams('', 'slug', slug));
}
const contentTypes = <String>[];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'GET',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve current shared link
/// Create a shared link
///
/// Retrieve the current shared link associated with authentication method.
/// Create a new shared link.
///
/// Parameters:
///
/// * [String] key:
///
/// * [String] slug:
Future<SharedLinkResponseDto?> getMySharedLink({ String? key, String? slug, }) async {
final response = await getMySharedLinkWithHttpInfo( key: key, slug: slug, );
/// Available since server v1.0.0.
Future<SharedLinkResponseDto> createSharedLink(
SharedLinkCreateDto sharedLinkCreateDto, {
Future<void>? abortTrigger,
}) async {
final response = await createSharedLinkWithHttpInfo(sharedLinkCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SharedLinkResponseDto')
as SharedLinkResponseDto;
}
return null;
}
/// Retrieve a shared link
///
/// Retrieve a specific shared link by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getSharedLinkByIdWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/shared-links/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve a shared link
///
/// Retrieve a specific shared link by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<SharedLinkResponseDto?> getSharedLinkById(String id,) async {
final response = await getSharedLinkByIdWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
}
return null;
}
/// Delete a shared link
///
/// Delete a specific shared link by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> removeSharedLinkWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/shared-links/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Delete a shared link
///
/// Delete a specific shared link by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> removeSharedLink(String id,) async {
final response = await removeSharedLinkWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Remove assets from a shared link
///
/// Remove assets from a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [AssetIdsDto] assetIdsDto (required):
Future<Response> removeSharedLinkAssetsWithHttpInfo(String id, AssetIdsDto assetIdsDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/shared-links/{id}/assets'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = assetIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Remove assets from a shared link
///
/// Remove assets from a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [AssetIdsDto] assetIdsDto (required):
Future<List<AssetIdsResponseDto>?> removeSharedLinkAssets(String id, AssetIdsDto assetIdsDto,) async {
final response = await removeSharedLinkAssetsWithHttpInfo(id, assetIdsDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<AssetIdsResponseDto>') as List)
.cast<AssetIdsResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Shared link login
///
/// Login to a password protected shared link
///
/// Available since server v2.6.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [SharedLinkLoginDto] sharedLinkLoginDto (required):
///
/// * [String] key:
///
/// * [String] slug:
Future<Response> sharedLinkLoginWithHttpInfo(SharedLinkLoginDto sharedLinkLoginDto, { String? key, String? slug, }) async {
// ignore: prefer_const_declarations
Future<Response> sharedLinkLoginWithHttpInfo(
SharedLinkLoginDto sharedLinkLoginDto, {
String? key,
String? slug,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/shared-links/login';
// ignore: prefer_final_locals
Object? postBody = sharedLinkLoginDto;
final queryParams = <QueryParam>[];
@@ -478,17 +184,17 @@ class SharedLinksApi {
queryParams.addAll(_queryParams('', 'slug', slug));
}
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -496,62 +202,203 @@ class SharedLinksApi {
///
/// Login to a password protected shared link
///
/// Parameters:
///
/// * [SharedLinkLoginDto] sharedLinkLoginDto (required):
///
/// * [String] key:
///
/// * [String] slug:
Future<SharedLinkResponseDto?> sharedLinkLogin(SharedLinkLoginDto sharedLinkLoginDto, { String? key, String? slug, }) async {
final response = await sharedLinkLoginWithHttpInfo(sharedLinkLoginDto, key: key, slug: slug, );
/// Available since server v2.6.0.
Future<SharedLinkResponseDto> sharedLinkLogin(
SharedLinkLoginDto sharedLinkLoginDto, {
String? key,
String? slug,
Future<void>? abortTrigger,
}) async {
final response = await sharedLinkLoginWithHttpInfo(
sharedLinkLoginDto,
key: key,
slug: slug,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SharedLinkResponseDto')
as SharedLinkResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve current shared link
///
/// Retrieve the current shared link associated with authentication method.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getMySharedLinkWithHttpInfo({String? key, String? slug, Future<void>? abortTrigger}) async {
final apiPath = r'/shared-links/me';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (key != null) {
queryParams.addAll(_queryParams('', 'key', key));
}
if (slug != null) {
queryParams.addAll(_queryParams('', 'slug', slug));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve current shared link
///
/// Retrieve the current shared link associated with authentication method.
///
/// Available since server v1.0.0.
Future<SharedLinkResponseDto> getMySharedLink({String? key, String? slug, Future<void>? abortTrigger}) async {
final response = await getMySharedLinkWithHttpInfo(key: key, slug: slug, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SharedLinkResponseDto')
as SharedLinkResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Delete a shared link
///
/// Delete a specific shared link by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> removeSharedLinkWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/shared-links/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Delete a shared link
///
/// Delete a specific shared link by its ID.
///
/// Available since server v1.0.0.
Future<void> removeSharedLink(String id, {Future<void>? abortTrigger}) async {
final response = await removeSharedLinkWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve a shared link
///
/// Retrieve a specific shared link by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getSharedLinkByIdWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/shared-links/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve a shared link
///
/// Retrieve a specific shared link by its ID.
///
/// Available since server v1.0.0.
Future<SharedLinkResponseDto> getSharedLinkById(String id, {Future<void>? abortTrigger}) async {
final response = await getSharedLinkByIdWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SharedLinkResponseDto')
as SharedLinkResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update a shared link
///
/// Update an existing shared link by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [SharedLinkEditDto] sharedLinkEditDto (required):
Future<Response> updateSharedLinkWithHttpInfo(String id, SharedLinkEditDto sharedLinkEditDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/shared-links/{id}'
.replaceAll('{id}', id);
Future<Response> updateSharedLinkWithHttpInfo(
String id,
SharedLinkEditDto sharedLinkEditDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/shared-links/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = sharedLinkEditDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PATCH',
r'PATCH',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -559,23 +406,134 @@ class SharedLinksApi {
///
/// Update an existing shared link by its ID.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [SharedLinkEditDto] sharedLinkEditDto (required):
Future<SharedLinkResponseDto?> updateSharedLink(String id, SharedLinkEditDto sharedLinkEditDto,) async {
final response = await updateSharedLinkWithHttpInfo(id, sharedLinkEditDto,);
/// Available since server v1.0.0.
Future<SharedLinkResponseDto> updateSharedLink(
String id,
SharedLinkEditDto sharedLinkEditDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateSharedLinkWithHttpInfo(id, sharedLinkEditDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SharedLinkResponseDto',) as SharedLinkResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SharedLinkResponseDto')
as SharedLinkResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Remove assets from a shared link
///
/// Remove assets from a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> removeSharedLinkAssetsWithHttpInfo(
String id,
AssetIdsDto assetIdsDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/shared-links/{id}/assets'.replaceAll('{id}', id);
Object? postBody = assetIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Remove assets from a shared link
///
/// Remove assets from a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.
///
/// Available since server v1.0.0.
Future<List<AssetIdsResponseDto>> removeSharedLinkAssets(
String id,
AssetIdsDto assetIdsDto, {
Future<void>? abortTrigger,
}) async {
final response = await removeSharedLinkAssetsWithHttpInfo(id, assetIdsDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<AssetIdsResponseDto>') as List)
.cast<AssetIdsResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Add assets to a shared link
///
/// Add assets to a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> addSharedLinkAssetsWithHttpInfo(
String id,
AssetIdsDto assetIdsDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/shared-links/{id}/assets'.replaceAll('{id}', id);
Object? postBody = assetIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Add assets to a shared link
///
/// Add assets to a specific shared link by its ID. This endpoint is only relevant for shared link of type individual.
///
/// Available since server v1.0.0.
Future<List<AssetIdsResponseDto>> addSharedLinkAssets(
String id,
AssetIdsDto assetIdsDto, {
Future<void>? abortTrigger,
}) async {
final response = await addSharedLinkAssetsWithHttpInfo(id, assetIdsDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<AssetIdsResponseDto>') as List)
.cast<AssetIdsResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+230 -277
View File
@@ -1,157 +1,67 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class StacksApi {
StacksApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Create a stack
///
/// Create a new stack by providing a name and a list of asset IDs to include in the stack. If any of the provided asset IDs are primary assets of an existing stack, the existing stack will be merged into the newly created stack.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [StackCreateDto] stackCreateDto (required):
Future<Response> createStackWithHttpInfo(StackCreateDto stackCreateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/stacks';
static const ApiVersion deleteStacksAddedIn = .new(1, 0, 0);
// ignore: prefer_final_locals
Object? postBody = stackCreateDto;
static const ApiState deleteStacksState = .stable;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiVersion searchStacksAddedIn = .new(1, 0, 0);
const contentTypes = <String>['application/json'];
static const ApiState searchStacksState = .stable;
static const ApiVersion createStackAddedIn = .new(1, 0, 0);
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiState createStackState = .stable;
/// Create a stack
///
/// Create a new stack by providing a name and a list of asset IDs to include in the stack. If any of the provided asset IDs are primary assets of an existing stack, the existing stack will be merged into the newly created stack.
///
/// Parameters:
///
/// * [StackCreateDto] stackCreateDto (required):
Future<StackResponseDto?> createStack(StackCreateDto stackCreateDto,) async {
final response = await createStackWithHttpInfo(stackCreateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'StackResponseDto',) as StackResponseDto;
}
return null;
}
static const ApiVersion deleteStackAddedIn = .new(1, 0, 0);
/// Delete a stack
///
/// Delete a specific stack by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteStackWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/stacks/{id}'
.replaceAll('{id}', id);
static const ApiState deleteStackState = .stable;
// ignore: prefer_final_locals
Object? postBody;
static const ApiVersion getStackAddedIn = .new(1, 0, 0);
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiState getStackState = .stable;
const contentTypes = <String>[];
static const ApiVersion updateStackAddedIn = .new(1, 0, 0);
static const ApiState updateStackState = .stable;
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiVersion removeAssetFromStackAddedIn = .new(1, 0, 0);
/// Delete a stack
///
/// Delete a specific stack by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteStack(String id,) async {
final response = await deleteStackWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
static const ApiState removeAssetFromStackState = .stable;
/// Delete stacks
///
/// Delete multiple stacks by providing a list of stack IDs.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<Response> deleteStacksWithHttpInfo(BulkIdsDto bulkIdsDto,) async {
// ignore: prefer_const_declarations
Future<Response> deleteStacksWithHttpInfo(BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/stacks';
// ignore: prefer_final_locals
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -159,122 +69,9 @@ class StacksApi {
///
/// Delete multiple stacks by providing a list of stack IDs.
///
/// Parameters:
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<void> deleteStacks(BulkIdsDto bulkIdsDto,) async {
final response = await deleteStacksWithHttpInfo(bulkIdsDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve a stack
///
/// Retrieve a specific stack by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getStackWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/stacks/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve a stack
///
/// Retrieve a specific stack by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<StackResponseDto?> getStack(String id,) async {
final response = await getStackWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'StackResponseDto',) as StackResponseDto;
}
return null;
}
/// Remove an asset from a stack
///
/// Remove a specific asset from a stack by providing the stack ID and asset ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] assetId (required):
///
/// * [String] id (required):
Future<Response> removeAssetFromStackWithHttpInfo(String assetId, String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/stacks/{id}/assets/{assetId}'
.replaceAll('{assetId}', assetId)
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Remove an asset from a stack
///
/// Remove a specific asset from a stack by providing the stack ID and asset ID.
///
/// Parameters:
///
/// * [String] assetId (required):
///
/// * [String] id (required):
Future<void> removeAssetFromStack(String assetId, String id,) async {
final response = await removeAssetFromStackWithHttpInfo(assetId, id,);
/// Available since server v1.0.0.
Future<void> deleteStacks(BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final response = await deleteStacksWithHttpInfo(bulkIdsDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -284,17 +81,12 @@ class StacksApi {
///
/// Retrieve a list of stacks.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] primaryAssetId:
/// Filter by primary asset ID
Future<Response> searchStacksWithHttpInfo({ String? primaryAssetId, }) async {
// ignore: prefer_const_declarations
Future<Response> searchStacksWithHttpInfo({String? primaryAssetId, Future<void>? abortTrigger}) async {
final apiPath = r'/stacks';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -307,15 +99,15 @@ class StacksApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -323,62 +115,188 @@ class StacksApi {
///
/// Retrieve a list of stacks.
///
/// Parameters:
///
/// * [String] primaryAssetId:
/// Filter by primary asset ID
Future<List<StackResponseDto>?> searchStacks({ String? primaryAssetId, }) async {
final response = await searchStacksWithHttpInfo( primaryAssetId: primaryAssetId, );
/// Available since server v1.0.0.
Future<List<StackResponseDto>> searchStacks({String? primaryAssetId, Future<void>? abortTrigger}) async {
final response = await searchStacksWithHttpInfo(primaryAssetId: primaryAssetId, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<StackResponseDto>') as List)
.cast<StackResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<StackResponseDto>') as List)
.cast<StackResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create a stack
///
/// Create a new stack by providing a name and a list of asset IDs to include in the stack. If any of the provided asset IDs are primary assets of an existing stack, the existing stack will be merged into the newly created stack.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> createStackWithHttpInfo(StackCreateDto stackCreateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/stacks';
Object? postBody = stackCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Create a stack
///
/// Create a new stack by providing a name and a list of asset IDs to include in the stack. If any of the provided asset IDs are primary assets of an existing stack, the existing stack will be merged into the newly created stack.
///
/// Available since server v1.0.0.
Future<StackResponseDto> createStack(StackCreateDto stackCreateDto, {Future<void>? abortTrigger}) async {
final response = await createStackWithHttpInfo(stackCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'StackResponseDto')
as StackResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Delete a stack
///
/// Delete a specific stack by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> deleteStackWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/stacks/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Delete a stack
///
/// Delete a specific stack by its ID.
///
/// Available since server v1.0.0.
Future<void> deleteStack(String id, {Future<void>? abortTrigger}) async {
final response = await deleteStackWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve a stack
///
/// Retrieve a specific stack by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getStackWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/stacks/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve a stack
///
/// Retrieve a specific stack by its ID.
///
/// Available since server v1.0.0.
Future<StackResponseDto> getStack(String id, {Future<void>? abortTrigger}) async {
final response = await getStackWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'StackResponseDto')
as StackResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update a stack
///
/// Update an existing stack by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [StackUpdateDto] stackUpdateDto (required):
Future<Response> updateStackWithHttpInfo(String id, StackUpdateDto stackUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/stacks/{id}'
.replaceAll('{id}', id);
Future<Response> updateStackWithHttpInfo(
String id,
StackUpdateDto stackUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/stacks/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = stackUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -386,23 +304,58 @@ class StacksApi {
///
/// Update an existing stack by its ID.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [StackUpdateDto] stackUpdateDto (required):
Future<StackResponseDto?> updateStack(String id, StackUpdateDto stackUpdateDto,) async {
final response = await updateStackWithHttpInfo(id, stackUpdateDto,);
/// Available since server v1.0.0.
Future<StackResponseDto> updateStack(String id, StackUpdateDto stackUpdateDto, {Future<void>? abortTrigger}) async {
final response = await updateStackWithHttpInfo(id, stackUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'StackResponseDto',) as StackResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'StackResponseDto')
as StackResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Remove an asset from a stack
///
/// Remove a specific asset from a stack by providing the stack ID and asset ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> removeAssetFromStackWithHttpInfo(String assetId, String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/stacks/{id}/assets/{assetId}'.replaceAll('{assetId}', assetId).replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Remove an asset from a stack
///
/// Remove a specific asset from a stack by providing the stack ID and asset ID.
///
/// Available since server v1.0.0.
Future<void> removeAssetFromStack(String assetId, String id, {Future<void>? abortTrigger}) async {
final response = await removeAssetFromStackWithHttpInfo(assetId, id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
return null;
}
}
+88 -101
View File
@@ -1,52 +1,55 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class SyncApi {
SyncApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion deleteSyncAckAddedIn = .new(1, 0, 0);
static const ApiState deleteSyncAckState = .stable;
static const ApiVersion getSyncAckAddedIn = .new(1, 0, 0);
static const ApiState getSyncAckState = .stable;
static const ApiVersion sendSyncAckAddedIn = .new(1, 0, 0);
static const ApiState sendSyncAckState = .stable;
static const ApiVersion getSyncStreamAddedIn = .new(1, 0, 0);
static const ApiState getSyncStreamState = .stable;
/// Delete acknowledgements
///
/// Delete specific synchronization acknowledgments.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [SyncAckDeleteDto] syncAckDeleteDto (required):
Future<Response> deleteSyncAckWithHttpInfo(SyncAckDeleteDto syncAckDeleteDto,) async {
// ignore: prefer_const_declarations
Future<Response> deleteSyncAckWithHttpInfo(SyncAckDeleteDto syncAckDeleteDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/sync/ack';
// ignore: prefer_final_locals
Object? postBody = syncAckDeleteDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -54,11 +57,9 @@ class SyncApi {
///
/// Delete specific synchronization acknowledgments.
///
/// Parameters:
///
/// * [SyncAckDeleteDto] syncAckDeleteDto (required):
Future<void> deleteSyncAck(SyncAckDeleteDto syncAckDeleteDto,) async {
final response = await deleteSyncAckWithHttpInfo(syncAckDeleteDto,);
/// Available since server v1.0.0.
Future<void> deleteSyncAck(SyncAckDeleteDto syncAckDeleteDto, {Future<void>? abortTrigger}) async {
final response = await deleteSyncAckWithHttpInfo(syncAckDeleteDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
@@ -68,12 +69,12 @@ class SyncApi {
///
/// Retrieve the synchronization acknowledgments for the current session.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getSyncAckWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> getSyncAckWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/sync/ack';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -82,118 +83,64 @@ class SyncApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve acknowledgements
///
/// Retrieve the synchronization acknowledgments for the current session.
Future<List<SyncAckDto>?> getSyncAck() async {
final response = await getSyncAckWithHttpInfo();
///
/// Available since server v1.0.0.
Future<List<SyncAckDto>> getSyncAck({Future<void>? abortTrigger}) async {
final response = await getSyncAckWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<SyncAckDto>') as List)
.cast<SyncAckDto>()
.toList(growable: false);
}
return null;
}
/// Stream sync changes
///
/// Retrieve a JSON lines streamed response of changes for synchronization. This endpoint is used by the mobile app to efficiently stay up to date with changes.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [SyncStreamDto] syncStreamDto (required):
Future<Response> getSyncStreamWithHttpInfo(SyncStreamDto syncStreamDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/sync/stream';
// ignore: prefer_final_locals
Object? postBody = syncStreamDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Stream sync changes
///
/// Retrieve a JSON lines streamed response of changes for synchronization. This endpoint is used by the mobile app to efficiently stay up to date with changes.
///
/// Parameters:
///
/// * [SyncStreamDto] syncStreamDto (required):
Future<void> getSyncStream(SyncStreamDto syncStreamDto,) async {
final response = await getSyncStreamWithHttpInfo(syncStreamDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
return (await apiClient.deserializeAsync(responseBody, r'List<SyncAckDto>') as List).cast<SyncAckDto>().toList(
growable: false,
);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Acknowledge changes
///
/// Send a list of synchronization acknowledgements to confirm that the latest changes have been received.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [SyncAckSetDto] syncAckSetDto (required):
Future<Response> sendSyncAckWithHttpInfo(SyncAckSetDto syncAckSetDto,) async {
// ignore: prefer_const_declarations
Future<Response> sendSyncAckWithHttpInfo(SyncAckSetDto syncAckSetDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/sync/ack';
// ignore: prefer_final_locals
Object? postBody = syncAckSetDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -201,11 +148,51 @@ class SyncApi {
///
/// Send a list of synchronization acknowledgements to confirm that the latest changes have been received.
///
/// Parameters:
/// Available since server v1.0.0.
Future<void> sendSyncAck(SyncAckSetDto syncAckSetDto, {Future<void>? abortTrigger}) async {
final response = await sendSyncAckWithHttpInfo(syncAckSetDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Stream sync changes
///
/// * [SyncAckSetDto] syncAckSetDto (required):
Future<void> sendSyncAck(SyncAckSetDto syncAckSetDto,) async {
final response = await sendSyncAckWithHttpInfo(syncAckSetDto,);
/// Retrieve a JSON lines streamed response of changes for synchronization. This endpoint is used by the mobile app to efficiently stay up to date with changes.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getSyncStreamWithHttpInfo(SyncStreamDto syncStreamDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/sync/stream';
Object? postBody = syncStreamDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Stream sync changes
///
/// Retrieve a JSON lines streamed response of changes for synchronization. This endpoint is used by the mobile app to efficiently stay up to date with changes.
///
/// Available since server v1.0.0.
Future<void> getSyncStream(SyncStreamDto syncStreamDto, {Future<void>? abortTrigger}) async {
final response = await getSyncStreamWithHttpInfo(syncStreamDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
+131 -139
View File
@@ -1,31 +1,38 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class SystemConfigApi {
SystemConfigApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion getConfigAddedIn = .new(1, 0, 0);
static const ApiState getConfigState = .stable;
static const ApiVersion updateConfigAddedIn = .new(1, 0, 0);
static const ApiState updateConfigState = .stable;
static const ApiVersion getConfigDefaultsAddedIn = .new(1, 0, 0);
static const ApiState getConfigDefaultsState = .stable;
static const ApiVersion getStorageTemplateOptionsAddedIn = .new(1, 0, 0);
static const ApiState getStorageTemplateOptionsState = .stable;
/// Get system configuration
///
/// Retrieve the current system configuration.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getConfigWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> getConfigWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/system-config';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -34,163 +41,61 @@ class SystemConfigApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Get system configuration
///
/// Retrieve the current system configuration.
Future<SystemConfigDto?> getConfig() async {
final response = await getConfigWithHttpInfo();
///
/// Available since server v1.0.0.
Future<SystemConfigDto> getConfig({Future<void>? abortTrigger}) async {
final response = await getConfigWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigDto',) as SystemConfigDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SystemConfigDto') as SystemConfigDto;
}
return null;
}
/// Get system configuration defaults
///
/// Retrieve the default values for the system configuration.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getConfigDefaultsWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/system-config/defaults';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Get system configuration defaults
///
/// Retrieve the default values for the system configuration.
Future<SystemConfigDto?> getConfigDefaults() async {
final response = await getConfigDefaultsWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigDto',) as SystemConfigDto;
}
return null;
}
/// Get storage template options
///
/// Retrieve exemplary storage template options.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getStorageTemplateOptionsWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/system-config/storage-template-options';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Get storage template options
///
/// Retrieve exemplary storage template options.
Future<SystemConfigTemplateStorageOptionDto?> getStorageTemplateOptions() async {
final response = await getStorageTemplateOptionsWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigTemplateStorageOptionDto',) as SystemConfigTemplateStorageOptionDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update system configuration
///
/// Update the system configuration with a new system configuration.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [SystemConfigDto] systemConfigDto (required):
Future<Response> updateConfigWithHttpInfo(SystemConfigDto systemConfigDto,) async {
// ignore: prefer_const_declarations
Future<Response> updateConfigWithHttpInfo(SystemConfigDto systemConfigDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/system-config';
// ignore: prefer_final_locals
Object? postBody = systemConfigDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -198,21 +103,108 @@ class SystemConfigApi {
///
/// Update the system configuration with a new system configuration.
///
/// Parameters:
///
/// * [SystemConfigDto] systemConfigDto (required):
Future<SystemConfigDto?> updateConfig(SystemConfigDto systemConfigDto,) async {
final response = await updateConfigWithHttpInfo(systemConfigDto,);
/// Available since server v1.0.0.
Future<SystemConfigDto> updateConfig(SystemConfigDto systemConfigDto, {Future<void>? abortTrigger}) async {
final response = await updateConfigWithHttpInfo(systemConfigDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SystemConfigDto',) as SystemConfigDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SystemConfigDto') as SystemConfigDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Get system configuration defaults
///
/// Retrieve the default values for the system configuration.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getConfigDefaultsWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/system-config/defaults';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Get system configuration defaults
///
/// Retrieve the default values for the system configuration.
///
/// Available since server v1.0.0.
Future<SystemConfigDto> getConfigDefaults({Future<void>? abortTrigger}) async {
final response = await getConfigDefaultsWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SystemConfigDto') as SystemConfigDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Get storage template options
///
/// Retrieve exemplary storage template options.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getStorageTemplateOptionsWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/system-config/storage-template-options';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Get storage template options
///
/// Retrieve exemplary storage template options.
///
/// Available since server v1.0.0.
Future<SystemConfigTemplateStorageOptionDto> getStorageTemplateOptions({Future<void>? abortTrigger}) async {
final response = await getStorageTemplateOptionsWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'SystemConfigTemplateStorageOptionDto')
as SystemConfigTemplateStorageOptionDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+137 -133
View File
@@ -1,31 +1,38 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class SystemMetadataApi {
SystemMetadataApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion getAdminOnboardingAddedIn = .new(1, 0, 0);
static const ApiState getAdminOnboardingState = .stable;
static const ApiVersion updateAdminOnboardingAddedIn = .new(1, 0, 0);
static const ApiState updateAdminOnboardingState = .stable;
static const ApiVersion getReverseGeocodingStateAddedIn = .new(1, 0, 0);
static const ApiState getReverseGeocodingStateState = .stable;
static const ApiVersion getVersionCheckStateAddedIn = .new(1, 0, 0);
static const ApiState getVersionCheckStateState = .stable;
/// Retrieve admin onboarding
///
/// Retrieve the current admin onboarding status.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getAdminOnboardingWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> getAdminOnboardingWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/system-metadata/admin-onboarding';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -34,163 +41,65 @@ class SystemMetadataApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve admin onboarding
///
/// Retrieve the current admin onboarding status.
Future<AdminOnboardingUpdateDto?> getAdminOnboarding() async {
final response = await getAdminOnboardingWithHttpInfo();
///
/// Available since server v1.0.0.
Future<AdminOnboardingUpdateDto> getAdminOnboarding({Future<void>? abortTrigger}) async {
final response = await getAdminOnboardingWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AdminOnboardingUpdateDto',) as AdminOnboardingUpdateDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'AdminOnboardingUpdateDto')
as AdminOnboardingUpdateDto;
}
return null;
}
/// Retrieve reverse geocoding state
///
/// Retrieve the current state of the reverse geocoding import.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getReverseGeocodingStateWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/system-metadata/reverse-geocoding-state';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve reverse geocoding state
///
/// Retrieve the current state of the reverse geocoding import.
Future<ReverseGeocodingStateResponseDto?> getReverseGeocodingState() async {
final response = await getReverseGeocodingStateWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'ReverseGeocodingStateResponseDto',) as ReverseGeocodingStateResponseDto;
}
return null;
}
/// Retrieve version check state
///
/// Retrieve the current state of the version check process.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getVersionCheckStateWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/system-metadata/version-check-state';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve version check state
///
/// Retrieve the current state of the version check process.
Future<VersionCheckStateResponseDto?> getVersionCheckState() async {
final response = await getVersionCheckStateWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'VersionCheckStateResponseDto',) as VersionCheckStateResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update admin onboarding
///
/// Update the admin onboarding status.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AdminOnboardingUpdateDto] adminOnboardingUpdateDto (required):
Future<Response> updateAdminOnboardingWithHttpInfo(AdminOnboardingUpdateDto adminOnboardingUpdateDto,) async {
// ignore: prefer_const_declarations
Future<Response> updateAdminOnboardingWithHttpInfo(
AdminOnboardingUpdateDto adminOnboardingUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/system-metadata/admin-onboarding';
// ignore: prefer_final_locals
Object? postBody = adminOnboardingUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -198,13 +107,108 @@ class SystemMetadataApi {
///
/// Update the admin onboarding status.
///
/// Parameters:
///
/// * [AdminOnboardingUpdateDto] adminOnboardingUpdateDto (required):
Future<void> updateAdminOnboarding(AdminOnboardingUpdateDto adminOnboardingUpdateDto,) async {
final response = await updateAdminOnboardingWithHttpInfo(adminOnboardingUpdateDto,);
/// Available since server v1.0.0.
Future<void> updateAdminOnboarding(
AdminOnboardingUpdateDto adminOnboardingUpdateDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateAdminOnboardingWithHttpInfo(adminOnboardingUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve reverse geocoding state
///
/// Retrieve the current state of the reverse geocoding import.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getReverseGeocodingStateWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/system-metadata/reverse-geocoding-state';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve reverse geocoding state
///
/// Retrieve the current state of the reverse geocoding import.
///
/// Available since server v1.0.0.
Future<ReverseGeocodingStateResponseDto> getReverseGeocodingState({Future<void>? abortTrigger}) async {
final response = await getReverseGeocodingStateWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'ReverseGeocodingStateResponseDto')
as ReverseGeocodingStateResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve version check state
///
/// Retrieve the current state of the version check process.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getVersionCheckStateWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/system-metadata/version-check-state';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve version check state
///
/// Retrieve the current state of the version check process.
///
/// Available since server v1.0.0.
Future<VersionCheckStateResponseDto> getVersionCheckState({Future<void>? abortTrigger}) async {
final response = await getVersionCheckStateWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'VersionCheckStateResponseDto')
as VersionCheckStateResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+362 -426
View File
@@ -1,108 +1,124 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class TagsApi {
TagsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Tag assets
static const ApiVersion getAllTagsAddedIn = .new(1, 0, 0);
static const ApiState getAllTagsState = .stable;
static const ApiVersion createTagAddedIn = .new(1, 0, 0);
static const ApiState createTagState = .stable;
static const ApiVersion upsertTagsAddedIn = .new(1, 0, 0);
static const ApiState upsertTagsState = .stable;
static const ApiVersion bulkTagAssetsAddedIn = .new(1, 0, 0);
static const ApiState bulkTagAssetsState = .stable;
static const ApiVersion deleteTagAddedIn = .new(1, 0, 0);
static const ApiState deleteTagState = .stable;
static const ApiVersion getTagByIdAddedIn = .new(1, 0, 0);
static const ApiState getTagByIdState = .stable;
static const ApiVersion updateTagAddedIn = .new(1, 0, 0);
static const ApiState updateTagState = .stable;
static const ApiVersion untagAssetsAddedIn = .new(1, 0, 0);
static const ApiState untagAssetsState = .stable;
static const ApiVersion tagAssetsAddedIn = .new(1, 0, 0);
static const ApiState tagAssetsState = .stable;
/// Retrieve tags
///
/// Add multiple tags to multiple assets in a single request.
/// Retrieve a list of all tags.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [TagBulkAssetsDto] tagBulkAssetsDto (required):
Future<Response> bulkTagAssetsWithHttpInfo(TagBulkAssetsDto tagBulkAssetsDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/tags/assets';
Future<Response> getAllTagsWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/tags';
// ignore: prefer_final_locals
Object? postBody = tagBulkAssetsDto;
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Tag assets
/// Retrieve tags
///
/// Add multiple tags to multiple assets in a single request.
/// Retrieve a list of all tags.
///
/// Parameters:
///
/// * [TagBulkAssetsDto] tagBulkAssetsDto (required):
Future<TagBulkAssetsResponseDto?> bulkTagAssets(TagBulkAssetsDto tagBulkAssetsDto,) async {
final response = await bulkTagAssetsWithHttpInfo(tagBulkAssetsDto,);
/// Available since server v1.0.0.
Future<List<TagResponseDto>> getAllTags({Future<void>? abortTrigger}) async {
final response = await getAllTagsWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TagBulkAssetsResponseDto',) as TagBulkAssetsResponseDto;
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<TagResponseDto>') as List)
.cast<TagResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create a tag
///
/// Create a new tag by providing a name and optional color.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [TagCreateDto] tagCreateDto (required):
Future<Response> createTagWithHttpInfo(TagCreateDto tagCreateDto,) async {
// ignore: prefer_const_declarations
Future<Response> createTagWithHttpInfo(TagCreateDto tagCreateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/tags';
// ignore: prefer_final_locals
Object? postBody = tagCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -110,401 +126,45 @@ class TagsApi {
///
/// Create a new tag by providing a name and optional color.
///
/// Parameters:
///
/// * [TagCreateDto] tagCreateDto (required):
Future<TagResponseDto?> createTag(TagCreateDto tagCreateDto,) async {
final response = await createTagWithHttpInfo(tagCreateDto,);
/// Available since server v1.0.0.
Future<TagResponseDto> createTag(TagCreateDto tagCreateDto, {Future<void>? abortTrigger}) async {
final response = await createTagWithHttpInfo(tagCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TagResponseDto',) as TagResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'TagResponseDto') as TagResponseDto;
}
return null;
}
/// Delete a tag
///
/// Delete a specific tag by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteTagWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/tags/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Delete a tag
///
/// Delete a specific tag by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteTag(String id,) async {
final response = await deleteTagWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve tags
///
/// Retrieve a list of all tags.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getAllTagsWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/tags';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve tags
///
/// Retrieve a list of all tags.
Future<List<TagResponseDto>?> getAllTags() async {
final response = await getAllTagsWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<TagResponseDto>') as List)
.cast<TagResponseDto>()
.toList(growable: false);
}
return null;
}
/// Retrieve a tag
///
/// Retrieve a specific tag by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getTagByIdWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/tags/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve a tag
///
/// Retrieve a specific tag by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<TagResponseDto?> getTagById(String id,) async {
final response = await getTagByIdWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TagResponseDto',) as TagResponseDto;
}
return null;
}
/// Tag assets
///
/// Add a tag to all the specified assets.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<Response> tagAssetsWithHttpInfo(String id, BulkIdsDto bulkIdsDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/tags/{id}/assets'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Tag assets
///
/// Add a tag to all the specified assets.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<List<BulkIdResponseDto>?> tagAssets(String id, BulkIdsDto bulkIdsDto,) async {
final response = await tagAssetsWithHttpInfo(id, bulkIdsDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList(growable: false);
}
return null;
}
/// Untag assets
///
/// Remove a tag from all the specified assets.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<Response> untagAssetsWithHttpInfo(String id, BulkIdsDto bulkIdsDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/tags/{id}/assets'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Untag assets
///
/// Remove a tag from all the specified assets.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<List<BulkIdResponseDto>?> untagAssets(String id, BulkIdsDto bulkIdsDto,) async {
final response = await untagAssetsWithHttpInfo(id, bulkIdsDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList(growable: false);
}
return null;
}
/// Update a tag
///
/// Update an existing tag identified by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [TagUpdateDto] tagUpdateDto (required):
Future<Response> updateTagWithHttpInfo(String id, TagUpdateDto tagUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/tags/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = tagUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Update a tag
///
/// Update an existing tag identified by its ID.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [TagUpdateDto] tagUpdateDto (required):
Future<TagResponseDto?> updateTag(String id, TagUpdateDto tagUpdateDto,) async {
final response = await updateTagWithHttpInfo(id, tagUpdateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TagResponseDto',) as TagResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Upsert tags
///
/// Create or update multiple tags in a single request.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [TagUpsertDto] tagUpsertDto (required):
Future<Response> upsertTagsWithHttpInfo(TagUpsertDto tagUpsertDto,) async {
// ignore: prefer_const_declarations
Future<Response> upsertTagsWithHttpInfo(TagUpsertDto tagUpsertDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/tags';
// ignore: prefer_final_locals
Object? postBody = tagUpsertDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -512,24 +172,300 @@ class TagsApi {
///
/// Create or update multiple tags in a single request.
///
/// Parameters:
///
/// * [TagUpsertDto] tagUpsertDto (required):
Future<List<TagResponseDto>?> upsertTags(TagUpsertDto tagUpsertDto,) async {
final response = await upsertTagsWithHttpInfo(tagUpsertDto,);
/// Available since server v1.0.0.
Future<List<TagResponseDto>> upsertTags(TagUpsertDto tagUpsertDto, {Future<void>? abortTrigger}) async {
final response = await upsertTagsWithHttpInfo(tagUpsertDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<TagResponseDto>') as List)
.cast<TagResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<TagResponseDto>') as List)
.cast<TagResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Tag assets
///
/// Add multiple tags to multiple assets in a single request.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> bulkTagAssetsWithHttpInfo(TagBulkAssetsDto tagBulkAssetsDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/tags/assets';
Object? postBody = tagBulkAssetsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Tag assets
///
/// Add multiple tags to multiple assets in a single request.
///
/// Available since server v1.0.0.
Future<TagBulkAssetsResponseDto> bulkTagAssets(
TagBulkAssetsDto tagBulkAssetsDto, {
Future<void>? abortTrigger,
}) async {
final response = await bulkTagAssetsWithHttpInfo(tagBulkAssetsDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'TagBulkAssetsResponseDto')
as TagBulkAssetsResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Delete a tag
///
/// Delete a specific tag by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> deleteTagWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/tags/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Delete a tag
///
/// Delete a specific tag by its ID.
///
/// Available since server v1.0.0.
Future<void> deleteTag(String id, {Future<void>? abortTrigger}) async {
final response = await deleteTagWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve a tag
///
/// Retrieve a specific tag by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getTagByIdWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/tags/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve a tag
///
/// Retrieve a specific tag by its ID.
///
/// Available since server v1.0.0.
Future<TagResponseDto> getTagById(String id, {Future<void>? abortTrigger}) async {
final response = await getTagByIdWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'TagResponseDto') as TagResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update a tag
///
/// Update an existing tag identified by its ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> updateTagWithHttpInfo(String id, TagUpdateDto tagUpdateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/tags/{id}'.replaceAll('{id}', id);
Object? postBody = tagUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a tag
///
/// Update an existing tag identified by its ID.
///
/// Available since server v1.0.0.
Future<TagResponseDto> updateTag(String id, TagUpdateDto tagUpdateDto, {Future<void>? abortTrigger}) async {
final response = await updateTagWithHttpInfo(id, tagUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'TagResponseDto') as TagResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Untag assets
///
/// Remove a tag from all the specified assets.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> untagAssetsWithHttpInfo(String id, BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/tags/{id}/assets'.replaceAll('{id}', id);
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Untag assets
///
/// Remove a tag from all the specified assets.
///
/// Available since server v1.0.0.
Future<List<BulkIdResponseDto>> untagAssets(String id, BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final response = await untagAssetsWithHttpInfo(id, bulkIdsDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Tag assets
///
/// Add a tag to all the specified assets.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> tagAssetsWithHttpInfo(String id, BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/tags/{id}/assets'.replaceAll('{id}', id);
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Tag assets
///
/// Add a tag to all the specified assets.
///
/// Available since server v1.0.0.
Future<List<BulkIdResponseDto>> tagAssets(String id, BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final response = await tagAssetsWithHttpInfo(id, bulkIdsDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<BulkIdResponseDto>') as List)
.cast<BulkIdResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+137 -222
View File
@@ -1,79 +1,48 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class TimelineApi {
TimelineApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion getTimeBucketAddedIn = .new(1, 0, 0);
static const ApiState getTimeBucketState = .internal;
static const ApiVersion getTimeBucketsAddedIn = .new(1, 0, 0);
static const ApiState getTimeBucketsState = .internal;
/// Get time bucket
///
/// Retrieve a string of all asset ids in a given time bucket.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] timeBucket (required):
/// Time bucket identifier in YYYY-MM-DD format
///
/// * [String] albumId:
/// Filter assets belonging to a specific album
///
/// * [String] bbox:
/// Bounding box coordinates as west,south,east,north (WGS84)
///
/// * [bool] isFavorite:
/// Filter by favorite status (true for favorites only, false for non-favorites only)
///
/// * [bool] isTrashed:
/// Filter by trash status (true for trashed assets only, false for non-trashed only)
///
/// * [String] key:
///
/// * [AssetOrder] order:
/// Sort order for assets within time buckets (ASC for oldest first, DESC for newest first)
///
/// * [AssetOrderBy] orderBy:
/// Date to group and order assets by (takenAt for date taken, createdAt for date added to Immich)
///
/// * [String] personId:
/// Filter assets containing a specific person (face recognition)
///
/// * [String] slug:
///
/// * [String] tagId:
/// Filter assets with a specific tag
///
/// * [String] userId:
/// Filter assets by specific user ID
///
/// * [AssetVisibility] visibility:
/// Filter by asset visibility status (ARCHIVE, TIMELINE, HIDDEN, LOCKED)
///
/// * [bool] withCoordinates:
/// Include location data in the response
///
/// * [bool] withPartners:
/// Include assets shared by partners
///
/// * [bool] withStacked:
/// Include stacked assets in the response. When true, only primary assets from stacks are returned.
Future<Response> getTimeBucketWithHttpInfo(String timeBucket, { String? albumId, String? bbox, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, AssetOrderBy? orderBy, String? personId, String? slug, String? tagId, String? userId, AssetVisibility? visibility, bool? withCoordinates, bool? withPartners, bool? withStacked, }) async {
// ignore: prefer_const_declarations
Future<Response> getTimeBucketWithHttpInfo({
String? albumId,
String? bbox,
bool? isFavorite,
bool? isTrashed,
String? key,
AssetOrder? order,
AssetOrderBy? orderBy,
String? personId,
String? slug,
String? tagId,
required String timeBucket,
String? userId,
AssetVisibility? visibility,
bool? withCoordinates,
bool? withPartners,
bool? withStacked,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/timeline/bucket';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -110,7 +79,7 @@ class TimelineApi {
if (tagId != null) {
queryParams.addAll(_queryParams('', 'tagId', tagId));
}
queryParams.addAll(_queryParams('', 'timeBucket', timeBucket));
queryParams.addAll(_queryParams('', 'timeBucket', timeBucket));
if (userId != null) {
queryParams.addAll(_queryParams('', 'userId', userId));
}
@@ -129,15 +98,15 @@ class TimelineApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -145,123 +114,82 @@ class TimelineApi {
///
/// Retrieve a string of all asset ids in a given time bucket.
///
/// Parameters:
///
/// * [String] timeBucket (required):
/// Time bucket identifier in YYYY-MM-DD format
///
/// * [String] albumId:
/// Filter assets belonging to a specific album
///
/// * [String] bbox:
/// Bounding box coordinates as west,south,east,north (WGS84)
///
/// * [bool] isFavorite:
/// Filter by favorite status (true for favorites only, false for non-favorites only)
///
/// * [bool] isTrashed:
/// Filter by trash status (true for trashed assets only, false for non-trashed only)
///
/// * [String] key:
///
/// * [AssetOrder] order:
/// Sort order for assets within time buckets (ASC for oldest first, DESC for newest first)
///
/// * [AssetOrderBy] orderBy:
/// Date to group and order assets by (takenAt for date taken, createdAt for date added to Immich)
///
/// * [String] personId:
/// Filter assets containing a specific person (face recognition)
///
/// * [String] slug:
///
/// * [String] tagId:
/// Filter assets with a specific tag
///
/// * [String] userId:
/// Filter assets by specific user ID
///
/// * [AssetVisibility] visibility:
/// Filter by asset visibility status (ARCHIVE, TIMELINE, HIDDEN, LOCKED)
///
/// * [bool] withCoordinates:
/// Include location data in the response
///
/// * [bool] withPartners:
/// Include assets shared by partners
///
/// * [bool] withStacked:
/// Include stacked assets in the response. When true, only primary assets from stacks are returned.
Future<TimeBucketAssetResponseDto?> getTimeBucket(String timeBucket, { String? albumId, String? bbox, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, AssetOrderBy? orderBy, String? personId, String? slug, String? tagId, String? userId, AssetVisibility? visibility, bool? withCoordinates, bool? withPartners, bool? withStacked, }) async {
final response = await getTimeBucketWithHttpInfo(timeBucket, albumId: albumId, bbox: bbox, isFavorite: isFavorite, isTrashed: isTrashed, key: key, order: order, orderBy: orderBy, personId: personId, slug: slug, tagId: tagId, userId: userId, visibility: visibility, withCoordinates: withCoordinates, withPartners: withPartners, withStacked: withStacked, );
/// Available since server v1.0.0.
Future<TimeBucketAssetResponseDto> getTimeBucket({
String? albumId,
String? bbox,
bool? isFavorite,
bool? isTrashed,
String? key,
AssetOrder? order,
AssetOrderBy? orderBy,
String? personId,
String? slug,
String? tagId,
required String timeBucket,
String? userId,
AssetVisibility? visibility,
bool? withCoordinates,
bool? withPartners,
bool? withStacked,
Future<void>? abortTrigger,
}) async {
final response = await getTimeBucketWithHttpInfo(
albumId: albumId,
bbox: bbox,
isFavorite: isFavorite,
isTrashed: isTrashed,
key: key,
order: order,
orderBy: orderBy,
personId: personId,
slug: slug,
tagId: tagId,
timeBucket: timeBucket,
userId: userId,
visibility: visibility,
withCoordinates: withCoordinates,
withPartners: withPartners,
withStacked: withStacked,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TimeBucketAssetResponseDto',) as TimeBucketAssetResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'TimeBucketAssetResponseDto')
as TimeBucketAssetResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Get time buckets
///
/// Retrieve a list of all minimal time buckets.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] albumId:
/// Filter assets belonging to a specific album
///
/// * [String] bbox:
/// Bounding box coordinates as west,south,east,north (WGS84)
///
/// * [bool] isFavorite:
/// Filter by favorite status (true for favorites only, false for non-favorites only)
///
/// * [bool] isTrashed:
/// Filter by trash status (true for trashed assets only, false for non-trashed only)
///
/// * [String] key:
///
/// * [AssetOrder] order:
/// Sort order for assets within time buckets (ASC for oldest first, DESC for newest first)
///
/// * [AssetOrderBy] orderBy:
/// Date to group and order assets by (takenAt for date taken, createdAt for date added to Immich)
///
/// * [String] personId:
/// Filter assets containing a specific person (face recognition)
///
/// * [String] slug:
///
/// * [String] tagId:
/// Filter assets with a specific tag
///
/// * [String] userId:
/// Filter assets by specific user ID
///
/// * [AssetVisibility] visibility:
/// Filter by asset visibility status (ARCHIVE, TIMELINE, HIDDEN, LOCKED)
///
/// * [bool] withCoordinates:
/// Include location data in the response
///
/// * [bool] withPartners:
/// Include assets shared by partners
///
/// * [bool] withStacked:
/// Include stacked assets in the response. When true, only primary assets from stacks are returned.
Future<Response> getTimeBucketsWithHttpInfo({ String? albumId, String? bbox, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, AssetOrderBy? orderBy, String? personId, String? slug, String? tagId, String? userId, AssetVisibility? visibility, bool? withCoordinates, bool? withPartners, bool? withStacked, }) async {
// ignore: prefer_const_declarations
Future<Response> getTimeBucketsWithHttpInfo({
String? albumId,
String? bbox,
bool? isFavorite,
bool? isTrashed,
String? key,
AssetOrder? order,
AssetOrderBy? orderBy,
String? personId,
String? slug,
String? tagId,
String? userId,
AssetVisibility? visibility,
bool? withCoordinates,
bool? withPartners,
bool? withStacked,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/timeline/buckets';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -316,15 +244,15 @@ class TimelineApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -332,65 +260,52 @@ class TimelineApi {
///
/// Retrieve a list of all minimal time buckets.
///
/// Parameters:
///
/// * [String] albumId:
/// Filter assets belonging to a specific album
///
/// * [String] bbox:
/// Bounding box coordinates as west,south,east,north (WGS84)
///
/// * [bool] isFavorite:
/// Filter by favorite status (true for favorites only, false for non-favorites only)
///
/// * [bool] isTrashed:
/// Filter by trash status (true for trashed assets only, false for non-trashed only)
///
/// * [String] key:
///
/// * [AssetOrder] order:
/// Sort order for assets within time buckets (ASC for oldest first, DESC for newest first)
///
/// * [AssetOrderBy] orderBy:
/// Date to group and order assets by (takenAt for date taken, createdAt for date added to Immich)
///
/// * [String] personId:
/// Filter assets containing a specific person (face recognition)
///
/// * [String] slug:
///
/// * [String] tagId:
/// Filter assets with a specific tag
///
/// * [String] userId:
/// Filter assets by specific user ID
///
/// * [AssetVisibility] visibility:
/// Filter by asset visibility status (ARCHIVE, TIMELINE, HIDDEN, LOCKED)
///
/// * [bool] withCoordinates:
/// Include location data in the response
///
/// * [bool] withPartners:
/// Include assets shared by partners
///
/// * [bool] withStacked:
/// Include stacked assets in the response. When true, only primary assets from stacks are returned.
Future<List<TimeBucketsResponseDto>?> getTimeBuckets({ String? albumId, String? bbox, bool? isFavorite, bool? isTrashed, String? key, AssetOrder? order, AssetOrderBy? orderBy, String? personId, String? slug, String? tagId, String? userId, AssetVisibility? visibility, bool? withCoordinates, bool? withPartners, bool? withStacked, }) async {
final response = await getTimeBucketsWithHttpInfo( albumId: albumId, bbox: bbox, isFavorite: isFavorite, isTrashed: isTrashed, key: key, order: order, orderBy: orderBy, personId: personId, slug: slug, tagId: tagId, userId: userId, visibility: visibility, withCoordinates: withCoordinates, withPartners: withPartners, withStacked: withStacked, );
/// Available since server v1.0.0.
Future<List<TimeBucketsResponseDto>> getTimeBuckets({
String? albumId,
String? bbox,
bool? isFavorite,
bool? isTrashed,
String? key,
AssetOrder? order,
AssetOrderBy? orderBy,
String? personId,
String? slug,
String? tagId,
String? userId,
AssetVisibility? visibility,
bool? withCoordinates,
bool? withPartners,
bool? withStacked,
Future<void>? abortTrigger,
}) async {
final response = await getTimeBucketsWithHttpInfo(
albumId: albumId,
bbox: bbox,
isFavorite: isFavorite,
isTrashed: isTrashed,
key: key,
order: order,
orderBy: orderBy,
personId: personId,
slug: slug,
tagId: tagId,
userId: userId,
visibility: visibility,
withCoordinates: withCoordinates,
withPartners: withPartners,
withStacked: withStacked,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<TimeBucketsResponseDto>') as List)
.cast<TimeBucketsResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<TimeBucketsResponseDto>') as List)
.cast<TimeBucketsResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+83 -91
View File
@@ -1,31 +1,34 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class TrashApi {
TrashApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion emptyTrashAddedIn = .new(1, 0, 0);
static const ApiState emptyTrashState = .stable;
static const ApiVersion restoreTrashAddedIn = .new(1, 0, 0);
static const ApiState restoreTrashState = .stable;
static const ApiVersion restoreAssetsAddedIn = .new(1, 0, 0);
static const ApiState restoreAssetsState = .stable;
/// Empty trash
///
/// Permanently delete all items in the trash.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> emptyTrashWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> emptyTrashWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/trash/empty';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -34,67 +37,109 @@ class TrashApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Empty trash
///
/// Permanently delete all items in the trash.
Future<TrashResponseDto?> emptyTrash() async {
final response = await emptyTrashWithHttpInfo();
///
/// Available since server v1.0.0.
Future<TrashResponseDto> emptyTrash({Future<void>? abortTrigger}) async {
final response = await emptyTrashWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TrashResponseDto',) as TrashResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'TrashResponseDto')
as TrashResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Restore trash
///
/// Restore all items in the trash.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> restoreTrashWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/trash/restore';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Restore trash
///
/// Restore all items in the trash.
///
/// Available since server v1.0.0.
Future<TrashResponseDto> restoreTrash({Future<void>? abortTrigger}) async {
final response = await restoreTrashWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'TrashResponseDto')
as TrashResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Restore assets
///
/// Restore specific assets from the trash.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<Response> restoreAssetsWithHttpInfo(BulkIdsDto bulkIdsDto,) async {
// ignore: prefer_const_declarations
Future<Response> restoreAssetsWithHttpInfo(BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/trash/restore/assets';
// ignore: prefer_final_locals
Object? postBody = bulkIdsDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -102,69 +147,16 @@ class TrashApi {
///
/// Restore specific assets from the trash.
///
/// Parameters:
///
/// * [BulkIdsDto] bulkIdsDto (required):
Future<TrashResponseDto?> restoreAssets(BulkIdsDto bulkIdsDto,) async {
final response = await restoreAssetsWithHttpInfo(bulkIdsDto,);
/// Available since server v1.0.0.
Future<TrashResponseDto> restoreAssets(BulkIdsDto bulkIdsDto, {Future<void>? abortTrigger}) async {
final response = await restoreAssetsWithHttpInfo(bulkIdsDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TrashResponseDto',) as TrashResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'TrashResponseDto')
as TrashResponseDto;
}
return null;
}
/// Restore trash
///
/// Restore all items in the trash.
///
/// Note: This method returns the HTTP [Response].
Future<Response> restoreTrashWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/trash/restore';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Restore trash
///
/// Restore all items in the trash.
Future<TrashResponseDto?> restoreTrash() async {
final response = await restoreTrashWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'TrashResponseDto',) as TrashResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+368 -417
View File
@@ -1,52 +1,142 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class UsersAdminApi {
UsersAdminApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion searchUsersAdminAddedIn = .new(1, 0, 0);
static const ApiState searchUsersAdminState = .stable;
static const ApiVersion createUserAdminAddedIn = .new(1, 0, 0);
static const ApiState createUserAdminState = .stable;
static const ApiVersion deleteUserAdminAddedIn = .new(1, 0, 0);
static const ApiState deleteUserAdminState = .stable;
static const ApiVersion getUserAdminAddedIn = .new(1, 0, 0);
static const ApiState getUserAdminState = .stable;
static const ApiVersion updateUserAdminAddedIn = .new(1, 0, 0);
static const ApiState updateUserAdminState = .stable;
static const ApiVersion getUserPreferencesAdminAddedIn = .new(1, 0, 0);
static const ApiState getUserPreferencesAdminState = .stable;
static const ApiVersion updateUserPreferencesAdminAddedIn = .new(1, 0, 0);
static const ApiState updateUserPreferencesAdminState = .stable;
static const ApiVersion restoreUserAdminAddedIn = .new(1, 0, 0);
static const ApiState restoreUserAdminState = .stable;
static const ApiVersion getUserSessionsAdminAddedIn = .new(1, 0, 0);
static const ApiState getUserSessionsAdminState = .stable;
static const ApiVersion getUserStatisticsAdminAddedIn = .new(1, 0, 0);
static const ApiState getUserStatisticsAdminState = .stable;
/// Search users
///
/// Search for users.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> searchUsersAdminWithHttpInfo({String? id, bool? withDeleted, Future<void>? abortTrigger}) async {
final apiPath = r'/admin/users';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (id != null) {
queryParams.addAll(_queryParams('', 'id', id));
}
if (withDeleted != null) {
queryParams.addAll(_queryParams('', 'withDeleted', withDeleted));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Search users
///
/// Search for users.
///
/// Available since server v1.0.0.
Future<List<UserAdminResponseDto>> searchUsersAdmin({
String? id,
bool? withDeleted,
Future<void>? abortTrigger,
}) async {
final response = await searchUsersAdminWithHttpInfo(id: id, withDeleted: withDeleted, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<UserAdminResponseDto>') as List)
.cast<UserAdminResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create a user
///
/// Create a new user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [UserAdminCreateDto] userAdminCreateDto (required):
Future<Response> createUserAdminWithHttpInfo(UserAdminCreateDto userAdminCreateDto,) async {
// ignore: prefer_const_declarations
Future<Response> createUserAdminWithHttpInfo(
UserAdminCreateDto userAdminCreateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/users';
// ignore: prefer_final_locals
Object? postBody = userAdminCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -54,58 +144,53 @@ class UsersAdminApi {
///
/// Create a new user.
///
/// Parameters:
///
/// * [UserAdminCreateDto] userAdminCreateDto (required):
Future<UserAdminResponseDto?> createUserAdmin(UserAdminCreateDto userAdminCreateDto,) async {
final response = await createUserAdminWithHttpInfo(userAdminCreateDto,);
/// Available since server v1.0.0.
Future<UserAdminResponseDto> createUserAdmin(
UserAdminCreateDto userAdminCreateDto, {
Future<void>? abortTrigger,
}) async {
final response = await createUserAdminWithHttpInfo(userAdminCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserAdminResponseDto',) as UserAdminResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'UserAdminResponseDto')
as UserAdminResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Delete a user
///
/// Delete a user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UserAdminDeleteDto] userAdminDeleteDto (required):
Future<Response> deleteUserAdminWithHttpInfo(String id, UserAdminDeleteDto userAdminDeleteDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users/{id}'
.replaceAll('{id}', id);
Future<Response> deleteUserAdminWithHttpInfo(
String id,
UserAdminDeleteDto userAdminDeleteDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/users/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = userAdminDeleteDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'DELETE',
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -113,41 +198,33 @@ class UsersAdminApi {
///
/// Delete a user.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UserAdminDeleteDto] userAdminDeleteDto (required):
Future<UserAdminResponseDto?> deleteUserAdmin(String id, UserAdminDeleteDto userAdminDeleteDto,) async {
final response = await deleteUserAdminWithHttpInfo(id, userAdminDeleteDto,);
/// Available since server v1.0.0.
Future<UserAdminResponseDto> deleteUserAdmin(
String id,
UserAdminDeleteDto userAdminDeleteDto, {
Future<void>? abortTrigger,
}) async {
final response = await deleteUserAdminWithHttpInfo(id, userAdminDeleteDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserAdminResponseDto',) as UserAdminResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'UserAdminResponseDto')
as UserAdminResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve a user
///
/// Retrieve a specific user by their ID.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getUserAdminWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users/{id}'
.replaceAll('{id}', id);
Future<Response> getUserAdminWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/admin/users/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -156,15 +233,15 @@ class UsersAdminApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -172,39 +249,84 @@ class UsersAdminApi {
///
/// Retrieve a specific user by their ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<UserAdminResponseDto?> getUserAdmin(String id,) async {
final response = await getUserAdminWithHttpInfo(id,);
/// Available since server v1.0.0.
Future<UserAdminResponseDto> getUserAdmin(String id, {Future<void>? abortTrigger}) async {
final response = await getUserAdminWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserAdminResponseDto',) as UserAdminResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'UserAdminResponseDto')
as UserAdminResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update a user
///
/// Update an existing user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> updateUserAdminWithHttpInfo(
String id,
UserAdminUpdateDto userAdminUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/users/{id}'.replaceAll('{id}', id);
Object? postBody = userAdminUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update a user
///
/// Update an existing user.
///
/// Available since server v1.0.0.
Future<UserAdminResponseDto> updateUserAdmin(
String id,
UserAdminUpdateDto userAdminUpdateDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateUserAdminWithHttpInfo(id, userAdminUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'UserAdminResponseDto')
as UserAdminResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve user preferences
///
/// Retrieve the preferences of a specific user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getUserPreferencesAdminWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users/{id}/preferences'
.replaceAll('{id}', id);
Future<Response> getUserPreferencesAdminWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/admin/users/{id}/preferences'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -213,15 +335,15 @@ class UsersAdminApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -229,39 +351,88 @@ class UsersAdminApi {
///
/// Retrieve the preferences of a specific user.
///
/// Parameters:
///
/// * [String] id (required):
Future<UserPreferencesResponseDto?> getUserPreferencesAdmin(String id,) async {
final response = await getUserPreferencesAdminWithHttpInfo(id,);
/// Available since server v1.0.0.
Future<UserPreferencesResponseDto> getUserPreferencesAdmin(String id, {Future<void>? abortTrigger}) async {
final response = await getUserPreferencesAdminWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserPreferencesResponseDto',) as UserPreferencesResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'UserPreferencesResponseDto')
as UserPreferencesResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve user sessions
/// Update user preferences
///
/// Retrieve all sessions for a specific user.
/// Update the preferences of a specific user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getUserSessionsAdminWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users/{id}/sessions'
.replaceAll('{id}', id);
Future<Response> updateUserPreferencesAdminWithHttpInfo(
String id,
UserPreferencesUpdateDto userPreferencesUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/users/{id}/preferences'.replaceAll('{id}', id);
Object? postBody = userPreferencesUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Update user preferences
///
/// Update the preferences of a specific user.
///
/// Available since server v1.0.0.
Future<UserPreferencesResponseDto> updateUserPreferencesAdmin(
String id,
UserPreferencesUpdateDto userPreferencesUpdateDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateUserPreferencesAdminWithHttpInfo(
id,
userPreferencesUpdateDto,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'UserPreferencesResponseDto')
as UserPreferencesResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Restore a deleted user
///
/// Restore a previously deleted user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> restoreUserAdminWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/admin/users/{id}/restore'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -270,15 +441,62 @@ class UsersAdminApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Restore a deleted user
///
/// Restore a previously deleted user.
///
/// Available since server v1.0.0.
Future<UserAdminResponseDto> restoreUserAdmin(String id, {Future<void>? abortTrigger}) async {
final response = await restoreUserAdminWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'UserAdminResponseDto')
as UserAdminResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve user sessions
///
/// Retrieve all sessions for a specific user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getUserSessionsAdminWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/admin/users/{id}/sessions'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -286,50 +504,37 @@ class UsersAdminApi {
///
/// Retrieve all sessions for a specific user.
///
/// Parameters:
///
/// * [String] id (required):
Future<List<SessionResponseDto>?> getUserSessionsAdmin(String id,) async {
final response = await getUserSessionsAdminWithHttpInfo(id,);
/// Available since server v1.0.0.
Future<List<SessionResponseDto>> getUserSessionsAdmin(String id, {Future<void>? abortTrigger}) async {
final response = await getUserSessionsAdminWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<SessionResponseDto>') as List)
.cast<SessionResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<SessionResponseDto>') as List)
.cast<SessionResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve user statistics
///
/// Retrieve asset statistics for a specific user.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [bool] isFavorite:
/// Filter by favorite status
///
/// * [bool] isTrashed:
/// Filter by trash status
///
/// * [AssetVisibility] visibility:
Future<Response> getUserStatisticsAdminWithHttpInfo(String id, { bool? isFavorite, bool? isTrashed, AssetVisibility? visibility, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users/{id}/statistics'
.replaceAll('{id}', id);
Future<Response> getUserStatisticsAdminWithHttpInfo(
String id, {
bool? isFavorite,
bool? isTrashed,
AssetVisibility? visibility,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/admin/users/{id}/statistics'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -348,15 +553,15 @@ class UsersAdminApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -364,282 +569,28 @@ class UsersAdminApi {
///
/// Retrieve asset statistics for a specific user.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [bool] isFavorite:
/// Filter by favorite status
///
/// * [bool] isTrashed:
/// Filter by trash status
///
/// * [AssetVisibility] visibility:
Future<AssetStatsResponseDto?> getUserStatisticsAdmin(String id, { bool? isFavorite, bool? isTrashed, AssetVisibility? visibility, }) async {
final response = await getUserStatisticsAdminWithHttpInfo(id, isFavorite: isFavorite, isTrashed: isTrashed, visibility: visibility, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetStatsResponseDto',) as AssetStatsResponseDto;
}
return null;
}
/// Restore a deleted user
///
/// Restore a previously deleted user.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> restoreUserAdminWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users/{id}/restore'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
/// Available since server v1.0.0.
Future<AssetStatsResponseDto> getUserStatisticsAdmin(
String id, {
bool? isFavorite,
bool? isTrashed,
AssetVisibility? visibility,
Future<void>? abortTrigger,
}) async {
final response = await getUserStatisticsAdminWithHttpInfo(
id,
isFavorite: isFavorite,
isTrashed: isTrashed,
visibility: visibility,
abortTrigger: abortTrigger,
);
}
/// Restore a deleted user
///
/// Restore a previously deleted user.
///
/// Parameters:
///
/// * [String] id (required):
Future<UserAdminResponseDto?> restoreUserAdmin(String id,) async {
final response = await restoreUserAdminWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserAdminResponseDto',) as UserAdminResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'AssetStatsResponseDto')
as AssetStatsResponseDto;
}
return null;
}
/// Search users
///
/// Search for users.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id:
/// User ID filter
///
/// * [bool] withDeleted:
/// Include deleted users
Future<Response> searchUsersAdminWithHttpInfo({ String? id, bool? withDeleted, }) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (id != null) {
queryParams.addAll(_queryParams('', 'id', id));
}
if (withDeleted != null) {
queryParams.addAll(_queryParams('', 'withDeleted', withDeleted));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Search users
///
/// Search for users.
///
/// Parameters:
///
/// * [String] id:
/// User ID filter
///
/// * [bool] withDeleted:
/// Include deleted users
Future<List<UserAdminResponseDto>?> searchUsersAdmin({ String? id, bool? withDeleted, }) async {
final response = await searchUsersAdminWithHttpInfo( id: id, withDeleted: withDeleted, );
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<UserAdminResponseDto>') as List)
.cast<UserAdminResponseDto>()
.toList(growable: false);
}
return null;
}
/// Update a user
///
/// Update an existing user.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UserAdminUpdateDto] userAdminUpdateDto (required):
Future<Response> updateUserAdminWithHttpInfo(String id, UserAdminUpdateDto userAdminUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = userAdminUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Update a user
///
/// Update an existing user.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UserAdminUpdateDto] userAdminUpdateDto (required):
Future<UserAdminResponseDto?> updateUserAdmin(String id, UserAdminUpdateDto userAdminUpdateDto,) async {
final response = await updateUserAdminWithHttpInfo(id, userAdminUpdateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserAdminResponseDto',) as UserAdminResponseDto;
}
return null;
}
/// Update user preferences
///
/// Update the preferences of a specific user.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UserPreferencesUpdateDto] userPreferencesUpdateDto (required):
Future<Response> updateUserPreferencesAdminWithHttpInfo(String id, UserPreferencesUpdateDto userPreferencesUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/admin/users/{id}/preferences'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = userPreferencesUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Update user preferences
///
/// Update the preferences of a specific user.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UserPreferencesUpdateDto] userPreferencesUpdateDto (required):
Future<UserPreferencesResponseDto?> updateUserPreferencesAdmin(String id, UserPreferencesUpdateDto userPreferencesUpdateDto,) async {
final response = await updateUserPreferencesAdminWithHttpInfo(id, userPreferencesUpdateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'UserPreferencesResponseDto',) as UserPreferencesResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+632 -648
View File
File diff suppressed because it is too large Load Diff
+34 -47
View File
@@ -1,54 +1,49 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ViewsApi {
ViewsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
static const ApiVersion getAssetsByOriginalPathAddedIn = .new(1, 0, 0);
static const ApiState getAssetsByOriginalPathState = .stable;
static const ApiVersion getUniqueOriginalPathsAddedIn = .new(1, 0, 0);
static const ApiState getUniqueOriginalPathsState = .stable;
/// Retrieve assets by original path
///
/// Retrieve assets that are children of a specific folder.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] path (required):
Future<Response> getAssetsByOriginalPathWithHttpInfo(String path,) async {
// ignore: prefer_const_declarations
Future<Response> getAssetsByOriginalPathWithHttpInfo({required String path, Future<void>? abortTrigger}) async {
final apiPath = r'/view/folder';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'path', path));
queryParams.addAll(_queryParams('', 'path', path));
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -56,37 +51,31 @@ class ViewsApi {
///
/// Retrieve assets that are children of a specific folder.
///
/// Parameters:
///
/// * [String] path (required):
Future<List<AssetResponseDto>?> getAssetsByOriginalPath(String path,) async {
final response = await getAssetsByOriginalPathWithHttpInfo(path,);
/// Available since server v1.0.0.
Future<List<AssetResponseDto>> getAssetsByOriginalPath({required String path, Future<void>? abortTrigger}) async {
final response = await getAssetsByOriginalPathWithHttpInfo(path: path, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<AssetResponseDto>') as List)
.cast<AssetResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<AssetResponseDto>') as List)
.cast<AssetResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve unique paths
///
/// Retrieve a list of unique folder paths from asset original paths.
///
/// Available since server v1.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getUniqueOriginalPathsWithHttpInfo() async {
// ignore: prefer_const_declarations
Future<Response> getUniqueOriginalPathsWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/view/folder/unique-paths';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -95,36 +84,34 @@ class ViewsApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve unique paths
///
/// Retrieve a list of unique folder paths from asset original paths.
Future<List<String>?> getUniqueOriginalPaths() async {
final response = await getUniqueOriginalPathsWithHttpInfo();
///
/// Available since server v1.0.0.
Future<List<String>> getUniqueOriginalPaths({Future<void>? abortTrigger}) async {
final response = await getUniqueOriginalPathsWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<String>') as List)
.cast<String>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<String>') as List).cast<String>().toList(
growable: false,
);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+300 -340
View File
@@ -1,318 +1,57 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class WorkflowsApi {
WorkflowsApi([ApiClient? apiClient]) : apiClient = apiClient ?? defaultApiClient;
final ApiClient apiClient;
/// Create a workflow
///
/// Create a new workflow, the workflow can also be created with empty filters and actions.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [WorkflowCreateDto] workflowCreateDto (required):
Future<Response> createWorkflowWithHttpInfo(WorkflowCreateDto workflowCreateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows';
static const ApiVersion searchWorkflowsAddedIn = .new(3, 0, 0);
// ignore: prefer_final_locals
Object? postBody = workflowCreateDto;
static const ApiState searchWorkflowsState = .added;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiVersion createWorkflowAddedIn = .new(3, 0, 0);
const contentTypes = <String>['application/json'];
static const ApiState createWorkflowState = .added;
static const ApiVersion getWorkflowTriggersAddedIn = .new(3, 0, 0);
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiState getWorkflowTriggersState = .added;
/// Create a workflow
///
/// Create a new workflow, the workflow can also be created with empty filters and actions.
///
/// Parameters:
///
/// * [WorkflowCreateDto] workflowCreateDto (required):
Future<WorkflowResponseDto?> createWorkflow(WorkflowCreateDto workflowCreateDto,) async {
final response = await createWorkflowWithHttpInfo(workflowCreateDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'WorkflowResponseDto',) as WorkflowResponseDto;
}
return null;
}
static const ApiVersion deleteWorkflowAddedIn = .new(3, 0, 0);
/// Delete a workflow
///
/// Delete a workflow by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> deleteWorkflowWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/{id}'
.replaceAll('{id}', id);
static const ApiState deleteWorkflowState = .added;
// ignore: prefer_final_locals
Object? postBody;
static const ApiVersion getWorkflowAddedIn = .new(3, 0, 0);
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
static const ApiState getWorkflowState = .added;
const contentTypes = <String>[];
static const ApiVersion updateWorkflowAddedIn = .new(3, 0, 0);
static const ApiState updateWorkflowState = .added;
return apiClient.invokeAPI(
apiPath,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
static const ApiVersion getWorkflowForShareAddedIn = .new(3, 0, 0);
/// Delete a workflow
///
/// Delete a workflow by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<void> deleteWorkflow(String id,) async {
final response = await deleteWorkflowWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve a workflow
///
/// Retrieve information about a specific workflow by its ID.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getWorkflowWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/{id}'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve a workflow
///
/// Retrieve information about a specific workflow by its ID.
///
/// Parameters:
///
/// * [String] id (required):
Future<WorkflowResponseDto?> getWorkflow(String id,) async {
final response = await getWorkflowWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'WorkflowResponseDto',) as WorkflowResponseDto;
}
return null;
}
/// Retrieve a workflow
///
/// Retrieve a workflow details without ids, default values, etc.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future<Response> getWorkflowForShareWithHttpInfo(String id,) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/{id}/share'
.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Retrieve a workflow
///
/// Retrieve a workflow details without ids, default values, etc.
///
/// Parameters:
///
/// * [String] id (required):
Future<WorkflowShareResponseDto?> getWorkflowForShare(String id,) async {
final response = await getWorkflowForShareWithHttpInfo(id,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'WorkflowShareResponseDto',) as WorkflowShareResponseDto;
}
return null;
}
/// List all workflow triggers
///
/// Retrieve a list of all available workflow triggers.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getWorkflowTriggersWithHttpInfo() async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/triggers';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// List all workflow triggers
///
/// Retrieve a list of all available workflow triggers.
Future<List<WorkflowTriggerResponseDto>?> getWorkflowTriggers() async {
final response = await getWorkflowTriggersWithHttpInfo();
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<WorkflowTriggerResponseDto>') as List)
.cast<WorkflowTriggerResponseDto>()
.toList(growable: false);
}
return null;
}
static const ApiState getWorkflowForShareState = .added;
/// List all workflows
///
/// Retrieve a list of workflows available to the authenticated user.
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] description:
/// Workflow description
///
/// * [bool] enabled:
/// Workflow enabled
///
/// * [String] id:
/// Workflow ID
///
/// * [String] name:
/// Workflow name
///
/// * [WorkflowTrigger] trigger:
/// Workflow trigger type
Future<Response> searchWorkflowsWithHttpInfo({ String? description, bool? enabled, String? id, String? name, WorkflowTrigger? trigger, }) async {
// ignore: prefer_const_declarations
Future<Response> searchWorkflowsWithHttpInfo({
String? description,
bool? enabled,
String? id,
String? name,
WorkflowTrigger? trigger,
Future<void>? abortTrigger,
}) async {
final apiPath = r'/workflows';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
@@ -337,15 +76,15 @@ class WorkflowsApi {
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
'GET',
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -353,74 +92,251 @@ class WorkflowsApi {
///
/// Retrieve a list of workflows available to the authenticated user.
///
/// Parameters:
///
/// * [String] description:
/// Workflow description
///
/// * [bool] enabled:
/// Workflow enabled
///
/// * [String] id:
/// Workflow ID
///
/// * [String] name:
/// Workflow name
///
/// * [WorkflowTrigger] trigger:
/// Workflow trigger type
Future<List<WorkflowResponseDto>?> searchWorkflows({ String? description, bool? enabled, String? id, String? name, WorkflowTrigger? trigger, }) async {
final response = await searchWorkflowsWithHttpInfo( description: description, enabled: enabled, id: id, name: name, trigger: trigger, );
/// Available since server v3.0.0.
Future<List<WorkflowResponseDto>> searchWorkflows({
String? description,
bool? enabled,
String? id,
String? name,
WorkflowTrigger? trigger,
Future<void>? abortTrigger,
}) async {
final response = await searchWorkflowsWithHttpInfo(
description: description,
enabled: enabled,
id: id,
name: name,
trigger: trigger,
abortTrigger: abortTrigger,
);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, 'List<WorkflowResponseDto>') as List)
.cast<WorkflowResponseDto>()
.toList(growable: false);
return (await apiClient.deserializeAsync(responseBody, r'List<WorkflowResponseDto>') as List)
.cast<WorkflowResponseDto>()
.toList(growable: false);
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Create a workflow
///
/// Create a new workflow, the workflow can also be created with empty filters and actions.
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> createWorkflowWithHttpInfo(WorkflowCreateDto workflowCreateDto, {Future<void>? abortTrigger}) async {
final apiPath = r'/workflows';
Object? postBody = workflowCreateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
r'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Create a workflow
///
/// Create a new workflow, the workflow can also be created with empty filters and actions.
///
/// Available since server v3.0.0.
Future<WorkflowResponseDto> createWorkflow(WorkflowCreateDto workflowCreateDto, {Future<void>? abortTrigger}) async {
final response = await createWorkflowWithHttpInfo(workflowCreateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'WorkflowResponseDto')
as WorkflowResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// List all workflow triggers
///
/// Retrieve a list of all available workflow triggers.
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getWorkflowTriggersWithHttpInfo({Future<void>? abortTrigger}) async {
final apiPath = r'/workflows/triggers';
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// List all workflow triggers
///
/// Retrieve a list of all available workflow triggers.
///
/// Available since server v3.0.0.
Future<List<WorkflowTriggerResponseDto>> getWorkflowTriggers({Future<void>? abortTrigger}) async {
final response = await getWorkflowTriggersWithHttpInfo(abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
final responseBody = await _decodeBodyBytes(response);
return (await apiClient.deserializeAsync(responseBody, r'List<WorkflowTriggerResponseDto>') as List)
.cast<WorkflowTriggerResponseDto>()
.toList(growable: false);
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Delete a workflow
///
/// Delete a workflow by its ID.
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> deleteWorkflowWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/workflows/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Delete a workflow
///
/// Delete a workflow by its ID.
///
/// Available since server v3.0.0.
Future<void> deleteWorkflow(String id, {Future<void>? abortTrigger}) async {
final response = await deleteWorkflowWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
}
/// Retrieve a workflow
///
/// Retrieve information about a specific workflow by its ID.
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getWorkflowWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/workflows/{id}'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve a workflow
///
/// Retrieve information about a specific workflow by its ID.
///
/// Available since server v3.0.0.
Future<WorkflowResponseDto> getWorkflow(String id, {Future<void>? abortTrigger}) async {
final response = await getWorkflowWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'WorkflowResponseDto')
as WorkflowResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Update a workflow
///
/// Update the information of a specific workflow by its ID. This endpoint can be used to update the workflow name, description, trigger type, filters and actions order, etc.
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [WorkflowUpdateDto] workflowUpdateDto (required):
Future<Response> updateWorkflowWithHttpInfo(String id, WorkflowUpdateDto workflowUpdateDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/workflows/{id}'
.replaceAll('{id}', id);
Future<Response> updateWorkflowWithHttpInfo(
String id,
WorkflowUpdateDto workflowUpdateDto, {
Future<void>? abortTrigger,
}) async {
final apiPath = r'/workflows/{id}'.replaceAll('{id}', id);
// ignore: prefer_final_locals
Object? postBody = workflowUpdateDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
const contentTypes = <String>[r'application/json'];
return apiClient.invokeAPI(
apiPath,
'PUT',
r'PUT',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
@@ -428,23 +344,67 @@ class WorkflowsApi {
///
/// Update the information of a specific workflow by its ID. This endpoint can be used to update the workflow name, description, trigger type, filters and actions order, etc.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [WorkflowUpdateDto] workflowUpdateDto (required):
Future<WorkflowResponseDto?> updateWorkflow(String id, WorkflowUpdateDto workflowUpdateDto,) async {
final response = await updateWorkflowWithHttpInfo(id, workflowUpdateDto,);
/// Available since server v3.0.0.
Future<WorkflowResponseDto> updateWorkflow(
String id,
WorkflowUpdateDto workflowUpdateDto, {
Future<void>? abortTrigger,
}) async {
final response = await updateWorkflowWithHttpInfo(id, workflowUpdateDto, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'WorkflowResponseDto',) as WorkflowResponseDto;
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'WorkflowResponseDto')
as WorkflowResponseDto;
}
return null;
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
/// Retrieve a workflow
///
/// Retrieve a workflow details without ids, default values, etc.
///
/// Available since server v3.0.0.
///
/// Note: This method returns the HTTP [Response].
Future<Response> getWorkflowForShareWithHttpInfo(String id, {Future<void>? abortTrigger}) async {
final apiPath = r'/workflows/{id}/share'.replaceAll('{id}', id);
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>[];
return apiClient.invokeAPI(
apiPath,
r'GET',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
abortTrigger: abortTrigger,
);
}
/// Retrieve a workflow
///
/// Retrieve a workflow details without ids, default values, etc.
///
/// Available since server v3.0.0.
Future<WorkflowShareResponseDto> getWorkflowForShare(String id, {Future<void>? abortTrigger}) async {
final response = await getWorkflowForShareWithHttpInfo(id, abortTrigger: abortTrigger);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), r'WorkflowShareResponseDto')
as WorkflowShareResponseDto;
}
throw ApiException(response.statusCode, r'Unexpected empty response body');
}
}
+840 -856
View File
File diff suppressed because it is too large Load Diff
+90
View File
@@ -0,0 +1,90 @@
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// Backward-compatibility mechanism. The generated client owns this hook but
// knows NO rules; the host app supplies them at startup, so the dependency
// flows app -> client only (this file has no app imports).
part of openapi.api;
/// One backward-compatibility default: when the wire JSON omits [path]
/// (dot-separated, e.g. `'download.includeEmbeddedVideos'`), fill it with
/// [value] before the DTO is parsed.
///
/// The constructor is `const`, so rule sets built entirely from static values
/// can be `const`; sets that need a DTO's `toJson()` or `DateTime.now()` are
/// plain (those values are computed when the rule set is built at startup).
final class JsonDefault {
/// The dot-separated wire path to back-fill.
final String path;
/// The value to set when [path] is absent or null.
final Object? value;
const JsonDefault(this.path, this.value);
}
/// Registry of per-DTO backward-compatibility defaults, keyed by the DTO [Type]
/// for compile-time safety.
///
/// Newer DTOs may declare fields that older servers don't send. Each model's
/// `fromJson` calls [upgrade] with its own type before parsing; the host app's
/// registered defaults fill any missing fields so deserialization tolerates
/// older servers.
///
/// Configured once at startup, keyed by DTO type so a renamed/removed DTO is a
/// compile error. Static-only entries can be `const` lists:
///
/// ```dart
/// ApiCompat.configure({
/// AssetResponseDto: const [
/// JsonDefault('visibility', 'timeline'),
/// JsonDefault('isEdited', false),
/// ],
/// });
/// ```
abstract final class ApiCompat {
ApiCompat._();
static Map<Type, List<JsonDefault>> _defaults = const <Type, List<JsonDefault>>{};
/// Install the backward-compat rule set (replaces any previous one).
static void configure(Map<Type, List<JsonDefault>> defaults) {
_defaults = defaults;
}
/// Clear all rules. Intended for test isolation.
static void reset() {
_defaults = const <Type, List<JsonDefault>>{};
}
/// Apply the registered defaults for DTO type [T] to [json], if any. Called
/// by every generated `fromJson`; a no-op when [json] is not a map or no
/// rules are registered for [T].
static void upgrade<T>(Object? json) {
if (json is! Map<String, dynamic>) return;
final defaults = _defaults[T];
if (defaults == null) return;
for (final entry in defaults) {
_putDefault(json, entry.path, entry.value);
}
}
/// Set [keyPath] (dot-separated) to [value] only when currently absent/null,
/// creating intermediate maps as needed.
static void _putDefault(Map<String, dynamic> json, String keyPath, Object? value) {
final keys = keyPath.split('.');
var node = json;
for (var i = 0; i < keys.length - 1; i++) {
final existing = node[keys[i]];
if (existing is Map<String, dynamic>) {
node = existing;
} else {
final created = <String, dynamic>{};
node[keys[i]] = created;
node = created;
}
}
if (node[keys.last] == null) {
node[keys.last] = value;
}
}
}
+19 -13
View File
@@ -1,24 +1,30 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
/// Thrown when an API call fails: a non-2xx HTTP status, a transport error, or
/// a (de)serialization failure.
///
/// [code] is the HTTP status code (or a transport-level sentinel such as
/// [HttpStatus.badRequest]) and [message] is a human-readable description.
class ApiException implements Exception {
ApiException(this.code, this.message);
ApiException(this.code, [this.message])
: innerException = null,
stackTrace = null;
ApiException.withInner(this.code, this.message, this.innerException, this.stackTrace);
int code = 0;
String? message;
Exception? innerException;
StackTrace? stackTrace;
/// HTTP status code, or a transport sentinel for non-HTTP failures.
final int code;
/// Human-readable failure description; may be the decoded response body.
final String? message;
/// The originating exception for transport / deserialization failures.
final Object? innerException;
/// The stack trace captured when [innerException] was caught.
final StackTrace? stackTrace;
@override
String toString() {
+55 -209
View File
@@ -1,15 +1,10 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
/// A single `name=value` query-string entry. Both halves are URL-encoded by
/// [toString], so multi-valued params (`?k=a&k=b`) are modeled as repeated
/// [QueryParam]s rather than a `Map`.
class QueryParam {
const QueryParam(this.name, this.value);
@@ -20,34 +15,42 @@ class QueryParam {
String toString() => '${Uri.encodeQueryComponent(name)}=${Uri.encodeQueryComponent(value)}';
}
// Ported from the Java version.
Iterable<QueryParam> _queryParams(String collectionFormat, String name, dynamic value,) {
// Assertions to run in debug mode only.
assert(name.isNotEmpty, 'Parameter cannot be an empty string.');
/// Delimiters for the non-`multi` array [collectionFormat]s.
const _delimiters = <String, String>{'csv': ',', 'ssv': ' ', 'tsv': '\t', 'pipes': '|'};
final params = <QueryParam>[];
/// Shared deep-equality used by generated model `==` operators so that `List`,
/// `Set`, and `Map` fields compare by structure rather than identity.
const _deepEquality = DeepCollectionEquality();
/// Expands a parameter [value] into zero or more [QueryParam]s under the given
/// [collectionFormat] (`'multi'`, `'csv'`, `'ssv'`, `'tsv'`, `'pipes'`).
///
/// A `null` value yields no params (the key is omitted); a `List` either repeats
/// the key (`multi`) or joins with the format delimiter; any other value is
/// stringified via [parameterToString].
Iterable<QueryParam> _queryParams(String collectionFormat, String name, dynamic value) {
assert(name.isNotEmpty, 'Parameter cannot be an empty string.');
if (value is List) {
if (collectionFormat == 'multi') {
return value.map((dynamic v) => QueryParam(name, parameterToString(v)),);
return value.map((dynamic v) => QueryParam(name, parameterToString(v)));
}
// Default collection format is 'csv'.
if (collectionFormat.isEmpty) {
collectionFormat = 'csv'; // ignore: parameter_assignments
}
final delimiter = _delimiters[collectionFormat] ?? ',';
params.add(QueryParam(name, value.map<dynamic>(parameterToString).join(delimiter),));
} else if (value != null) {
params.add(QueryParam(name, parameterToString(value)));
final format = collectionFormat.isEmpty ? 'csv' : collectionFormat;
final delimiter = _delimiters[format] ?? ',';
return [QueryParam(name, value.map<String>(parameterToString).join(delimiter))];
}
return params;
if (value != null) {
return [QueryParam(name, parameterToString(value))];
}
return const [];
}
/// Format the given parameter object into a [String].
/// Formats a single parameter [value] for use in a path, query, header, or form
/// field.
///
/// `null` becomes the empty string, `DateTime` is emitted as a UTC ISO-8601
/// string, generated enums delegate to their `toJson()` (the raw wire value),
/// and everything else uses [Object.toString].
String parameterToString(dynamic value) {
if (value == null) {
return '';
@@ -55,197 +58,40 @@ String parameterToString(dynamic value) {
if (value is DateTime) {
return value.toUtc().toIso8601String();
}
if (value is AlbumUserRole) {
return AlbumUserRoleTypeTransformer().encode(value).toString();
}
if (value is AssetEditAction) {
return AssetEditActionTypeTransformer().encode(value).toString();
}
if (value is AssetIdErrorReason) {
return AssetIdErrorReasonTypeTransformer().encode(value).toString();
}
if (value is AssetJobName) {
return AssetJobNameTypeTransformer().encode(value).toString();
}
if (value is AssetMediaSize) {
return AssetMediaSizeTypeTransformer().encode(value).toString();
}
if (value is AssetMediaStatus) {
return AssetMediaStatusTypeTransformer().encode(value).toString();
}
if (value is AssetOrder) {
return AssetOrderTypeTransformer().encode(value).toString();
}
if (value is AssetOrderBy) {
return AssetOrderByTypeTransformer().encode(value).toString();
}
if (value is AssetRejectReason) {
return AssetRejectReasonTypeTransformer().encode(value).toString();
}
if (value is AssetTypeEnum) {
return AssetTypeEnumTypeTransformer().encode(value).toString();
}
if (value is AssetUploadAction) {
return AssetUploadActionTypeTransformer().encode(value).toString();
}
if (value is AssetVisibility) {
return AssetVisibilityTypeTransformer().encode(value).toString();
}
if (value is AudioCodec) {
return AudioCodecTypeTransformer().encode(value).toString();
}
if (value is BulkIdErrorReason) {
return BulkIdErrorReasonTypeTransformer().encode(value).toString();
}
if (value is CQMode) {
return CQModeTypeTransformer().encode(value).toString();
}
if (value is Colorspace) {
return ColorspaceTypeTransformer().encode(value).toString();
}
if (value is ImageFormat) {
return ImageFormatTypeTransformer().encode(value).toString();
}
if (value is JobName) {
return JobNameTypeTransformer().encode(value).toString();
}
if (value is LogLevel) {
return LogLevelTypeTransformer().encode(value).toString();
}
if (value is MaintenanceAction) {
return MaintenanceActionTypeTransformer().encode(value).toString();
}
if (value is ManualJobName) {
return ManualJobNameTypeTransformer().encode(value).toString();
}
if (value is MemorySearchOrder) {
return MemorySearchOrderTypeTransformer().encode(value).toString();
}
if (value is MemoryType) {
return MemoryTypeTypeTransformer().encode(value).toString();
}
if (value is MirrorAxis) {
return MirrorAxisTypeTransformer().encode(value).toString();
}
if (value is NotificationLevel) {
return NotificationLevelTypeTransformer().encode(value).toString();
}
if (value is NotificationType) {
return NotificationTypeTypeTransformer().encode(value).toString();
}
if (value is OAuthTokenEndpointAuthMethod) {
return OAuthTokenEndpointAuthMethodTypeTransformer().encode(value).toString();
}
if (value is PartnerDirection) {
return PartnerDirectionTypeTransformer().encode(value).toString();
}
if (value is Permission) {
return PermissionTypeTransformer().encode(value).toString();
}
if (value is QueueCommand) {
return QueueCommandTypeTransformer().encode(value).toString();
}
if (value is QueueJobStatus) {
return QueueJobStatusTypeTransformer().encode(value).toString();
}
if (value is QueueName) {
return QueueNameTypeTransformer().encode(value).toString();
}
if (value is ReactionLevel) {
return ReactionLevelTypeTransformer().encode(value).toString();
}
if (value is ReactionType) {
return ReactionTypeTypeTransformer().encode(value).toString();
}
if (value is SearchSuggestionType) {
return SearchSuggestionTypeTypeTransformer().encode(value).toString();
}
if (value is SharedLinkType) {
return SharedLinkTypeTypeTransformer().encode(value).toString();
}
if (value is SourceType) {
return SourceTypeTypeTransformer().encode(value).toString();
}
if (value is StorageFolder) {
return StorageFolderTypeTransformer().encode(value).toString();
}
if (value is SyncEntityType) {
return SyncEntityTypeTypeTransformer().encode(value).toString();
}
if (value is SyncRequestType) {
return SyncRequestTypeTypeTransformer().encode(value).toString();
}
if (value is ToneMapping) {
return ToneMappingTypeTransformer().encode(value).toString();
}
if (value is TranscodeHWAccel) {
return TranscodeHWAccelTypeTransformer().encode(value).toString();
}
if (value is TranscodePolicy) {
return TranscodePolicyTypeTransformer().encode(value).toString();
}
if (value is UserAvatarColor) {
return UserAvatarColorTypeTransformer().encode(value).toString();
}
if (value is UserMetadataKey) {
return UserMetadataKeyTypeTransformer().encode(value).toString();
}
if (value is UserStatus) {
return UserStatusTypeTransformer().encode(value).toString();
}
if (value is VideoCodec) {
return VideoCodecTypeTransformer().encode(value).toString();
}
if (value is VideoContainer) {
return VideoContainerTypeTransformer().encode(value).toString();
}
if (value is WorkflowTrigger) {
return WorkflowTriggerTypeTransformer().encode(value).toString();
}
if (value is WorkflowType) {
return WorkflowTypeTypeTransformer().encode(value).toString();
// Every generated enum is a Dart `enum` exposing `Object toJson()` returning
// its raw wire value; this keeps the helper free of per-enum branches.
if (value is Enum) {
return (value as dynamic).toJson().toString();
}
return value.toString();
}
/// Returns the decoded body as UTF-8 if the given headers indicate an 'application/json'
/// content type. Otherwise, returns the decoded body as decoded by dart:http package.
/// Decodes a response body as UTF-8 when the headers declare JSON, otherwise
/// returns the body as already decoded by `package:http`.
Future<String> _decodeBodyBytes(Response response) async {
final contentType = response.headers['content-type'];
return contentType != null && contentType.toLowerCase().startsWith('application/json')
? response.bodyBytes.isEmpty ? '' : utf8.decode(response.bodyBytes)
: response.body;
? (response.bodyBytes.isEmpty ? '' : utf8.decode(response.bodyBytes))
: response.body;
}
/// Returns a valid [T] value found at the specified Map [key], null otherwise.
/// Parses a JSON scalar into a [DateTime]: an ISO-8601 string or epoch
/// milliseconds (`int`). Returns `null` when [value] is absent or unparseable.
DateTime? _dateTimeFromJson(Object? value) {
return switch (value) {
DateTime() => value,
String() => DateTime.tryParse(value),
int() => DateTime.fromMillisecondsSinceEpoch(value, isUtc: true),
_ => null,
};
}
/// Widens a JSON number to `double`, tolerating an integer wire value. Returns
/// `null` when [value] is not a number.
double? _toDouble(Object? value) => (value as num?)?.toDouble();
/// Returns the value at [key] of [map] when it is a [T], else `null`.
T? mapValueOfType<T>(dynamic map, String key) {
final dynamic value = map is Map ? map[key] : null;
return value is T ? value : null;
}
/// Returns a valid Map<K, V> found at the specified Map [key], null otherwise.
Map<K, V>? mapCastOfType<K, V>(dynamic map, String key) {
final dynamic value = map is Map ? map[key] : null;
return value is Map ? value.cast<K, V>() : null;
}
/// Returns a valid [DateTime] found at the specified Map [key], null otherwise.
DateTime? mapDateTime(dynamic map, String key, [String? pattern]) {
final dynamic value = map is Map ? map[key] : null;
if (value != null) {
int? millis;
if (value is int) {
millis = value;
} else if (value is String) {
if (_isEpochMarker(pattern)) {
millis = int.tryParse(value);
} else {
return DateTime.tryParse(value);
}
}
if (millis != null) {
return DateTime.fromMillisecondsSinceEpoch(millis, isUtc: true);
}
}
return null;
}
+8
View File
@@ -0,0 +1,8 @@
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
part of openapi.api;
/// Lifecycle state of an endpoint or DTO field, from the spec's
/// `x-immich-state` / `x-immich-history`. Surfaced on the inlined `*State`
/// metadata (e.g. `AssetResponseDto.isEditedState == ApiState.beta`).
enum ApiState { added, alpha, beta, stable, updated, deprecated, internal }
+81
View File
@@ -0,0 +1,81 @@
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// Self-contained version type for server-capability gating. Intentionally has
// no dependency on the host app: the generated client is a lower layer and
// must not reach up into application utilities.
part of openapi.api;
/// An Immich server API version, used to gate endpoints and DTO fields that
/// were added or deprecated at a particular release.
///
/// Version metadata is derived at generation time from the spec's
/// `x-immich-history` and emitted as `const ApiVersion(...)` literals on the
/// `*Meta` types, so comparisons are const-friendly and cheap:
///
/// ```dart
/// if (ApiVersion.parse(server.version) >= AssetResponseDtoMeta.isEditedAddedIn) {
/// // safe to read `isEdited`
/// }
/// ```
final class ApiVersion implements Comparable<ApiVersion> {
const ApiVersion(this.major, this.minor, this.patch);
final int major;
final int minor;
final int patch;
/// Parses `"v2.6.0"`, `"2.6.0"`, or a bare `"v1"`/`"2"` (missing components
/// default to zero). Returns `null` when the string is not a version.
static ApiVersion? tryParse(String value) {
final core = value.trim().replaceFirst(RegExp(r'^v', caseSensitive: false), '').split(RegExp(r'[-+]')).first;
if (core.isEmpty) return null;
final parts = core.split('.');
final nums = <int>[];
for (final part in parts) {
final n = int.tryParse(part);
if (n == null) return null;
nums.add(n);
}
return ApiVersion(
nums.isNotEmpty ? nums[0] : 0,
nums.length > 1 ? nums[1] : 0,
nums.length > 2 ? nums[2] : 0,
);
}
/// Like [tryParse] but throws [FormatException] on a malformed string.
factory ApiVersion.parse(String value) =>
tryParse(value) ?? (throw FormatException('Invalid API version', value));
@override
int compareTo(ApiVersion other) {
final byMajor = major.compareTo(other.major);
if (byMajor != 0) return byMajor;
final byMinor = minor.compareTo(other.minor);
if (byMinor != 0) return byMinor;
return patch.compareTo(other.patch);
}
bool operator >(ApiVersion other) => compareTo(other) > 0;
bool operator >=(ApiVersion other) => compareTo(other) >= 0;
bool operator <(ApiVersion other) => compareTo(other) < 0;
bool operator <=(ApiVersion other) => compareTo(other) <= 0;
/// Whether this version (typically the connected server's) is new enough to
/// support a [feature] introduced at the given version. Reads naturally:
///
/// ```dart
/// if (serverVersion.supports(AssetResponseDto.isEditedAddedIn)) { ... }
/// ```
bool supports(ApiVersion feature) => this >= feature;
@override
bool operator ==(Object other) =>
other is ApiVersion && other.major == major && other.minor == minor && other.patch == patch;
@override
int get hashCode => Object.hash(major, minor, patch);
@override
String toString() => '$major.$minor.$patch';
}
+8 -14
View File
@@ -1,15 +1,9 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
/// API-key authentication, applied to a query param, header, or cookie
/// depending on [location] (`'query'`, `'header'`, or `'cookie'`).
class ApiKeyAuth implements Authentication {
ApiKeyAuth(this.location, this.paramName);
@@ -20,21 +14,21 @@ class ApiKeyAuth implements Authentication {
String apiKey = '';
@override
Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams,) async {
Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) async {
final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey';
if (paramValue.isEmpty) return;
if (paramValue.isNotEmpty) {
if (location == 'query') {
switch (location) {
case 'query':
queryParams.add(QueryParam(paramName, paramValue));
} else if (location == 'header') {
case 'header':
headerParams[paramName] = paramValue;
} else if (location == 'cookie') {
case 'cookie':
headerParams.update(
'Cookie',
(existingCookie) => '$existingCookie; $paramName=$paramValue',
ifAbsent: () => '$paramName=$paramValue',
);
}
}
}
}
+1 -8
View File
@@ -1,15 +1,8 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
/// Applies credentials to an outgoing request's query and header params.
// ignore: one_member_abstracts
abstract class Authentication {
/// Apply authentication settings to header and query params.
-26
View File
@@ -1,26 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class HttpBasicAuth implements Authentication {
HttpBasicAuth({this.username = '', this.password = ''});
String username;
String password;
@override
Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams,) async {
if (username.isNotEmpty && password.isNotEmpty) {
final credentials = '$username:$password';
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';
}
}
}
+15 -27
View File
@@ -1,25 +1,21 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
/// Supplies a bearer token, either as a literal `String` or lazily via a
/// `String Function()` resolved on each request.
typedef HttpBearerAuthProvider = String Function();
/// HTTP bearer-token authentication, applied as an `Authorization: Bearer ...`
/// header.
class HttpBearerAuth implements Authentication {
HttpBearerAuth();
dynamic _accessToken;
Object? _accessToken;
dynamic get accessToken => _accessToken;
Object? get accessToken => _accessToken;
set accessToken(dynamic accessToken) {
set accessToken(Object? accessToken) {
if (accessToken is! String && accessToken is! HttpBearerAuthProvider) {
throw ArgumentError('accessToken value must be either a String or a String Function().');
}
@@ -27,22 +23,14 @@ class HttpBearerAuth implements Authentication {
}
@override
Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams,) async {
if (_accessToken == null) {
return;
}
String accessToken;
if (_accessToken is String) {
accessToken = _accessToken;
} else if (_accessToken is HttpBearerAuthProvider) {
accessToken = _accessToken!();
} else {
return;
}
if (accessToken.isNotEmpty) {
Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) async {
final token = _accessToken;
final accessToken = switch (token) {
String() => token,
HttpBearerAuthProvider() => token(),
_ => null,
};
if (accessToken != null && accessToken.isNotEmpty) {
headerParams['Authorization'] = 'Bearer $accessToken';
}
}
+3 -9
View File
@@ -1,22 +1,16 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
/// OAuth bearer-token authentication, applied as an `Authorization: Bearer ...`
/// header.
class OAuth implements Authentication {
OAuth({this.accessToken = ''});
String accessToken;
@override
Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams,) async {
Future<void> applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) async {
if (accessToken.isNotEmpty) {
headerParams['Authorization'] = 'Bearer $accessToken';
}
+51 -114
View File
@@ -1,144 +1,81 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ActivityCreateDto {
/// Returns a new [ActivityCreateDto] instance.
ActivityCreateDto({
/// Activity create
final class ActivityCreateDto {
const ActivityCreateDto({
required this.albumId,
this.assetId,
this.comment,
this.assetId = const Optional.absent(),
this.comment = const Optional.absent(),
required this.type,
});
/// Album ID
String albumId;
final String albumId;
/// Asset ID (if activity is for an asset)
///
/// 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.
///
String? assetId;
final Optional<String> assetId;
/// Comment text (required if type is comment)
///
/// 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.
///
String? comment;
final Optional<String> comment;
ReactionType type;
final ReactionType type;
@override
bool operator ==(Object other) => identical(this, other) || other is ActivityCreateDto &&
other.albumId == albumId &&
other.assetId == assetId &&
other.comment == comment &&
other.type == type;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(albumId.hashCode) +
(assetId == null ? 0 : assetId!.hashCode) +
(comment == null ? 0 : comment!.hashCode) +
(type.hashCode);
@override
String toString() => 'ActivityCreateDto[albumId=$albumId, assetId=$assetId, comment=$comment, type=$type]';
static ActivityCreateDto? fromJson(dynamic value) {
ApiCompat.upgrade<ActivityCreateDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(
albumId: json[r'albumId'] as String,
assetId: json.containsKey(r'assetId') ? Optional.present(json[r'assetId'] as String) : const Optional.absent(),
comment: json.containsKey(r'comment') ? Optional.present(json[r'comment'] as String) : const Optional.absent(),
type: (ReactionType.fromJson(json[r'type']))!,
);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albumId'] = this.albumId;
if (this.assetId != null) {
json[r'assetId'] = this.assetId;
} else {
// json[r'assetId'] = null;
json[r'albumId'] = albumId;
if (assetId case Present(:final value)) {
json[r'assetId'] = value;
}
if (this.comment != null) {
json[r'comment'] = this.comment;
} else {
// json[r'comment'] = null;
if (comment case Present(:final value)) {
json[r'comment'] = value;
}
json[r'type'] = this.type;
json[r'type'] = type.toJson();
return json;
}
/// Returns a new [ActivityCreateDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ActivityCreateDto? fromJson(dynamic value) {
upgradeDto(value, "ActivityCreateDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ActivityCreateDto(
albumId: mapValueOfType<String>(json, r'albumId')!,
assetId: mapValueOfType<String>(json, r'assetId'),
comment: mapValueOfType<String>(json, r'comment'),
type: ReactionType.fromJson(json[r'type'])!,
);
}
return null;
ActivityCreateDto copyWith({
String? albumId,
Optional<String>? assetId,
Optional<String>? comment,
ReactionType? type,
}) {
return .new(
albumId: albumId ?? this.albumId,
assetId: assetId ?? this.assetId,
comment: comment ?? this.comment,
type: type ?? this.type,
);
}
static List<ActivityCreateDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ActivityCreateDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ActivityCreateDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other is ActivityCreateDto &&
albumId == other.albumId &&
assetId == other.assetId &&
comment == other.comment &&
type == other.type);
}
static Map<String, ActivityCreateDto> mapFromJson(dynamic json) {
final map = <String, ActivityCreateDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ActivityCreateDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([albumId, assetId, comment, type]);
}
// maps a json object with a list of ActivityCreateDto-objects as value to a dart map
static Map<String, List<ActivityCreateDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ActivityCreateDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ActivityCreateDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'albumId',
'type',
};
@override
String toString() => 'ActivityCreateDto(albumId=$albumId, assetId=$assetId, comment=$comment, type=$type)';
}
+62 -114
View File
@@ -1,18 +1,9 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ActivityResponseDto {
/// Returns a new [ActivityResponseDto] instance.
ActivityResponseDto({
final class ActivityResponseDto {
const ActivityResponseDto({
required this.assetId,
this.comment,
required this.createdAt,
@@ -22,131 +13,88 @@ class ActivityResponseDto {
});
/// Asset ID (if activity is for an asset)
String? assetId;
final String? assetId;
/// Comment text (for comment activities)
String? comment;
final String? comment;
/// Creation date
DateTime createdAt;
final DateTime createdAt;
/// Activity ID
String id;
final String id;
ReactionType type;
final ReactionType type;
UserResponseDto user;
final UserResponseDto user;
@override
bool operator ==(Object other) => identical(this, other) || other is ActivityResponseDto &&
other.assetId == assetId &&
other.comment == comment &&
other.createdAt == createdAt &&
other.id == id &&
other.type == type &&
other.user == user;
static const _undefined = Object();
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(assetId == null ? 0 : assetId!.hashCode) +
(comment == null ? 0 : comment!.hashCode) +
(createdAt.hashCode) +
(id.hashCode) +
(type.hashCode) +
(user.hashCode);
@override
String toString() => 'ActivityResponseDto[assetId=$assetId, comment=$comment, createdAt=$createdAt, id=$id, type=$type, user=$user]';
static ActivityResponseDto? fromJson(dynamic value) {
ApiCompat.upgrade<ActivityResponseDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(
assetId: (json[r'assetId'] as String?),
comment: (json[r'comment'] as String?),
createdAt: DateTime.parse(json[r'createdAt'] as String),
id: json[r'id'] as String,
type: (ReactionType.fromJson(json[r'type']))!,
user: (UserResponseDto.fromJson(json[r'user']))!,
);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.assetId != null) {
json[r'assetId'] = this.assetId;
} else {
// json[r'assetId'] = null;
if (assetId != null) {
json[r'assetId'] = assetId!;
}
if (this.comment != null) {
json[r'comment'] = this.comment;
} else {
// json[r'comment'] = null;
if (comment != null) {
json[r'comment'] = comment!;
}
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
: this.createdAt.toUtc().toIso8601String();
json[r'id'] = this.id;
json[r'type'] = this.type;
json[r'user'] = this.user;
json[r'createdAt'] = createdAt.toUtc().toIso8601String();
json[r'id'] = id;
json[r'type'] = type.toJson();
json[r'user'] = user.toJson();
return json;
}
/// Returns a new [ActivityResponseDto] instance and imports its values from
/// [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>();
return ActivityResponseDto(
assetId: mapValueOfType<String>(json, r'assetId'),
comment: mapValueOfType<String>(json, r'comment'),
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))$/')!,
id: mapValueOfType<String>(json, r'id')!,
type: ReactionType.fromJson(json[r'type'])!,
user: UserResponseDto.fromJson(json[r'user'])!,
);
}
return null;
ActivityResponseDto copyWith({
Object? assetId = _undefined,
Object? comment = _undefined,
DateTime? createdAt,
String? id,
ReactionType? type,
UserResponseDto? user,
}) {
return .new(
assetId: identical(assetId, _undefined) ? this.assetId : assetId as String?,
comment: identical(comment, _undefined) ? this.comment : comment as String?,
createdAt: createdAt ?? this.createdAt,
id: id ?? this.id,
type: type ?? this.type,
user: user ?? this.user,
);
}
static List<ActivityResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ActivityResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ActivityResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other is ActivityResponseDto &&
assetId == other.assetId &&
comment == other.comment &&
createdAt == other.createdAt &&
id == other.id &&
type == other.type &&
user == other.user);
}
static Map<String, ActivityResponseDto> mapFromJson(dynamic json) {
final map = <String, ActivityResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ActivityResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([assetId, comment, createdAt, id, type, user]);
}
// maps a json object with a list of ActivityResponseDto-objects as value to a dart map
static Map<String, List<ActivityResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ActivityResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ActivityResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'assetId',
'createdAt',
'id',
'type',
'user',
};
@override
String toString() =>
'ActivityResponseDto(assetId=$assetId, comment=$comment, createdAt=$createdAt, id=$id, type=$type, user=$user)';
}
+23 -93
View File
@@ -1,115 +1,45 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class ActivityStatisticsResponseDto {
/// Returns a new [ActivityStatisticsResponseDto] instance.
ActivityStatisticsResponseDto({
required this.comments,
required this.likes,
});
final class ActivityStatisticsResponseDto {
const ActivityStatisticsResponseDto({required this.comments, required this.likes});
/// Number of comments
///
/// Minimum value: 0
/// Maximum value: 9007199254740991
int comments;
final int comments;
/// Number of likes
///
/// Minimum value: 0
/// Maximum value: 9007199254740991
int likes;
final int likes;
@override
bool operator ==(Object other) => identical(this, other) || other is ActivityStatisticsResponseDto &&
other.comments == comments &&
other.likes == likes;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(comments.hashCode) +
(likes.hashCode);
@override
String toString() => 'ActivityStatisticsResponseDto[comments=$comments, likes=$likes]';
static ActivityStatisticsResponseDto? fromJson(dynamic value) {
ApiCompat.upgrade<ActivityStatisticsResponseDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(comments: json[r'comments'] as int, likes: json[r'likes'] as int);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'comments'] = this.comments;
json[r'likes'] = this.likes;
json[r'comments'] = comments;
json[r'likes'] = likes;
return json;
}
/// Returns a new [ActivityStatisticsResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ActivityStatisticsResponseDto? fromJson(dynamic value) {
upgradeDto(value, "ActivityStatisticsResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return ActivityStatisticsResponseDto(
comments: mapValueOfType<int>(json, r'comments')!,
likes: mapValueOfType<int>(json, r'likes')!,
);
}
return null;
ActivityStatisticsResponseDto copyWith({int? comments, int? likes}) {
return .new(comments: comments ?? this.comments, likes: likes ?? this.likes);
}
static List<ActivityStatisticsResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <ActivityStatisticsResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ActivityStatisticsResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other is ActivityStatisticsResponseDto && comments == other.comments && likes == other.likes);
}
static Map<String, ActivityStatisticsResponseDto> mapFromJson(dynamic json) {
final map = <String, ActivityStatisticsResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ActivityStatisticsResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([comments, likes]);
}
// maps a json object with a list of ActivityStatisticsResponseDto-objects as value to a dart map
static Map<String, List<ActivityStatisticsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ActivityStatisticsResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = ActivityStatisticsResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'comments',
'likes',
};
@override
String toString() => 'ActivityStatisticsResponseDto(comments=$comments, likes=$likes)';
}
+25 -80
View File
@@ -1,100 +1,45 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AddUsersDto {
/// Returns a new [AddUsersDto] instance.
AddUsersDto({
this.albumUsers = const [],
});
final class AddUsersDto {
const AddUsersDto({required this.albumUsers});
/// Album users to add
List<AlbumUserAddDto> albumUsers;
final List<AlbumUserAddDto> albumUsers;
@override
bool operator ==(Object other) => identical(this, other) || other is AddUsersDto &&
_deepEquality.equals(other.albumUsers, albumUsers);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(albumUsers.hashCode);
@override
String toString() => 'AddUsersDto[albumUsers=$albumUsers]';
static AddUsersDto? fromJson(dynamic value) {
ApiCompat.upgrade<AddUsersDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(
albumUsers: ((json[r'albumUsers'] as List?)
?.map(($e) => (AlbumUserAddDto.fromJson($e))!)
.toList(growable: false))!,
);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albumUsers'] = this.albumUsers;
json[r'albumUsers'] = albumUsers.map(($e) => $e.toJson()).toList(growable: false);
return json;
}
/// Returns a new [AddUsersDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AddUsersDto? fromJson(dynamic value) {
upgradeDto(value, "AddUsersDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AddUsersDto(
albumUsers: AlbumUserAddDto.listFromJson(json[r'albumUsers']),
);
}
return null;
AddUsersDto copyWith({List<AlbumUserAddDto>? albumUsers}) {
return .new(albumUsers: albumUsers ?? this.albumUsers);
}
static List<AddUsersDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AddUsersDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AddUsersDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other is AddUsersDto && const DeepCollectionEquality().equals(albumUsers, other.albumUsers));
}
static Map<String, AddUsersDto> mapFromJson(dynamic json) {
final map = <String, AddUsersDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AddUsersDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([const DeepCollectionEquality().hash(albumUsers)]);
}
// maps a json object with a list of AddUsersDto-objects as value to a dart map
static Map<String, List<AddUsersDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AddUsersDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AddUsersDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'albumUsers',
};
@override
String toString() => 'AddUsersDto(albumUsers=$albumUsers)';
}
+20 -80
View File
@@ -1,100 +1,40 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AdminOnboardingUpdateDto {
/// Returns a new [AdminOnboardingUpdateDto] instance.
AdminOnboardingUpdateDto({
required this.isOnboarded,
});
final class AdminOnboardingUpdateDto {
const AdminOnboardingUpdateDto({required this.isOnboarded});
/// Is admin onboarded
bool isOnboarded;
final bool isOnboarded;
@override
bool operator ==(Object other) => identical(this, other) || other is AdminOnboardingUpdateDto &&
other.isOnboarded == isOnboarded;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(isOnboarded.hashCode);
@override
String toString() => 'AdminOnboardingUpdateDto[isOnboarded=$isOnboarded]';
static AdminOnboardingUpdateDto? fromJson(dynamic value) {
ApiCompat.upgrade<AdminOnboardingUpdateDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(isOnboarded: json[r'isOnboarded'] as bool);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'isOnboarded'] = this.isOnboarded;
json[r'isOnboarded'] = isOnboarded;
return json;
}
/// Returns a new [AdminOnboardingUpdateDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AdminOnboardingUpdateDto? fromJson(dynamic value) {
upgradeDto(value, "AdminOnboardingUpdateDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AdminOnboardingUpdateDto(
isOnboarded: mapValueOfType<bool>(json, r'isOnboarded')!,
);
}
return null;
AdminOnboardingUpdateDto copyWith({bool? isOnboarded}) {
return .new(isOnboarded: isOnboarded ?? this.isOnboarded);
}
static List<AdminOnboardingUpdateDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AdminOnboardingUpdateDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AdminOnboardingUpdateDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) || (other is AdminOnboardingUpdateDto && isOnboarded == other.isOnboarded);
}
static Map<String, AdminOnboardingUpdateDto> mapFromJson(dynamic json) {
final map = <String, AdminOnboardingUpdateDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AdminOnboardingUpdateDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([isOnboarded]);
}
// maps a json object with a list of AdminOnboardingUpdateDto-objects as value to a dart map
static Map<String, List<AdminOnboardingUpdateDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AdminOnboardingUpdateDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AdminOnboardingUpdateDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'isOnboarded',
};
@override
String toString() => 'AdminOnboardingUpdateDto(isOnboarded=$isOnboarded)';
}
+158 -206
View File
@@ -1,23 +1,14 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AlbumResponseDto {
/// Returns a new [AlbumResponseDto] instance.
AlbumResponseDto({
final class AlbumResponseDto {
const AlbumResponseDto({
required this.albumName,
required this.albumThumbnailAssetId,
this.albumUsers = const [],
required this.albumUsers,
required this.assetCount,
this.contributorCounts = const [],
this.contributorCounts,
required this.createdAt,
required this.description,
this.endDate,
@@ -32,244 +23,205 @@ class AlbumResponseDto {
});
/// Album name
String albumName;
final String albumName;
/// Thumbnail asset ID
String? albumThumbnailAssetId;
final String? albumThumbnailAssetId;
/// First entry is always the album owner. Second entry is the auth user, if it differs from the owner. The rest are ordered alphabetically.
List<AlbumUserResponseDto> albumUsers;
final List<AlbumUserResponseDto> albumUsers;
/// Number of assets
///
/// Minimum value: 0
/// Maximum value: 9007199254740991
int assetCount;
final int assetCount;
List<ContributorCountResponseDto> contributorCounts;
final List<ContributorCountResponseDto>? contributorCounts;
/// Creation date
DateTime createdAt;
final DateTime createdAt;
/// Album description
String description;
final String description;
/// End date (latest asset)
///
/// 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.
///
DateTime? endDate;
final DateTime? endDate;
/// Has shared link
bool hasSharedLink;
final bool hasSharedLink;
/// Album ID
String id;
final String id;
/// Activity feed enabled
bool isActivityEnabled;
final bool isActivityEnabled;
/// Last modified asset timestamp
///
/// 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.
///
DateTime? lastModifiedAssetTimestamp;
final DateTime? lastModifiedAssetTimestamp;
///
/// 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.
///
AssetOrder? order;
final AssetOrder? order;
/// Is shared album
bool shared;
final bool shared;
/// Start date (earliest asset)
///
/// 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.
///
DateTime? startDate;
final DateTime? startDate;
/// Last update date
DateTime updatedAt;
final DateTime updatedAt;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumResponseDto &&
other.albumName == albumName &&
other.albumThumbnailAssetId == albumThumbnailAssetId &&
_deepEquality.equals(other.albumUsers, albumUsers) &&
other.assetCount == assetCount &&
_deepEquality.equals(other.contributorCounts, contributorCounts) &&
other.createdAt == createdAt &&
other.description == description &&
other.endDate == endDate &&
other.hasSharedLink == hasSharedLink &&
other.id == id &&
other.isActivityEnabled == isActivityEnabled &&
other.lastModifiedAssetTimestamp == lastModifiedAssetTimestamp &&
other.order == order &&
other.shared == shared &&
other.startDate == startDate &&
other.updatedAt == updatedAt;
static const _undefined = Object();
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(albumName.hashCode) +
(albumThumbnailAssetId == null ? 0 : albumThumbnailAssetId!.hashCode) +
(albumUsers.hashCode) +
(assetCount.hashCode) +
(contributorCounts.hashCode) +
(createdAt.hashCode) +
(description.hashCode) +
(endDate == null ? 0 : endDate!.hashCode) +
(hasSharedLink.hashCode) +
(id.hashCode) +
(isActivityEnabled.hashCode) +
(lastModifiedAssetTimestamp == null ? 0 : lastModifiedAssetTimestamp!.hashCode) +
(order == null ? 0 : order!.hashCode) +
(shared.hashCode) +
(startDate == null ? 0 : startDate!.hashCode) +
(updatedAt.hashCode);
@override
String toString() => 'AlbumResponseDto[albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, albumUsers=$albumUsers, assetCount=$assetCount, contributorCounts=$contributorCounts, createdAt=$createdAt, description=$description, endDate=$endDate, hasSharedLink=$hasSharedLink, id=$id, isActivityEnabled=$isActivityEnabled, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, order=$order, shared=$shared, startDate=$startDate, updatedAt=$updatedAt]';
static AlbumResponseDto? fromJson(dynamic value) {
ApiCompat.upgrade<AlbumResponseDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(
albumName: json[r'albumName'] as String,
albumThumbnailAssetId: (json[r'albumThumbnailAssetId'] as String?),
albumUsers: ((json[r'albumUsers'] as List?)
?.map(($e) => (AlbumUserResponseDto.fromJson($e))!)
.toList(growable: false))!,
assetCount: json[r'assetCount'] as int,
contributorCounts: (json[r'contributorCounts'] as List?)
?.map(($e) => (ContributorCountResponseDto.fromJson($e))!)
.toList(growable: false),
createdAt: DateTime.parse(json[r'createdAt'] as String),
description: json[r'description'] as String,
endDate: (json[r'endDate'] == null ? null : DateTime.parse(json[r'endDate'] as String)),
hasSharedLink: json[r'hasSharedLink'] as bool,
id: json[r'id'] as String,
isActivityEnabled: json[r'isActivityEnabled'] as bool,
lastModifiedAssetTimestamp: (json[r'lastModifiedAssetTimestamp'] == null
? null
: DateTime.parse(json[r'lastModifiedAssetTimestamp'] as String)),
order: AssetOrder.fromJson(json[r'order']),
shared: json[r'shared'] as bool,
startDate: (json[r'startDate'] == null ? null : DateTime.parse(json[r'startDate'] as String)),
updatedAt: DateTime.parse(json[r'updatedAt'] as String),
);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albumName'] = this.albumName;
if (this.albumThumbnailAssetId != null) {
json[r'albumThumbnailAssetId'] = this.albumThumbnailAssetId;
} else {
// json[r'albumThumbnailAssetId'] = null;
json[r'albumName'] = albumName;
if (albumThumbnailAssetId != null) {
json[r'albumThumbnailAssetId'] = albumThumbnailAssetId!;
}
json[r'albumUsers'] = this.albumUsers;
json[r'assetCount'] = this.assetCount;
json[r'contributorCounts'] = this.contributorCounts;
json[r'createdAt'] = this.createdAt.toUtc().toIso8601String();
json[r'description'] = this.description;
if (this.endDate != null) {
json[r'endDate'] = this.endDate!.toUtc().toIso8601String();
} else {
// json[r'endDate'] = null;
json[r'albumUsers'] = albumUsers.map(($e) => $e.toJson()).toList(growable: false);
json[r'assetCount'] = assetCount;
if (contributorCounts != null) {
json[r'contributorCounts'] = contributorCounts!.map(($e) => $e.toJson()).toList(growable: false);
}
json[r'hasSharedLink'] = this.hasSharedLink;
json[r'id'] = this.id;
json[r'isActivityEnabled'] = this.isActivityEnabled;
if (this.lastModifiedAssetTimestamp != null) {
json[r'lastModifiedAssetTimestamp'] = this.lastModifiedAssetTimestamp!.toUtc().toIso8601String();
} else {
// json[r'lastModifiedAssetTimestamp'] = null;
json[r'createdAt'] = createdAt.toUtc().toIso8601String();
json[r'description'] = description;
if (endDate != null) {
json[r'endDate'] = endDate!.toUtc().toIso8601String();
}
if (this.order != null) {
json[r'order'] = this.order;
} else {
// json[r'order'] = null;
json[r'hasSharedLink'] = hasSharedLink;
json[r'id'] = id;
json[r'isActivityEnabled'] = isActivityEnabled;
if (lastModifiedAssetTimestamp != null) {
json[r'lastModifiedAssetTimestamp'] = lastModifiedAssetTimestamp!.toUtc().toIso8601String();
}
json[r'shared'] = this.shared;
if (this.startDate != null) {
json[r'startDate'] = this.startDate!.toUtc().toIso8601String();
} else {
// json[r'startDate'] = null;
if (order != null) {
json[r'order'] = order!.toJson();
}
json[r'updatedAt'] = this.updatedAt.toUtc().toIso8601String();
json[r'shared'] = shared;
if (startDate != null) {
json[r'startDate'] = startDate!.toUtc().toIso8601String();
}
json[r'updatedAt'] = updatedAt.toUtc().toIso8601String();
return json;
}
/// Returns a new [AlbumResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AlbumResponseDto? fromJson(dynamic value) {
upgradeDto(value, "AlbumResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AlbumResponseDto(
albumName: mapValueOfType<String>(json, r'albumName')!,
albumThumbnailAssetId: mapValueOfType<String>(json, r'albumThumbnailAssetId'),
albumUsers: AlbumUserResponseDto.listFromJson(json[r'albumUsers']),
assetCount: mapValueOfType<int>(json, r'assetCount')!,
contributorCounts: ContributorCountResponseDto.listFromJson(json[r'contributorCounts']),
createdAt: mapDateTime(json, r'createdAt', r'')!,
description: mapValueOfType<String>(json, r'description')!,
endDate: mapDateTime(json, r'endDate', r''),
hasSharedLink: mapValueOfType<bool>(json, r'hasSharedLink')!,
id: mapValueOfType<String>(json, r'id')!,
isActivityEnabled: mapValueOfType<bool>(json, r'isActivityEnabled')!,
lastModifiedAssetTimestamp: mapDateTime(json, r'lastModifiedAssetTimestamp', r''),
order: AssetOrder.fromJson(json[r'order']),
shared: mapValueOfType<bool>(json, r'shared')!,
startDate: mapDateTime(json, r'startDate', r''),
updatedAt: mapDateTime(json, r'updatedAt', r'')!,
);
}
return null;
AlbumResponseDto copyWith({
String? albumName,
Object? albumThumbnailAssetId = _undefined,
List<AlbumUserResponseDto>? albumUsers,
int? assetCount,
Object? contributorCounts = _undefined,
DateTime? createdAt,
String? description,
Object? endDate = _undefined,
bool? hasSharedLink,
String? id,
bool? isActivityEnabled,
Object? lastModifiedAssetTimestamp = _undefined,
Object? order = _undefined,
bool? shared,
Object? startDate = _undefined,
DateTime? updatedAt,
}) {
return .new(
albumName: albumName ?? this.albumName,
albumThumbnailAssetId: identical(albumThumbnailAssetId, _undefined)
? this.albumThumbnailAssetId
: albumThumbnailAssetId as String?,
albumUsers: albumUsers ?? this.albumUsers,
assetCount: assetCount ?? this.assetCount,
contributorCounts: identical(contributorCounts, _undefined)
? this.contributorCounts
: contributorCounts as List<ContributorCountResponseDto>?,
createdAt: createdAt ?? this.createdAt,
description: description ?? this.description,
endDate: identical(endDate, _undefined) ? this.endDate : endDate as DateTime?,
hasSharedLink: hasSharedLink ?? this.hasSharedLink,
id: id ?? this.id,
isActivityEnabled: isActivityEnabled ?? this.isActivityEnabled,
lastModifiedAssetTimestamp: identical(lastModifiedAssetTimestamp, _undefined)
? this.lastModifiedAssetTimestamp
: lastModifiedAssetTimestamp as DateTime?,
order: identical(order, _undefined) ? this.order : order as AssetOrder?,
shared: shared ?? this.shared,
startDate: identical(startDate, _undefined) ? this.startDate : startDate as DateTime?,
updatedAt: updatedAt ?? this.updatedAt,
);
}
static List<AlbumResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other is AlbumResponseDto &&
albumName == other.albumName &&
albumThumbnailAssetId == other.albumThumbnailAssetId &&
const DeepCollectionEquality().equals(albumUsers, other.albumUsers) &&
assetCount == other.assetCount &&
const DeepCollectionEquality().equals(contributorCounts, other.contributorCounts) &&
createdAt == other.createdAt &&
description == other.description &&
endDate == other.endDate &&
hasSharedLink == other.hasSharedLink &&
id == other.id &&
isActivityEnabled == other.isActivityEnabled &&
lastModifiedAssetTimestamp == other.lastModifiedAssetTimestamp &&
order == other.order &&
shared == other.shared &&
startDate == other.startDate &&
updatedAt == other.updatedAt);
}
static Map<String, AlbumResponseDto> mapFromJson(dynamic json) {
final map = <String, AlbumResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([
albumName,
albumThumbnailAssetId,
const DeepCollectionEquality().hash(albumUsers),
assetCount,
const DeepCollectionEquality().hash(contributorCounts),
createdAt,
description,
endDate,
hasSharedLink,
id,
isActivityEnabled,
lastModifiedAssetTimestamp,
order,
shared,
startDate,
updatedAt,
]);
}
// maps a json object with a list of AlbumResponseDto-objects as value to a dart map
static Map<String, List<AlbumResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AlbumResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'albumName',
'albumThumbnailAssetId',
'albumUsers',
'assetCount',
'createdAt',
'description',
'hasSharedLink',
'id',
'isActivityEnabled',
'shared',
'updatedAt',
};
@override
String toString() =>
'AlbumResponseDto(albumName=$albumName, albumThumbnailAssetId=$albumThumbnailAssetId, albumUsers=$albumUsers, assetCount=$assetCount, contributorCounts=$contributorCounts, createdAt=$createdAt, description=$description, endDate=$endDate, hasSharedLink=$hasSharedLink, id=$id, isActivityEnabled=$isActivityEnabled, lastModifiedAssetTimestamp=$lastModifiedAssetTimestamp, order=$order, shared=$shared, startDate=$startDate, updatedAt=$updatedAt)';
}
+28 -103
View File
@@ -1,127 +1,52 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AlbumStatisticsResponseDto {
/// Returns a new [AlbumStatisticsResponseDto] instance.
AlbumStatisticsResponseDto({
required this.notShared,
required this.owned,
required this.shared,
});
final class AlbumStatisticsResponseDto {
const AlbumStatisticsResponseDto({required this.notShared, required this.owned, required this.shared});
/// Number of non-shared albums
///
/// Minimum value: 0
/// Maximum value: 9007199254740991
int notShared;
final int notShared;
/// Number of owned albums
///
/// Minimum value: 0
/// Maximum value: 9007199254740991
int owned;
final int owned;
/// Number of shared albums
///
/// Minimum value: 0
/// Maximum value: 9007199254740991
int shared;
final int shared;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumStatisticsResponseDto &&
other.notShared == notShared &&
other.owned == owned &&
other.shared == shared;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(notShared.hashCode) +
(owned.hashCode) +
(shared.hashCode);
@override
String toString() => 'AlbumStatisticsResponseDto[notShared=$notShared, owned=$owned, shared=$shared]';
static AlbumStatisticsResponseDto? fromJson(dynamic value) {
ApiCompat.upgrade<AlbumStatisticsResponseDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(notShared: json[r'notShared'] as int, owned: json[r'owned'] as int, shared: json[r'shared'] as int);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'notShared'] = this.notShared;
json[r'owned'] = this.owned;
json[r'shared'] = this.shared;
json[r'notShared'] = notShared;
json[r'owned'] = owned;
json[r'shared'] = shared;
return json;
}
/// Returns a new [AlbumStatisticsResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AlbumStatisticsResponseDto? fromJson(dynamic value) {
upgradeDto(value, "AlbumStatisticsResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AlbumStatisticsResponseDto(
notShared: mapValueOfType<int>(json, r'notShared')!,
owned: mapValueOfType<int>(json, r'owned')!,
shared: mapValueOfType<int>(json, r'shared')!,
);
}
return null;
AlbumStatisticsResponseDto copyWith({int? notShared, int? owned, int? shared}) {
return .new(notShared: notShared ?? this.notShared, owned: owned ?? this.owned, shared: shared ?? this.shared);
}
static List<AlbumStatisticsResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumStatisticsResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumStatisticsResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other is AlbumStatisticsResponseDto &&
notShared == other.notShared &&
owned == other.owned &&
shared == other.shared);
}
static Map<String, AlbumStatisticsResponseDto> mapFromJson(dynamic json) {
final map = <String, AlbumStatisticsResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumStatisticsResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([notShared, owned, shared]);
}
// maps a json object with a list of AlbumStatisticsResponseDto-objects as value to a dart map
static Map<String, List<AlbumStatisticsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumStatisticsResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AlbumStatisticsResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'notShared',
'owned',
'shared',
};
@override
String toString() => 'AlbumStatisticsResponseDto(notShared=$notShared, owned=$owned, shared=$shared)';
}
+23 -96
View File
@@ -1,117 +1,44 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AlbumUserAddDto {
/// Returns a new [AlbumUserAddDto] instance.
AlbumUserAddDto({
this.role,
required this.userId,
});
final class AlbumUserAddDto {
const AlbumUserAddDto({this.role = AlbumUserRole.editor, required this.userId});
///
/// 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.
///
AlbumUserRole? role;
/// Album user role
final AlbumUserRole role;
/// User ID
String userId;
final String userId;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumUserAddDto &&
other.role == role &&
other.userId == userId;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(role == null ? 0 : role!.hashCode) +
(userId.hashCode);
@override
String toString() => 'AlbumUserAddDto[role=$role, userId=$userId]';
static AlbumUserAddDto? fromJson(dynamic value) {
ApiCompat.upgrade<AlbumUserAddDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(role: AlbumUserRole.fromJson(json[r'role']) ?? AlbumUserRole.editor, userId: json[r'userId'] as String);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.role != null) {
json[r'role'] = this.role;
} else {
// json[r'role'] = null;
}
json[r'userId'] = this.userId;
json[r'role'] = role.toJson();
json[r'userId'] = userId;
return json;
}
/// Returns a new [AlbumUserAddDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AlbumUserAddDto? fromJson(dynamic value) {
upgradeDto(value, "AlbumUserAddDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AlbumUserAddDto(
role: AlbumUserRole.fromJson(json[r'role']),
userId: mapValueOfType<String>(json, r'userId')!,
);
}
return null;
AlbumUserAddDto copyWith({AlbumUserRole? role, String? userId}) {
return .new(role: role ?? this.role, userId: userId ?? this.userId);
}
static List<AlbumUserAddDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumUserAddDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumUserAddDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) || (other is AlbumUserAddDto && role == other.role && userId == other.userId);
}
static Map<String, AlbumUserAddDto> mapFromJson(dynamic json) {
final map = <String, AlbumUserAddDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumUserAddDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([role, userId]);
}
// maps a json object with a list of AlbumUserAddDto-objects as value to a dart map
static Map<String, List<AlbumUserAddDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumUserAddDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AlbumUserAddDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'userId',
};
@override
String toString() => 'AlbumUserAddDto(role=$role, userId=$userId)';
}
+22 -87
View File
@@ -1,108 +1,43 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AlbumUserCreateDto {
/// Returns a new [AlbumUserCreateDto] instance.
AlbumUserCreateDto({
required this.role,
required this.userId,
});
final class AlbumUserCreateDto {
const AlbumUserCreateDto({required this.role, required this.userId});
AlbumUserRole role;
final AlbumUserRole role;
/// User ID
String userId;
final String userId;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumUserCreateDto &&
other.role == role &&
other.userId == userId;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(role.hashCode) +
(userId.hashCode);
@override
String toString() => 'AlbumUserCreateDto[role=$role, userId=$userId]';
static AlbumUserCreateDto? fromJson(dynamic value) {
ApiCompat.upgrade<AlbumUserCreateDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(role: (AlbumUserRole.fromJson(json[r'role']))!, userId: json[r'userId'] as String);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'role'] = this.role;
json[r'userId'] = this.userId;
json[r'role'] = role.toJson();
json[r'userId'] = userId;
return json;
}
/// Returns a new [AlbumUserCreateDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AlbumUserCreateDto? fromJson(dynamic value) {
upgradeDto(value, "AlbumUserCreateDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AlbumUserCreateDto(
role: AlbumUserRole.fromJson(json[r'role'])!,
userId: mapValueOfType<String>(json, r'userId')!,
);
}
return null;
AlbumUserCreateDto copyWith({AlbumUserRole? role, String? userId}) {
return .new(role: role ?? this.role, userId: userId ?? this.userId);
}
static List<AlbumUserCreateDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumUserCreateDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumUserCreateDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) || (other is AlbumUserCreateDto && role == other.role && userId == other.userId);
}
static Map<String, AlbumUserCreateDto> mapFromJson(dynamic json) {
final map = <String, AlbumUserCreateDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumUserCreateDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([role, userId]);
}
// maps a json object with a list of AlbumUserCreateDto-objects as value to a dart map
static Map<String, List<AlbumUserCreateDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumUserCreateDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AlbumUserCreateDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'role',
'userId',
};
@override
String toString() => 'AlbumUserCreateDto(role=$role, userId=$userId)';
}
+22 -87
View File
@@ -1,107 +1,42 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AlbumUserResponseDto {
/// Returns a new [AlbumUserResponseDto] instance.
AlbumUserResponseDto({
required this.role,
required this.user,
});
final class AlbumUserResponseDto {
const AlbumUserResponseDto({required this.role, required this.user});
AlbumUserRole role;
final AlbumUserRole role;
UserResponseDto user;
final UserResponseDto user;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumUserResponseDto &&
other.role == role &&
other.user == user;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(role.hashCode) +
(user.hashCode);
@override
String toString() => 'AlbumUserResponseDto[role=$role, user=$user]';
static AlbumUserResponseDto? fromJson(dynamic value) {
ApiCompat.upgrade<AlbumUserResponseDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(role: (AlbumUserRole.fromJson(json[r'role']))!, user: (UserResponseDto.fromJson(json[r'user']))!);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'role'] = this.role;
json[r'user'] = this.user;
json[r'role'] = role.toJson();
json[r'user'] = user.toJson();
return json;
}
/// Returns a new [AlbumUserResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AlbumUserResponseDto? fromJson(dynamic value) {
upgradeDto(value, "AlbumUserResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AlbumUserResponseDto(
role: AlbumUserRole.fromJson(json[r'role'])!,
user: UserResponseDto.fromJson(json[r'user'])!,
);
}
return null;
AlbumUserResponseDto copyWith({AlbumUserRole? role, UserResponseDto? user}) {
return .new(role: role ?? this.role, user: user ?? this.user);
}
static List<AlbumUserResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumUserResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumUserResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) || (other is AlbumUserResponseDto && role == other.role && user == other.user);
}
static Map<String, AlbumUserResponseDto> mapFromJson(dynamic json) {
final map = <String, AlbumUserResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumUserResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([role, user]);
}
// maps a json object with a list of AlbumUserResponseDto-objects as value to a dart map
static Map<String, List<AlbumUserResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumUserResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AlbumUserResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'role',
'user',
};
@override
String toString() => 'AlbumUserResponseDto(role=$role, user=$user)';
}
+18 -77
View File
@@ -1,88 +1,29 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
/// Album user role
class AlbumUserRole {
/// Instantiate a new enum with the provided [value].
enum AlbumUserRole {
editor._(r'editor'),
owner._(r'owner'),
viewer._(r'viewer'),
/// Reserved for values from newer servers. Never sent by this client.
valueUnknown._(r'__unknown__');
const AlbumUserRole._(this.value);
/// The underlying value of this enum member.
final String value;
static AlbumUserRole? fromJson(dynamic value) {
for (final e in values) {
if (e.value == value) return e;
}
return value == null ? null : valueUnknown;
}
Object toJson() => value;
@override
String toString() => value;
String toJson() => value;
static const editor = AlbumUserRole._(r'editor');
static const owner = AlbumUserRole._(r'owner');
static const viewer = AlbumUserRole._(r'viewer');
/// List of all possible values in this [enum][AlbumUserRole].
static const values = <AlbumUserRole>[
editor,
owner,
viewer,
];
static AlbumUserRole? fromJson(dynamic value) => AlbumUserRoleTypeTransformer().decode(value);
static List<AlbumUserRole> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumUserRole>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumUserRole.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
String toString() => value.toString();
}
/// Transformation class that can [encode] an instance of [AlbumUserRole] to String,
/// and [decode] dynamic data back to [AlbumUserRole].
class AlbumUserRoleTypeTransformer {
factory AlbumUserRoleTypeTransformer() => _instance ??= const AlbumUserRoleTypeTransformer._();
const AlbumUserRoleTypeTransformer._();
String encode(AlbumUserRole data) => data.value;
/// Decodes a [dynamic value][data] to a AlbumUserRole.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
AlbumUserRole? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'editor': return AlbumUserRole.editor;
case r'owner': return AlbumUserRole.owner;
case r'viewer': return AlbumUserRole.viewer;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [AlbumUserRoleTypeTransformer] instance.
static AlbumUserRoleTypeTransformer? _instance;
}
+31 -91
View File
@@ -1,113 +1,53 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AlbumsAddAssetsDto {
/// Returns a new [AlbumsAddAssetsDto] instance.
AlbumsAddAssetsDto({
this.albumIds = const [],
this.assetIds = const [],
});
final class AlbumsAddAssetsDto {
const AlbumsAddAssetsDto({required this.albumIds, required this.assetIds});
/// Album IDs
List<String> albumIds;
final List<String> albumIds;
/// Asset IDs
List<String> assetIds;
final List<String> assetIds;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumsAddAssetsDto &&
_deepEquality.equals(other.albumIds, albumIds) &&
_deepEquality.equals(other.assetIds, assetIds);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(albumIds.hashCode) +
(assetIds.hashCode);
@override
String toString() => 'AlbumsAddAssetsDto[albumIds=$albumIds, assetIds=$assetIds]';
static AlbumsAddAssetsDto? fromJson(dynamic value) {
ApiCompat.upgrade<AlbumsAddAssetsDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(
albumIds: ((json[r'albumIds'] as List?)?.map(($e) => $e as String).toList(growable: false))!,
assetIds: ((json[r'assetIds'] as List?)?.map(($e) => $e as String).toList(growable: false))!,
);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albumIds'] = this.albumIds;
json[r'assetIds'] = this.assetIds;
json[r'albumIds'] = albumIds;
json[r'assetIds'] = assetIds;
return json;
}
/// Returns a new [AlbumsAddAssetsDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AlbumsAddAssetsDto? fromJson(dynamic value) {
upgradeDto(value, "AlbumsAddAssetsDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AlbumsAddAssetsDto(
albumIds: json[r'albumIds'] is Iterable
? (json[r'albumIds'] as Iterable).cast<String>().toList(growable: false)
: const [],
assetIds: json[r'assetIds'] is Iterable
? (json[r'assetIds'] as Iterable).cast<String>().toList(growable: false)
: const [],
);
}
return null;
AlbumsAddAssetsDto copyWith({List<String>? albumIds, List<String>? assetIds}) {
return .new(albumIds: albumIds ?? this.albumIds, assetIds: assetIds ?? this.assetIds);
}
static List<AlbumsAddAssetsDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumsAddAssetsDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumsAddAssetsDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other is AlbumsAddAssetsDto &&
const DeepCollectionEquality().equals(albumIds, other.albumIds) &&
const DeepCollectionEquality().equals(assetIds, other.assetIds));
}
static Map<String, AlbumsAddAssetsDto> mapFromJson(dynamic json) {
final map = <String, AlbumsAddAssetsDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumsAddAssetsDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([
const DeepCollectionEquality().hash(albumIds),
const DeepCollectionEquality().hash(assetIds),
]);
}
// maps a json object with a list of AlbumsAddAssetsDto-objects as value to a dart map
static Map<String, List<AlbumsAddAssetsDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumsAddAssetsDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AlbumsAddAssetsDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'albumIds',
'assetIds',
};
@override
String toString() => 'AlbumsAddAssetsDto(albumIds=$albumIds, assetIds=$assetIds)';
}
+28 -94
View File
@@ -1,117 +1,51 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AlbumsAddAssetsResponseDto {
/// Returns a new [AlbumsAddAssetsResponseDto] instance.
AlbumsAddAssetsResponseDto({
this.error,
required this.success,
});
final class AlbumsAddAssetsResponseDto {
const AlbumsAddAssetsResponseDto({this.error, required this.success});
///
/// 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.
///
BulkIdErrorReason? error;
final BulkIdErrorReason? error;
/// Operation success
bool success;
final bool success;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumsAddAssetsResponseDto &&
other.error == error &&
other.success == success;
static const _undefined = Object();
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(error == null ? 0 : error!.hashCode) +
(success.hashCode);
@override
String toString() => 'AlbumsAddAssetsResponseDto[error=$error, success=$success]';
static AlbumsAddAssetsResponseDto? fromJson(dynamic value) {
ApiCompat.upgrade<AlbumsAddAssetsResponseDto>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(error: BulkIdErrorReason.fromJson(json[r'error']), success: json[r'success'] as bool);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.error != null) {
json[r'error'] = this.error;
} else {
// json[r'error'] = null;
if (error != null) {
json[r'error'] = error!.toJson();
}
json[r'success'] = this.success;
json[r'success'] = success;
return json;
}
/// Returns a new [AlbumsAddAssetsResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AlbumsAddAssetsResponseDto? fromJson(dynamic value) {
upgradeDto(value, "AlbumsAddAssetsResponseDto");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AlbumsAddAssetsResponseDto(
error: BulkIdErrorReason.fromJson(json[r'error']),
success: mapValueOfType<bool>(json, r'success')!,
);
}
return null;
AlbumsAddAssetsResponseDto copyWith({Object? error = _undefined, bool? success}) {
return .new(
error: identical(error, _undefined) ? this.error : error as BulkIdErrorReason?,
success: success ?? this.success,
);
}
static List<AlbumsAddAssetsResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumsAddAssetsResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumsAddAssetsResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other is AlbumsAddAssetsResponseDto && error == other.error && success == other.success);
}
static Map<String, AlbumsAddAssetsResponseDto> mapFromJson(dynamic json) {
final map = <String, AlbumsAddAssetsResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumsAddAssetsResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([error, success]);
}
// maps a json object with a list of AlbumsAddAssetsResponseDto-objects as value to a dart map
static Map<String, List<AlbumsAddAssetsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumsAddAssetsResponseDto>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AlbumsAddAssetsResponseDto.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'success',
};
@override
String toString() => 'AlbumsAddAssetsResponseDto(error=$error, success=$success)';
}
+20 -80
View File
@@ -1,99 +1,39 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AlbumsResponse {
/// Returns a new [AlbumsResponse] instance.
AlbumsResponse({
required this.defaultAssetOrder,
});
final class AlbumsResponse {
const AlbumsResponse({required this.defaultAssetOrder});
AssetOrder defaultAssetOrder;
final AssetOrder defaultAssetOrder;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumsResponse &&
other.defaultAssetOrder == defaultAssetOrder;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(defaultAssetOrder.hashCode);
@override
String toString() => 'AlbumsResponse[defaultAssetOrder=$defaultAssetOrder]';
static AlbumsResponse? fromJson(dynamic value) {
ApiCompat.upgrade<AlbumsResponse>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(defaultAssetOrder: (AssetOrder.fromJson(json[r'defaultAssetOrder']))!);
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'defaultAssetOrder'] = this.defaultAssetOrder;
json[r'defaultAssetOrder'] = defaultAssetOrder.toJson();
return json;
}
/// Returns a new [AlbumsResponse] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AlbumsResponse? fromJson(dynamic value) {
upgradeDto(value, "AlbumsResponse");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AlbumsResponse(
defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder'])!,
);
}
return null;
AlbumsResponse copyWith({AssetOrder? defaultAssetOrder}) {
return .new(defaultAssetOrder: defaultAssetOrder ?? this.defaultAssetOrder);
}
static List<AlbumsResponse> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumsResponse>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumsResponse.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) || (other is AlbumsResponse && defaultAssetOrder == other.defaultAssetOrder);
}
static Map<String, AlbumsResponse> mapFromJson(dynamic json) {
final map = <String, AlbumsResponse>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumsResponse.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([defaultAssetOrder]);
}
// maps a json object with a list of AlbumsResponse-objects as value to a dart map
static Map<String, List<AlbumsResponse>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumsResponse>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AlbumsResponse.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'defaultAssetOrder',
};
@override
String toString() => 'AlbumsResponse(defaultAssetOrder=$defaultAssetOrder)';
}
+27 -87
View File
@@ -1,108 +1,48 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AlbumsUpdate {
/// Returns a new [AlbumsUpdate] instance.
AlbumsUpdate({
this.defaultAssetOrder,
});
/// Album preferences
final class AlbumsUpdate {
const AlbumsUpdate({this.defaultAssetOrder});
///
/// 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.
///
AssetOrder? defaultAssetOrder;
final AssetOrder? defaultAssetOrder;
@override
bool operator ==(Object other) => identical(this, other) || other is AlbumsUpdate &&
other.defaultAssetOrder == defaultAssetOrder;
static const _undefined = Object();
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(defaultAssetOrder == null ? 0 : defaultAssetOrder!.hashCode);
@override
String toString() => 'AlbumsUpdate[defaultAssetOrder=$defaultAssetOrder]';
static AlbumsUpdate? fromJson(dynamic value) {
ApiCompat.upgrade<AlbumsUpdate>(value);
if (value is! Map) return null;
final json = value.cast<String, dynamic>();
return .new(defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder']));
}
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.defaultAssetOrder != null) {
json[r'defaultAssetOrder'] = this.defaultAssetOrder;
} else {
// json[r'defaultAssetOrder'] = null;
if (defaultAssetOrder != null) {
json[r'defaultAssetOrder'] = defaultAssetOrder!.toJson();
}
return json;
}
/// Returns a new [AlbumsUpdate] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AlbumsUpdate? fromJson(dynamic value) {
upgradeDto(value, "AlbumsUpdate");
if (value is Map) {
final json = value.cast<String, dynamic>();
return AlbumsUpdate(
defaultAssetOrder: AssetOrder.fromJson(json[r'defaultAssetOrder']),
);
}
return null;
AlbumsUpdate copyWith({Object? defaultAssetOrder = _undefined}) {
return .new(
defaultAssetOrder: identical(defaultAssetOrder, _undefined)
? this.defaultAssetOrder
: defaultAssetOrder as AssetOrder?,
);
}
static List<AlbumsUpdate> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AlbumsUpdate>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AlbumsUpdate.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
@override
bool operator ==(Object other) {
return identical(this, other) || (other is AlbumsUpdate && defaultAssetOrder == other.defaultAssetOrder);
}
static Map<String, AlbumsUpdate> mapFromJson(dynamic json) {
final map = <String, AlbumsUpdate>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AlbumsUpdate.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
@override
int get hashCode {
return Object.hashAll([defaultAssetOrder]);
}
// maps a json object with a list of AlbumsUpdate-objects as value to a dart map
static Map<String, List<AlbumsUpdate>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AlbumsUpdate>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments
json = json.cast<String, dynamic>();
for (final entry in json.entries) {
map[entry.key] = AlbumsUpdate.listFromJson(entry.value, growable: growable,);
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
};
@override
String toString() => 'AlbumsUpdate(defaultAssetOrder=$defaultAssetOrder)';
}

Some files were not shown because too many files have changed in this diff Show More